字典缓存修改
This commit is contained in:
parent
4d491f91d0
commit
ea6c0b76ac
@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ComDict extends BaseEntity {
|
||||
public class ComDict {
|
||||
@Excel(name = "字典类别")
|
||||
private String zdlb;
|
||||
@Excel(name = "编码")
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.czlis.liswork.controller.dict;
|
||||
|
||||
|
||||
import com.czlis.common.annotation.Anonymous;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.page.TableDataInfo;
|
||||
@ -31,17 +32,20 @@ public class DictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 获取字典列表
|
||||
*
|
||||
* @param comDict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询字典列表")
|
||||
@GetMapping("/query")
|
||||
@Anonymous
|
||||
public TableDataInfo query(ComDict comDict) {
|
||||
log.info("调用查询字典列表,{}", comDict);
|
||||
startPage();
|
||||
List<ComDict> comDictList = comDictService.getComDictList(comDict);
|
||||
return getDataTable(comDictList);
|
||||
}
|
||||
|
||||
@ApiOperation("查询字典列表(不分页)")
|
||||
@GetMapping("/getComDicts")
|
||||
public Result getComDicts(String zdlb) {
|
||||
@ -59,7 +63,7 @@ public class DictController extends BaseController {
|
||||
|
||||
@ApiOperation("删除字典")
|
||||
@DeleteMapping("/del")
|
||||
public Result del(ComDict comDict){
|
||||
public Result del(@RequestBody ComDict comDict) {
|
||||
log.info("调用删除字典接口{}", comDict);
|
||||
return comDictService.delComDict(comDict);
|
||||
}
|
||||
@ -70,6 +74,7 @@ public class DictController extends BaseController {
|
||||
log.info("调用修改字典接口{}", comDict);
|
||||
return comDictService.updateComDict(comDict);
|
||||
}
|
||||
|
||||
@ApiOperation("导出字典")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ComDict comDict) {
|
||||
@ -83,6 +88,7 @@ public class DictController extends BaseController {
|
||||
ExcelUtil<ComDict> util = new ExcelUtil<>(ComDict.class);
|
||||
util.importTemplateExcel(response, "字典数据");
|
||||
}
|
||||
|
||||
@ApiOperation("导入字典")
|
||||
@PostMapping("/importData")
|
||||
public Result importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.czlis.liswork.service.impl;
|
||||
|
||||
|
||||
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.utils.StringUtils;
|
||||
@ -17,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* lis字典管理
|
||||
*/
|
||||
@ -30,17 +30,18 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
private CommonUtil commonUtil;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<ComDict> getComDictList(ComDict comDict) {
|
||||
return commonUtil.getComDictList(comDict.getZdlb());
|
||||
//return commonUtil.getComDictList(comDict.getZdlb());
|
||||
return comDictMapper.getComDictList(comDict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getComDicts(String zdlb) {
|
||||
List<ComDict> comDictList = commonUtil.getComDictList(zdlb);
|
||||
return new Result("0", "成功!", comDictList);
|
||||
}
|
||||
|
||||
//根据编号查名称
|
||||
public Result getComDictNameById(String zdlb, String zddh) {
|
||||
List<ComDict> comDictList = commonUtil.getComDictList(zdlb);
|
||||
@ -51,6 +52,7 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
}
|
||||
return new Result("-1", "失败!", null);
|
||||
}
|
||||
|
||||
//根据名称查编号
|
||||
public Result getComDictIdByName(String zdlb, String zdmc) {
|
||||
List<ComDict> comDictList = commonUtil.getComDictList(zdlb);
|
||||
@ -61,12 +63,13 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
}
|
||||
return new Result("-1", "失败!", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加字典信息
|
||||
*
|
||||
* @param comDict
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Result insertComDict(ComDict comDict) {
|
||||
String pinyin = PinyinUtil.getFirstLetter(comDict.getZdmc(), ""); //拼音首字母
|
||||
@ -77,14 +80,15 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
comDict.setZdbz("N");
|
||||
int row = comDictMapper.insertComDict(comDict);
|
||||
if (row > 0) {
|
||||
List<ComDict> comDictList = comDictMapper.getComDictList(comDict);
|
||||
List<ComDict> comDictList = commonUtil.getComDictList(comDict.getZdlb());
|
||||
commonUtil.setDictCache(comDict.getZdlb(), comDictList);
|
||||
}
|
||||
return null;
|
||||
return new Result("0", "新增字典成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据,事务查询方式为脏读,防止重复提交的数据存在
|
||||
*
|
||||
* @param comDictList
|
||||
* @param updateDlCeshi
|
||||
* @return
|
||||
@ -107,7 +111,9 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
zddh = comDict.getZddh();
|
||||
//是否覆盖数据,不覆盖跳过
|
||||
int row0 = comDictMapper.getCountById(zdlb, zddh);
|
||||
if (row0 != 0) {haveRow=true;}
|
||||
if (row0 != 0) {
|
||||
haveRow = true;
|
||||
}
|
||||
if (haveRow && !updateDlCeshi) continue;
|
||||
|
||||
pinyin = PinyinUtil.getFirstLetter(comDict.getZdmc(), ""); //拼音首字母
|
||||
@ -138,8 +144,10 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
return new Result("-1", "导入失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新,REQUIRES_NEW提交独立,保证部分成功部分失败互不影响
|
||||
*
|
||||
* @param comDict
|
||||
* @param haveRow
|
||||
* @return
|
||||
@ -174,7 +182,8 @@ public class ComDictServiceImpl implements ComDictService {
|
||||
public Result updateComDict(ComDict comDict) {
|
||||
int row = comDictMapper.updateComDict(comDict);
|
||||
if (row > 0) {
|
||||
List<ComDict> comDictList = comDictMapper.getComDictList(comDict);
|
||||
String zdlb = comDict.getZdlb();
|
||||
List<ComDict> comDictList = commonUtil.getComDictList(zdlb);
|
||||
commonUtil.setDictCache(comDict.getZdlb(), comDictList);
|
||||
}
|
||||
return new Result("0", "修改成功!");
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.czlis.zycx.controller;
|
||||
|
||||
import com.czlis.common.annotation.Anonymous;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
@ -27,12 +28,10 @@ public class ZycxController extends BaseController {
|
||||
@Autowired
|
||||
private ZycxService zycxService;
|
||||
|
||||
@Resource
|
||||
LisInterfaceUtil lisInterfaceUtil;
|
||||
|
||||
|
||||
@ApiOperation("获取申请单")
|
||||
@GetMapping("/query")
|
||||
@Anonymous
|
||||
//@PreAuthorize("@ss.hasPermi('zycx:interface:query')")
|
||||
public TableDataInfo getSQDInfo(LabReqmain labReqmain){
|
||||
startPage();
|
||||
@ -42,6 +41,7 @@ public class ZycxController extends BaseController {
|
||||
|
||||
@ApiOperation("生成条码")
|
||||
@GetMapping("/add")
|
||||
@Anonymous
|
||||
public Result createSQD(String dept,String userid,String st,String et,String yljg){
|
||||
log.info("调用生成条码接口:{},{},{},{},{}",dept,userid,st,et,yljg);
|
||||
return zycxService.createSQD(dept,userid,st,et,yljg);
|
||||
@ -50,6 +50,7 @@ public class ZycxController extends BaseController {
|
||||
|
||||
@ApiOperation("执行条码")
|
||||
@GetMapping("/print")
|
||||
@Anonymous
|
||||
public Result execSQD(String[] sqh,String userid,String status,String yljg){
|
||||
log.info("执行条码接口:{},{},{},{}",sqh,userid,status,yljg);
|
||||
return zycxService.execSQD(sqh,userid,status,yljg);
|
||||
|
||||
@ -10,19 +10,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="getSQDInfo" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain" resultType="com.czlis.common.core.domain.entity.lis.LabReqmain">
|
||||
<include refid="selectLabReqmainVo"></include>
|
||||
<where>
|
||||
<if test="a.sqh != null and a.sqh != ''"> and sqh = #{sqh}</if>
|
||||
<if test="a.zt != null and a.zt != ''"> and zt = #{zt}</if>
|
||||
<if test="a.ksdh != null and a.ksdh != ''"> and ksdh = #{ksdh}</if>
|
||||
<if test="a.brly != null and a.brly != ''"> and brly = #{brly}</if>
|
||||
<if test="sqh != null and sqh != ''"> and a.sqh = #{sqh}</if>
|
||||
<if test="zt != null and zt != ''"> and a.zt = #{zt}</if>
|
||||
<if test="ksdh != null and ksdh != ''"> and a.ksdh = #{ksdh}</if>
|
||||
<if test="brly != null and brly != ''"> and a.brly = #{brly}</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND a.sqsj >= CONVERT(varchar(100), #{params.beginTime}, 120)
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND a.sqsj <= CONVERT(varchar(100), #{params.endTime}, 120)
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="createSQD" parameterType="map" statementType="CALLABLE" useCache="false">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user