Commit 6b4c989e authored by fangxinjiang's avatar fangxinjiang

项目配置限制项日志调整-fxj

parent a17fd9aa
......@@ -1889,32 +1889,37 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
entity.setRuleUpdateTime(DateUtil.getCurrentDateTime());
baseMapper.updateById(entity);
// 记录变更日志
// 记录变更日志 - 整合所有限制项到 autoMailRel
Map<String,String> diffKeyMap = new HashMap<>();
Map<String,Object> oldMap = new HashMap<>();
Map<String,Object> newMap = new HashMap<>();
// 添加有变化的字段到差异映射
// 收集所有变化的字段名
List<String> changedFields = new ArrayList<>();
if (!oldEntity.getAutoFlag().equals(entity.getAutoFlag())) {
diffKeyMap.put("autoFlag", "autoFlag");
changedFields.add("autoFlag");
}
if (!oldEntity.getRestrictArchive().equals(entity.getRestrictArchive())) {
diffKeyMap.put("restrictArchive", "restrictArchive");
changedFields.add("restrictArchive");
}
if (!oldEntity.getRestrictInsurance().equals(entity.getRestrictInsurance())) {
diffKeyMap.put("restrictInsurance", "restrictInsurance");
changedFields.add("restrictInsurance");
}
if (!oldEntity.getRestrictContract().equals(entity.getRestrictContract())) {
diffKeyMap.put("restrictContract", "restrictContract");
changedFields.add("restrictContract");
}
if (!oldEntity.getRestrictSocialFund().equals(entity.getRestrictSocialFund())) {
diffKeyMap.put("restrictSocialFund", "restrictSocialFund");
changedFields.add("restrictSocialFund");
}
oldMap.put("oldAutoMainRel", oldEntity);
newMap.put("newAutoMainRel", entity);
insertLog(entity, diffKeyMap, oldMap, newMap);
// 将变化的字段名用逗号分隔
if (!changedFields.isEmpty()) {
diffKeyMap.put("autoMailRel", String.join(",", changedFields));
oldMap.put("oldAutoMailRel", oldEntity);
newMap.put("newAutoMailRel", entity);
insertLog(entity, diffKeyMap, oldMap, newMap);
}
log.info("更新限制项, 项目配置ID: {}, 用户: {}", vo.getId(), user.getNickname());
}
......@@ -2093,32 +2098,37 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
entity.setRuleUpdateTime(DateUtil.getCurrentDateTime());
baseMapper.updateById(entity);
// 记录变更日志
// 记录变更日志 - 整合所有限制项到 autoMailRel
Map<String,String> diffKeyMap = new HashMap<>();
Map<String,Object> oldMap = new HashMap<>();
Map<String,Object> newMap = new HashMap<>();
// 添加有变化的字段到差异映射
// 收集所有变化的字段名
List<String> changedFields = new ArrayList<>();
if (!oldEntity.getAutoFlag().equals(entity.getAutoFlag())) {
diffKeyMap.put("autoFlag", "autoFlag");
changedFields.add("autoFlag");
}
if (!oldEntity.getRestrictArchive().equals(entity.getRestrictArchive())) {
diffKeyMap.put("restrictArchive", "restrictArchive");
changedFields.add("restrictArchive");
}
if (!oldEntity.getRestrictInsurance().equals(entity.getRestrictInsurance())) {
diffKeyMap.put("restrictInsurance", "restrictInsurance");
changedFields.add("restrictInsurance");
}
if (!oldEntity.getRestrictContract().equals(entity.getRestrictContract())) {
diffKeyMap.put("restrictContract", "restrictContract");
changedFields.add("restrictContract");
}
if (!oldEntity.getRestrictSocialFund().equals(entity.getRestrictSocialFund())) {
diffKeyMap.put("restrictSocialFund", "restrictSocialFund");
changedFields.add("restrictSocialFund");
}
oldMap.put("oldAutoMainRel", oldEntity);
newMap.put("newAutoMainRel", entity);
insertLog(entity, diffKeyMap, oldMap, newMap);
// 将变化的字段名用逗号分隔
if (!changedFields.isEmpty()) {
diffKeyMap.put("autoMailRel", String.join(",", changedFields));
oldMap.put("oldAutoMailRel", oldEntity);
newMap.put("newAutoMailRel", entity);
insertLog(entity, diffKeyMap, oldMap, newMap);
}
log.info("更新限制项, 项目编码: {}, 用户: {}", excel.getDeptNo(), user.getNickname());
}
}
......@@ -2226,9 +2236,11 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
if (!errorMessages.isEmpty()) {
resultMsg = "错误: " + String.join("; ", errorMessages);
logId = UUID.randomUUID().toString().replace("-", "");
saveRefreshLog(logId, tAutoMainRel, "ERROR", resultMsg, duration);
} else {
resultMsg = "合同和商险续签刷新成功";
logId = UUID.randomUUID().toString().replace("-", "");
saveRefreshLog(logId, tAutoMainRel, "SUCCESS", resultMsg, duration);
}
......@@ -2239,6 +2251,7 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
} catch (Exception e) {
long duration = System.currentTimeMillis() - startTime;
logId = UUID.randomUUID().toString().replace("-", "");
saveRefreshLog(logId, tAutoMainRel, "EXCEPTION", e.getMessage(), duration);
}
}
......
......@@ -500,7 +500,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
}
//更新自动化的所有的合同办理状态--这里如果项目编码不为空要传参
baseMapper.updateProcessStatus(deptNo);
return R.ok();
return R.ok(true);
}
......
......@@ -301,7 +301,7 @@ public class InsuranceDaprUtil {
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprInsurancesProperties.getAppUrl(),
daprInsurancesProperties.getAppId(),
"/tinsurancewarn/inner/createInsuranceAlert",
"/insuranceWarn/inner/createInsuranceAlert",
paramVo,
Boolean.class,
SecurityConstants.FROM_IN
......
......@@ -210,9 +210,14 @@ public class TInsurancesWarnController {
@Operation(description = "每天刷新商险到期提醒信息")
@Inner
@PostMapping("/inner/createInsuranceAlert")
public void createInsuranceAlert(@RequestBody(required = false) BaseSearchVO paramVo) {
String deptNo = Common.isNotNull(paramVo) ? paramVo.getDeptNo() : null;
insuranceWarnService.createInsuranceAlert(deptNo);
public Boolean createInsuranceAlert(@RequestBody(required = false) BaseSearchVO paramVo) {
try {
String deptNo = Common.isNotNull(paramVo) ? paramVo.getDeptNo() : null;
insuranceWarnService.createInsuranceAlert(deptNo);
return true;
}catch (Exception e){
return false;
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment