Commit 014795ae authored by hongguangwu's avatar hongguangwu

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

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