Commit 10327474 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 948f30cb
...@@ -197,14 +197,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -197,14 +197,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型并更新 //从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
for (TEmployeeProject t : list) { Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (CommonConstants.ZERO_STRING.equals(t.getEmpNatrue())) { if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
break; } else if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ONE_STRING))){
} else if (CommonConstants.ONE_STRING.equals(t.getEmpNatrue()) && !CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue())) { tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); } else {
break;
}
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
} }
} }
...@@ -276,14 +274,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -276,14 +274,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型并更新 //从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
for (TEmployeeProject t : list) { Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (CommonConstants.ZERO_STRING.equals(t.getEmpNatrue())) { if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
break; } else if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ONE_STRING))){
} else if (CommonConstants.ONE_STRING.equals(t.getEmpNatrue()) && !CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue())) { tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); } else {
break;
}
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
} }
} }
...@@ -311,14 +307,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -311,14 +307,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型并更新 //从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
for (TEmployeeProject t : list) { Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (CommonConstants.ZERO_STRING.equals(t.getEmpNatrue())) { if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
break; } else if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ONE_STRING))){
} else if (CommonConstants.ONE_STRING.equals(t.getEmpNatrue()) && !CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue())) { tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); } else {
break;
}
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
} }
} }
...@@ -364,14 +358,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -364,14 +358,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型并更新 //从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
for (TEmployeeProject t : list) { Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (CommonConstants.ZERO_STRING.equals(t.getEmpNatrue())) { if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
break; } else if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ONE_STRING))){
} else if (CommonConstants.ONE_STRING.equals(t.getEmpNatrue()) && !CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue())) { tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); } else {
break;
}
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
} }
} }
...@@ -678,6 +670,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -678,6 +670,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
try { try {
if (updateList.size() > CommonConstants.dingleDigitIntArray[0]) { if (updateList.size() > CommonConstants.dingleDigitIntArray[0]) {
tEmployeeInfoMapper.updateExcelEmployeeInfo(updateList); tEmployeeInfoMapper.updateExcelEmployeeInfo(updateList);
doJointTask.doUpdateEmployeeInfo(updateList);
} }
if (proInsList.size() > CommonConstants.dingleDigitIntArray[0]) { if (proInsList.size() > CommonConstants.dingleDigitIntArray[0]) {
baseMapper.insertExcelEmpProject(proInsList); baseMapper.insertExcelEmpProject(proInsList);
......
...@@ -13,6 +13,8 @@ import org.springframework.scheduling.annotation.Async; ...@@ -13,6 +13,8 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* 主要执行人员档案的员工类型同步更新 * 主要执行人员档案的员工类型同步更新
...@@ -50,16 +52,15 @@ public class DoJointTask { ...@@ -50,16 +52,15 @@ public class DoJointTask {
.eq(TEmployeeProject::getEmpIdcard, tEmployeeInfo.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, tEmployeeInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)); .eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
for (TEmployeeProject tEmployeeProject:list) { Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) { if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
break; } else if (empNatrue.stream().anyMatch(e-> e.equals(CommonConstants.ONE_STRING))){
} else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) { tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); } else {
break;
}
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
} }
tEmployeeInfoService.updateById(tEmployeeInfo); tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0] tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0]
, tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo); , tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo);
......
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