Commit 5bd602ad authored by fangxinjiang's avatar fangxinjiang

批量办理 100%

parent c7deae3c
...@@ -448,4 +448,12 @@ public interface ErrorCodes { ...@@ -448,4 +448,12 @@ public interface ErrorCodes {
* 派增异常: 社保各项起缴日不一致,委托备注必填 * 派增异常: 社保各项起缴日不一致,委托备注必填
*/ */
String EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR = "emp.dispatch.social.date.limit.error"; 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 ...@@ -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.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 { ...@@ -54,7 +54,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 身份证号 * 身份证号
*/ */
@Length(max = 20, message = "身份证号 不能超过20 个字符" ) @Length(max = 20, message = "身份证号 不能超过20 个字符" )
@ExcelAttribute(name = "身份证号", maxLength = 20, isNotEmpty = true) @ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号" ) @Schema(description = "身份证号" )
@ExcelProperty("身份证号" ) @ExcelProperty("身份证号" )
private String empIdcard; private String empIdcard;
...@@ -62,7 +62,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -62,7 +62,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 员工类型 * 员工类型
*/ */
@Length(max = 32, message = "员工类型 不能超过32 个字符" ) @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 = "员工类型" ) @Schema(description = "员工类型" )
@ExcelProperty("员工类型" ) @ExcelProperty("员工类型" )
private String empType; private String empType;
...@@ -70,7 +70,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -70,7 +70,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 手机号码 * 手机号码
*/ */
@Length(max = 32, message = "手机号码 不能超过32 个字符" ) @Length(max = 32, message = "手机号码 不能超过32 个字符" )
@ExcelAttribute(name = "手机号码", maxLength = 32, isNotEmpty = true) @ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" ) @Schema(description = "手机号码" )
@ExcelProperty("手机号码" ) @ExcelProperty("手机号码" )
private String empMobile; private String empMobile;
...@@ -123,7 +123,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -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 = "档案-市" ) @Schema(description = "档案-市" )
@ExcelProperty("档案-市" ) @ExcelProperty("档案-市" )
private String fileCity; private String fileCity;
......
...@@ -820,6 +820,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -820,6 +820,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setFileCity(empVo.getFileCity()); dispatch.setFileCity(empVo.getFileCity());
dispatch.setFileTown(empVo.getFileTown()); dispatch.setFileTown(empVo.getFileTown());
dispatch.setContractId(empVo.getContractId()); dispatch.setContractId(empVo.getContractId());
dispatch.setEmpType(empVo.getEmpNatrue());
if (Common.isNotNull(empVo.getIdProvince())){ if (Common.isNotNull(empVo.getIdProvince())){
dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince())); dispatch.setIdCardProvince(Common.isNotNullToStr(empVo.getIdProvince()));
dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity())); dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
...@@ -856,6 +857,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -856,6 +857,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund.setProvidentStart(excel.getProvidentStart()); fund.setProvidentStart(excel.getProvidentStart());
if (Common.isNotNull(fundSet)){ if (Common.isNotNull(fundSet)){
fund.setProvidentHousehold(fundSet.getDepartId()); fund.setProvidentHousehold(fundSet.getDepartId());
fund.setProvidentHouseholdName(fundSet.getDepartName());
if (!checkFundPer(fundSet.getFundProList(), excel)){ if (!checkFundPer(fundSet.getFundProList(), excel)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_PERCENT_NOT_EXIST))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_PERCENT_NOT_EXIST)));
return true; return true;
...@@ -1361,6 +1363,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -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))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_USED)));
return true; 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.setSettleDomainId(setInfoVo.getId());
excel.setDepartName(setInfoVo.getDepartName()); excel.setDepartName(setInfoVo.getDepartName());
...@@ -1434,88 +1448,139 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1434,88 +1448,139 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getSocialHousehold())){ if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType()) // 各个社保基数和日期空 默认养老日期和基数
&& (Common.isNotNull(excel.getPensionCardinal()) initExcelBaseAndDate(excel);
&& excel.getPensionCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT // 校验各项起缴日期 查看是否符合社保补缴政策
&& excel.getPensionCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) if (validSocialStartDate(errorMessageList, excel, socialSet)) return true;
||(Common.isNotNull(excel.getMedicalCardinal()) //校验各项基数
&& excel.getMedicalCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT if (validSocialBaseInfo(errorMessageList, excel, empVo, socialSet)) return true;
&& excel.getMedicalCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) }
||(Common.isNotNull(excel.getUnemploymentCardinal()) // 校验公积金上下限和起缴日期
&& excel.getUnemploymentCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT if (Common.isNotNull(excel.getProvidentHousehold())){
&& excel.getUnemploymentCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) if(Common.isNotNull(fundSet)
||(Common.isNotNull(excel.getWorkInjuryCardinal()) && Common.isNotNull(excel.getProvidentCardinal())
&& excel.getWorkInjuryCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT && excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getWorkInjuryCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) && excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){
||(Common.isNotNull(excel.getBirthCardinal()) errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR)));
&& excel.getBirthCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT return true;
&& excel.getBirthCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) }
||(Common.isNotNull(excel.getBigailmentCardinal()) if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getProvidentStart()),
&& excel.getBigailmentCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT fundSet.getCanOverpay(),fundSet.getOverpayNumber(),fundSet.getHaveThisMonth())){
&& excel.getBigailmentCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT) errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_DATE_LIMIT_ERROR)));
){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_LIMIT_ERROR)));
return true; return true;
} }
// 备案基数和养老基数 养老起缴日期 必填在前面已必填校验,这里不重复校验
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
|| excel.getMedicalCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getUnemploymentCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getWorkInjuryCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getBirthCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getBigailmentCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR)));
return true;
}
Date temp = new Date();
if (Common.isEmpty(empVo)){
temp = excel.getContractStart();
}else if (Common.isNotNull(empVo) && Common.isNotNull(empVo.getContractStart())){
temp = empVo.getContractStart();
}else {
temp = excel.getContractStart();
}
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionStart().equals(temp)
|| excel.getMedicalStart().equals(temp)
|| excel.getUnemployStart().equals(temp)
|| excel.getWorkInjuryStart().equals(temp)
|| excel.getBirthStart().equals(temp)
|| excel.getBigailmentStart().equals(temp)
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR)));
return true;
}
// 其他 只用判断对应养老基数和时间 与合同时间 即可
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionStart().equals(temp)
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR)));
return true;
}
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType()) }
&& excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT){ return false;
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR))); }
return true;
} 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
&& excel.getPensionCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
||(Common.isNotNull(excel.getMedicalCardinal())
&& excel.getMedicalCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getMedicalCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
||(Common.isNotNull(excel.getUnemploymentCardinal())
&& excel.getUnemploymentCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getUnemploymentCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
||(Common.isNotNull(excel.getWorkInjuryCardinal())
&& excel.getWorkInjuryCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getWorkInjuryCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
||(Common.isNotNull(excel.getBirthCardinal())
&& excel.getBirthCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getBirthCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
||(Common.isNotNull(excel.getBigailmentCardinal())
&& excel.getBigailmentCardinal().compareTo(socialSet.getUpperLimit()) > CommonConstants.ZERO_INT
&& excel.getBigailmentCardinal().compareTo(socialSet.getLowerLimit())< CommonConstants.ZERO_INT)
){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_LIMIT_ERROR)));
return true;
}
// 备案基数和养老基数 养老起缴日期 必填在前面已必填校验,这里不重复校验
if (Common.isEmpty(excel.getRecordBase()) && Common.isEmpty(excel.getSocialHousehold())){
// 自定义 只要有一个不相当同的 日期或基数 就要提示
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getMedicalCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getUnemploymentCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getWorkInjuryCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getBirthCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
|| excel.getBigailmentCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR)));
return true;
}
Date temp = new Date();
if (Common.isEmpty(empVo)){
temp = excel.getContractStart();
}else if (Common.isNotNull(empVo) && Common.isNotNull(empVo.getContractStart())){
temp = empVo.getContractStart();
}else {
temp = excel.getContractStart();
}
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionStart().equals(temp)
|| excel.getMedicalStart().equals(temp)
|| excel.getUnemployStart().equals(temp)
|| excel.getWorkInjuryStart().equals(temp)
|| excel.getBirthStart().equals(temp)
|| excel.getBigailmentStart().equals(temp)
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR)));
return true;
}
// 其他 只用判断对应养老基数和时间 与合同时间 即可
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& (excel.getPensionStart().equals(temp)
)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_DATE_LIMIT_ERROR)));
return true;
}
if (!CommonConstants.ONE_STRING.equals(excel.getPaymentType())
&& excel.getPensionCardinal().compareTo(excel.getRecordBase()) != CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_BASE_LIMIT_ERROR)));
return true;
} }
} }
if (Common.isNotNull(excel.getProvidentHousehold()) return false;
&& Common.isNotNull(fundSet) }
&& Common.isNotNull(excel.getProvidentCardinal())
&& excel.getProvidentCardinal().compareTo(fundSet.getUpperLimit()) > CommonConstants.ZERO_INT private boolean validSocialStartDate(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, SysBaseSetInfo socialSet) {
&& excel.getProvidentCardinal().compareTo(fundSet.getLowerLimit())< CommonConstants.ZERO_INT){ if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_LIMIT_ERROR))); if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getPensionStart()),
return true; 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; return false;
} }
......
...@@ -155,4 +155,31 @@ public class ServiceUtil { ...@@ -155,4 +155,31 @@ public class ServiceUtil {
} }
return false; 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