Commit 80f30a38 authored by huyuchen's avatar huyuchen

预估库导入人部门修改

parent 4439b10b
...@@ -108,7 +108,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -108,7 +108,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
//身份证系统中是否已有 //身份证系统中是否已有
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
...@@ -157,13 +156,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -157,13 +156,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} else { } else {
if (Common.isEmpty(tEmployeeInfo)) { if (Common.isEmpty(tEmployeeInfo)) {
return R.failed("该人员暂无档案信息,禁止关联项目,如要添加,请先至“在档人员”处建档"); return R.failed("该人员暂无档案信息,禁止关联项目,如要添加,请先至“在档人员”处建档");
}
//身份证实名认证 //身份证实名认证
if (!Common.isEmpty(tEmployeeInfo)) { } else if (!tEmployeeProject.getEmpName().equals(tEmployeeInfo.getEmpName())) {
if (!tEmployeeProject.getEmpName().equals(tEmployeeInfo.getEmpName())) {
return R.failed("姓名和身份证不一致,请确认后再次新增"); return R.failed("姓名和身份证不一致,请确认后再次新增");
} }
}
//判断是否已经减档 //判断是否已经减档
if (tEmployeeInfo.getFileStatus() == CommonConstants.dingleDigitIntArray[1]) { if (tEmployeeInfo.getFileStatus() == CommonConstants.dingleDigitIntArray[1]) {
map.put("employeeId", tEmployeeInfo.getId()); map.put("employeeId", tEmployeeInfo.getId());
...@@ -234,7 +230,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -234,7 +230,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
!CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) { !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
} }
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT); tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],
tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo); tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo);
...@@ -574,9 +570,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -574,9 +570,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>(); List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>();
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) { for (EmployeeXProjectVO excel : excelVOList) {
EmployeeXProjectVO excel = excelVOList.get(i);
//根据身份证和项目编码获取项目档案 //根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()) .eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
...@@ -916,7 +910,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -916,7 +910,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public R<List<ErrorMessage>> importEmpProjectUpdate(InputStream inputStream) { public R<List<ErrorMessage>> importEmpProjectUpdate(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmployeeProjectUpdateVO> util1 = new ExcelUtil<>(EmployeeProjectUpdateVO.class); ExcelUtil<EmployeeProjectUpdateVO> util1 = new ExcelUtil<>(EmployeeProjectUpdateVO.class);
;
// 写法2: // 写法2:
// 匿名内部类 不用额外写一个DemoDataListener // 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
...@@ -976,8 +969,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -976,8 +969,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @Date 19:25 2022/6/21 * @Date 19:25 2022/6/21
**/ **/
public void importEmpProjectUpdate(List<EmployeeProjectUpdateVO> excelVOList, List<ErrorMessage> errorMessageList) { public void importEmpProjectUpdate(List<EmployeeProjectUpdateVO> excelVOList, List<ErrorMessage> errorMessageList) {
// 通用校验获取失败的数据
Map<Long, ErrorMessage> errorMsgMap = new HashMap<>();
// 项目档案更新List // 项目档案更新List
List<TEmployeeProject> updateList = new ArrayList<>(); List<TEmployeeProject> updateList = new ArrayList<>();
...@@ -988,8 +979,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -988,8 +979,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老档案List // 新老档案List
List<EmployeeNewOldVO> updateInfoList = new ArrayList<>(); List<EmployeeNewOldVO> updateInfoList = new ArrayList<>();
// 新老档案vo
EmployeeNewOldVO newOld;
// 新老项目档案vo // 新老项目档案vo
EmployeeProjectNewOldVO newOldProject; EmployeeProjectNewOldVO newOldProject;
// 新老项目档案List // 新老项目档案List
...@@ -997,10 +986,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -997,10 +986,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
if (Common.isNotNull(errorMsgMap.get(i + 2))) {
continue;
}
EmployeeProjectUpdateVO excel = excelVOList.get(i); EmployeeProjectUpdateVO excel = excelVOList.get(i);
String checkCount = excel.getEmpIdcard().concat(excel.getDeptNo()); String checkCount = excel.getEmpIdcard().concat(excel.getDeptNo());
...@@ -1069,14 +1054,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1069,14 +1054,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
doJointTask.doUpdateEmployeeInfo(updEmpInfoList, user); doJointTask.doUpdateEmployeeInfo(updEmpInfoList, user);
} }
// 记录变更日志 // 记录变更日志
if (updateInfoList.size() > CommonConstants.dingleDigitIntArray[0]) { if (updateProjectList.size() > CommonConstants.dingleDigitIntArray[0]) {
for (EmployeeNewOldVO newOldInfo : updateInfoList) { for (EmployeeProjectNewOldVO newOldProjectLog : updateProjectList) {
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0] tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1]
, newOldInfo.getOldEmployee().getId(), "" , newOldProjectLog.getNewProjectEmployee().getId(), ""
, newOldInfo.getOldEmployee(), newOldInfo.getNewEmployee()); , newOldProjectLog.getOldProjectEmployee(), newOldProjectLog.getNewProjectEmployee());
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.error("数据更新异常", e); log.error("数据更新异常", e);
} }
...@@ -1125,13 +1109,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1125,13 +1109,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override @Override
@Transactional @Transactional
public R<List<ErrorMessage>> batchRemoveByIds(String ids) { public R<List<ErrorMessage>> batchRemoveByIds(String ids) {
List<ErrorMessage> errorList = new ArrayList<ErrorMessage>(); List<ErrorMessage> errorList = new ArrayList<>();
List<TEmployeeProject> updList = new ArrayList<>(); List<TEmployeeProject> updList = new ArrayList<>();
List<TEmployeeInfo> infoUpdList = new ArrayList<>(); List<TEmployeeInfo> infoUpdList = new ArrayList<>();
List<String> idsList = null; List<String> idsList;
if (!Common.isEmpty(ids)) { if (!Common.isEmpty(ids)) {
idsList = Common.initStrToList(ids, CommonConstants.COMMA_STRING); idsList = Common.initStrToList(ids, CommonConstants.COMMA_STRING);
} else { } else {
...@@ -1197,13 +1181,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1197,13 +1181,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String fileName = "项目档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = "项目档案批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
// 根据用户传入确定要导出的字段 // 根据用户传入确定要导出的字段
Set<String> includeColumnFiledNames = new HashSet<String>(); Set<String> includeColumnFiledNames = new HashSet<>();
for (String exportField : exportFields) { for (String exportField : exportFields) {
includeColumnFiledNames.add(exportField); includeColumnFiledNames.add(exportField);
} }
//获取要导出的列表 //获取要导出的列表
List<EmployeeProjectExportVO> list = new ArrayList<>(); List<EmployeeProjectExportVO> list;
//获取记录 //获取记录
list = gettEmpProInfoExportVos(idstr, projectDTO); list = gettEmpProInfoExportVos(idstr, projectDTO);
...@@ -1268,7 +1252,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1268,7 +1252,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType()); tEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
tEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType()); tEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
tEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType()); tEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
TCustomerInfo tCustomerInfo = tCustomerInfoMapper.selectById(tSettleDomain.getCustomerId());
tEmployeeProject.setUnitId(tSettleDomain.getCustomerId()); tEmployeeProject.setUnitId(tSettleDomain.getCustomerId());
tEmployeeProject.setUnitNo(tSettleDomain.getCustomerNo()); tEmployeeProject.setUnitNo(tSettleDomain.getCustomerNo());
tEmployeeProject.setUnitName(tSettleDomain.getCustomerName()); tEmployeeProject.setUnitName(tSettleDomain.getCustomerName());
......
...@@ -692,7 +692,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -692,7 +692,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
// 5.封装地市派单限制日 // 5.封装地市派单限制日
initDayLimit(dayConfMap, info); initDayLimit(dayConfMap, info);
// 6.保存 有异常也保存 要标识 // 6.保存 有异常也保存 要标识
info.setUserDeptName(selectVo.getDepartName()); info.setUserDeptName(user.getDeptName());
info.setPreStatus(CommonConstants.ZERO_STRING); info.setPreStatus(CommonConstants.ZERO_STRING);
// 为验重添加到MAP // 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info); existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
...@@ -763,11 +763,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -763,11 +763,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
// 4.封装地市派单限制日 // 4.封装地市派单限制日
initDayLimit(dayConfMap, info); initDayLimit(dayConfMap, info);
// 5.保存 有异常也保存 要做标识 // 5.保存 有异常也保存 要做标识
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(user.getDeptId().toString()); info.setUserDeptName(user.getDeptName());
if (Common.isNotNull(domainR) && Common.isNotNull(domainR.getData())) {
TSettleDomainSelectVo selectVo = domainR.getData();
info.setUserDeptName(selectVo.getDepartName());
}
info.setPreStatus(CommonConstants.ZERO_STRING); info.setPreStatus(CommonConstants.ZERO_STRING);
// 如果已经存在未派单的派增 这个时候派减 直接标记异常 客服自行判断是否派单 // 如果已经存在未派单的派增 这个时候派减 直接标记异常 客服自行判断是否派单
if (null != preAddMap.get(info.getEmpIdcard())) { if (null != preAddMap.get(info.getEmpIdcard())) {
......
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