Commit 56a26ee2 authored by hongguangwu's avatar hongguangwu

MVP1.6.8-优化薪资

parent c6f2e69b
......@@ -420,29 +420,56 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
TSalaryEmpModLog log;
List<TSalaryEmpModLog> saveLogList = new ArrayList<>();
for (TSalaryEmployee employee : updateEmployeeBankList) {
if (Common.isNotNull(employee.getBankNo()) && Common.isNotNull(employee.getBankProvince())) {
areaProvince = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankProvince().trim());
if (Common.isNotNull(areaProvince)) {
if (Common.isNotNull(employee.getBankCity())) {
areaCity = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + employee.getBankProvince().trim());
if (Common.isNotNull(areaCity)) {
employee.setBankCity(areaCity);
} else {
employee.setBankCity(null);
}
}
employee.setBankProvince(areaProvince);
} else {
employee.setBankProvince(null);
}
}
if (Common.isNotNull(employee.getBankNo())
&& (Common.isEmpty(employee.getIssueStatus()) || employee.getIssueStatus().equals(CommonConstants.ZERO_INT))) {
oldEmp = updateEmpBankMap.get(employee.getEmpIdcard());
if (oldEmp != null) {
if (Common.isNotNull(employee.getBankNo())) {
if (Common.isEmpty(employee.getIssueStatus()) || employee.getIssueStatus().equals(CommonConstants.ZERO_INT)) {
oldEmp = updateEmpBankMap.get(employee.getEmpIdcard());
if (oldEmp != null) {
if (Common.isNotNull(employee.getBankProvince())) {
areaProvince = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankProvince().trim());
if (Common.isNotNull(areaProvince)) {
if (Common.isNotNull(employee.getBankCity())) {
areaCity = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + employee.getBankProvince().trim());
if (Common.isNotNull(areaCity)) {
employee.setBankCity(areaCity);
} else {
errorList.add(new ErrorMessage((employee.getLineNums()), "第" + (employee.getLineNums()) + "行:该员工更新失败:【" + SalaryConstants.CITY_ERROR + "】"));
isFalse = true;
}
}
employee.setBankProvince(areaProvince);
} else {
errorList.add(new ErrorMessage((employee.getLineNums()), "第" + (employee.getLineNums()) + "行:该员工更新失败:【" + SalaryConstants.PROVINCE_ERROR + "】"));
isFalse = true;
}
}
// 有变更才更新
if ((Common.isNotNull(employee.getBankNo()) && !employee.getBankNo().equals(oldEmp.getBankNo()))
|| (Common.isNotNull(employee.getBankProvince()) && !employee.getBankProvince().equals(oldEmp.getBankProvince()))
|| (Common.isNotNull(employee.getBankCity()) && !employee.getBankCity().equals(oldEmp.getBankCity()))
|| (Common.isNotNull(employee.getBankName()) && !employee.getBankName().equals(oldEmp.getBankName()))
|| (Common.isNotNull(employee.getBankSubName()) && !employee.getBankSubName().equals(oldEmp.getBankSubName()))
) {
if (bankMap.get(employee.getBankNo()) != null) {
if (Boolean.FALSE.equals(bankMap.get(employee.getBankNo()))) {
errorList.add(new ErrorMessage((employee.getLineNums()), "第" + (employee.getLineNums()) + "行:该员工更新失败:【姓名与卡号验证:认证不一致】"));
isFalse = true;
}
} else {
errorList.add(new ErrorMessage((employee.getLineNums()), "第" + (employee.getLineNums()) + "行:该员工更新失败:【姓名与卡号验证:" + SalaryConstants.CHECK_NO_RESPONSE + "】"));
isFalse = true;
}
if (!isFalse) {
log = logService.checkEditToLog(employee, oldEmp, CommonConstants.FOUR_STRING, employee.getCreateName(), util);
if (log != null) {
saveLogList.add(log);
}
}
if (Common.isNotNull(employee.getBankProvince())) {
}
}
} else if (employee.getIssueStatus().equals(CommonConstants.ONE_INT) && Common.isNotNull(employee.getBankProvince())) {
areaProvince = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + employee.getBankProvince().trim());
if (Common.isNotNull(areaProvince)) {
if (Common.isNotNull(employee.getBankCity())) {
......@@ -451,42 +478,14 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
if (Common.isNotNull(areaCity)) {
employee.setBankCity(areaCity);
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【" + SalaryConstants.CITY_ERROR + "】"));
isFalse = true;
employee.setBankCity(null);
}
}
employee.setBankProvince(areaProvince);
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【" + SalaryConstants.PROVINCE_ERROR + "】"));
isFalse = true;
}
}
// 有变更才更新
if ( (Common.isNotNull(employee.getBankNo()) && !employee.getBankNo().equals(oldEmp.getBankNo()))
|| (Common.isNotNull(employee.getBankProvince()) && !employee.getBankProvince().equals(oldEmp.getBankProvince()))
|| (Common.isNotNull(employee.getBankCity()) && !employee.getBankCity().equals(oldEmp.getBankCity()))
|| (Common.isNotNull(employee.getBankName()) && !employee.getBankName().equals(oldEmp.getBankName()))
|| (Common.isNotNull(employee.getBankSubName()) && !employee.getBankSubName().equals(oldEmp.getBankSubName()))
) {
if (bankMap.get(employee.getBankNo()) != null) {
if (Boolean.FALSE.equals(bankMap.get(employee.getBankNo()))) {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【姓名与卡号验证:认证不一致】"));
isFalse = true;
}
} else {
errorList.add(new ErrorMessage((employee.getLineNums() ), "第" + (employee.getLineNums() ) + "行:该员工更新失败:【姓名与卡号验证:" + SalaryConstants.CHECK_NO_RESPONSE + "】"));
isFalse = true;
employee.setBankProvince(null);
}
if (!isFalse) {
log = logService.checkEditToLog(employee,oldEmp,CommonConstants.FOUR_STRING,employee.getCreateName(), util);
if (log != null) {
saveLogList.add(log);
}
}
}
}
}
}
if (isFalse) {
......
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