Commit 3f15142c authored by hongguangwu's avatar hongguangwu

MVP1.5-薪资导入优化

parent a18f1a57
......@@ -110,4 +110,6 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
**/
boolean checkBankInfo(TSalaryEmployee employee);
boolean checkBankInfoList(List<TSalaryEmployee> empList, List<ErrorMessage> errorList);
}
......@@ -635,6 +635,39 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
}
}
@Override
public boolean checkBankInfoList(List<TSalaryEmployee> empList, List<ErrorMessage> errorList) {
// 批量校验 卡号与手机号
Map<String, Boolean> bankMap = new HashMap<>();
List<TCheckBankNo> bankList = new ArrayList<>();
TCheckBankNo checkBankNo;
for (TSalaryEmployee employee : empList) {
if (Common.isNotNull(employee.getBankNo())) {
checkBankNo = new TCheckBankNo();
checkBankNo.setName(employee.getEmpName());
checkBankNo.setBankNo(employee.getBankNo());
bankList.add(checkBankNo);
}
}
if (!bankList.isEmpty()) {
R<CheckBatchVo> checkListR = HttpDaprUtil.invokeMethodPost(checkProperties.getAppUrl(), checkProperties.getAppId()
, "/tcheckbankno/inner/checkBankNoBatch", bankList, CheckBatchVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
bankMap = checkListR.getData().getCheckMap();
}
for (TSalaryEmployee employee : empList) {
employee.setIssueStatus(CommonConstants.ZERO_INT);
if (bankMap.get(employee.getBankNo()) != null && Boolean.FALSE.equals(bankMap.get(employee.getBankNo()))) {
errorList.add(new ErrorMessage((employee.getLineNums() + 2), "第" + (employee.getLineNums() + 2)
+ "行:-上次代发户未校验【姓名与卡号】,本次校验结果:不匹配。请去薪酬人员查询处更新卡号信息!"));
return false;
}
}
this.saveBatch(empList);
}
return true;
}
/**
* @param vo
* @Description: 批量更新-薪资人员信息
......
......@@ -134,7 +134,7 @@ public class SalaryAccountUtil implements Serializable {
boolean notLabour = !CommonConstants.THREE_STRING.equals(salaryType);
// 连接查询的数据集合
List<TSalaryEmployee> updateEmpList = new ArrayList<>();
Map<Integer, TSalaryEmployee> checkBankInfoEmpMap = new HashMap<>();
List<TSalaryEmployee> checkBankInfoEmpList = new ArrayList<>();
Map<Integer, TSalaryEmployee> newEmpMap = new HashMap<>();
Map<String, TSalaryAccountVo> entityMap = new HashMap<>();
List<String> otherIdCard = new ArrayList<>();
......@@ -145,6 +145,7 @@ public class SalaryAccountUtil implements Serializable {
entity = new TSalaryAccountVo();
emp = null;
newEmp = new TSalaryEmployee();
newEmp.setLineNums(i);
salaryGiveTimeFlag = true;
entity.setSalaryGiveTime(CommonConstants.ZERO_STRING);
empName = null;
......@@ -392,6 +393,7 @@ public class SalaryAccountUtil implements Serializable {
continue;
} else {
emp = eR.getData();
emp.setLineNums(i);
}
} else if (emp == null) {
newEmpMap.put((i + 2), newEmp);
......@@ -401,7 +403,7 @@ public class SalaryAccountUtil implements Serializable {
if (emp != null) {
if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList
, entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle
, nowMonth, updateEmpList, checkBankInfoEmpMap, i))
, nowMonth, updateEmpList, checkBankInfoEmpList, i))
continue;
} else if ("3".equals(salaryType) || "4".equals(salaryType)) {
error = "第" + (i + 2) + "行:薪酬人员查询菜单无此员工,请添加<是否新员工>列,并录入身份证号、开户行总行、开户行省、开户行市、银行卡号、手机号码!";
......@@ -448,14 +450,9 @@ public class SalaryAccountUtil implements Serializable {
// 统一处理连接查询
tSalaryEmployeeService.updateBatchById(updateEmpList);
for (Map.Entry<Integer, TSalaryEmployee> checkBank : checkBankInfoEmpMap.entrySet()) {
if (!checkBankInfoEmpList.isEmpty()) {
// 本次不为代发户,并且薪资人员里的代发户标记没去掉,要校验银行卡
boolean bankNoIsTrue = tSalaryEmployeeService.checkBankInfo(checkBank.getValue());
if (!bankNoIsTrue) {
error = "第" + checkBank.getKey() + SalaryConstants.LINE_EMP + checkBank.getValue().getEmpIdcard()
+ "-上次代发户未校验【姓名与卡号】,本次校验结果:不匹配。请去薪酬人员查询处更新卡号信息!";
errorList.add(new ErrorMessage(checkBank.getKey(), error));
}
tSalaryEmployeeService.checkBankInfoList(checkBankInfoEmpList, errorList);
}
Map<String, TSalaryEmployee> otherEmpMap = new HashMap<>();
if (!otherIdCard.isEmpty()) {
......@@ -492,7 +489,7 @@ public class SalaryAccountUtil implements Serializable {
, CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime())
, CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())
, otherEmp.getEmpName(), entity.getSalaryStyle()
, nowMonth, updateEmpList, checkBankInfoEmpMap, newEmps.getKey() - 2)) return;
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getKey() - 2)) return;
}
}
int nowYear = Integer.parseInt(nowMonth.substring(0, 4));
......@@ -530,7 +527,7 @@ public class SalaryAccountUtil implements Serializable {
, Map<String, Integer> ownDeptMap, String salaryType, Integer isIssue, List<ErrorMessage> errorList
, TSalaryAccountVo entity, TSalaryEmployee emp, List<TSalaryAccountItemVo> saiList
, boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth
, List<TSalaryEmployee> updateEmpList, Map<Integer, TSalaryEmployee> checkBankInfoEmpMap, int i) {
, List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i) {
TSalaryAccountItemVo sai;
String error;
if (Common.isEmpty(emp.getEmpName())) {
......@@ -593,7 +590,7 @@ public class SalaryAccountUtil implements Serializable {
if (isIssue == 0 && Common.isNotNull(emp.getBankNo())
&& Common.isNotNull(emp.getIssueStatus())
&& CommonConstants.ONE_INT == emp.getIssueStatus()) {
checkBankInfoEmpMap.put((i + 2), emp);
checkBankInfoEmpList.add(emp);
}
entity.setEmpId(emp.getId());
......
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