Commit 2934a019 authored by fangxinjiang's avatar fangxinjiang

公积金自动化-fxj

parent e4a23c9a
......@@ -618,4 +618,13 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@ExcelProperty("公积金缴纳地-县Id")
@Schema(description = "公积金缴纳地-县Id")
private String fundTownId;
/**
* 公积金户ID
*/
@ExcelAttribute(name = "公积金户ID", maxLength = 50)
@Length(max = 50, message = "公积金户ID不能超过50个字符")
@ExcelProperty("公积金户ID")
@Schema(description = "公积金户ID")
private String configHouseId;
}
......@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
......@@ -812,32 +813,46 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo();
cardVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard());
R<Boolean> fundFlag = socialDaprUtils.selectExitEmpFund(cardVo);
//是否已签署为是需要判断公积金是否在用或者流程中
//是否已购买为是需要判断公积金是否在用或者流程中
if (CommonConstants.ZERO_STRING.equals(employeeRegistrationPre.getFundIsBuy()) &&
(Common.isEmpty(fundFlag) || Boolean.TRUE.equals(!fundFlag.getData()))) {
return R.other(CommonConstants.TWO_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, "该人员存在在途/有效的公积金数据,请将“是否已参保”调整为“是”");
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(employeeRegistrationPre.getDispatchInfoFundPreVo().getConfigHouseId())
&& Common.isNotNull(employeeRegistrationPre.getDispatchInfoFundPreVo().getProvidentCardinal())){
R<SysBaseSetInfoVo> resR = socialDaprUtils.getSocialHouseBaseSet(employeeRegistrationPre.getDispatchInfoFundPreVo().getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
SysBaseSetInfoVo setInfo = resR.getData();
if (employeeRegistrationPre.getDispatchInfoFundPreVo().getProvidentCardinal().compareTo(setInfo.getLowerLimit()) < 0) {
return R.other(CommonConstants.TWO_INT,null,"公积金基数需≥当前户("+setInfo.getDepartName()+")的最低基数:"+setInfo.getLowerLimit()+"!");
}
}else {
return R.other(CommonConstants.TWO_INT,null,"获取公积金配置信息失败!");
}
}
//流程中的公积金数据不能修改
//查已购买公积金明细
if (null != employeeRegistrationPre.getDispatchInfoPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) {
/*if (null != employeeRegistrationPre.getDispatchInfoFundPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoFundPreVo().getId())) {
R<EmployeePreSocialListVo> fundSdr = socialDaprUtils.getFundPreInfoStatus(id);
//公积金购买状态,0待确认,1待派单,2派单失败,3待审核,4审核不通过,5待办理,7办理成功,8办理失败
if (fundSdr != null && fundSdr.getData() != null
&& null != fundSdr.getData().getDispatchInfoPreFundVo()
&& (fundSdr.getData().getDispatchInfoPreFundVo().getProcessStatus().equals(CommonConstants.THREE_STRING) ||
fundSdr.getData().getDispatchInfoPreFundVo().getProcessStatus().equals(CommonConstants.FOUR_STRING) ||
fundSdr.getData().getDispatchInfoPreFundVo().getProcessStatus().equals(CommonConstants.SEVEN_STRING) ||
fundSdr.getData().getDispatchInfoPreFundVo().getProcessStatus().equals(CommonConstants.FIVE_STRING))) {
return R.failed("流程中的公积金待购买数据不可修改!");
}
}
}*/
//更新合同签署状态
if (null != employeeRegistrationPre.getDispatchInfoPreVo()) {
employeeRegistrationPre.getDispatchInfoPreVo().setContractStatus(flag ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
......
......@@ -247,7 +247,7 @@ public class SocialDaprUtils {
* @return
**/
public R<Boolean> selectExitEmpFund(TEmployeeAutoRegistCheckVo cardVo) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/selectExitEmpSocial", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/selectExitEmpFund", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @Author fxj
......
......@@ -43,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -659,7 +660,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
// 公积金自动化校验逻辑 1.9.17 FXJ
if (preVo.getServerItem().contains("公积金") && null != preVo.getDispatchInfoPreVo()) {
if (preVo.getServerItem().contains("公积金") && null != preVo.getDispatchInfoFundPreVo()) {
//根据身份证号码和项目编号查询公积金
flag = socialDaprUtils.selectExitEmpFund(cardVo);
//是否已签署为是需要判断是否在用或者流程中的公积金
......@@ -672,6 +673,21 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
return R.other(CommonConstants.TWO_INT,null,"该人员存在在途/有效的公积金数据,请将'是否已参保'调整为'是'");
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
&& Common.isNotNull(preVo.getDispatchInfoFundPreVo().getProvidentCardinal())){
R<SysBaseSetInfoVo> resR = socialDaprUtils.getSocialHouseBaseSet(preVo.getDispatchInfoFundPreVo().getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
SysBaseSetInfoVo setInfo = resR.getData();
if (preVo.getDispatchInfoFundPreVo().getProvidentCardinal().compareTo(setInfo.getLowerLimit()) < 0) {
return R.other(CommonConstants.TWO_INT,null,"公积金基数需≥当前户("+setInfo.getDepartName()+")的最低基数:"+setInfo.getLowerLimit()+"!");
}
}else {
return R.other(CommonConstants.TWO_INT,null,"获取公积金配置信息失败!");
}
}
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
......@@ -771,6 +787,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setDispatchItem("公积金");
//如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType())) {
......@@ -796,7 +813,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//用户自定义取值用户填写的起缴日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getSocialStartDate());
vo.setRegistDate(preVo.getFundStartDate());
}
}
Date date = this.addYearsMonths(vo);
......@@ -1019,6 +1036,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
R<TEmployeeInsuranceWorkDayVo> dataR;
R<Boolean> flag;
TEmployeeAutoRegistCheckVo exitCheckVo;
R<SysBaseSetInfoVo> resR;
SysBaseSetInfoVo setInfo;
for (EmployeeRegistration registration:registrationList) {
exitCheckVo = new TEmployeeAutoRegistCheckVo();
exitCheckVo.setEmployeeName(registration.getEmployeeName());
......@@ -1112,13 +1131,42 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (preVo.getServerItem().contains("公积金") && null != preVo.getDispatchInfoFundPreVo()) {
//根据身份证号码和项目编号查询公积金
flag = socialDaprUtils.selectExitEmpFund(cardVo);
//是否已签署为是需要判断是否在用或者流程中的公积金
if (CommonConstants.ZERO_STRING.equals(preVo.getFundIsBuy()) &&
(Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData()))) {
exitCheckVo.setType("公积金");
exitCheckVo.setErrorMsg("未找到流程中或者在用的公积金信息");
errorList.add(exitCheckVo);
continue;
}
//是否已签署为否需要判断是否在用或者流程中的公积金
if (Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
if (CommonConstants.ONE_STRING.equals(preVo.getFundIsBuy()) &&
Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
exitCheckVo.setType("公积金");
exitCheckVo.setErrorMsg("该人员存在在途/有效的公积金数据");
errorList.add(exitCheckVo);
continue;
}
//判断公积金基数 是否小于 公积金户配置的最低基数
if (Common.isNotNull(preVo.getDispatchInfoFundPreVo().getConfigHouseId())
&& Common.isNotNull(preVo.getDispatchInfoFundPreVo().getProvidentCardinal())){
resR = socialDaprUtils.getSocialHouseBaseSet(preVo.getDispatchInfoFundPreVo().getConfigHouseId());
if (Common.isNotNull(resR) && resR.getData() != null) {
setInfo = resR.getData();
if (preVo.getDispatchInfoFundPreVo().getProvidentCardinal().compareTo(setInfo.getLowerLimit()) < 0) {
exitCheckVo.setType("公积金");
exitCheckVo.setErrorMsg("公积金基数需≥当前户("+setInfo.getDepartName()+")的最低基数:"+setInfo.getLowerLimit()+"!");
errorList.add(exitCheckVo);
continue;
}
}else {
exitCheckVo.setType("公积金");
exitCheckVo.setErrorMsg("获取公积金配置信息失败!");
errorList.add(exitCheckVo);
continue;
}
}
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
......
......@@ -178,7 +178,7 @@ public class TDispatchInfoPreController {
* 社保待购买信息单个/批量发起购买任务
* @param idList id数组
**/
@Operation(description = "社保待购买信息单个/批量发起购买任务")
@Operation(description = "社保待购买信息单个/批量发起购买任务")
@PostMapping("/dispatcherContract")
public R dispatcherContract(@RequestBody List<String> idList) {
return tDispatchInfoPreService.dispatcherSocial(idList,"1");
......
......@@ -203,8 +203,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
socialPreDetailService.save(preDetal);
}
//批量删除社保待购买列表中的待确认、待派单、派单失败、审核、办理失败的数据
baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda().in(
TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
.eq(TDispatchInfoPre::getRegisterId, registrationPreVo.getExitSocialInfoList()
.get(0).getRegisterId()));
} else {
......@@ -317,8 +318,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
fundPreDetailService.save(preDetal);
}
//批量删除公积金待购买列表中的待确认、待派单、派单失败、审核、办理失败的数据
baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda().in(
TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
.eq(TDispatchInfoPre::getRegisterId, registrationPreVo.getExitSocialInfoList()
.get(0).getRegisterId()));
} else {
......@@ -376,7 +378,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
//用户自定义取值用户填写的起缴日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getSocialStartDate());
vo.setRegistDate(preVo.getFundStartDate());
}
}
Date date = this.addYearsMonths(vo);
......@@ -385,7 +387,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
dayVo.setRegistDate(date);
dayVo.setRegistType(0);
TEmployeeInsuranceWorkDayVo dataR = tHolidayInfoService.selectBeforeOrAfterWorkDayCommon(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getPriDisDate())) {
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getRegistDate())) {
preVo.setExpectedCollectionTime(dataR.getRegistDate());
preVo.setExpectedConfirmTime(dataR.getRegistDate());
} else {
......@@ -540,7 +542,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
YifuUser user = SecurityUtils.getUser();
List<TDispatchInfoPre> contractPreList = baseMapper.selectList(Wrappers.<TDispatchInfoPre>query()
.lambda().in(TDispatchInfoPre::getId, idList)
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING)
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("1","2","4","8","9")));
// 如果没有找到任何未处理的社保待购买数据,返回失败消息
if (Common.isEmpty(contractPreList)) {
......
......@@ -540,9 +540,9 @@
a.RECORD_BASE recordBase,
a.PROVIDENT_HOUSEHOLD_NAME providentHousehold,
a.PROVIDENT_CARDINAL providentCardinal,
a.PROVIDENT_START providentStart,
a.PER_FLAG perFlag,
a.PROVIDENT_PER providentPer,
a.FUND_START_DATE providentStart,
a.FUND_PER_FLAG perFlag,
a.UNIT_PROVIDENT_PER providentPer,
a.PERSONAL_PROVIDENT_PER personalProvidentPer,
a.id preId,
a.TRUST_REMARK trustRemark,
......
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