Commit 035e968e authored by fangxinjiang's avatar fangxinjiang

公积金自动化-fxj

parent b67e23ee
......@@ -816,14 +816,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
//是否已购买为是需要判断公积金是否在用或者流程中
if (CommonConstants.ZERO_STRING.equals(employeeRegistrationPre.getFundIsBuy()) &&
(Common.isEmpty(fundFlag) || Boolean.TRUE.equals(!fundFlag.getData()))) {
return R.other(CommonConstants.TWO_INT, null, "未找到流程中或者在用的公积金信息!");
return R.other(CommonConstants.THREE_INT, null, "未找到流程中或者在用的公积金信息!");
}
//是否已购买为否需要判断是否在用或者流程中的公积金
if (CommonConstants.ONE_STRING.equals(employeeRegistrationPre.getFundIsBuy()) &&
Common.isNotNull(fundFlag) && Boolean.TRUE.equals(fundFlag.getData()) &&
null != employeeRegistrationPre.getDispatchInfoPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) {
return R.other(CommonConstants.TWO_INT, null, "该人员存在在途/有效的公积金数据,请将“是否已参保”调整为“是”");
null != employeeRegistrationPre.getDispatchInfoFundPreVo()) {
return R.other(CommonConstants.THREE_INT, null, "该人员存在在途/有效的公积金数据,请将“是否已参保”调整为“是”");
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(employeeRegistrationPre.getDispatchInfoFundPreVo().getConfigHouseId())
......
......@@ -685,6 +685,9 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
Date date = this.addYearsMonths(vo);
if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
date = DateUtil.getFirstDay(date);
}
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
......@@ -1111,8 +1114,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setDispatchItem("公积金");
if (null != fundPreVo){
preVo.setExpectedCollectionTime(fundPreVo.getExpectedCollectionTime());
preVo.setExpectedConfirmTime(fundPreVo.getExpectedConfirmTime());
preVo.setExpectedCollectionTime(null);
preVo.setExpectedConfirmTime(null);
preVo.setExpectedCollectionType(fundPreVo.getExpectedCollectionType());
preVo.setReceiveType(fundPreVo.getReceiveType());
preVo.setConfigId(fundPreVo.getConfigId());
......
......@@ -254,4 +254,38 @@ public class BigDecimalUtils {
}
return new BigDecimal(c);
}
/**
* 判断BigDecimal值是否在指定范围内(包含边界)
* @param value 要检查的值
* @param min 最小值(包含)
* @param max 最大值(包含)
* @return 如果值在范围内返回true,否则返回false
*/
public static boolean isBetween(BigDecimal value, BigDecimal min, BigDecimal max) {
if (value == null || min == null || max == null) {
return false;
}
return value.compareTo(min) >= 0 && value.compareTo(max) <= 0;
}
/**
* 判断BigDecimal值是否在指定范围内
* @param value 要检查的值
* @param min 最小值
* @param minInclusive 最小值是否包含在内
* @param max 最大值
* @param maxInclusive 最大值是否包含在内
* @return 如果值在范围内返回true,否则返回false
*/
public static boolean isBetween(BigDecimal value, BigDecimal min, boolean minInclusive, BigDecimal max, boolean maxInclusive) {
if (value == null || min == null || max == null) {
return false;
}
boolean minCheck = minInclusive ? value.compareTo(min) >= 0 : value.compareTo(min) > 0;
boolean maxCheck = maxInclusive ? value.compareTo(max) <= 0 : value.compareTo(max) < 0;
return minCheck && maxCheck;
}
}
......@@ -1277,6 +1277,23 @@ public class DateUtil {
return c1.getTime();
}
/**
* 获取第一天
* @Author fxj
* @Date 2019-10-16
* @param date
* @return
**/
public static Date getFirstDay(Date date){
if (!Common.isNotNull(date)){
return null;
}
Calendar c1 = Calendar.getInstance();
c1.setTime(date);
c1.set(Calendar.DATE, 1);
return c1.getTime();
}
/**
* 获取第一天
* @Author fxj
......
......@@ -666,12 +666,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//是否已签署为是需要判断是否在用或者流程中的公积金
if (CommonConstants.ZERO_STRING.equals(preVo.getFundIsBuy()) &&
(Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData()))) {
return R.other(CommonConstants.TWO_INT,null,"未找到流程中或者在用的公积金信息!");
return R.other(CommonConstants.THREE_INT,null,"未找到流程中或者在用的公积金信息!");
}
// 是否已签署为否需要判断是否在用或者流程中的公积金
if (CommonConstants.ONE_STRING.equals(preVo.getFundIsBuy()) &&
Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
return R.other(CommonConstants.TWO_INT,null,"该人员存在在途/有效的公积金数据,请将'是否已参保'调整为'是'");
return R.other(CommonConstants.THREE_INT,null,"该人员存在在途/有效的公积金数据,请将'是否已参保'调整为'是'");
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
......@@ -786,14 +786,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setTypeSub(CommonConstants.ONE_STRING);
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setDispatchItem("公积金");
//如果公积金起缴日期为空需要初始化--只有批量确认时才会走到这里
initFundStartDate(registration, preVo);
//如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType())) {
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
//如果公积金起缴日期为空需要初始化--只有批量确认时才会走到这里
initFundStartDate(registration, preVo);
//接收方式 0项目配置 1自定义
if (CommonConstants.ONE_STRING.equals(preVo.getReceiveType())){
vo.setMonthAfter(CommonConstants.ZERO_INT);
......@@ -826,6 +825,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
Date date = this.addYearsMonths(vo);
if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
date = DateUtil.getFirstDay(date);
}
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
......@@ -873,6 +875,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initDate.setRegistDate(preVo.getFundStartDate());
}
Date date = this.addYearsMonths(initDate);
if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
date = DateUtil.getFirstDay(date);
}
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
......
......@@ -651,6 +651,8 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
SysHouseHoldInfo hold = null;
//补缴险种
String insurancePension = null;
String startDateTemp = null;
String doMonthTemp = null;
for (int i = 0; i < excelVOList.size(); i++) {
infoVo = new SysBaseSetInfo();
excel = excelVOList.get(i);
......@@ -679,14 +681,14 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
errorMessageList.add(errorMsg);
continue;
}
excel.setApplyStartDate(excel.getApplyStartDate()
startDateTemp = excel.getApplyStartDate()
.replace("-", CommonConstants.EMPTY_STRING)
.replace("/", CommonConstants.EMPTY_STRING));
excel.setDoMonth(excel.getDoMonth()
.replace("/", CommonConstants.EMPTY_STRING);
doMonthTemp = excel.getDoMonth()
.replace("-", CommonConstants.EMPTY_STRING)
.replace("/", CommonConstants.EMPTY_STRING));
.replace("/", CommonConstants.EMPTY_STRING);
//适用起始月份
dateFormat = DateUtil.stringToDate2(excel.getApplyStartDate()+"01", DateUtil.ISO_DATE_FORMAT);
dateFormat = DateUtil.stringToDate2(startDateTemp+"01", DateUtil.ISO_DATE_FORMAT);
if (null != dateFormat){
infoVo.setApplyStartDate(dateFormat);
}else {
......@@ -714,7 +716,7 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
temp.setApplyEndDate(DateUtil.addDayByDate(dateFormat,-1));
}
//执行月份校验
dateUse = DateUtil.stringToDate2(excel.getDoMonth()+"01", DateUtil.ISO_DATE_FORMAT);
dateUse = DateUtil.stringToDate2(doMonthTemp+"01", DateUtil.ISO_DATE_FORMAT);
if (null != dateUse){
infoVo.setDoMonth(DateUtil.getYearAndMonth(dateFormat,0));
}else {
......@@ -1018,6 +1020,19 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
infoVo.setPersonalMedicalPro(excel.getPersonalMedicalPro());
infoVo.setPersonalPersionPro(excel.getPersonalPersionPro());
infoVo.setPayPersonalPro(excel.getPayPersonalPro());
//各种比例需在0~100内
if (infoVo.getUnitPersionPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUnitInjuryPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUnitMedicalPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getUnitBirthPro().compareTo( BigDecimal.ZERO) < 0
|| infoVo.getUnitUnemploymentPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getPersonalUnemploymentPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getPersonalMedicalPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getPersonalPersionPro().compareTo(BigDecimal.ZERO) < 0 ){
errorMsg = new ErrorMessage(excel.getRowIndex(),"比例需在0~100内,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
//单位及个人比例合计
infoVo.setUnitProSum(BigDecimalUtils.safeAdd(infoVo.getUnitInjuryPro(),
infoVo.getUnitMedicalPro(),
......@@ -1031,6 +1046,13 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
if (CommonConstants.ZERO_STRING.equals(excel.getIsIllness()) && CommonConstants.ONE_STRING.equals(excel.getValueType())){
infoVo.setUnitProSum(BigDecimalUtils.safeAdd(infoVo.getUnitProSum(), infoVo.getPayCompanyPro()));
infoVo.setPersonalProSum(BigDecimalUtils.safeAdd(infoVo.getPersonalProSum(),infoVo.getPayPersonalPro()));
//各种比例需在0~100内
if (infoVo.getPayCompanyPro().compareTo(BigDecimal.ZERO) < 0
|| infoVo.getPayPersonalPro().compareTo(BigDecimal.ZERO) < 0){
errorMsg = new ErrorMessage(excel.getRowIndex(),"比例需在0~100内,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
}
infoVo.setStatus(CommonConstants.ZERO_INT);
infoVo.setBaseType(CommonConstants.ZERO_STRING);
......@@ -1243,35 +1265,35 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
continue;
}
infoVo.setOverpayNumber(Integer.parseInt(excel.getOverpayNumber()));
//是否含起缴当月
//是否含起缴当月 必填
if (!Common.getSet(CommonConstants.ZERO_STRING, CommonConstants.ONE_STRING).contains(excel.getHaveThisMonth())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"是否含起缴当月必填,只可填写“是”或“否”,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
infoVo.setHaveThisMonth(excel.getHaveThisMonth());
// 补缴基数 若是否可补缴为“是”,必填,只可填写“最新基数”或“当期基数”
if (!Common.getSet(CommonConstants.ZERO_STRING, CommonConstants.ONE_STRING).contains(excel.getInsuranceIsLatestCardinality())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴基数必填,只可填写“最新基数”或“当期基数”,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
// 补缴政策 必填
if (Common.isEmpty(excel.getPayPolicy())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴政策必填,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
//补缴政策大于200个汉字,则报错
if (excel.getPayPolicy().length() > 200) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴政策长度不可大于200个汉字,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
infoVo.setPayPolicy(excel.getPayPolicy());
infoVo.setInsuranceIsLatestCardinality(excel.getInsuranceIsLatestCardinality());
}
//是否含起缴当月
//是否含起缴当月 必填
if (!Common.getSet(CommonConstants.ZERO_STRING, CommonConstants.ONE_STRING).contains(excel.getHaveThisMonth())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"是否含起缴当月必填,只可填写“是”或“否”,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
infoVo.setHaveThisMonth(excel.getHaveThisMonth());
// 补缴基数 若是否可补缴为“是”,必填,只可填写“最新基数”或“当期基数”
if (!Common.getSet(CommonConstants.ZERO_STRING, CommonConstants.ONE_STRING).contains(excel.getInsuranceIsLatestCardinality())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴基数必填,只可填写“最新基数”或“当期基数”,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
// 补缴政策 必填
if (Common.isEmpty(excel.getPayPolicy())) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴政策必填,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
//补缴政策大于200个汉字,则报错
if (excel.getPayPolicy().length() > 200) {
errorMsg = new ErrorMessage(excel.getRowIndex(),"补缴政策长度不可大于200个汉字,请修改后重新提交",excel);
errorMessageList.add(errorMsg);
continue;
}
infoVo.setPayPolicy(excel.getPayPolicy());
infoVo.setInsuranceIsLatestCardinality(excel.getInsuranceIsLatestCardinality());
infoVo.setCanOverpay(excel.getCanOverpay());
infoVo.setStatus(CommonConstants.ZERO_INT);
infoVo.setBaseType(CommonConstants.ONE_STRING);
......
......@@ -389,6 +389,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
Date date = this.addYearsMonths(vo);
if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
date = DateUtil.getFirstDay(date);
}
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
......
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