Commit 66e821a8 authored by huyuchen's avatar huyuchen

法大大代码提交

parent 95702c74
...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService; ...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo; import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
...@@ -170,7 +171,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -170,7 +171,9 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
Enumeration<?> entries = zipFile.entries(); Enumeration<?> entries = zipFile.entries();
Map<String,String> insMap = new HashMap<>(); Map<String,String> insMap = new HashMap<>();
Map<String,String> map = new HashMap<>();
List<TElecEmployeeInfo> infolist = new ArrayList<>();
List<String> list = new ArrayList<>();
while (entries.hasMoreElements()) { while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement(); ZipEntry entry = (ZipEntry) entries.nextElement();
//添加进filesName //添加进filesName
...@@ -199,7 +202,6 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -199,7 +202,6 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
} }
TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo(); TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo();
List<String> list = new ArrayList<>();
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) { if (empInfo.length() > empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0,empInfo.indexOf("/")); String idCard = empInfo.substring(0,empInfo.indexOf("/"));
String dataType = empInfo.substring(empInfo.indexOf("/") +1,empInfo.lastIndexOf("/")); String dataType = empInfo.substring(empInfo.indexOf("/") +1,empInfo.lastIndexOf("/"));
...@@ -219,15 +221,17 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -219,15 +221,17 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
if (Common.isNotNull(elecTypeMap.get(dataType))) { if (Common.isNotNull(elecTypeMap.get(dataType))) {
tElecEmployeeInfo.setDataType(elecTypeMap.get(dataType)); tElecEmployeeInfo.setDataType(elecTypeMap.get(dataType));
} else { } else {
return R.failed("资料类型错误:" + dataType); throw new CheckedException("资料类型错误:" + dataType);
} }
} }
String id = insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType); String id = insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType);
//if (!elecTypeMap.get(dataType).equals(insMap.get(idCard))) { //if (!elecTypeMap.get(dataType).equals(insMap.get(idCard))) {
if (Common.isEmpty(id)) { if (Common.isEmpty(id)) {
infolist.add(tElecEmployeeInfo);
this.save(tElecEmployeeInfo); this.save(tElecEmployeeInfo);
insMap.put(idCard + CommonConstants.DOWN_LINE_STRING + dataType, tElecEmployeeInfo.getId()); insMap.put(idCard + CommonConstants.DOWN_LINE_STRING + dataType, tElecEmployeeInfo.getId());
} }
list.add(insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType)); fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
} }
......
...@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants; import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
...@@ -48,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; ...@@ -48,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -76,7 +78,7 @@ import java.util.stream.Collectors; ...@@ -76,7 +78,7 @@ import java.util.stream.Collectors;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Log4j2 @Log4j2
@EnableConfigurationProperties(DaprCheckProperties.class) @EnableConfigurationProperties({DaprUpmsProperties.class, DaprCheckProperties.class})
public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService { public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService {
@Autowired @Autowired
...@@ -98,6 +100,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -98,6 +100,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired @Autowired
private DaprCheckProperties daprCheckProperties; private DaprCheckProperties daprCheckProperties;
@Autowired
private DaprUpmsProperties daprUpmsProperties;
@Override @Override
public R addCheck(TEmployeeProject tEmployeeProject) { public R addCheck(TEmployeeProject tEmployeeProject) {
...@@ -172,21 +177,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -172,21 +177,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isNotNull(tEmployeeInfo)) { if (Common.isNotNull(tEmployeeInfo)) {
TCheckBankNo check = new TCheckBankNo(); if (Common.isNotNull(tEmployeeProject.getBankNo())) {
check.setBankNo(tEmployeeProject.getBankNo()); TCheckBankNo check = new TCheckBankNo();
check.setIdNum(tEmployeeProject.getEmpIdcard()); check.setBankNo(tEmployeeProject.getBankNo());
check.setName(tEmployeeProject.getEmpName()); check.setIdNum(tEmployeeProject.getEmpIdcard());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() check.setName(tEmployeeProject.getEmpName());
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN); R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
if (checkListR != null && checkListR.getData() != null) { , "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
check = checkListR.getData(); if (checkListR != null && checkListR.getData() != null) {
if (check == null || Common.isEmpty(check.getResult())) { check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
return R.failed(check.getMessage());
}
} else {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE); return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
return R.failed(check.getMessage());
} }
} else {
return R.failed(EmployeeConstants.CHECK_NO_RESPONSE);
} }
TEmployeeInfo tEmployeeInfoCompare = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId()); TEmployeeInfo tEmployeeInfoCompare = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
...@@ -516,13 +523,37 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -516,13 +523,37 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)); .eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
// 调用字典服务,渲染字典值
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToValue", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
// 减项原因
Map<String, String> empReduceMap;
if (dictR == null || dictR.getData() == null) {
return R.failed("获取字典失败!");
} else {
dictDataMap = dictR.getData();
dictMap = dictDataMap.get("data");
if (dictMap == null) {
return R.failed("获取字典失败!!");
}
empReduceMap = dictMap.get("reduce_project_reason");
}
String leaveReason = "";
if (empReduceMap != null) {
leaveReason = empReduceMap.get(excel.getLeaveReason());
}
String errorMessage = ""; String errorMessage = "";
if (Common.isNotNull(excel.getEmpName())) { if (Common.isNotNull(excel.getEmpName())) {
errorMessage = errorMessage.concat(excel.getEmpName()).concat(";"); errorMessage = errorMessage.concat(excel.getEmpName()).concat(";");
}else { }else {
errorMessage = " ".concat(";"); errorMessage = " ".concat(";");
} }
errorMessage = errorMessage + excel.getEmpIdcard() + ";" + excel.getDeptNo() + ";" + excel.getLeaveReason() + ";"; errorMessage = errorMessage + excel.getEmpIdcard() + ";" + excel.getDeptNo() + ";" + leaveReason + ";";
if (Common.isNotNull(excel.getLeaveRemark())) { if (Common.isNotNull(excel.getLeaveRemark())) {
errorMessage = errorMessage.concat(excel.getLeaveRemark()).concat(";"); errorMessage = errorMessage.concat(excel.getLeaveRemark()).concat(";");
}else { }else {
...@@ -710,21 +741,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -710,21 +741,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(在档人员),项目无 //档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject) } else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) { && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) {
TCheckBankNo check = new TCheckBankNo(); if (Common.isNotNull(excel.getBankNo())) {
check.setBankNo(excel.getBankNo()); TCheckBankNo check = new TCheckBankNo();
check.setIdNum(excel.getEmpIdcard()); check.setBankNo(excel.getBankNo());
check.setName(excel.getEmpName()); check.setIdNum(excel.getEmpIdcard());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() check.setName(excel.getEmpName());
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN); R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
if (checkListR != null && checkListR.getData() != null) { , "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
check = checkListR.getData(); if (checkListR != null && checkListR.getData() != null) {
if (check == null || Common.isEmpty(check.getResult())) { check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} }
updateExcelPost(excel, updateList, tEmployeeInfo); updateExcelPost(excel, updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList,tEmployeeInfo); insertExcelPro(excel, proInsList,tEmployeeInfo);
...@@ -745,21 +778,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -745,21 +778,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目无; //档案有(离职库),项目无;
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus() } else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) { && Common.isEmpty(tEmployeeProject)) {
TCheckBankNo check = new TCheckBankNo(); if (Common.isNotNull(excel.getBankNo())) {
check.setBankNo(excel.getBankNo()); TCheckBankNo check = new TCheckBankNo();
check.setIdNum(excel.getEmpIdcard()); check.setBankNo(excel.getBankNo());
check.setName(excel.getEmpName()); check.setIdNum(excel.getEmpIdcard());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() check.setName(excel.getEmpName());
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN); R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
if (checkListR != null && checkListR.getData() != null) { , "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
check = checkListR.getData(); if (checkListR != null && checkListR.getData() != null) {
if (check == null || Common.isEmpty(check.getResult())) { check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} }
updateExcelPost(excel, updateList, tEmployeeInfo); updateExcelPost(excel, updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo); insertExcelPro(excel, proInsList, 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