参数模块
This commit is contained in:
parent
0a3dcb1d53
commit
5e2f3dc381
@ -4,16 +4,21 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ComLocalconfig {
|
public class ComLocalconfig {
|
||||||
|
|
||||||
private long sid;
|
private Long sid;
|
||||||
private String smac;
|
private String smac;
|
||||||
private String sip;
|
private String sip;
|
||||||
private String sname;
|
private String sname;
|
||||||
private String configvalue;
|
private String configvalue;
|
||||||
|
private String create_by;
|
||||||
|
private Date create_time;
|
||||||
|
private String update_by;
|
||||||
|
private Date update_time;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,10 +29,10 @@ public class ComConfigDictController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("获取字典列表")
|
@ApiOperation("获取字典列表")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(ComConfigDict post) {
|
public AjaxResult list(ComConfigDict post) {
|
||||||
startPage();
|
// startPage();
|
||||||
List<ComConfigDict> list = ComConfigDictService.selectComConfigDictList(post);
|
List<ComConfigDict> list = ComConfigDictService.selectComConfigDictList(post);
|
||||||
return getDataTable(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
@ApiOperation("字典导出")
|
@ApiOperation("字典导出")
|
||||||
@Log(title = "字典导出", businessType = BusinessType.EXPORT)
|
@Log(title = "字典导出", businessType = BusinessType.EXPORT)
|
||||||
|
|||||||
@ -0,0 +1,74 @@
|
|||||||
|
package com.czlis.liswork.controller.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.annotation.Log;
|
||||||
|
import com.czlis.common.core.controller.BaseController;
|
||||||
|
import com.czlis.common.core.domain.AjaxResult;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComConfigDict;
|
||||||
|
import com.czlis.common.enums.BusinessType;
|
||||||
|
import com.czlis.common.utils.SecurityUtils;
|
||||||
|
import com.czlis.common.utils.poi.ExcelUtil;
|
||||||
|
import com.czlis.liswork.service.ComConfigDictService;
|
||||||
|
import com.czlis.liswork.service.ComLocalconfigService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "参数模板设置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/localconfig")
|
||||||
|
@Slf4j
|
||||||
|
public class ComLocalconfigController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
ComConfigDictService ComConfigDictService;
|
||||||
|
ComLocalconfigService ComLocalconfigService;
|
||||||
|
/**
|
||||||
|
* 获取字典列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取参数列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list() {
|
||||||
|
String localid= SecurityUtils.getLoginUser().getSysLoginParam().getLocalid();
|
||||||
|
ComLocalconfigService.getComLocalconfigList(localid);
|
||||||
|
return success(ComLocalconfigService.getComLocalconfigList(localid));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据字典编号获取详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取详细信息")
|
||||||
|
@GetMapping(value = "/{dictId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable Long dictId) {
|
||||||
|
return success(ComConfigDictService.selectComConfigDictById(dictId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改字典
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改字典")
|
||||||
|
@Log(title = "字典管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@Validated @RequestBody ComConfigDict post) {
|
||||||
|
if (!ComConfigDictService.checkDictNameUnique(post)) {
|
||||||
|
return error("修改字典'" + post.getConfigName() + "'失败,字典名称已存在");
|
||||||
|
} else if (!ComConfigDictService.checkDictCodeUnique(post)) {
|
||||||
|
return error("修改字典'" + post.getConfigName() + "'失败,字典编码已存在");
|
||||||
|
}
|
||||||
|
post.setUpdateBy(getUsername());
|
||||||
|
return toAjax(ComConfigDictService.updateDict(post));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典选择框列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取字典选择框列表")
|
||||||
|
@GetMapping("/optionselect/{dictId}")
|
||||||
|
public AjaxResult optionselect() {
|
||||||
|
List<ComConfigDict> posts = ComConfigDictService.selectComConfigDictAll();
|
||||||
|
return success(posts);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.czlis.liswork.mapper.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComLocalconfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface LocalconfigMapper {
|
||||||
|
|
||||||
|
List<ComLocalconfig> selectComLocalconfigList(ComLocalconfig comLocalconfig);
|
||||||
|
Long getCountById(Long sid);
|
||||||
|
Long getCountBymic(String smac);
|
||||||
|
Long getsid(String smac);
|
||||||
|
List<ComLocalconfig> selectComLocalconfigAll();
|
||||||
|
int insertComLocalconfig(ComLocalconfig comLocalconfig);
|
||||||
|
int delComLocalconfigById(Long sid);
|
||||||
|
int delComLocalconfigBymac(String smac);
|
||||||
|
int delComLocalconfigByIds(Long[] sids);
|
||||||
|
int updateComLocalconfig(ComLocalconfig comLocalconfig);
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.czlis.liswork.service;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComConfigDict;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComLocalconfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ComLocalconfigService {
|
||||||
|
List<ComConfigDict> getComLocalconfigList(String smac);
|
||||||
|
Long getCountById(Long sid);
|
||||||
|
Long getCountBymic(String smac);
|
||||||
|
Long getsid(String smac);
|
||||||
|
List<ComLocalconfig> selectComLocalconfigAll();
|
||||||
|
int insertComLocalconfig(ComLocalconfig comLocalconfig);
|
||||||
|
int delComLocalconfigById(Long sid);
|
||||||
|
int delComLocalconfigBymac(String smac);
|
||||||
|
int delComLocalconfigByIds(Long[] sids);
|
||||||
|
int updateComLocalconfig(ComLocalconfig comLocalconfig);
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.czlis.liswork.service.impl.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComConfigDict;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.ComLocalconfig;
|
||||||
|
import com.czlis.liswork.mapper.xtwh.LocalconfigMapper;
|
||||||
|
import com.czlis.liswork.service.ComConfigDictService;
|
||||||
|
import com.czlis.liswork.service.ComLocalconfigService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ComLocalconfigServiceImpl implements ComLocalconfigService {
|
||||||
|
@Autowired
|
||||||
|
ComConfigDictService ComConfigDictService;
|
||||||
|
@Autowired
|
||||||
|
LocalconfigMapper localconfigMapper;
|
||||||
|
@Override
|
||||||
|
public List<ComConfigDict> getComLocalconfigList(String smac){
|
||||||
|
ComConfigDict post=new ComConfigDict();
|
||||||
|
post.setConfigType("LOCAL");
|
||||||
|
post.setStatus("0");
|
||||||
|
List<ComConfigDict> list = ComConfigDictService.selectComConfigDictList(post);
|
||||||
|
if(list.isEmpty())return null;
|
||||||
|
ComLocalconfig comLocalconfig=new ComLocalconfig();
|
||||||
|
comLocalconfig.setSmac(smac);
|
||||||
|
List<ComLocalconfig> comLocalconfiglist=localconfigMapper.selectComLocalconfigList(comLocalconfig);
|
||||||
|
if(comLocalconfiglist.size()>0){
|
||||||
|
comLocalconfig= comLocalconfiglist.get(0);
|
||||||
|
String configvalue=comLocalconfig.getConfigvalue();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Long getCountById(Long sid){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Long getCountBymic(String smac){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Long getsid(String smac){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<ComLocalconfig> selectComLocalconfigAll(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int insertComLocalconfig(ComLocalconfig comLocalconfig){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int delComLocalconfigById(Long sid){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int delComLocalconfigBymac(String smac){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int delComLocalconfigByIds(Long[] sids){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int updateComLocalconfig(ComLocalconfig comLocalconfig){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
84
liswork/src/main/resources/mapper/ComLocalconfigMapper.xml
Normal file
84
liswork/src/main/resources/mapper/ComLocalconfigMapper.xml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.czlis.liswork.mapper.xtwh.LocalconfigMapper">
|
||||||
|
<select id="selectComLocalconfigList" parameterType="com.czlis.common.core.domain.entity.lis.ComLocalconfig" >
|
||||||
|
select * from com_localconfig
|
||||||
|
<where>
|
||||||
|
<if test="sid != null and sid != 0">
|
||||||
|
and sid = #{sid}
|
||||||
|
</if>
|
||||||
|
<if test="smac != null and smac != ''">
|
||||||
|
and smac = #{smac}
|
||||||
|
</if>
|
||||||
|
<if test="sip != null and sip != ''">
|
||||||
|
and sip = #{sip}
|
||||||
|
</if>
|
||||||
|
<if test="sname != null and sname != ''">
|
||||||
|
and sname = #{sname}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by sid ASC
|
||||||
|
</select>
|
||||||
|
<select id="getCountById" resultType="Long">
|
||||||
|
select count(1) from com_localconfig where sid = #{sid}
|
||||||
|
</select>
|
||||||
|
<select id="getCountBymic" resultType="Long">
|
||||||
|
select count(1) from com_localconfig where smac = #{smac}
|
||||||
|
</select>
|
||||||
|
<select id="getsid" resultType="Long">
|
||||||
|
select sid from com_localconfig where smac = #{smac}
|
||||||
|
</select>
|
||||||
|
<select id="selectComLocalconfigAll" resultType="ComLocalconfig">
|
||||||
|
select * from com_localconfig
|
||||||
|
order by sid
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertComLocalconfig" parameterType="com.czlis.common.core.domain.entity.lis.ComLocalconfig" useGeneratedKeys="true" keyProperty="sid">
|
||||||
|
insert into com_localconfig(
|
||||||
|
<if test="sid != null and sid != 0">sid,</if>
|
||||||
|
<if test="smac != null and smac != ''">smac,</if>
|
||||||
|
<if test="sip != null and sip != ''">sip,</if>
|
||||||
|
<if test="sname != null and sname != ''">sname,</if>
|
||||||
|
<if test="configvalue != null and configvalue != ''">configvalue,</if>
|
||||||
|
<if test="create_by != null and create_by != ''">create_by,</if>
|
||||||
|
create_time
|
||||||
|
)values(
|
||||||
|
<if test="sid != null and sid != 0">#{sid},</if>
|
||||||
|
<if test="smac != null and smac != ''">#{smac},</if>
|
||||||
|
<if test="sip != null and sip != ''">#{sip},</if>
|
||||||
|
<if test="sname != null and sname != ''">#{sname},</if>
|
||||||
|
<if test="configvalue != null and configvalue != ''">#{configvalue},</if>
|
||||||
|
<if test="create_by != null and create_by != ''">#{create_by},</if>
|
||||||
|
getdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="delComLocalconfigById" parameterType="Long">
|
||||||
|
delete from com_localconfig where sid = #{sid}
|
||||||
|
</delete>
|
||||||
|
<delete id="delComLocalconfigBymac" parameterType="String">
|
||||||
|
delete from com_localconfig where smac = #{smac}
|
||||||
|
</delete>
|
||||||
|
<delete id="delComLocalconfigByIds" parameterType="Long">
|
||||||
|
delete from com_localconfig where sid in
|
||||||
|
<foreach collection="array" item="sid" open="(" separator="," close=")">
|
||||||
|
#{sid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateComLocalconfig" parameterType="com.czlis.common.core.domain.entity.lis.ComLocalconfig">
|
||||||
|
update com_localconfig
|
||||||
|
<set>
|
||||||
|
<if test="smac != null and smac != ''">config_type = #{smac},</if>
|
||||||
|
<if test="sip != null and sip != ''">sip = #{sip},</if>
|
||||||
|
<if test="sname != null and sname != ''">sname = #{sname},</if>
|
||||||
|
<if test="configvalue != null and configvalue != ''">configvalue = #{configvalue},</if>
|
||||||
|
<if test="update_by != null and update_by != ''">update_by = #{update_by},</if>
|
||||||
|
update_time = getdate()
|
||||||
|
</set>
|
||||||
|
where sid = #{sid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -369,8 +369,12 @@ CREATE TABLE [dbo].[com_localconfig](
|
|||||||
[sid] [int] IDENTITY(1,1) NOT NULL,
|
[sid] [int] IDENTITY(1,1) NOT NULL,
|
||||||
[smac] [varchar](50) NULL,
|
[smac] [varchar](50) NULL,
|
||||||
[sip] [varchar](50) NULL,
|
[sip] [varchar](50) NULL,
|
||||||
[sname] [varchar](50) NULL,
|
[sname] [varchar](250) NULL,
|
||||||
[configvalue] [varchar](8000) NULL,
|
[configvalue] [varchar](8000) NULL,
|
||||||
|
[create_by] [varchar](64) NULL,
|
||||||
|
[create_time] [datetime] NULL,
|
||||||
|
[update_by] [varchar](64) NULL,
|
||||||
|
[update_time] [datetime] NULL,
|
||||||
CONSTRAINT [PK_com_localconfig] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_com_localconfig] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
[sid] ASC
|
[sid] ASC
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user