Commit 6b4c989e authored by fangxinjiang's avatar fangxinjiang

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

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