Commit 5bd602ad authored by fangxinjiang's avatar fangxinjiang

批量办理 100%

parent c7deae3c
......@@ -448,4 +448,12 @@ public interface ErrorCodes {
* 派增异常: 社保各项起缴日不一致,委托备注必填
*/
String EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR = "emp.dispatch.social.date.limit.error";
/**
* 派增异常: 社保各项起缴月份需为可补缴月份,请确认后操作!
*/
String EMP_DISPATCH_SOCIAL_START_IS_ERROR = "emp.dispatch.social.start.is.error";
/**
* 派增异常: 公积金起缴月份需为可补缴月份,请确认后操作!
*/
String EMP_DISPATCH_FUND_DATE_LIMIT_ERROR = "emp.dispatch.fund.start.is.error";
}
......@@ -167,6 +167,10 @@ emp.dispatch.social.base.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD
emp.dispatch.social.date.limit.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u5404\u9879\u8D77\u7F34\u65E5\u4E0D\u4E00\u81F4\uFF0C\u59D4\u6258\u5907\u6CE8\u5FC5\u586B
emp.dispatch.social.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u793E\u4FDD\u5404\u9879\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01
emp.dispatch.fund.start.is.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u516C\u79EF\u91D1\u8D77\u7F34\u6708\u4EFD\u9700\u4E3A\u53EF\u8865\u7F34\u6708\u4EFD\uFF0C\u8BF7\u786E\u8BA4\u540E\u64CD\u4F5C\uFF01
......
......@@ -54,7 +54,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 身份证号
*/
@Length(max = 20, message = "身份证号 不能超过20 个字符" )
@ExcelAttribute(name = "身份证号", maxLength = 20, isNotEmpty = true)
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号" )
@ExcelProperty("身份证号" )
private String empIdcard;
......@@ -62,7 +62,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 员工类型
*/
@Length(max = 32, message = "员工类型 不能超过32 个字符" )
@ExcelAttribute(name = "员工类型", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE, isNotEmpty = true)
@ExcelAttribute(name = "员工类型", maxLength = 32, isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型" )
@ExcelProperty("员工类型" )
private String empType;
......@@ -70,7 +70,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 手机号码
*/
@Length(max = 32, message = "手机号码 不能超过32 个字符" )
@ExcelAttribute(name = "手机号码", maxLength = 32, isNotEmpty = true)
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" )
@ExcelProperty("手机号码" )
private String empMobile;
......@@ -123,7 +123,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true)
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince")
@Schema(description = "档案-市" )
@ExcelProperty("档案-市" )
private String fileCity;
......
......@@ -820,6 +820,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setFileCity(empVo.getFileCity());
dispatch.setFileTown(empVo.getFileTown());
dispatch.setContractId(empVo.getContractId());
dispatch.setEmpType(empVo.getEmpNatrue());
if (Common.isNotNull(empVo.getIdProvince())){
dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
......@@ -856,6 +857,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund.setProvidentStart(excel.getProvidentStart());
if (Common.isNotNull(fundSet)){
fund.setProvidentHousehold(fundSet.getDepartId());
fund.setProvidentHouseholdName(fundSet.getDepartName());
if (!checkFundPer(fundSet.getFundProList(), excel)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_PERCENT_NOT_EXIST)));
return true;
......@@ -1361,6 +1363,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED)));
return true;
}
if (Common.isEmpty(empVo.getContractStart()) && Common.isEmpty(excel.getContractStart())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED)));
return true;
}
excel.setEmpType(empVo.getEmpNatrue());
excel.setEmpMobile(empVo.getEmpPhone());
excel.setFileProvince(Common.isNotNullToStr(empVo.getFileProvince()));
excel.setFileCity(Common.isNotNullToStr(empVo.getFileCity()));
excel.setFileTown(Common.isNotNullToStr(empVo.getFileTown()));
excel.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
}
excel.setSettleDomainId(setInfoVo.getId());
excel.setDepartName(setInfoVo.getDepartName());
......@@ -1434,6 +1448,33 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
if (Common.isNotNull(excel.getSocialHousehold())){
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate(excel);
// 校验各项起缴日期 查看是否符合社保补缴政策
if (validSocialStartDate(errorMessageList, excel, socialSet)) return true;
//校验各项基数
if (validSocialBaseInfo(errorMessageList, excel, empVo, socialSet)) return true;
}
// 校验公积金上下限和起缴日期
if (Common.isNotNull(excel.getProvidentHousehold())){
if(Common.isNotNull(fundSet)
&& Common.isNotNull(excel.getProvidentCardinal())
&& excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getProvidentStart()),
fundSet.getCanOverpay(),fundSet.getOverpayNumber(),fundSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_DATE_LIMIT_ERROR)));
return true;
}
}
return false;
}
private boolean validSocialBaseInfo(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, DispatchEmpVo empVo, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (Common.isNotNull(excel.getPensionCardinal())
&& excel.getPensionCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
......@@ -1459,9 +1500,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
// 备案基数和养老基数 养老起缴日期 必填在前面已必填校验,这里不重复校验
if (Common.isEmpty(excel.getRecordBase()) && Common.isEmpty(excel.getSocialHousehold())){
boolean flag = false;
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate(excel);
// 自定义 只要有一个不相当同的 日期或基数 就要提示
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
......@@ -1508,15 +1546,42 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
return false;
}
if (Common.isNotNull(excel.getProvidentHousehold())
&& Common.isNotNull(fundSet)
&& Common.isNotNull(excel.getProvidentCardinal())
&& excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR)));
private boolean validSocialStartDate(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getPensionStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getMedicalStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getUnemployStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getWorkInjuryStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getBirthStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getBigailmentStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
}
return false;
}
......
......@@ -155,4 +155,31 @@ public class ServiceUtil {
}
return false;
}
/**
* 查看社保公积金起缴日期是否符合补缴逻辑
* @Author fxj
* @Date 2020-09-07
* @param socialStartDate 起缴日期
* @param canOverpay 是否可补缴 0:是,1:否
* @param overpayNumber 补缴期限 整数
* @param haveThisMonth 是否含当月 0:是,1:否 如果无符合条件默认不含当月
* @return 符合 false 不符合 true
**/
public static boolean checkDispatchDate(LocalDateTime socialStartDate,String canOverpay,Integer overpayNumber,String haveThisMonth){
if (null == socialStartDate){
return false;
}
LocalDateTime temp = null;
LocalDateTime now = LocalDateTime.now();
if (CommonConstants.ZERO_STRING.equals(canOverpay)){
temp = socialStartDate.plusMonths(CommonConstants.ZERO_STRING.equals(haveThisMonth)?(long)overpayNumber:(long)(overpayNumber+1));
}else if (CommonConstants.ONE_STRING.equals(canOverpay)){
temp = socialStartDate;
}
return (null != temp && (temp.getYear() < now.getYear() || isaBoolean(temp, now)));
}
private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
return temp.getYear() == now.getYear() && temp.getMonthValue() < now.getMonthValue();
}
}
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