Commit b4d490da authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.5.1' into MVP1.5.1

parents 0b4b7931 523ffe01
......@@ -457,6 +457,7 @@ public class SalaryAccountUtil implements Serializable {
TSalaryEmployee otherEmp;
List<TSalaryEmployee> saveNewEmpList = new ArrayList<>();
List<String> checkTaxMonthList = new ArrayList<>();
boolean isContinue = true;
if (!newEmpList.isEmpty()) {
TSalaryEmployee newEmps;
for (int i = 0; i < newEmpList.size(); i++) {
......@@ -489,34 +490,38 @@ public class SalaryAccountUtil implements Serializable {
, CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime())
, CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())
, otherEmp.getEmpName(), entity.getSalaryStyle()
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums())) return;
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums())) {
isContinue = false;
}
}
}
}
int nowYear = Integer.parseInt(nowMonth.substring(0, 4));
Map<String, String> minTaxMonthMap = tSalaryAccountService.getMinTaxMonthByNowYearAndList(checkTaxMonthList, nowYear);
String minTaxMonth;
boolean canSave = true;
if (!saveNewEmpList.isEmpty()) {
TSalaryEmployee saveNewEmp;
for (int i = 0; i < saveNewEmpList.size(); i++) {
saveNewEmp = saveNewEmpList.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() + 2) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((saveNewEmp.getLineNums() + 2), error));
canSave = false;
if (isContinue) {
int nowYear = Integer.parseInt(nowMonth.substring(0, 4));
Map<String, String> minTaxMonthMap = tSalaryAccountService.getMinTaxMonthByNowYearAndList(checkTaxMonthList, nowYear);
String minTaxMonth;
boolean canSave = true;
if (!saveNewEmpList.isEmpty()) {
TSalaryEmployee saveNewEmp;
for (int i = 0; i < saveNewEmpList.size(); i++) {
saveNewEmp = saveNewEmpList.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() + 2) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((saveNewEmp.getLineNums() + 2), error));
canSave = false;
}
}
}
}
}
if (canSave) {
// 新增
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList);
if (canSave) {
// 新增
tSalaryEmployeeService.saveNewEmployeeList(saveNewEmpList, errorList);
}
}
}
} catch (Exception e) {
......
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