Commit 703f73e3 authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent ae0cdea5
...@@ -596,7 +596,6 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu ...@@ -596,7 +596,6 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
autoInsurRuleOld = autoInsurRuleInfoMapper.selectOne(Wrappers.<TAutoInsurRuleInfo>query().lambda() autoInsurRuleOld = autoInsurRuleInfoMapper.selectOne(Wrappers.<TAutoInsurRuleInfo>query().lambda()
.eq(TAutoInsurRuleInfo::getMainId,autoMainRel.getId()).last(CommonConstants.LAST_ONE_SQL)); .eq(TAutoInsurRuleInfo::getMainId,autoMainRel.getId()).last(CommonConstants.LAST_ONE_SQL));
} }
//商险购买标准是否更新标识 false 未更新 true 更新 //商险购买标准是否更新标识 false 未更新 true 更新
boolean flag = false; boolean flag = false;
List<TAutoInsurStandard> insurStandardsOld = null; List<TAutoInsurStandard> insurStandardsOld = null;
...@@ -759,27 +758,23 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu ...@@ -759,27 +758,23 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
autoEmpRuleNew.setMainId(autoMainRel.getId()); autoEmpRuleNew.setMainId(autoMainRel.getId());
autoEmpRuleInfoMapper.updateById(autoEmpRuleNew); autoEmpRuleInfoMapper.updateById(autoEmpRuleNew);
} }
//处理商险规则日志 StringBuilder diffKeys = new StringBuilder();
if (Common.isNotNull(autoInsurRuleNew)){ String differenceKey;
if (Common.isEmpty(autoInsurRuleOld)){ //处理商险规则日志 -- 如果是初次创建的,则不记录日志
autoInsurRuleOld = new TAutoInsurRuleInfo(); if (Common.isNotNull(autoInsurRuleNew) && !Common.isEmpty(autoInsurRuleOld)){
} differenceKey = HrEquator.comparisonValueIgnoreField(autoInsurRuleOld, autoInsurRuleNew,ignoreFields);
String differenceKey = HrEquator.comparisonValueIgnoreField(autoInsurRuleOld, autoInsurRuleNew,ignoreFields);
if (!Common.isEmpty(differenceKey)){ if (!Common.isEmpty(differenceKey)){
diffKeyMap.put("insurRule",differenceKey); diffKeyMap.put("insurRule",differenceKey);
oldMap.put("oldInsurRule",autoInsurRuleOld); oldMap.put("oldInsurRule",autoInsurRuleOld);
newMap.put("newInsurRule",autoInsurRuleNew); newMap.put("newInsurRule",autoInsurRuleNew);
} }
}
//处理商险购买标准日志 //处理商险购买标准日志
StringBuilder diffKeys = new StringBuilder();
if (Common.isNotNull(insurStandards)){ if (Common.isNotNull(insurStandards)){
Map<String,TAutoInsurStandard> map; Map<String,TAutoInsurStandard> map;
// 不为空且无新增数据,为空前面校验过了,这里不处理 // 不为空且无新增数据,为空前面校验过了,这里不处理
if (Common.isNotNull(insurStandards) && !flag){ if (Common.isNotNull(insurStandards) && !flag){
map = insurStandards.stream().collect(Collectors.toMap(TAutoInsurStandard::getId, v->v)); map = insurStandards.stream().collect(Collectors.toMap(TAutoInsurStandard::getId, v->v));
if (Common.isNotNull(insurStandardsOld)){ if (Common.isNotNull(insurStandardsOld)){
String differenceKey;
TAutoInsurStandard newTemp; TAutoInsurStandard newTemp;
for (TAutoInsurStandard old:insurStandardsOld){ for (TAutoInsurStandard old:insurStandardsOld){
// 如果存在,则比较,不存在则标记为更新 // 如果存在,则比较,不存在则标记为更新
...@@ -802,18 +797,15 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu ...@@ -802,18 +797,15 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
newMap.put("newInsurStandards",insurStandards); newMap.put("newInsurStandards",insurStandards);
} }
} }
//处理员工合同签订规则日志
if (Common.isNotNull(autoContractRuleNew)){
if (Common.isEmpty(autoContractRuleOld)){
autoContractRuleOld = new TAutoContractRuleInfo();
} }
String differenceKey = HrEquator.comparisonValueIgnoreField(autoContractRuleOld, autoContractRuleNew,ignoreFields); //处理员工合同签订规则日志
if (Common.isNotNull(autoContractRuleNew) && !Common.isEmpty(autoContractRuleOld)){
differenceKey = HrEquator.comparisonValueIgnoreField(autoContractRuleOld, autoContractRuleNew,ignoreFields);
if (!Common.isEmpty(differenceKey)){ if (!Common.isEmpty(differenceKey)){
diffKeyMap.put("contractRule",differenceKey); diffKeyMap.put("contractRule",differenceKey);
oldMap.put("oldcontractRule",autoContractRuleOld); oldMap.put("oldcontractRule",autoContractRuleOld);
newMap.put("newcontractRule",autoContractRuleNew); newMap.put("newcontractRule",autoContractRuleNew);
} }
}
//处理员工合同签订规则方案配置日志 //处理员工合同签订规则方案配置日志
diffKeys = new StringBuilder(); diffKeys = new StringBuilder();
if (Common.isNotNull(schemes)){ if (Common.isNotNull(schemes)){
...@@ -822,7 +814,6 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu ...@@ -822,7 +814,6 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
if (Common.isNotNull(schemes) && !schemeFlag){ if (Common.isNotNull(schemes) && !schemeFlag){
map = schemes.stream().collect(Collectors.toMap(TAutoContractScheme::getId, v->v)); map = schemes.stream().collect(Collectors.toMap(TAutoContractScheme::getId, v->v));
if (Common.isNotNull(autoContractRuleOld)){ if (Common.isNotNull(autoContractRuleOld)){
String differenceKey;
TAutoContractScheme newTemp; TAutoContractScheme newTemp;
for (TAutoContractScheme old:schemesOld){ for (TAutoContractScheme old:schemesOld){
// 如果存在,则比较,不存在则标记为更新 // 如果存在,则比较,不存在则标记为更新
...@@ -839,6 +830,7 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu ...@@ -839,6 +830,7 @@ public class TAutoMainRelServiceImpl extends ServiceImpl<TAutoMainRelMapper, TAu
} }
} }
} }
}
if (schemeFlag){ if (schemeFlag){
diffKeyMap.put("schemeRule","schemes"); diffKeyMap.put("schemeRule","schemes");
oldMap.put("oldSchemes",schemesOld); oldMap.put("oldSchemes",schemesOld);
......
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