Merge remote-tracking branch 'origin/master'

# Conflicts:
#	lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/CommonUtil.java
#	liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkOperServiceImpl.java
This commit is contained in:
tangw 2025-08-20 18:59:28 +08:00
commit 73b748cbde
19 changed files with 348 additions and 119 deletions

View File

@ -1,4 +1,4 @@
package com.czlis.system.manager;
package com.czlis.common.asyncmanager;
import com.czlis.common.utils.Threads;
import com.czlis.common.utils.spring.SpringUtils;

View File

@ -1,4 +1,4 @@
package com.czlis.system.manager;
package com.czlis.common.asyncmanager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -15,31 +15,32 @@ import java.util.List;
public class ComDictUtils {
/**
* 设置字典缓存
* 设置代码字典缓存
*
* @param key 参数键
* @param zdlb 字典类别
* @param dictDatas 字典数据列表
*/
public static void setDictCache(String key, List<ComDict> dictDatas) {
public static void setDictCache(String zdlb, List<ComDict> dictDatas) {
//先清除该key的所有缓存,然后再重新设置该key的缓存
SpringUtils.getBean(RedisCache.class).deleteObject(key);
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
SpringUtils.getBean(RedisCache.class).deleteObject(zdlb);
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(zdlb), dictDatas);
}
/**
* 清空字典缓存
*/
public static void clearDictCache() {
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys("com_dict:" + "*");
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.COM_DICT_KEY + "*");
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
}
/**
* 获取字典缓存
*
* @param key 参数键
* @param zdlb 字典类别
* @return dictDatas 字典数据列表
*/
public static List<ComDict> getDictCache(String key) {
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
public static List<ComDict> getDictCache(String zdlb) {
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(zdlb));
if (StringUtils.isNotNull(arrayCache)) {
return arrayCache.toList(ComDict.class);
}

View File

@ -0,0 +1,20 @@
package com.czlis.interfaceCommon.config;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.filter.Filter;
import ch.qos.logback.core.spi.FilterReply;
public class MapperTurboFilter extends Filter<ILoggingEvent> {
private static final String MAPPER_PACKAGE_PREFIX = "com.czlis";
private static final String MAPPER_SUFFIX = "mapper.";
@Override
public FilterReply decide(ILoggingEvent event) {
String loggerName = event.getLoggerName();
// 仅允许 Mapper 接口的日志进入 mysql_log
if (loggerName.startsWith(MAPPER_PACKAGE_PREFIX) && loggerName.contains(MAPPER_SUFFIX)) {
return FilterReply.ACCEPT; // 允许进入 mysql_log
}
return FilterReply.DENY; // 拒绝非 Mapper 日志进入 mysql_log
}
}

View File

@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class CommonUtil {
@ -45,20 +46,43 @@ public class CommonUtil {
LabInstrMapper labInstrMapper;
@Autowired
XmAlarmdetailMapper xmAlarmdetailMapper;
//====检验主表操作方法集合===
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
}
public List<LabPat> getLabPatListBySqh(String sqh){return labPatMapper.getLabPatListBySqh(sqh);}
public List<LabPat> getLabPatList(LabPat labPat) {return labPatMapper.getLabPat(labPat);}
public List<LabPat> getLabPatListBySqh(String sqh) {
return labPatMapper.getLabPatListBySqh(sqh);
}
public List<LabPat> getLabPatList(LabPat labPat) {
return labPatMapper.getLabPat(labPat);
}
@Transactional(rollbackFor = Exception.class)
public int insertLabPat(LabPat labPat) {return labPatMapper.updateLabPat(labPat);}
public int insertLabPat(LabPat labPat) {
return labPatMapper.updateLabPat(labPat);
}
@Transactional(rollbackFor = Exception.class)
public int delLabPat(LabPat labPat){return labPatMapper.updateLabPat(labPat);}
public int delLabPat(LabPat labPat) {
return labPatMapper.updateLabPat(labPat);
}
@Transactional(rollbackFor = Exception.class)
public int updateLabPat(LabPat labPat){return labPatMapper.updateLabPat(labPat);}
public int getCountByKey(Date jyrq, String yq,String ybh) {return labPatMapper.getCountByKey(jyrq,yq,ybh);}
public String getSqhByKey(Date jyrq,String yq,String ybh){return labPatMapper.getSqhByKey(jyrq,yq,ybh);}
public int updateLabPat(LabPat labPat) {
return labPatMapper.updateLabPat(labPat);
}
public int getCountByKey(Date jyrq, String yq, String ybh) {
return labPatMapper.getCountByKey(jyrq, yq, ybh);
}
public String getSqhByKey(Date jyrq, String yq, String ybh) {
return labPatMapper.getSqhByKey(jyrq, yq, ybh);
}
//申请单主表方法集合
public LabReqmain getLabReqmainOne(String sqh) {
return labReqmainMapper.getLabReqmainOne(sqh);
@ -66,17 +90,38 @@ public class CommonUtil {
//申请单明细表集合
//====检验结果表操作方法集合===
public LabResult getLabResult(Date jyrq, String yq, String ybh, String xmdh) {return labResultMapper.getLabResult(jyrq, yq, ybh,xmdh);}
public List<LabResult> getLabResultList(Date jyrq, String yq, String ybh) {return labResultMapper.getLabResultList(jyrq, yq, ybh);}
public LabResult getLabResult(Date jyrq, String yq, String ybh, String xmdh) {
return labResultMapper.getLabResult(jyrq, yq, ybh, xmdh);
}
public List<LabResult> getLabResultList(Date jyrq, String yq, String ybh) {
return labResultMapper.getLabResultList(jyrq, yq, ybh);
}
@Transactional(rollbackFor = Exception.class)
public int insertLabResult(LabResult labResult) {return labResultMapper.insertLabResult(labResult);}
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {return labResultMapper.getLabResultList(jyrq, yq, ybh);}
public int insertLabResult(LabResult labResult) {
return labResultMapper.insertLabResult(labResult);
}
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {
return labResultMapper.getLabResultList(jyrq, yq, ybh);
}
@Transactional(rollbackFor = Exception.class)
public int delLabResult(LabResult labResult) {return labResultMapper.delLabResult(labResult);}
public int delLabResult(LabResult labResult) {
return labResultMapper.delLabResult(labResult);
}
@Transactional(rollbackFor = Exception.class)
public int delNullLabResult(Date jyrq, String yq, String ybh) {return labResultMapper.delNullLabResult(jyrq, yq, ybh);}
public int delNullLabResult(Date jyrq, String yq, String ybh) {
return labResultMapper.delNullLabResult(jyrq, yq, ybh);
}
@Transactional(rollbackFor = Exception.class)
public int updateLabResult(LabResult labResult) {return labResultMapper.updateLabResult(labResult);}
public int updateLabResult(LabResult labResult) {
return labResultMapper.updateLabResult(labResult);
}
//=====项目字典查询=========
public List<XmInfo> getXmInfoList(String yq) {return xmInfoMapper.getXmInfoList(yq);}
public XmInfo getXmInfo(String yq,String xmdh) {return xmInfoMapper.getXmInfo(yq,xmdh);}
@ -106,6 +151,7 @@ public class CommonUtil {
return zdmc;
}
}
public String getCompany() {
String zdmc = getComDictNameById("99", "COMPANY");
if (zdmc == null || zdmc.equals("")) {
@ -119,31 +165,44 @@ public class CommonUtil {
public String getComDictNameById(String zdlb, String zddh) {
List<ComDict> comDictList = getDictCache(zdlb);
if (comDictList != null) {
for (ComDict dict : comDictList) {
if (zddh.equals(dict.getZddh())) {
return dict.getZdmc();
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zddh)).collect(Collectors.toList());
if(collect.size() > 0){
return collect.get(0).getZdmc();
}
}}
}
//如果redis当中没有查到数据,则先在设置redis值,
ComDictUtils.setDictCache(zdlb,comDictMapper.getComDictListByZdlb(zdlb));
return comDictMapper.getComDictNameById(zdlb, zddh);
}
public String getComDictIdByName(String zdlb, String zdmc) {
List<ComDict> comDictList = getDictCache(zdlb);
if (comDictList != null) {
for (ComDict dict : comDictList) {
if (zdmc.equals(dict.getZdmc())) {
return dict.getZddh();
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zdmc)).collect(Collectors.toList());
if(collect.size() > 0){
return collect.get(0).getZdmc();
}
}}
}
//如果redis当中没有查到数据,则先在设置redis值,
ComDictUtils.setDictCache(zdlb,comDictMapper.getComDictListByZdlb(zdlb));
return comDictMapper.getComDictIdByName(zdlb, zdmc);
}
public List<ComDict> getComDictList(String zdlb){
List<ComDict> dictCacheList = getDictCache(zdlb);
if(dictCacheList != null){
return dictCacheList;
}else{
return comDictMapper.getComDictListByZdlb(zdlb);
}
}
/**
* 获取本院设置全局参数yq=HISOPT
* @param xxdh
* @return
*/
public String getHISOPT(String xxdh){return getComOptValue("HISOPT",xxdh);}
public String getComOptValue(String yq, String xxdh) {
ComOpt comOpt = getOptCache(yq, xxdh);
if (comOpt != null) {
@ -158,6 +217,11 @@ public class CommonUtil {
}
public void setDictCache(String zdlb, List<ComDict> dictDatas){
ComDictUtils.setDictCache(zdlb,dictDatas);
}
public List<LabReqdetail> getLabReqdetailList(String sqh) {
return labReqdetailMapper.getLabReqdetailList(sqh);
}

View File

@ -33,8 +33,9 @@ public class SysJobServiceImpl implements ISysJobService {
/**
* 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
* 统一在applicationconfig类中进行异步调用
*/
@PostConstruct
//@PostConstruct
public void init() throws SchedulerException, TaskException {
scheduler.clear();
List<SysJob> jobList = jobMapper.selectJobAll();

View File

@ -1,7 +1,7 @@
package com.czlis.system.aspectj;
import com.czlis.common.annotation.Async;
import com.czlis.system.manager.AsyncManager;
import com.czlis.common.asyncmanager.AsyncManager;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@ -42,7 +42,7 @@ public class AsyncAspect {
// 异步执行目标方法
targetMethod.invoke(targetObject, methodArgs);
} catch (Exception e) {
log.error("异步执行方法失败", e);
log.error("异步执行{}方法失败",targetMethod, e);
}
}
};

View File

@ -13,7 +13,7 @@ import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.ServletUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.common.utils.ip.IpUtils;
import com.czlis.system.manager.AsyncManager;
import com.czlis.common.asyncmanager.AsyncManager;
import com.czlis.system.manager.factory.AsyncFactory;
import com.czlis.system.domain.SysOperLog;
import lombok.extern.slf4j.Slf4j;
@ -23,8 +23,6 @@ import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.NamedThreadLocal;
import org.springframework.stereotype.Component;
import org.springframework.validation.BindingResult;

View File

@ -1,15 +1,26 @@
package com.czlis.system.config;
import com.czlis.common.asyncmanager.AsyncManager;
import com.czlis.common.utils.ComDictUtils;
import com.czlis.interfaceCommon.mapper.ComDictMapper;
import com.czlis.quartz.service.impl.SysJobServiceImpl;
import com.czlis.system.service.impl.SysConfigServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import java.util.Arrays;
import java.util.List;
import java.util.TimeZone;
import java.util.TimerTask;
/**
* 程序注解配置
* 项目初始化运行逻辑
*
* @author admin
*/
@ -18,7 +29,19 @@ import java.util.TimeZone;
@EnableAspectJAutoProxy(exposeProxy = true)
// 指定要扫描的Mapper类的包的路径
@MapperScan("com.czlis.**.mapper")
@Slf4j
public class ApplicationConfig {
@Autowired
private ComDictMapper comDictMapper;
@Autowired
private SysConfigServiceImpl sysConfigService;
@Autowired
private SysJobServiceImpl sysJobService;
//选择性提供缓存的字典类别
private List<String> list = Arrays.asList("GROUP","AU","BT","DG", "DP", "FT", "HOS","LG","PT","PW","SRD","SX","UT","CM","VF");
/**
* 时区配置
*/
@ -26,4 +49,67 @@ public class ApplicationConfig {
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
}
/**
* 加载字典缓存数据
*/
@Bean
public void loadingDictCache() {
TimerTask task = new TimerTask(){
@Override
public void run() {
try {
//清空所有com_dict缓存
ComDictUtils.clearDictCache();
list.stream().forEach(zdlb -> ComDictUtils.setDictCache(zdlb, comDictMapper.getComDictListByZdlb(zdlb)));
} catch (Exception e) {
log.error("获取lis代码字典失败,异步执行{}方法失败",this, e);
}
}
};
AsyncManager.me().execute(task);
}
/**
* 加载系统配置缓存
*/
@Bean
public void loadingSysConfigCache() {
TimerTask task = new TimerTask(){
@Override
public void run() {
try {
sysConfigService.loadingConfigCache();
} catch (Exception e) {
log.error("获取系统配置字典失败,异步执行{}方法失败",this, e);
}
}
};
AsyncManager.me().execute(task);
}
/**
* 加载定时任务列表
*/
@Bean
public void loadingSysJobCache() {
TimerTask task = new TimerTask(){
@Override
public void run() {
try {
sysJobService.init();
} catch (Exception e) {
log.error("获取系统配置字典失败,异步执行{}方法失败",this, e);
}
}
};
AsyncManager.me().execute(task);
}
}

View File

@ -7,7 +7,7 @@ import com.czlis.common.core.domain.model.LoginUser;
import com.czlis.common.utils.MessageUtils;
import com.czlis.common.utils.ServletUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.system.manager.AsyncManager;
import com.czlis.common.asyncmanager.AsyncManager;
import com.czlis.system.manager.factory.AsyncFactory;
import com.czlis.system.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -34,10 +34,10 @@ public class SysConfigServiceImpl implements ISysConfigService {
/**
* 项目启动时,初始化参数到缓存
*/
@PostConstruct
public void init() {
loadingConfigCache();
}
// @PostConstruct
// public void init() {
// loadingConfigCache();
// }
/**
* 查询参数配置信息

View File

@ -3,9 +3,13 @@ package com.czlis.system.service.impl;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TimerTask;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import com.czlis.common.annotation.Async;
import com.czlis.common.asyncmanager.AsyncManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,6 +29,7 @@ import com.czlis.system.service.ISysDictTypeService;
* @author admin
*/
@Service
@Slf4j
public class SysDictTypeServiceImpl implements ISysDictTypeService {
@Autowired
private SysDictTypeMapper dictTypeMapper;
@ -37,7 +42,18 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
*/
@PostConstruct
public void init() {
TimerTask task = new TimerTask(){
@Override
public void run() {
try {
// 异步执行目标方法
loadingDictCache();
} catch (Exception e) {
log.error("获取系统字典失败,异步执行{}方法失败","loadingDictCache", e);
}
}
};
AsyncManager.me().execute(task);
}
/**
@ -123,8 +139,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
/**
* 加载字典缓存数据
*/
@Async
@Override
public void loadingDictCache() {
System.out.println("异步执行线程:" + Thread.currentThread().getName()); // 新增此行
SysDictData dictData = new SysDictData();
dictData.setStatus("0");
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));

View File

@ -12,7 +12,7 @@ import com.czlis.common.utils.DateUtils;
import com.czlis.common.utils.MessageUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.common.utils.ip.IpUtils;
import com.czlis.system.manager.AsyncManager;
import com.czlis.common.asyncmanager.AsyncManager;
import com.czlis.system.manager.factory.AsyncFactory;
import com.czlis.system.security.context.AuthenticationContextHolder;
import com.czlis.system.service.ISysConfigService;

View File

@ -11,7 +11,7 @@ import com.czlis.common.exception.user.CaptchaExpireException;
import com.czlis.common.utils.MessageUtils;
import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.system.manager.AsyncManager;
import com.czlis.common.asyncmanager.AsyncManager;
import com.czlis.system.manager.factory.AsyncFactory;
import com.czlis.system.service.ISysConfigService;
import com.czlis.system.service.ISysUserService;

View File

@ -75,6 +75,7 @@
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder" charset="UTF-8">
<pattern>${pattern}</pattern>
</encoder>
<filter class="com.czlis.interfaceCommon.config.MapperTurboFilter"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>

View File

@ -1,13 +1,13 @@
package com.czlis.liswork.service.impl;
import java.util.Arrays;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.czlis.common.core.domain.Result;
import com.czlis.common.utils.ComDictUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.interfaceCommon.mapper.ComDictMapper;
import com.czlis.common.core.domain.entity.lis.ComDict;
import com.czlis.interfaceCommon.utils.CommonUtil;
import com.czlis.liswork.service.ComDictService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.util.List;
/**
* lis字典管理
@ -23,44 +23,27 @@ import java.util.List;
@Service
@Slf4j
public class ComDictServiceImpl implements ComDictService {
//选择性提供缓存的字典类别
private List<String> list = Arrays.asList("GROUP","AU","BT","DG", "DP", "FT", "HOS","LG","PT","PW","SRD","SX","UT","CM","VF");
@Autowired
private ComDictMapper comDictMapper;
@PostConstruct
public void init() {
loadingDictCache();
}
/**
* 加载字典缓存数据
*/
private void loadingDictCache() {
//清空所有com_dict缓存
ComDictUtils.clearDictCache();
list.stream().forEach(zdlb -> ComDictUtils.setDictCache(zdlb, comDictMapper.getComDictListByZdlb(zdlb)));
}
private void setDictCache(String zdlb,List<ComDict> comDictList) {
boolean isPresent = list.contains(zdlb);
if(isPresent)ComDictUtils.setDictCache(zdlb,comDictList);
}
private List<ComDict> getDictCache(String zdlb) {
boolean isPresent = list.contains(zdlb);
if(isPresent) return ComDictUtils.getDictCache(zdlb);
else return comDictMapper.getComDictListByZdlb(zdlb);
}
@Autowired
private CommonUtil commonUtil;
@Override
public List<ComDict> getComDictList(ComDict comDict) {
return getDictCache(comDict.getZdlb());
return commonUtil.getComDictList(comDict.getZdlb());
}
@Override
public Result getComDicts(String zdlb) {
List<ComDict> comDictList = getDictCache(zdlb);
List<ComDict> comDictList = commonUtil.getComDictList(zdlb);
return new Result("0", "成功!",comDictList);
}
//根据编号查名称
public Result getComDictNameById(String zdlb,String zddh) {
List<ComDict> comDictList =getDictCache(zdlb);
List<ComDict> comDictList =commonUtil.getComDictList(zdlb);
for (ComDict dict : comDictList) {
if (zddh.equals(dict.getZddh())) {
return new Result("0", "成功!",dict.getZdmc());
@ -70,7 +53,7 @@ public class ComDictServiceImpl implements ComDictService {
}
//根据名称查编号
public Result getComDictIdByName(String zdlb,String zdmc) {
List<ComDict> comDictList =getDictCache(zdlb);
List<ComDict> comDictList =commonUtil.getComDictList(zdlb);
for (ComDict dict : comDictList) {
if (zdmc.equals(dict.getZdmc())) {
return new Result("0", "成功!",dict.getZddh());
@ -95,7 +78,7 @@ public class ComDictServiceImpl implements ComDictService {
int row = comDictMapper.insertComDict(comDict);
if (row > 0) {
List<ComDict> comDictList = comDictMapper.getComDictList(comDict);
setDictCache(comDict.getZdlb(), comDictList);
commonUtil.setDictCache(comDict.getZdlb(), comDictList);
}
return null;
}
@ -144,7 +127,7 @@ public class ComDictServiceImpl implements ComDictService {
ComDict comDict0 = new ComDict();
comDict0.setZdlb(zdlb);
List<ComDict> comDictList1 = comDictMapper.getComDictList(comDict0);
setDictCache(comDict0.getZdlb(), comDictList1);
commonUtil.setDictCache(comDict0.getZdlb(), comDictList1);
if (failureNum == comDictList.size()) {
return new Result("0", "数据已全部导入成功!共 " + comDictList.size() + " 条");
} else {
@ -182,7 +165,7 @@ public class ComDictServiceImpl implements ComDictService {
if (zddh == null || zddh.equals("")) return new Result("-1", "字典代号不能为空!");
if (yljg == null || yljg.equals("")) return new Result("-1", "医疗机构不能为空!");
int row = comDictMapper.delComDict(comDict);
if (row > 0) setDictCache(zdlb, comDictMapper.getComDictListByZdlb(zdlb));
if (row > 0) commonUtil.setDictCache(zdlb,comDictMapper.getComDictListByZdlb(zdlb));
return new Result("0", "删除成功!");
}
@ -192,7 +175,7 @@ public class ComDictServiceImpl implements ComDictService {
int row = comDictMapper.updateComDict(comDict);
if (row > 0) {
List<ComDict> comDictList = comDictMapper.getComDictList(comDict);
setDictCache(comDict.getZdlb(), comDictList);
commonUtil.setDictCache(comDict.getZdlb(), comDictList);
}
return new Result("0", "修改成功!");
}

View File

@ -798,7 +798,7 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_
-- ----------------------------
-- 初始化-部门表数据
-- ----------------------------
SET IDENTITY_INSERT dbo.sys_dept ON;
if not exists(select 1 from dbo.sys_dept where dept_id = '100' and parent_id = '0')
begin
INSERT INTO dbo.sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag, create_by, create_time, update_by, update_time)
@ -817,7 +817,7 @@ if not exists(select 1 from dbo.sys_dept where dept_id = '103' and parent_id = '
VALUES (103, 101, '0,100,101', '临检组', 1, 'lis', '15888888888', null, '0', '0', 'admin', '2025-05-05 11:09:44.197', '', NULL)
end
SET IDENTITY_INSERT dbo.sys_dept OFF;
-- ----------------------------
-- 2、用户信息表
-- ----------------------------
@ -850,7 +850,7 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_
-- ----------------------------
-- 初始化-用户信息表数据
-- ----------------------------
SET IDENTITY_INSERT dbo.sys_user ON;
if not exists(select 1 from dbo.sys_user where user_id = '1')
begin
INSERT INTO dbo.sys_user (user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark)
@ -864,7 +864,7 @@ if not exists(select 1 from dbo.sys_user where user_id = '2')
VALUES (2, 103, 'ry', '管理员1', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2025-05-05 11:37:08.193', 'admin', '2025-05-05 11:37:08.193', '', NULL, '测试员')
end
SET IDENTITY_INSERT dbo.sys_user OFF;
-- ----------------------------
-- 3、岗位信息表
-- ----------------------------
@ -889,7 +889,7 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_
-- ----------------------------
-- 初始化-岗位信息表数据
-- ----------------------------
SET IDENTITY_INSERT dbo.sys_post ON;
if not exists(select 1 from dbo.sys_post where post_id = '1')
begin
INSERT INTO dbo.sys_post (post_id, post_code, post_name, post_sort, status, create_by, create_time, update_by, update_time, remark)
@ -917,7 +917,7 @@ if not exists(select 1 from dbo.sys_post where post_id = '4')
VALUES (4, 'user', '普通员工', 4, '0', 'admin', '2025-05-05 11:38:34.44', '', NULL, '')
end
SET IDENTITY_INSERT dbo.sys_post OFF;
-- ----------------------------
-- 8、角色和部门关联表 角色1-N部门
-- ----------------------------
@ -1592,3 +1592,60 @@ if not exists(select 1 from dbo.sys_job where invoke_target = 'lisTask.getXmFee'
VALUES ('获取his收费项目', 'DEFAULT', 'lisTask.getXmFee', '0 0 23 * * ?', '3', '1', '1', 'admin', '2025-08-15 11:58:04.853', '', NULL, '')
end
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE name LIKE '%DF__sys_oper___json%' AND type = 'D' AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]'))
begin
DECLARE @constraintName NVARCHAR(128)
SELECT @constraintName = name
FROM dbo.sysobjects
WHERE
name LIKE '%DF__sys_oper___json%'
AND type = 'D'
AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]')
-- 动态执行删除约束(因约束名称是变量,需用动态SQL)
EXEC('ALTER TABLE [dbo].[sys_oper_log] DROP CONSTRAINT [' + @constraintName + ']')
end
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE name LIKE '%DF__sys_oper___oper%' AND type = 'D' AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]'))
begin
SELECT @constraintName = name
FROM dbo.sysobjects
WHERE
name LIKE '%DF__sys_oper___oper%'
AND type = 'D'
AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]')
-- 动态执行删除约束(因约束名称是变量,需用动态SQL)
EXEC('ALTER TABLE [dbo].[sys_oper_log] DROP CONSTRAINT [' + @constraintName + ']')
end
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE name LIKE '%DF__sys_oper___error%' AND type = 'D' AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]'))
begin
SELECT @constraintName = name
FROM dbo.sysobjects
WHERE
name LIKE '%DF__sys_oper___error%'
AND type = 'D'
AND parent_obj = OBJECT_ID(N'[dbo].[sys_oper_log]')
-- 动态执行删除约束(因约束名称是变量,需用动态SQL)
EXEC('ALTER TABLE [dbo].[sys_oper_log] DROP CONSTRAINT [' + @constraintName + ']')
end
if exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_oper_log' AND COLUMN_NAME = 'oper_param')
begin
alter table sys_oper_log ALTER COLUMN oper_param nvarchar(max)
end
if exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_oper_log' AND COLUMN_NAME = 'json_result')
begin
alter table sys_oper_log ALTER COLUMN json_result nvarchar(max)
end
if exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sys_oper_log' AND COLUMN_NAME = 'error_msg')
begin
alter table sys_oper_log ALTER COLUMN error_msg nvarchar(max)
end

Binary file not shown.