Commit fd26ba2b authored by hongguangwu's avatar hongguangwu

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

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