Commit 2312743e authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化长度

parent 1610d5a5
...@@ -3503,7 +3503,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -3503,7 +3503,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(info.getBankNo())) { if (Common.isNotNull(info.getBankNo())) {
resultB = bankNoMap.get(info.getBankNo()); resultB = bankNoMap.get(info.getBankNo());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("姓名&银行卡号不一致;"); errorCheck.append("姓名&银行卡号不一致;");
} }
} else { } else {
...@@ -3517,7 +3517,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -3517,7 +3517,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 手机号码(紧急联系人) // 手机号码(紧急联系人)
if (Common.isNotNull(info.getTel())) { if (Common.isNotNull(info.getTel())) {
checkPhoneInfo(errorCheck, existPhoneMap, phoneMap, info, info.getTel(), "手机号码(紧急联系人)"); resultB = phoneMap.get(info.getTel());
if (resultB != null) {
if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("手机号码(紧急联系人)").append("校验不通过;");
}
} else {
errorCheck.append("手机号码(紧急联系人)").append("未校验;");
}
} }
if (errorCheck.length() > 0) { if (errorCheck.length() > 0) {
info.setErrorInfo(info.getErrorInfo() + "校验未通过:" + errorCheck); info.setErrorInfo(info.getErrorInfo() + "校验未通过:" + errorCheck);
...@@ -3764,7 +3771,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -3764,7 +3771,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} else { } else {
resultB = phoneMap.get(phone); resultB = phoneMap.get(phone);
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append(phoneName).append("校验不通过;"); errorCheck.append(phoneName).append("校验不通过;");
} }
} else { } else {
......
...@@ -18,7 +18,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -18,7 +18,6 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
...@@ -32,7 +31,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -32,7 +31,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.monitorjbl.xlsx.StreamingReader;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard; import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo; import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
...@@ -42,8 +40,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper; ...@@ -42,8 +40,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPreEmpMainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ExcelStyle; import com.yifu.cloud.plus.v1.yifu.archives.utils.ExcelStyle;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.SmsUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.SmsUtil;
...@@ -58,12 +58,9 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; ...@@ -58,12 +58,9 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TBankNameMapVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TBankNameMapVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoImportLogVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.authority.AuthorityUtils;
...@@ -78,11 +75,8 @@ import java.io.InputStream; ...@@ -78,11 +75,8 @@ import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* 预入职-主表 * 预入职-主表
...@@ -158,7 +152,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -158,7 +152,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
private static final String ID = "id"; private static final String ID = "id";
public static final String taxMonthRegex = "^2\\d{5}"; public static final String TAX_MONTH_REGEX = "^2\\d{5}";
private final RedisUtil redisUtil; private final RedisUtil redisUtil;
...@@ -915,7 +909,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -915,7 +909,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
if (Common.isNotNull(tPreEmployee.getTaxMonth())) { if (Common.isNotNull(tPreEmployee.getTaxMonth())) {
String taxMonth = tPreEmployee.getTaxMonth().trim(); String taxMonth = tPreEmployee.getTaxMonth().trim();
if (!taxMonth.matches(taxMonthRegex)) { if (!taxMonth.matches(TAX_MONTH_REGEX)) {
return R.failed("计税月份为6位年月,例如:202407!"); return R.failed("计税月份为6位年月,例如:202407!");
} }
if (Common.isNotNull(main.getSourType()) && CommonConstants.ONE_STRING.equals(main.getSourType())) { if (Common.isNotNull(main.getSourType()) && CommonConstants.ONE_STRING.equals(main.getSourType())) {
...@@ -1065,11 +1059,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1065,11 +1059,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
// 删除时 // 删除时
}if (CommonConstants.THREE_STRING.equals(otherFile.getHandleType())){ }if (CommonConstants.THREE_STRING.equals(otherFile.getHandleType())){
if (Common.isNotNull(otherFile.getId())){ if (Common.isNotNull(otherFile.getId()) && Common.isNotNull(otherFile.getAttaList())){
if (Common.isNotNull(otherFile.getAttaList())){ for (TAttaInfo info: otherFile.getAttaList()){
for (TAttaInfo info: otherFile.getAttaList()){ info.setDomainId(otherFile.getId());
info.setDomainId(otherFile.getId());
}
} }
} }
// 删除时 // 删除时
...@@ -2177,8 +2169,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2177,8 +2169,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmployeeInfo employee; TPreEmployeeInfo employee;
TPreEmployeeProject project; TPreEmployeeProject project;
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (TPreEmpMainVo excel : excelVOList) {
TPreEmpMainVo excel = excelVOList.get(i);
if (Common.isEmpty(excel.getDeptNo()) || Common.isEmpty(excel.getEmpIdcard()) || Common.isEmpty(excel.getEmpNatrue()) || Common.isEmpty(excel.getFileProvince())) { if (Common.isEmpty(excel.getDeptNo()) || Common.isEmpty(excel.getEmpIdcard()) || Common.isEmpty(excel.getEmpNatrue()) || Common.isEmpty(excel.getFileProvince())) {
errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "完善信息不可为空!")); errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "完善信息不可为空!"));
} else { } else {
...@@ -2204,7 +2195,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2204,7 +2195,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} }
if (Common.isNotNull(excel.getTaxMonth())) { if (Common.isNotNull(excel.getTaxMonth())) {
String taxMonth = excel.getTaxMonth().trim(); String taxMonth = excel.getTaxMonth().trim();
if (!taxMonth.matches(taxMonthRegex)) { if (!taxMonth.matches(TAX_MONTH_REGEX)) {
errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "计税月份为6位年月,例如:202407!")); errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "计税月份为6位年月,例如:202407!"));
continue; continue;
} }
...@@ -2232,7 +2223,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2232,7 +2223,6 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
employee.setFileTown(Integer.parseInt(excel.getFileTown())); employee.setFileTown(Integer.parseInt(excel.getFileTown()));
} catch (Exception e) { } catch (Exception e) {
//errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "未找到县!")); 2024-09-26 mvp1.6.11 预入职档案地区县选填 //errorMessageList.add(new ErrorMessage<>(excel.getRowIndex(), "未找到县!")); 2024-09-26 mvp1.6.11 预入职档案地区县选填
//continue;
throw new RuntimeException("档案地址-区/县转换异常"); throw new RuntimeException("档案地址-区/县转换异常");
} }
} }
...@@ -2888,11 +2878,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2888,11 +2878,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
field = fieldsMap.get(shuName); field = fieldsMap.get(shuName);
if (field != null) { if (field != null) {
attr = field.getAnnotation(ExcelAttribute.class); attr = field.getAnnotation(ExcelAttribute.class);
if (curVo == null) { // 必填
// 必填 if (curVo == null && attr.isNotEmpty() && Common.isEmpty(shuValue)) {
if (attr.isNotEmpty() && Common.isEmpty(shuValue)) { errorMust.append(attr.name()).append(";");
errorMust.append(attr.name()).append(";");
}
} }
if (Common.isNotNull(shuValue)) { if (Common.isNotNull(shuValue)) {
shuValue = shuValue.trim(); shuValue = shuValue.trim();
...@@ -3084,7 +3072,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3084,7 +3072,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(info.getEmpIdcard())) { if (Common.isNotNull(info.getEmpIdcard())) {
resultB = idCardMap.get(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getEmpName()); resultB = idCardMap.get(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getEmpName());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("姓名&身份证号不一致;"); errorCheck.append("姓名&身份证号不一致;");
} }
} else { } else {
...@@ -3097,7 +3085,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3097,7 +3085,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(info.getBankNo())) { if (Common.isNotNull(info.getBankNo())) {
resultB = bankNoMap.get(info.getBankNo() + CommonConstants.DOWN_LINE_STRING + info.getEmpName()); resultB = bankNoMap.get(info.getBankNo() + CommonConstants.DOWN_LINE_STRING + info.getEmpName());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("姓名&银行卡号不一致;"); errorCheck.append("姓名&银行卡号不一致;");
} }
} else { } else {
...@@ -3109,7 +3097,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3109,7 +3097,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(info.getEmpPhone())) { if (Common.isNotNull(info.getEmpPhone())) {
resultB = phoneMap.get(info.getEmpPhone()); resultB = phoneMap.get(info.getEmpPhone());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("手机号码校验不通过;"); errorCheck.append("手机号码校验不通过;");
} }
} else { } else {
...@@ -3120,7 +3108,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3120,7 +3108,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(info.getTel())) { if (Common.isNotNull(info.getTel())) {
resultB = phoneMap.get(info.getTel()); resultB = phoneMap.get(info.getTel());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("手机号码(紧急联系人)校验不通过;"); errorCheck.append("手机号码(紧急联系人)校验不通过;");
} }
} else { } else {
...@@ -3131,7 +3119,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -3131,7 +3119,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (Common.isNotNull(info.getContractTel())) { if (Common.isNotNull(info.getContractTel())) {
resultB = phoneMap.get(info.getContractTel()); resultB = phoneMap.get(info.getContractTel());
if (resultB != null) { if (resultB != null) {
if (!resultB) { if (Boolean.FALSE.equals(resultB)) {
errorCheck.append("手机号码(家庭成员)校验不通过;"); errorCheck.append("手机号码(家庭成员)校验不通过;");
} }
} else { } else {
......
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