Commit 014795ae authored by hongguangwu's avatar hongguangwu

MVP1.6.7-同步薪资人员信息

parent b29fa7e1
......@@ -1148,8 +1148,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return R.failed("新建员工失败!");
}
// 更新或新增薪资人员
if (Common.isNotNull(tPreEmployeeInfo.getBankNo())
&& Common.isNotNull(tPreEmployeeInfo.getTaxMonth())) {
if (Common.isNotNull(tPreEmployeeInfo.getBankNo())) {
TSalaryEmployee newEmp = new TSalaryEmployee();
newEmp.setFileStatus(CommonConstants.ZERO_STRING);
......@@ -1170,7 +1169,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
newEmp.setBankProvince(tPreEmployeeInfo.getBankProvince());
newEmp.setBankCity(tPreEmployeeInfo.getBankCity());
newEmp.setBankNo(tPreEmployeeInfo.getBankNo());
newEmp.setTaxMonth(tPreEmployeeInfo.getTaxMonth());
String taxMonth = tPreEmployeeInfo.getTaxMonth();
if (Common.isEmpty(tPreEmployeeInfo.getTaxMonth())) {
taxMonth = DateUtil.getThisMonth();
}
newEmp.setTaxMonth(taxMonth);
newEmp.setBankName(tPreEmployeeInfo.getBankName());
newEmp.setBankSubName(tPreEmployeeInfo.getBankSubName());
newEmp.setEmpPhone(tPreEmployeeInfo.getEmpPhone());
......
......@@ -1098,7 +1098,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
**/
@Override
public String savePreNewEmpInfo(TSalaryEmployee newEmp) {
// 0表示 未找到薪资记录,C端可编辑
// true表示 未找到薪资记录,C端可编辑计税月份
boolean canSaveFlag = true;
TSalaryEmployee employee = baseMapper.getByEmpIdCard(newEmp.getEmpIdcard());
if (employee != null) {
......@@ -1108,19 +1108,18 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
canSaveFlag = false;
}
}
if (canSaveFlag) {
if (employee != null) {
// 变更日志 hgw 2024-7-16 18:19:57
logService.initModLog(employee,newEmp,CommonConstants.THREE_STRING,newEmp.getCreateName(), null);
String[] ignoreProperties = new String[]{"id", "createBy", "createName", "createTime"};
BeanUtil.copyProperties(newEmp, employee, ignoreProperties);
this.updateById(employee);
} else {
this.save(newEmp);
if (employee != null) {
String[] ignoreProperties = new String[]{"id", "createBy", "createName", "createTime"};
// 当年有发薪纪录,不允许编辑计税月
if (!canSaveFlag) {
newEmp.setTaxMonth(employee.getTaxMonth());
}
// 变更日志 hgw 2024-7-16 18:19:57
logService.initModLog(employee,newEmp,CommonConstants.THREE_STRING,newEmp.getCreateName(), null);
BeanUtil.copyProperties(newEmp, employee, ignoreProperties);
this.updateById(employee);
} else {
this.save(newEmp);
}
return CommonConstants.SAVE_SUCCESS;
}
......
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