Commit fd26ba2b authored by hongguangwu's avatar hongguangwu

MVP1.6.2-工资原表识别-优化

parent b481fedb
......@@ -36,6 +36,10 @@ public class SalaryUploadParamVo {
// 代发户的配置list
List<TSalaryStandardIssueRes> resList;
// 原表识别,返回校验信息给前端
List<TCheckIdCard> checkList;
// 数据行,从0开始计数的
Integer dataNum;
}
......@@ -710,7 +710,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
String jsonString = null;
InputStream inputStream = file.getInputStream();
R<ExcelSheetVo> voR;
ExcelSheetVo vo = null;
ExcelSheetVo vo;
//根据文件格式 对应不同的api解析
if (filename.endsWith(".xlsx")) {
voR = readXlsx(inputStream, specialIdCardList, false, sheetName);
......@@ -859,6 +859,7 @@ public class TSalaryStandardOriginalServiceImpl extends ServiceImpl<TSalaryStand
// 最后转化为jsonString
jsonString = JSON.toJSON(contentList).toString();
SalaryUploadParamVo returnVo = new SalaryUploadParamVo();
returnVo.setDataNum(vo.getDataNum());
returnVo.setCheckList(checkList);
returnVo.setJsonString(jsonString);
returnVo.setSalaryType(excelVo.getSalaryType());
......
......@@ -143,6 +143,11 @@ public class SalaryAccountUtil implements Serializable {
List<String> otherIdCard = new ArrayList<>();
BigDecimal phoneSubsidyMoney;
TSalaryAccountItem phoneSubsidyItem;
// 基础的数据行,用于返回信息
int dataRow = 2;
if (Common.isNotNull(vo.getDataNum())) {
dataRow += vo.getDataNum();
}
for (int i = 0; i < rows; i++) {
annualBonusFlag = false;
errorFlag = true;
......@@ -169,8 +174,8 @@ public class SalaryAccountUtil implements Serializable {
cellValueStr = getStringValByObject(cellValueObj);
if (!StringUtils.isNotBlank(cellValueStr)) {
errorFlag = false;
error = "第" + (i + 2) + "行:" + entry.getKey() + "列_不识别对象类型";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:" + entry.getKey() + "列_不识别对象类型";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
dbFiedName = scs.getDbFiedName();
......@@ -184,8 +189,8 @@ public class SalaryAccountUtil implements Serializable {
phoneSubsidyMoney = NumberUtils.createBigDecimal(cellValueStr);
if(phoneSubsidyMoney.compareTo(new BigDecimal("300")) > 0) {
errorFlag = false;
error = "第" + (i + 2) + "行:本次发放"+cellValueStr+"元,超出300元的限制,禁止导入";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:本次发放"+cellValueStr+"元,超出300元的限制,禁止导入";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
......@@ -208,8 +213,8 @@ public class SalaryAccountUtil implements Serializable {
saiList.add(sai);
} catch (Exception e) {
errorFlag = false;
error = "第" + (i + 2) + "行:应发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:应发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
......@@ -224,8 +229,8 @@ public class SalaryAccountUtil implements Serializable {
saiList.add(sai);
} catch (Exception e) {
errorFlag = false;
error = "第" + (i + 2) + "行:通讯补贴:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:通讯补贴:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
......@@ -235,8 +240,8 @@ public class SalaryAccountUtil implements Serializable {
entity.setActualSalary(actualSalarySum);
} catch (Exception e) {
errorFlag = false;
error = "第" + (i + 2) + "行:实发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:实发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
......@@ -249,8 +254,8 @@ public class SalaryAccountUtil implements Serializable {
new BigDecimal(cellValueStr.replace(",", ""));
} catch (Exception ex) {
errorFlag = false;
error = "第" + (i + 2) + "行:代扣、企业年金,只能是金额!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:代扣、企业年金,只能是金额!";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
......@@ -269,11 +274,11 @@ public class SalaryAccountUtil implements Serializable {
}
if (SalaryConstants.ID_NUMBER.equals(dbFiedName)) {
if (checkIdNumberMap.get(cellValueStr) == null) {
checkIdNumberMap.put(cellValueStr, (i + 2));
checkIdNumberMap.put(cellValueStr, (i + dataRow));
} else {
errorFlag = false;
error = "第" + (i + 2) + "行与第:" + checkIdNumberMap.get(cellValueStr) + "行身份证重复:" + cellValueStr;
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行与第:" + checkIdNumberMap.get(cellValueStr) + "行身份证重复:" + cellValueStr;
errorList.add(new ErrorMessage((i + dataRow), error));
break;
}
if (cellValueStr.contains("x")) {
......@@ -305,7 +310,7 @@ public class SalaryAccountUtil implements Serializable {
if (cellValueBig.toString().length() > 11) {
if (cellValueBig.toString().length() > 500) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "文本超长!"));
errorList.add(new ErrorMessage((i + dataRow), "文本超长!"));
continue;
}
sai.setTextValue(cellValueBig.toString());
......@@ -315,7 +320,7 @@ public class SalaryAccountUtil implements Serializable {
} catch (NumberFormatException e) {
if (cellValueStr.length() > 500) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "文本超长!"));
errorList.add(new ErrorMessage((i + dataRow), "文本超长!"));
continue;
}
sai.setTextValue(cellValueStr);
......@@ -331,7 +336,7 @@ public class SalaryAccountUtil implements Serializable {
&& !SalaryConstants.SALARY_GIVE_TIME.equals(cellValueStr)
&& !SalaryConstants.SALARY_GIVE_TIME_TWO.equals(cellValueStr)) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "请注意:工资发放时间,只能是【立即发】或【暂停发】!你的内容:【"+cellValueStr+"】"));
errorList.add(new ErrorMessage((i + dataRow), "请注意:工资发放时间,只能是【立即发】或【暂停发】!你的内容:【"+cellValueStr+"】"));
continue;
}
......@@ -342,16 +347,16 @@ public class SalaryAccountUtil implements Serializable {
&& !SalaryConstants.IS_PERSON_OTHER.equals(cellValueStr)
&& !SalaryConstants.IS_PERSON.equals(cellValueStr)) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), "请注意:是否个人承担部分税费,只能是【"
errorList.add(new ErrorMessage((i + dataRow), "请注意:是否个人承担部分税费,只能是【"
+SalaryConstants.IS_COMPANY+"】或【"+SalaryConstants.IS_PERSON_OTHER+"】或【"
+SalaryConstants.IS_PERSON+"】!你的内容:【"+cellValueStr+"】"));
continue;
}
setFields(field, cellValueStr, attr, fieldType, entity);
error = validateUtil(cellValueStr, attr, (i + 2));
error = validateUtil(cellValueStr, attr, (i + dataRow));
if (null != error) {
errorFlag = false;
errorList.add(new ErrorMessage((i + 2), error));
errorList.add(new ErrorMessage((i + dataRow), error));
}
}
}
......@@ -368,44 +373,44 @@ public class SalaryAccountUtil implements Serializable {
}
}
if (Common.isNotNull(must)) {
error = "第" + (i + 2) + "行:" + must + "列_不可缺少";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:" + must + "列_不可缺少";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
if (Common.isNotNull(phoneSubsidy)) {
phoneSubsidyItem = tSalaryEmployeeService.selectByIdcard(newEmp.getEmpIdcard(), nowMonth);
if (phoneSubsidyItem != null && Common.isNotNull(phoneSubsidyItem.getSalaryMoney())
&& (phoneSubsidyItem.getSalaryMoney().add(phoneSubsidy)).compareTo(new BigDecimal("300")) > 0) {
error = "第" + (i + 2) + "行:当月已发" + phoneSubsidyItem.getSalaryMoney() + "元,本次发放" + phoneSubsidy + "元,累计超出300元限制,禁止发放!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:当月已发" + phoneSubsidyItem.getSalaryMoney() + "元,本次发放" + phoneSubsidy + "元,累计超出300元限制,禁止发放!";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
}
if (annualBonusFlag && Common.isEmpty(entity.getAnnualBonusType())) {
error = "第" + (i + 2) + "行:年终奖有值,【年终奖扣税方式】需填写【单独】/【合并】";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:年终奖有值,【年终奖扣税方式】需填写【单独】/【合并】";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
if ("3".equals(salaryType) && actualSalarySum == null) {
error = "第" + (i + 2) + "行:【劳务费】列_不可缺少";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:【劳务费】列_不可缺少";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
if ("3".equals(salaryType) && Common.isEmpty(entity.getIsPersonTax())) {
error = "第" + (i + 2) + "行:【是否个人承担部分税费】列_不可为空";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:【是否个人承担部分税费】列_不可为空";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
if ("4".equals(salaryType) && actualSalarySum == null) {
error = "第" + (i + 2) + "行:【稿酬】列_不可缺少";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:【稿酬】列_不可缺少";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
// 应发、实发、实发劳务费不可都为空
if (relaySalary == null && actualSalarySum == null) {
error = "第" + (i + 2) + "行:【应发工资】列_不可缺少";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:【应发工资】列_不可缺少";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
// 版本2.6.6判重:对同一“项目”、同一“结算月份”、同一“报表类型”、同一“工资月份”、同一“身份证号”、同一“应发金额”进行校验
......@@ -448,7 +453,7 @@ public class SalaryAccountUtil implements Serializable {
newEmp.setIssueStatus(isIssue);
// 劳务费要使用人员信息
if (!notLabour) {
R<TSalaryEmployee> eR = this.getNewEmp(newEmp, i, errorList, notLabour, entity, salaryType, dept, user
R<TSalaryEmployee> eR = this.getNewEmp(newEmp, i + dataRow, errorList, notLabour, entity, salaryType, dept, user
, salaryStyle, salaryGiveTimeFlag, invoiceTitle, tSalaryAccountService
, tSalaryEmployeeService, bankMap);
if (eR.getCode() != 200) {
......@@ -465,7 +470,7 @@ public class SalaryAccountUtil implements Serializable {
if (emp != null) {
if (setEntityByEmpInfo(dept, ownEmployeeMap, ownDeptMap, salaryType, isIssue, errorList
, entity, emp, saiList, salaryGiveTimeFlag, isNewEmployee, empName, salaryStyle
, nowMonth, updateEmpList, checkBankInfoEmpList, i, bankMap))
, nowMonth, updateEmpList, checkBankInfoEmpList, i + dataRow, bankMap))
continue;
}
if (saiList != null && !saiList.isEmpty()) {
......@@ -480,8 +485,8 @@ public class SalaryAccountUtil implements Serializable {
if ("3".equals(salaryType)) {
if (CommonConstants.dingleDigitStrArray[1].equals(entity.getIsDeductSocial())
|| CommonConstants.dingleDigitStrArray[1].equals(entity.getIsDeductFund())) {
error = "第" + (i + 2) + "行:劳务费不可扣社保、公积金,请去除【是否扣除社保】列,或写【否】";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:劳务费不可扣社保、公积金,请去除【是否扣除社保】列,或写【否】";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
} else {
entity.setIsDeductSocial("0");
......@@ -494,13 +499,13 @@ public class SalaryAccountUtil implements Serializable {
//验证扣社保以及扣公积金时的关联关系
if (CommonConstants.dingleDigitStrArray[1].equals(entity.getIsDeductSocial()) && Common.isEmpty(entity.getDeduSocialMonth())) {
error = "第" + (i + 2) + "行:扣社保无社保扣缴月份";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:扣社保无社保扣缴月份";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
if (CommonConstants.dingleDigitStrArray[1].equals(entity.getIsDeductFund()) && Common.isEmpty(entity.getDeduProvidentMonth())) {
error = "第" + (i + 2) + "行:扣公积金无公积金扣缴月份";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + (i + dataRow) + "行:扣公积金无公积金扣缴月份";
errorList.add(new ErrorMessage((i + dataRow), error));
continue;
}
entity.setInvoiceTitle(invoiceTitle);
......@@ -534,7 +539,7 @@ public class SalaryAccountUtil implements Serializable {
otherEmp = otherEmpMap.get(newEmps.getEmpIdcard());
if (otherEmp == null) {
if (CommonConstants.ONE_STRING.equals(entity.getIsNewEmployee())) {
if (!this.setNewEmpBase(newEmps, newEmps.getLineNums(), errorList, notLabour
if (!this.setNewEmpBase(newEmps, newEmps.getLineNums() + dataRow, errorList, notLabour
, entity, salaryType, dept, user, entity.getSalaryStyle()
, CommonConstants.ZERO_STRING.equals(entity.getSalaryGiveTime()), invoiceTitle
, entity.getSaiList(), bankMap)) {
......@@ -546,11 +551,11 @@ public class SalaryAccountUtil implements Serializable {
checkTaxMonthList.add(newEmps.getEmpIdcard());
} else {
if ("3".equals(salaryType) || "4".equals(salaryType)) {
error = "第" + (newEmps.getLineNums() + 2) + "行:薪酬人员查询菜单无此员工,请添加<是否新员工>列,并录入身份证号、开户行总行、开户行省、开户行市、银行卡号、手机号码!";
errorList.add(new ErrorMessage((newEmps.getLineNums() + 2), error));
error = "第" + (newEmps.getLineNums() + dataRow) + "行:薪酬人员查询菜单无此员工,请添加<是否新员工>列,并录入身份证号、开户行总行、开户行省、开户行市、银行卡号、手机号码!";
errorList.add(new ErrorMessage((newEmps.getLineNums() + dataRow), error));
} else {
error = "第" + (newEmps.getLineNums() + 2) + "行:薪酬人员查询菜单无此员工,请添加<是否新员工(默认否)>列,并录入身份证号、开户行总行、开户行省、开户行市、银行卡号、计税月份、手机号码!";
errorList.add(new ErrorMessage(newEmps.getLineNums() + 2, error));
error = "第" + (newEmps.getLineNums() + dataRow) + "行:薪酬人员查询菜单无此员工,请添加<是否新员工(默认否)>列,并录入身份证号、开户行总行、开户行省、开户行市、银行卡号、计税月份、手机号码!";
errorList.add(new ErrorMessage(newEmps.getLineNums() + dataRow, error));
}
isContinue = false;
}
......@@ -561,7 +566,7 @@ 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(), bankMap)) {
, nowMonth, updateEmpList, checkBankInfoEmpList, newEmps.getLineNums() + dataRow, bankMap)) {
isContinue = false;
}
}
......@@ -582,8 +587,8 @@ public class SalaryAccountUtil implements Serializable {
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));
error = "第" + (saveNewEmp.getLineNums() + dataRow) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((saveNewEmp.getLineNums() + dataRow), error));
canSave = false;
}
}
......@@ -612,25 +617,25 @@ public class SalaryAccountUtil implements Serializable {
TSalaryAccountItemVo sai;
String error;
if (Common.isEmpty(emp.getEmpName())) {
error = "第" + (i + 2) + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
} else if (Common.isEmpty(empName)) {
error = "第" + (i + 2) + "行:模板-员工姓名-为空,请添加员工姓名列!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:模板-员工姓名-为空,请添加员工姓名列!";
errorList.add(new ErrorMessage(i, error));
return true;
} else if (!empName.equals(emp.getEmpName())) {
error = "第" + (i + 2) + "行:员工-姓名与身份证-不匹配,请确认薪酬人员查询处信息!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:员工-姓名与身份证-不匹配,请确认薪酬人员查询处信息!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (Common.isEmpty(emp.getEmpPhone())) {
error = "第" + (i + 2) + "行:薪酬人员查询处-手机号码-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-手机号码-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
} else if (!ValidityUtil.validateEmpPhone(emp.getEmpPhone())) {
error = "第" + (i + 2) + "行:薪酬人员查询处-手机号码格式错误,请去薪酬人员查询处更新:" + emp.getEmpPhone();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-手机号码格式错误,请去薪酬人员查询处更新:" + emp.getEmpPhone();
errorList.add(new ErrorMessage(i, error));
return true;
}
if (Common.isEmpty(emp.getTaxMonth()) && !"3".equals(salaryType) && !"4".equals(salaryType)) {
......@@ -638,20 +643,20 @@ public class SalaryAccountUtil implements Serializable {
if (entity.getTaxMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
entity.setTaxMonth(emp.getTaxMonth().substring(0, 6));
} else if (entity.getTaxMonth().length() < CommonConstants.dingleDigitIntArray[6]) {
error = "第" + (i + 2) + "行:工资模板里-计税月份-长度小于6:" + entity.getTaxMonth() + ",请在工资模板修改!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:工资模板里-计税月份-长度小于6:" + entity.getTaxMonth() + ",请在工资模板修改!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (DateUtil.compareYearMonth(entity.getTaxMonth(), nowMonth)) {
error = "第" + (i + 2) + "行:工资模板里-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:工资模板里-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return true;
}
emp.setTaxMonth(entity.getTaxMonth());
updateEmpList.add(emp);
} else {
error = "第" + (i + 2) + "行:薪酬人员查询处-计税月份-为空,请在工资模板填写-计税月份-列的内容!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-计税月份-为空,请在工资模板填写-计税月份-列的内容!";
errorList.add(new ErrorMessage(i, error));
return true;
}
}
......@@ -680,28 +685,28 @@ public class SalaryAccountUtil implements Serializable {
entity.setEmpPhone(emp.getEmpPhone());
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle) && salaryGiveTimeFlag) {
if (Common.isEmpty(emp.getBankName())) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (Common.isEmpty(emp.getBankNo())) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-银行卡号-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (Common.isEmpty(emp.getBankProvince())) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行省-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (Common.isEmpty(emp.getBankCity())) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行市-为空,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
if (bankMap.get(emp.getBankName()) == null) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
entity.setBankName(emp.getBankName());
......@@ -712,8 +717,8 @@ public class SalaryAccountUtil implements Serializable {
} else {
if (Common.isNotNull(emp.getBankName())) {
if (bankMap.get(emp.getBankName()) == null) {
error = "第" + (i + 2) + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + SalaryConstants.LINE_EMP + emp.getEmpIdcard() + "-发放方式为银行发放,但是-开户行总行-不符合财务要求,请去薪酬人员查询处更新!";
errorList.add(new ErrorMessage(i, error));
return true;
}
entity.setBankName(emp.getBankName());
......@@ -745,15 +750,15 @@ public class SalaryAccountUtil implements Serializable {
if (emp.getTaxMonth().length() > CommonConstants.dingleDigitIntArray[6]) {
entity.setTaxMonth(emp.getTaxMonth().substring(0, 6));
} else if (emp.getTaxMonth().length() < CommonConstants.dingleDigitIntArray[6]) {
error = "第" + (i + 2) + "行:薪酬人员查询处-计税月份-长度小于6:" + entity.getTaxMonth() + ",请去薪酬人员查询处更新!在工资模板修改无效!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-计税月份-长度小于6:" + entity.getTaxMonth() + ",请去薪酬人员查询处更新!在工资模板修改无效!";
errorList.add(new ErrorMessage(i, error));
return true;
} else {
entity.setTaxMonth(emp.getTaxMonth());
}
if (DateUtil.compareYearMonth(entity.getTaxMonth(), nowMonth)) {
error = "第" + (i + 2) + "行:薪酬人员查询处-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:薪酬人员查询处-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return true;
}
sai = new TSalaryAccountItemVo();
......@@ -785,24 +790,24 @@ public class SalaryAccountUtil implements Serializable {
//增加工资人员档案:(临时使用)
if (newEmp != null) {
if (Common.isEmpty(newEmp.getEmpName())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-姓名-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-姓名-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
if (Common.isEmpty(newEmp.getEmpIdcard())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-身份证号-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-身份证号-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
// 2021-8-31 hgw2.6.5新增手机号校验
if (Common.isEmpty(newEmp.getEmpPhone())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-手机号码-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-手机号码-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else if (!ValidityUtil.validateEmpPhone(newEmp.getEmpPhone())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-手机号码格式错误:" + newEmp.getEmpPhone();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-手机号码格式错误:" + newEmp.getEmpPhone();
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
} else {
......@@ -811,16 +816,16 @@ public class SalaryAccountUtil implements Serializable {
if (entity != null) {
if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
if (Common.isEmpty(entity.getTaxMonth())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else if (entity.getTaxMonth().length() < CommonConstants.dingleDigitIntArray[6]) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-长度小于6:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-长度小于6:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else if (DateUtil.compareYearMonth(entity.getTaxMonth(), nowMonth)) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else {
newEmp.setTaxMonth(entity.getTaxMonth());
......@@ -831,28 +836,28 @@ public class SalaryAccountUtil implements Serializable {
String areaStr;
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle) && salaryGiveTimeFlag) {
if (Common.isEmpty(entity.getBankName())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else {
if (bankMap.get(entity.getBankName()) == null) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
newEmp.setBankName(entity.getBankName());
}
if (Common.isEmpty(entity.getBankProvince()) || Common.isEmpty(entity.getBankCity())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行省、市-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行省、市-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankProvince(areaStr);
} else {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行省错误:" + entity.getBankProvince();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行省错误:" + entity.getBankProvince();
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankCity().trim()
......@@ -860,14 +865,14 @@ public class SalaryAccountUtil implements Serializable {
if (Common.isNotNull(areaStr)) {
newEmp.setBankCity(areaStr);
} else {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
}
if (Common.isEmpty(entity.getBankNo())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-银行卡号-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-银行卡号-不可为空!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
} else {
newEmp.setBankNo(entity.getBankNo());
......@@ -878,8 +883,8 @@ public class SalaryAccountUtil implements Serializable {
} else {
if (Common.isNotNull(entity.getBankName())) {
if (bankMap.get(entity.getBankName()) == null) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
newEmp.setBankName(entity.getBankName());
......@@ -920,15 +925,15 @@ public class SalaryAccountUtil implements Serializable {
String minTaxMonth = tSalaryAccountService.getMinTaxMonthByNowYear(newEmp.getEmpIdcard(), nowYear);
if (Common.isNotNull(minTaxMonth)
&& !minTaxMonth.equals(entity.getTaxMonth())) {
error = "第" + (i + 2) + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:该员工已有发薪记录,计税月份请填写:【" + minTaxMonth + "】" + ",你填写了计税月:【" + entity.getTaxMonth() + "】";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
}
String saveNewEmpReturn = tSalaryEmployeeService.saveNewSalaryEmployee(notLabour, newEmp);
if (Common.isNotNull(saveNewEmpReturn)) {
error = "第" + (i + 2) + "行:该员工新建失败:【" + saveNewEmpReturn + "】";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:该员工新建失败:【" + saveNewEmpReturn + "】";
errorList.add(new ErrorMessage(i, error));
return R.failed();
}
return R.ok(newEmp);
......@@ -947,24 +952,24 @@ public class SalaryAccountUtil implements Serializable {
if (newEmp != null) {
newEmp.setLineNums(i);
if (Common.isEmpty(newEmp.getEmpName())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-姓名-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-姓名-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
}
if (Common.isEmpty(newEmp.getEmpIdcard())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-身份证号-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-身份证号-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
}
// 2021-8-31 hgw2.6.5新增手机号校验
if (Common.isEmpty(newEmp.getEmpPhone())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-手机号码-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-手机号码-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
} else if (!ValidityUtil.validateEmpPhone(newEmp.getEmpPhone())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-手机号码格式错误:" + newEmp.getEmpPhone();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-手机号码格式错误:" + newEmp.getEmpPhone();
errorList.add(new ErrorMessage(i, error));
return false;
}
} else {
......@@ -973,16 +978,16 @@ public class SalaryAccountUtil implements Serializable {
if (entity != null) {
if (!"3".equals(salaryType) && !"4".equals(salaryType)) {
if (Common.isEmpty(entity.getTaxMonth())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
} else if (entity.getTaxMonth().length() < CommonConstants.dingleDigitIntArray[6]) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-长度小于6:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-长度小于6:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return false;
} else if (DateUtil.compareYearMonth(entity.getTaxMonth(), nowMonth)) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-计税月份-大于当前年月或错误,请调整:" + entity.getTaxMonth();
errorList.add(new ErrorMessage(i, error));
return false;
} else {
TSalaryAccountItemVo sai = new TSalaryAccountItemVo();
......@@ -999,28 +1004,28 @@ public class SalaryAccountUtil implements Serializable {
String areaStr;
if (SalaryConstants.SALARY_STYLE_BANK.equals(salaryStyle) && salaryGiveTimeFlag) {
if (Common.isEmpty(entity.getBankName())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
} else {
if (bankMap.get(entity.getBankName()) == null) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage(i, error));
return false;
}
newEmp.setBankName(entity.getBankName());
}
if (Common.isEmpty(entity.getBankProvince()) || Common.isEmpty(entity.getBankCity())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行省、市-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行省、市-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
} else {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankProvince(areaStr);
} else {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行省错误:" + entity.getBankProvince();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行省错误:" + entity.getBankProvince();
errorList.add(new ErrorMessage(i, error));
return false;
}
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankCity().trim()
......@@ -1028,14 +1033,14 @@ public class SalaryAccountUtil implements Serializable {
if (Common.isNotNull(areaStr)) {
newEmp.setBankCity(areaStr);
} else {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage(i, error));
return false;
}
}
if (Common.isEmpty(entity.getBankNo())) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-银行卡号-不可为空!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-银行卡号-不可为空!";
errorList.add(new ErrorMessage(i, error));
return false;
} else {
newEmp.setBankNo(entity.getBankNo());
......@@ -1046,8 +1051,8 @@ public class SalaryAccountUtil implements Serializable {
} else {
if (Common.isNotNull(entity.getBankName())) {
if (bankMap.get(entity.getBankName()) == null) {
error = "第" + (i + 2) + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage((i + 2), error));
error = "第" + i + "行:" + newEmpStr + "-开户行总行-不符合财务要求,请去【开户行配置】菜单查询!";
errorList.add(new ErrorMessage(i, error));
return false;
}
newEmp.setBankName(entity.getBankName());
......@@ -1209,7 +1214,7 @@ public class SalaryAccountUtil implements Serializable {
return errorInfo(attr, "_小于最小值", i);
}
} else {
return "第" + (i + 2) + "行:" + "_必须为数字";
return "第" + i + "行:" + "_必须为数字";
}
}
}
......
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