Commit 3aef3a48 authored by fangxinjiang's avatar fangxinjiang

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

parents 689c722c f82734a8
...@@ -89,7 +89,7 @@ public class TSalaryZeroVo extends RowIndex implements Serializable { ...@@ -89,7 +89,7 @@ public class TSalaryZeroVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "减除费用", isNotEmpty = true, errorInfo = "减除费用不能为空") @ExcelAttribute(name = "减除费用", isNotEmpty = true, errorInfo = "减除费用不能为空")
@Schema(description = "减除费用") @Schema(description = "减除费用")
@ExcelProperty("减除费用") @ExcelProperty("减除费用")
private BigDecimal costReduction; private String costReduction;
/** /**
* 计税月份 * 计税月份
*/ */
......
...@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.salary.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.salary.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryZero;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryZeroMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryZeroMapper;
...@@ -61,6 +62,8 @@ import java.util.ArrayList; ...@@ -61,6 +62,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* 0申报 * 0申报
...@@ -273,7 +276,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -273,7 +276,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
/** /**
* 单次缓存的数据量 * 单次缓存的数据量
*/ */
public static final int MAX_ROWS = 5; public static final int MAX_ROWS = 500;
private int rowCount = CommonConstants.ZERO_INT; private int rowCount = CommonConstants.ZERO_INT;
/** /**
*临时存储 *临时存储
...@@ -314,15 +317,17 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -314,15 +317,17 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
codeList.add(data.getDeptNo()); codeList.add(data.getDeptNo());
} }
if (Common.isNotNull(data.getEmpPhone())) { if (Common.isNotNull(data.getEmpPhone())) {
if (!ValidityUtil.validateEmpPhone(data.getEmpPhone())) {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "手机号码格式错误,请检查并修改后重新导入", data));
} else {
phoneList.add(data.getEmpPhone()); phoneList.add(data.getEmpPhone());
}
if (Common.isNotNull(data.getEmpIdcard())) { if (Common.isNotNull(data.getEmpIdcard())) {
if (regIdCard(data.getEmpIdcard())) {
cardList.add(data.getEmpIdcard()); cardList.add(data.getEmpIdcard());
if (cardRepeatMap.get(data.getEmpIdcard()) != null) { if (cardRepeatMap.get(data.getEmpIdcard()) != null) {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该身份证在本次导入表中有重复,请检查并修改后重新导入", data)); errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该身份证在本次导入表中有重复,请检查并修改后重新导入", data));
} else { } else {
cardRepeatMap.put(data.getEmpIdcard(), CommonConstants.ONE_INT); cardRepeatMap.put(data.getEmpIdcard(), CommonConstants.ONE_INT);
idCardCheck = new TCheckIdCard(); idCardCheck = new TCheckIdCard();
idCardCheck.setIdCard(data.getEmpIdcard()); idCardCheck.setIdCard(data.getEmpIdcard());
idCardCheck.setName(data.getEmpName()); idCardCheck.setName(data.getEmpName());
...@@ -331,6 +336,11 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -331,6 +336,11 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
checkList.add(idCardCheck); checkList.add(idCardCheck);
cachedDataList.add(data); cachedDataList.add(data);
} }
} else {
errorMessageList.add(new ErrorMessage(data.getRowIndex(), "该身份证号基本格式不正确,请检查并修改后重新导入", data));
}
}
}
} }
} }
} }
...@@ -416,6 +426,16 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -416,6 +426,16 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
} }
} }
private static boolean regIdCard(String content) {
boolean flag = false;
Pattern p = Pattern.compile("\\d{18}|\\d{17}X|\\d{15}|\\d{14}X");
Matcher m = p.matcher(content);
if (m.matches()) {
flag = true;
}
return flag;
}
private void importTSalaryZero(List<TSalaryZeroVo> excelVOList, List<ErrorMessage> errorMessageList private void importTSalaryZero(List<TSalaryZeroVo> excelVOList, List<ErrorMessage> errorMessageList
, String settleMonth, String invoiceTitle, String userName, Map<String, ProjectSetInfoVo> projectVoMap , String settleMonth, String invoiceTitle, String userName, Map<String, ProjectSetInfoVo> projectVoMap
, Map<String, Integer> accountMap, Map<String, Boolean> idCardMap, Map<String, Boolean> phoneMap , Map<String, Integer> accountMap, Map<String, Boolean> idCardMap, Map<String, Boolean> phoneMap
...@@ -444,10 +464,19 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -444,10 +464,19 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
} }
String idCard; String idCard;
Boolean resultB; Boolean resultB;
BigDecimal costReduction;
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i); excel = excelVOList.get(i);
if (Common.isEmpty(excel.getCostReduction()) if (Common.isNotNull(excel.getCostReduction())) {
|| excel.getCostReduction().remainder(SalaryConstants.COST_MONEY).compareTo(BigDecimal.ZERO) != CommonConstants.ZERO_INT) { try {
costReduction = new BigDecimal(excel.getCostReduction());
} catch (Exception e) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.MONEY_NUM_ERROR, excel));
continue;
}
if (costReduction.compareTo(SalaryConstants.COST_MONEY) < CommonConstants.ZERO_INT
|| costReduction.compareTo(SalaryConstants.MAX_COST_MONEY) > CommonConstants.ZERO_INT
|| costReduction.remainder(SalaryConstants.COST_MONEY).compareTo(BigDecimal.ZERO) != 0) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.MONEY_ERROR, excel)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), SalaryConstants.MONEY_ERROR, excel));
} else { } else {
if (Common.isNotNull(excel.getDeptNo()) && projectVoMap.get(excel.getDeptNo()) != null) { if (Common.isNotNull(excel.getDeptNo()) && projectVoMap.get(excel.getDeptNo()) != null) {
...@@ -515,6 +544,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala ...@@ -515,6 +544,7 @@ public class TSalaryZeroServiceImpl extends ServiceImpl<TSalaryZeroMapper, TSala
} }
} }
} }
}
if (!insertList.isEmpty()) { if (!insertList.isEmpty()) {
this.saveBatchWithTableName(insertList, tableName); this.saveBatchWithTableName(insertList, tableName);
} }
......
...@@ -208,6 +208,7 @@ public class SalaryConstants { ...@@ -208,6 +208,7 @@ public class SalaryConstants {
public static final String VIEW_DAY_NAME_PRE = "view_salary_zero_day_"; public static final String VIEW_DAY_NAME_PRE = "view_salary_zero_day_";
public static final String MONEY_ERROR = "减除费用金额仅限5000~60000且是5000的倍数"; public static final String MONEY_ERROR = "减除费用金额仅限5000~60000且是5000的倍数";
public static final String MONEY_NUM_ERROR = "减除费用只能是金额,不能是汉字等其他字符";
public static final String DEPT_ERROR = "根据项目编码未找到项目信息"; public static final String DEPT_ERROR = "根据项目编码未找到项目信息";
public static final BigDecimal COST_MONEY = new BigDecimal("5000"); public static final BigDecimal COST_MONEY = new BigDecimal("5000");
// 最大减除费用 // 最大减除费用
......
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