Commit b69335d0 authored by hongguangwu's avatar hongguangwu

MVP1.6.7-薪资导入相关

parent 0c66d60f
...@@ -58,13 +58,13 @@ public class TSalaryEmpModLog extends BaseEntity { ...@@ -58,13 +58,13 @@ public class TSalaryEmpModLog extends BaseEntity {
@Schema(description = "content") @Schema(description = "content")
private String content; private String content;
/** /**
* 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新 * 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新;4导入更新银行信息
*/ */
@ExcelAttribute(name = "0编辑、1批量更新、2EKP变更银行卡号", isNotEmpty = true, errorInfo = "0编辑、1批量更新、2EKP变更银行卡号不能为空", maxLength = 1) @ExcelAttribute(name = "类型", isNotEmpty = true, errorInfo = "类型不能为空", maxLength = 1)
@NotBlank(message = "0编辑、1批量更新、2EKP变更银行卡号不能为空") @NotBlank(message = "类型不能为空")
@Length(max = 1, message = "0编辑、1批量更新、2EKP变更银行卡号不能超过1个字符") @Length(max = 1, message = "类型不能超过1个字符")
@ExcelProperty("0编辑、1批量更新、2EKP变更银行卡号") @ExcelProperty("类型")
@Schema(description = "0编辑、1批量更新、2EKP变更银行卡号;3预入职更新") @Schema(description = "0编辑、1批量更新、2EKP变更银行卡号;3预入职更新;4导入更新银行信息")
private String type; private String type;
/** /**
......
...@@ -45,4 +45,6 @@ public interface TSalaryEmpModLogService extends IService<TSalaryEmpModLog> { ...@@ -45,4 +45,6 @@ public interface TSalaryEmpModLogService extends IService<TSalaryEmpModLog> {
List<TSalaryEmpModLog> noPageDiy(TSalaryEmpModLogSearchVo searchVo); List<TSalaryEmpModLog> noPageDiy(TSalaryEmpModLogSearchVo searchVo);
void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util); void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util);
TSalaryEmpModLog checkEditToLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util);
} }
...@@ -73,6 +73,14 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> { ...@@ -73,6 +73,14 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
**/ **/
String saveNewEmployeeList(List<TSalaryEmployee> saveNewEmpList, List<ErrorMessage> errorList); String saveNewEmployeeList(List<TSalaryEmployee> saveNewEmpList, List<ErrorMessage> errorList);
/**
* @Description: 更新卡号等信息
* @Author: hgw
* @Date: 2024/7/22 10:27
* @return: java.lang.String
**/
String updateEmployeeBankList(List<TSalaryEmployee> updateEmpBankList, Map<String, TSalaryEmployee> updateEmpBankMap, List<ErrorMessage> errorList);
/** /**
* @param inputStream * @param inputStream
* @Description: 批量更新-薪资人员信息 * @Description: 批量更新-薪资人员信息
......
...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.esotericsoftware.minlog.Log;
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.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
...@@ -77,8 +76,22 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap ...@@ -77,8 +76,22 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
**/ **/
@Override @Override
public void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName,ExcelUtil<TSalaryEmployee> util) { public void initModLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName,ExcelUtil<TSalaryEmployee> util) {
TSalaryEmpModLog log = doCheckModCore(newEntity, oldEntity, type, userName, util);
if (log != null && Common.isNotNull(log.getContent())){
baseMapper.insert(log);
}
}
@Override
public TSalaryEmpModLog checkEditToLog(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type,String userName
, ExcelUtil<TSalaryEmployee> util) {
return doCheckModCore(newEntity, oldEntity, type, userName, util);
}
private TSalaryEmpModLog doCheckModCore(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, String type, String userName, ExcelUtil<TSalaryEmployee> util) {
TSalaryEmpModLog log = null;
if (Common.isNotNull(newEntity) && Common.isNotNull(oldEntity)){ if (Common.isNotNull(newEntity) && Common.isNotNull(oldEntity)){
TSalaryEmpModLog log = new TSalaryEmpModLog(); log = new TSalaryEmpModLog();
log.setIdNum(newEntity.getEmpIdcard()); log.setIdNum(newEntity.getEmpIdcard());
log.setParentId(newEntity.getId()); log.setParentId(newEntity.getId());
log.setType(type); log.setType(type);
...@@ -102,26 +115,23 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap ...@@ -102,26 +115,23 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
if (Common.isNotNull(newEntity.getBankProvince()) if (Common.isNotNull(newEntity.getBankProvince())
&& Common.isNotNull(oldEntity.getBankProvince()) && !oldEntity.getBankProvince().equals(newEntity.getBankProvince())){ && Common.isNotNull(oldEntity.getBankProvince()) && !oldEntity.getBankProvince().equals(newEntity.getBankProvince())){
str.append("开户行省:"); str.append("开户行省:");
str.append(Common.isEmpty(oldEntity.getBankProvince())?"":util.getAreaLabelPublic(oldEntity.getBankProvince())); str.append(Common.isEmpty(oldEntity.getBankProvince())?"": util.getAreaLabelPublic(oldEntity.getBankProvince()));
str.append("->"); str.append("->");
str.append(Common.isEmpty(newEntity.getBankProvince())?"":util.getAreaLabelPublic(newEntity.getBankProvince())); str.append(Common.isEmpty(newEntity.getBankProvince())?"": util.getAreaLabelPublic(newEntity.getBankProvince()));
str.append(" "); str.append(" ");
} }
//开户行市 //开户行市
if (Common.isNotNull(newEntity.getBankCity()) if (Common.isNotNull(newEntity.getBankCity())
&& Common.isNotNull(oldEntity.getBankCity()) && !oldEntity.getBankCity().equals(newEntity.getBankCity())){ && Common.isNotNull(oldEntity.getBankCity()) && !oldEntity.getBankCity().equals(newEntity.getBankCity())){
str.append("开户行市:"); str.append("开户行市:");
str.append(Common.isEmpty(oldEntity.getBankCity())?"":util.getAreaLabelPublic(oldEntity.getBankCity())); str.append(Common.isEmpty(oldEntity.getBankCity())?"": util.getAreaLabelPublic(oldEntity.getBankCity()));
str.append("->"); str.append("->");
str.append(Common.isEmpty(newEntity.getBankCity())?"":util.getAreaLabelPublic(newEntity.getBankCity())); str.append(Common.isEmpty(newEntity.getBankCity())?"": util.getAreaLabelPublic(newEntity.getBankCity()));
str.append(" "); str.append(" ");
} }
log.setContent(str.toString()); log.setContent(str.toString());
Log.error("薪资人员变更记录表:"+str.toString());
if (Common.isNotNull(log.getContent())){
baseMapper.insert(log);
}
} }
return log;
} }
private void extracted(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, StringBuilder str) { private void extracted(TSalaryEmployee newEntity, TSalaryEmployee oldEntity, StringBuilder str) {
......
...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; ...@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
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 com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmpModLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper;
...@@ -386,6 +387,100 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe ...@@ -386,6 +387,100 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return null; return null;
} }
@Override
public String updateEmployeeBankList(List<TSalaryEmployee> updateEmployeeBankList
, Map<String, TSalaryEmployee> updateEmpBankMap, List<ErrorMessage> errorList) {
if (updateEmployeeBankList != null && !updateEmployeeBankList.isEmpty()) {
// 银行卡
List<TCheckBankNo> bankList = new ArrayList<>();
TCheckBankNo checkBankNo;
for (TSalaryEmployee employee : updateEmployeeBankList) {
if (Common.isNotNull(employee.getBankNo())
&& (Common.isEmpty(employee.getIssueStatus()) || employee.getIssueStatus().equals(CommonConstants.ZERO_INT))) {
checkBankNo = new TCheckBankNo();
checkBankNo.setName(employee.getEmpName());
checkBankNo.setBankNo(employee.getBankNo());
bankList.add(checkBankNo);
}
}
// 批量校验 卡号与手机号
Map<String, Boolean> bankMap = new HashMap<>();
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();
}
}
boolean isFalse = false;
String areaProvince;
String areaCity;
TSalaryEmployee oldEmp;
ExcelUtil<TSalaryEmployee> util = new ExcelUtil<>(TSalaryEmployee.class);
TSalaryEmpModLog log;
List<TSalaryEmpModLog> saveLogList = new ArrayList<>();
for (TSalaryEmployee employee : updateEmployeeBankList) {
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()) && !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 (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 (!isFalse) {
log = logService.checkEditToLog(employee,oldEmp,CommonConstants.FOUR_STRING,employee.getCreateName(), util);
if (log != null) {
saveLogList.add(log);
}
}
}
}
}
}
if (isFalse) {
return null;
}
// 更新人员
this.updateBatchById(updateEmployeeBankList);
// 新增日志
logService.saveBatch(saveLogList);
}
return null;
}
/** /**
* @param employee * @param employee
* @Description: 校验卡号与手机号 * @Description: 校验卡号与手机号
......
package com.yifu.cloud.plus.v1.yifu.salary.util; package com.yifu.cloud.plus.v1.yifu.salary.util;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -142,6 +143,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -142,6 +143,11 @@ public class SalaryAccountUtil implements Serializable {
boolean notLabour = !CommonConstants.THREE_STRING.equals(salaryType); boolean notLabour = !CommonConstants.THREE_STRING.equals(salaryType);
// 连接查询的数据集合 // 连接查询的数据集合
List<TSalaryEmployee> updateEmpList = new ArrayList<>(); List<TSalaryEmployee> updateEmpList = new ArrayList<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息
List<TSalaryEmployee> updateEmpBankList = new ArrayList<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息,存储旧人员信息,以增加更新记录使用
Map<String, TSalaryEmployee> updateEmpBankMap = new HashMap<>();
List<TSalaryEmployee> checkBankInfoEmpList = new ArrayList<>(); List<TSalaryEmployee> checkBankInfoEmpList = new ArrayList<>();
List<TSalaryEmployee> newEmpList = new ArrayList<>(); List<TSalaryEmployee> newEmpList = new ArrayList<>();
Map<String, TSalaryAccountVo> entityMap = new HashMap<>(); Map<String, TSalaryAccountVo> entityMap = new HashMap<>();
...@@ -477,7 +483,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -477,7 +483,8 @@ public class SalaryAccountUtil implements Serializable {
// newEmpUpdateFlag = CommonConstants.ZERO_STRING // newEmpUpdateFlag = CommonConstants.ZERO_STRING
if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList
, entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle , entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle
, nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap, newEmpUpdateFlag)) , nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap
, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap))
continue; continue;
} }
if (saiList != null && !saiList.isEmpty()) { if (saiList != null && !saiList.isEmpty()) {
...@@ -575,7 +582,8 @@ public class SalaryAccountUtil implements Serializable { ...@@ -575,7 +582,8 @@ public class SalaryAccountUtil implements Serializable {
, CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime()) , CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime())
, CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee()) , CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())
, otherEmp.getEmpName(), entity.getSalaryStyle() , otherEmp.getEmpName(), entity.getSalaryStyle()
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow, bankMap, newEmpUpdateFlag)) { , nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow
, bankMap, newEmpUpdateFlag, updateEmpBankList, updateEmpBankMap)) {
isContinue = false; isContinue = false;
} }
} }
...@@ -603,9 +611,32 @@ public class SalaryAccountUtil implements Serializable { ...@@ -603,9 +611,32 @@ public class SalaryAccountUtil implements Serializable {
} }
} }
} }
if (!updateEmpBankList.isEmpty()) {
TSalaryEmployee saveNewEmp;
for (int i = 0; i < updateEmpBankList.size(); i++) {
saveNewEmp = updateEmpBankList.get(i);
// 新员工校验计税月
if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
entity = entityMap.get(saveNewEmp.getEmpIdcard());
minTaxMonth = minTaxMonthMap.get(saveNewEmp.getEmpIdcard());
if (Common.isNotNull(minTaxMonth)
&& !minTaxMonth.equals(entity.getTaxMonth())) {
error = "第" + (saveNewEmp.getLineNums() + dataRow) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((saveNewEmp.getLineNums() + dataRow), error));
canSave = false;
}
}
}
}
if (canSave) { if (canSave) {
// 新增 // 新增
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList); if (!saveNewEmpList.isEmpty()) {
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList);
}
// 更新人员信息
if (!updateEmpBankList.isEmpty()) {
tSalaryEmployeeService.updateEmployeeBankList(updateEmpBankList, updateEmpBankMap, errorList);
}
} }
} }
} }
...@@ -618,14 +649,25 @@ public class SalaryAccountUtil implements Serializable { ...@@ -618,14 +649,25 @@ public class SalaryAccountUtil implements Serializable {
this.setErrorInfo(errorList); this.setErrorInfo(errorList);
} }
// updateEmpBankList hgw 2024-7-22 10:18:02 更新开户行卡号等信息,以表导入为准
private boolean setEntityByEmpInfo(TSettleDomainSelectVo dept, Map<String, Integer> ownEmployeeMap private boolean setEntityByEmpInfo(TSettleDomainSelectVo dept, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, String salaryType, Integer isIssue, List<ErrorMessage> errorList , Map<String, Integer> ownDeptMap, String salaryType, Integer isIssue, List<ErrorMessage> errorList
, TSalaryAccountVo entity, TSalaryEmployee emp, List<TSalaryAccountItemVo> saiList , TSalaryAccountVo entity, TSalaryEmployee emp, List<TSalaryAccountItemVo> saiList
, boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth , boolean salaryGiveTimeFlag, boolean isNewEmployee, String empName, String salaryStyle, String nowMonth
, List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i , List<TSalaryEmployee> updateEmpList, List<TSalaryEmployee> checkBankInfoEmpList, int i
, Map<String, String> bankMap, String newEmpUpdateFlag) { , Map<String, String> bankMap, String newEmpUpdateFlag, List<TSalaryEmployee> updateEmpBankList
, Map<String, TSalaryEmployee> updateEmpBankMap) {
TSalaryAccountItemVo sai; TSalaryAccountItemVo sai;
String error; String error;
emp.setLineNums(i);
if (dept != null && dept.getId() != null && !dept.getId().equals(emp.getDeptId())) {
emp.setDeptId(dept.getId());
emp.setDeptName(dept.getDepartName());
emp.setDeptNo(dept.getDepartNo());
emp.setUnitId(dept.getCustomerId());
emp.setUnitNo(dept.getCustomerNo());
emp.setUnitName(dept.getCustomerName());
}
if (Common.isEmpty(emp.getEmpName())) { if (Common.isEmpty(emp.getEmpName())) {
error = "第" + i + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!"; error = "第" + i + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
...@@ -696,9 +738,12 @@ public class SalaryAccountUtil implements Serializable { ...@@ -696,9 +738,12 @@ public class SalaryAccountUtil implements Serializable {
// hgs 2024-7-19 09:33:29 新增按照页面开关与新员工字段,来更新员工信息: // hgs 2024-7-19 09:33:29 新增按照页面开关与新员工字段,来更新员工信息:
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle)) { if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle)) {
if (CommonConstants.ONE_STRING.equals(newEmpUpdateFlag) && isNewEmployee) { if (CommonConstants.ONE_STRING.equals(newEmpUpdateFlag) && isNewEmployee) {
TSalaryEmployee oldEmp = new TSalaryEmployee();
BeanUtil.copyProperties(emp,oldEmp);
updateEmpBankMap.put(emp.getEmpIdcard(), oldEmp);
if (Common.isEmpty(entity.getBankName())) { if (Common.isEmpty(entity.getBankName())) {
if (Common.isEmpty(emp.getBankName())) { if (Common.isEmpty(emp.getBankName())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -709,7 +754,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -709,7 +754,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(entity.getBankNo())) { if (Common.isEmpty(entity.getBankNo())) {
if (Common.isEmpty(emp.getBankNo())) { if (Common.isEmpty(emp.getBankNo())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -720,7 +765,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -720,7 +765,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(entity.getBankProvince())) { if (Common.isEmpty(entity.getBankProvince())) {
if (Common.isEmpty(emp.getBankProvince())) { if (Common.isEmpty(emp.getBankProvince())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -731,7 +776,7 @@ public class SalaryAccountUtil implements Serializable { ...@@ -731,7 +776,7 @@ public class SalaryAccountUtil implements Serializable {
} }
if (Common.isEmpty(emp.getBankCity())) { if (Common.isEmpty(emp.getBankCity())) {
if (Common.isEmpty(emp.getBankCity())) { if (Common.isEmpty(emp.getBankCity())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} else { } else {
...@@ -740,6 +785,22 @@ public class SalaryAccountUtil implements Serializable { ...@@ -740,6 +785,22 @@ public class SalaryAccountUtil implements Serializable {
} else { } else {
emp.setBankCity(entity.getBankCity()); emp.setBankCity(entity.getBankCity());
} }
if (Common.isNotNull(emp.getBankProvince())) {
String areaInt = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + emp.getBankProvince().trim());
if (Common.isNotNull(areaInt)) {
entity.setBankProvince(areaInt);
}
String areaCityInt = null;
if (Common.isNotNull(emp.getBankCity())) {
areaCityInt = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + emp.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + emp.getBankProvince().trim());
if (Common.isNotNull(areaCityInt)) {
entity.setBankCity(areaCityInt);
}
}
}
if (Common.isEmpty(entity.getBankSubName()) ){ if (Common.isEmpty(entity.getBankSubName()) ){
if (Common.isNotNull(emp.getBankSubName())) { if (Common.isNotNull(emp.getBankSubName())) {
entity.setBankSubName(emp.getBankSubName()); entity.setBankSubName(emp.getBankSubName());
...@@ -748,11 +809,11 @@ public class SalaryAccountUtil implements Serializable { ...@@ -748,11 +809,11 @@ public class SalaryAccountUtil implements Serializable {
emp.setBankSubName(entity.getBankSubName()); emp.setBankSubName(entity.getBankSubName());
} }
if (bankMap.get(entity.getBankName()) == null) { if (bankMap.get(entity.getBankName()) == null) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板填写!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板正确填写!";
errorList.add(new ErrorMessage(i, error)); errorList.add(new ErrorMessage(i, error));
return true; return true;
} }
updateEmpList.add(emp); updateEmpBankList.add(emp);
} else if (salaryGiveTimeFlag) { } else if (salaryGiveTimeFlag) {
if (Common.isEmpty(emp.getBankName())) { if (Common.isEmpty(emp.getBankName())) {
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!"; error = "第" + i + SalaryConstants.LINE_EMP + emp.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