Commit dbce2f03 authored by hongguangwu's avatar hongguangwu

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

parents afb35874 9783fe98
......@@ -334,4 +334,15 @@ public class TEmployeeContractPreController {
public R contractUrg(@RequestParam String id) {
return tEmployeeContractPreService.contractUrg(id);
}
/**
* 通过id查询合同待签订任务记录表
* @param registId
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " )
public R<TEmployeeContractPre> getInfoByRegistId(@RequestParam("registId" ) String registId) {
return tEmployeeContractPreService.getInfoByRegistId(registId);
}
}
......@@ -103,4 +103,6 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
* @return
*/
R contractUrg(String id);
R<TEmployeeContractPre> getInfoByRegistId(String registId);
}
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
......@@ -274,6 +275,17 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
try {
//调用csp服务更新状态和新增操作记录
cspDaprUtils.updateRegistByPreInfo(receiveVo);
//处理合同待办信息
contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId()));
//处理商险待办信息
BaseSearchVO insuranceSearchVo = new BaseSearchVO();
insuranceSearchVo.setRegisterId(updatePre.getId());
insuranceDaprUtil.getInsurancesStatus(insuranceSearchVo);
//处理社保待办信息
socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId());
//处理公积金待办信息
socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId());
} catch (Exception e) {
log.error("调用csp服务更新数据异常", e);
}
......
......@@ -1244,5 +1244,13 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
}
}
@Override
public R<TEmployeeContractPre> getInfoByRegistId(String registId) {
if (Common.isEmpty(registId)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, registId)
.last(CommonConstants.LAST_ONE_SQL)));
}
}
......@@ -644,7 +644,7 @@ public interface CommonConstants {
List<String> processStatus = Stream.of("0","1").collect(Collectors.toList());
List<String> insuranceAutoProcessStatus = Stream.of("0","1","2","5").collect(Collectors.toList());
List<String> insuranceAutoProcessStatus = Stream.of("0","1","2","5","7").collect(Collectors.toList());
List<String> processPreStatus = Stream.of("1").collect(Collectors.toList());
......
......@@ -65,4 +65,7 @@ public class BaseSearchVO implements Serializable {
private Date startDate;
//入职登记表ID
private String registerId;
}
......@@ -112,7 +112,21 @@ public class InsuranceDaprUtil {
}
return res;
}
/**
* @Author fxj
* @Description 通过如入职ID删除商险待办数据
* @Date 20:28 2026/1/22
* @Param
* @return
**/
public R<Boolean> delInsurancePreByRegisterId(BaseSearchVO paramVo) {
R<Boolean> res = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId()
,"/temployeeinsurancepre/inner/delInsurancePreByRegisterId", paramVo, Boolean.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("通过如入职ID删除商险待办数据!");
}
return res;
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 查询人员的已减完成的商险(返回值,则表示有未减完成的商险
......
......@@ -128,4 +128,8 @@ public class EmployeeRegistration extends BaseEntity {
@Schema(description = "离职处理状态:0待确认1待处理2处理中3已处理")
private String leaveStatus;
@TableField(exist = false)
@Schema(description = "拒绝入职原因")
private String leaveReason;
}
......@@ -132,6 +132,20 @@ public class EmployeeRegistrationController {
return employeeRegistrationService.updateRegist(employeeRegistration);
}
/**
* @Author fxj
* @Description 拒绝入职
* @Date 20:08 2026/1/22
* @Param
* @return
**/
@Operation(summary = "拒绝入职")
@SysLog("拒绝入职")
@PostMapping("/refuseOffer")
public R refuseOffer(@RequestBody EmployeeRegistration employeeRegistration) {
return employeeRegistrationService.refuseOffer(employeeRegistration);
}
/**
* 单个更新,更新入离职日期和手机号码
*
......
......@@ -181,4 +181,5 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
EkpDeptContractInfoVo selectContractInfoByDetptNo(EkpDeptContractInfoVo vo);
R refuseOffer(EmployeeRegistration employeeRegistration);
}
......@@ -2384,5 +2384,24 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
}
/**
* @Author fxj
* @Description 拒绝入职--入职待确认列表
* @Date 20:14 2026/1/22
* @Param
* @return
**/
@Override
public R refuseOffer(EmployeeRegistration registration) {
YifuUser user = SecurityUtils.getUser();
EmployeeRegistration registrationNow = baseMapper.selectById(registration.getId());
if (Common.isEmpty(registrationNow)) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
}
registrationNow.setProcessStatus(CommonConstants.THREE_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(),
user.getNickname(), registration.getLeaveReason());
baseMapper.updateById(registrationNow);
return R.ok();
}
}
......@@ -33,4 +33,13 @@ public class EkpStatusParamVo implements Serializable {
*/
private String callBackFlag;
/**
* 收款结算单退单或款项撤销表示 商险ID
*/
private String detailIds;
/**
* 0代表收款结算单已收或垫付
*/
private String paymentStatsus;
}
......@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
......@@ -312,4 +314,31 @@ public class TEmployeeInsurancePreController {
return tEmployeeInsurancePreService.getExitInsuranceListByEmpPreId(empPreId);
}
/**
* @Author fxj
* @Description 通过如入职ID删除商险待办数据
* @Date 20:31 2026/1/22
* @Param
* @return
**/
@Operation(description = "通过如入职ID删除商险待办数据")
@Inner
@PostMapping("/inner/delInsurancePreByRegisterId")
public Boolean delInsurancePreByRegisterId(@RequestBody BaseSearchVO preVo) {
if (null == preVo || preVo.getRegisterId() == null){
return false;
}
return tEmployeeInsurancePreService.delInsurancePreByRegisterId(preVo);
}
/**
* 通过id查询商险待签订任务记录表
* @param registId
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " )
public R<TEmployeeInsurancePre> getInfoByRegistId(@RequestParam("registId" ) String registId) {
return tEmployeeInsurancePreService.getInfoByRegistId(registId);
}
}
......@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
......@@ -131,4 +132,8 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
**/
List<InsuranceAutoParam> getInsuranceAutoParamList(List<InsuranceAddParam> addParamList, List<InsuranceBatchParam> batchParamList
, List<InsuranceReplaceParam> replaceParamList);
Boolean delInsurancePreByRegisterId(BaseSearchVO preVo);
R<TEmployeeInsurancePre> getInfoByRegistId(String registId);
}
......@@ -21,6 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
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.UpmsDaprUtils;
......@@ -299,10 +300,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
).collect(Collectors.toList());
if (autoAddParamList.isEmpty()) {
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
/*LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeInsurancePre::getId,pushIdList)
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.THREE_STRING);
this.update(updateWrapper);
this.update(updateWrapper);*/
} else {
// 将 autoAddParamList 中的id等信息提取出来,放入一个 Set 中
Set<String> autoAddParamSet = new HashSet<>();
......@@ -812,6 +813,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
).collect(Collectors.toList());
}
private InsuranceAutoParam convertAddParam(InsuranceAddParam addParam) {
InsuranceAutoParam autoParam = new InsuranceAutoParam();
// 复制InsuranceAddParam的字段
......@@ -986,5 +988,25 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
vo.setPreList(preList);
return vo;
}
/**
* @Author fxj
* @Description 通过如入职ID删除商险待办数据
* @Date 20:31 2026/1/22
* @Param
* @return
**/
@Override
public Boolean delInsurancePreByRegisterId(BaseSearchVO preVo) {
return this.remove(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId()));
}
@Override
public R<TEmployeeInsurancePre> getInfoByRegistId(String registId) {
if (Common.isEmpty(registId)){
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL)));
}
}
......@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -72,6 +73,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import javax.json.JsonObject;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -446,14 +448,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送
List<TInsuranceDetail> successList = new ArrayList<>();
successList.add(detail);
doJointInsuranceTask.pushEstime(successList);
}else {
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.THREE_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
}
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
if (isAuto || Common.isNotNull(success.getCustomerUserName())) {
isAuto = true;
......@@ -647,14 +651,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送
List<TInsuranceDetail> successList = new ArrayList<>();
successList.add(detail);
doJointInsuranceTask.pushEstime(successList);
}else {
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.THREE_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
}
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
if (isAuto || Common.isNotNull(success.getCustomerUserName())) {
isAuto = true;
......@@ -1807,7 +1813,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//红冲预估推送
pushResult = pushEstimate(detail, CommonConstants.THREE_INT);
//已投保 需要处理实缴和差额数据 (已支出或支出中禁止退保)
if (CommonConstants.THREE_STRING.equals(detail.getBuyHandleStatus())){
if (CommonConstants.THREE_INT == detail.getBuyHandleStatus()){
//直接删除实缴及实缴与预估的差额
ekpSettleService.deleteEkpInsuranceDetailAsso(detail.getId());
}
......@@ -1877,10 +1883,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果是见费出单,投保中,推送作废 2026-01-22 v1.7.19
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.SEVEN_STRING, true);
}else {
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING);
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING, true);
}
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING, true);
}
//更新状态
this.updateBatchById(successList);
......@@ -2154,7 +2162,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detailTemp.setDefaultSettleId(settle.getId());
detailTemp.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getActualPremium(),detail.getEstimatePremium()));
detailTemp.setActualPremium(BigDecimal.ZERO);
//差额结算 TODO 需要解决已退回和删除时的数据处理
//差额结算
detailTemp.setSettleType(CommonConstants.TWO_INT);
successBanlance.add(detailTemp);
}
......@@ -8689,6 +8697,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
try {
log.info("商险状态更新报文"+JSON.toJSONString(vo));
doJointInsuranceTask.updateInsuranceSettleStatus(vo);
}catch (Exception e) {
log.error("商险结算状态更新异常", e);
......@@ -9388,7 +9397,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != insurancePreId) {
pre = employeeInsurancePreMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getId,insurancePreId)
.in(TEmployeeInsurancePre::getProcessStatus,Stream.of("0","1","2","5").collect(Collectors.toList()))
.in(TEmployeeInsurancePre::getProcessStatus,Stream.of("0","1","2","5","7").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL));
} else {
pre = employeeInsurancePreMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
......@@ -9399,7 +9408,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TEmployeeInsurancePre::getInsuranceCompanyName, insuranceDetail.getInsuranceCompanyName())
.eq(TEmployeeInsurancePre::getPolicyStart, insuranceDetail.getPolicyStart())
.eq(TEmployeeInsurancePre::getPolicyEnd, insuranceDetail.getPolicyEnd())
.in(TEmployeeInsurancePre::getProcessStatus, Stream.of("0","1","2","5").collect(Collectors.toList()))
.in(TEmployeeInsurancePre::getProcessStatus, Stream.of("0","1","2","5","7").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL));
}
if (Common.isNotNull(pre)) {
......@@ -9437,7 +9446,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != insurancePreId) {
pre = tInsurancePreRenewDetailMapper.selectOne(Wrappers.<TInsurancePreRenewDetail>query().lambda()
.eq(TInsurancePreRenewDetail::getId,insurancePreId)
.in(TInsurancePreRenewDetail::getProcessStatus,Stream.of("0","1","2","5").collect(Collectors.toList()))
.in(TInsurancePreRenewDetail::getProcessStatus,Stream.of("0","1","2","5","7").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL));
} else {
pre = tInsurancePreRenewDetailMapper.selectOne(Wrappers.<TInsurancePreRenewDetail>query().lambda()
......@@ -9448,7 +9457,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsurancePreRenewDetail::getInsuranceCompanyName, insuranceDetail.getInsuranceCompanyName())
.eq(TInsurancePreRenewDetail::getPolicyStart, insuranceDetail.getPolicyStart())
.eq(TInsurancePreRenewDetail::getPolicyEnd, insuranceDetail.getPolicyEnd())
.in(TInsurancePreRenewDetail::getProcessStatus, Stream.of("0","1","2","5").collect(Collectors.toList()))
.in(TInsurancePreRenewDetail::getProcessStatus, Stream.of("0","1","2","5","7").collect(Collectors.toList()))
.last(CommonConstants.LAST_ONE_SQL));
}
if (Common.isNotNull(pre)) {
......@@ -9673,7 +9682,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R callBack(TInsuranceDetail detail) {
String id = detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId();
EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetailAsso(id);
if (null != vo && "已结算".equals(vo.getSettleStatus()) || "结算中".equals(vo.getSettleStatus())){
if (null != vo && ("已结算".equals(vo.getSettleStatus()) || "结算中".equals(vo.getSettleStatus()))){
return R.failed("已结算或结算中的投保记录不可撤回");
}
try {
......@@ -9696,7 +9705,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//未结算更新自动化测的状态为待派单 temployeeinsurancepre
employeeInsurancePreMapper.delete(Wrappers.<TEmployeeInsurancePre>query().lambda().eq(TEmployeeInsurancePre::getInsurancesId,detail.getId()));
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
updateWrapper.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING);
employeeInsurancePreMapper.update(null,updateWrapper);
} catch (Exception e) {
return R.failed("撤回异常:"+e.getMessage());
}
......@@ -9721,25 +9733,42 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
if (Common.isNotNull(list)){
List<String> idStrs = new ArrayList<>();
for (TInsuranceDetail detail:list){
idStrs.add(detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId());
}
//list转为MAP id 为 key
Map<String,TInsuranceDetail> map = list.stream().collect(Collectors.toMap(TInsuranceDetail::getId, v -> v));
List<EkpSettleStatusVo> voList = ekpSettleService.getSettleStatusFromEkpAssoByIds(list.stream()
.map(TInsuranceDetail::getId).distinct().collect(Collectors.toList()));
List<EkpSettleStatusVo> voList = ekpSettleService.getSettleStatusFromEkpAssoByIds(idStrs);
if (Common.isNotNull(voList)){
//如果EKP对应提前缴费的预估数据已结算或已垫付则HRO商险派单状态同步为待投保
List<TInsuranceDetail> updateList = new ArrayList<>();
// 自动化测需要同步更新为待投保
List<String> ids = new ArrayList<>();
TInsuranceDetail detail = null;
TInsuranceDetail detailOld = null;
String detailId = null;
for (EkpSettleStatusVo vo : voList){
if (("已收".equals(vo.getPaymentStatus())
|| "垫付".equals(vo.getPaymentStatus()))
&& map.containsKey(vo.getDetailId())){
detail = map.get(vo.getDetailId());
detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND));
detail.setPaymentStatus(CommonConstants.ONE_STRING);
updateList.add(detail);
ids.add(vo.getDetailId());
if (null != vo.getDetailId() && vo.getDetailId().length() > 19){
detailId = vo.getDetailId().substring(0,19);
if (("已收".equals(vo.getPaymentStatus())
|| "垫付".equals(vo.getPaymentStatus()))
&& map.containsKey(detailId)){
detail = map.get(detailId);
detail.setPaymentStatus(CommonConstants.ONE_STRING);
if (null != detail){
detailOld = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailOld);
detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND));
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setUpdateTime(LocalDateTime.now());
detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保");
updateList.add(detail);
ids.add(detailId);
}
}
}
}
if (Common.isNotNull(updateList)){
......@@ -9749,7 +9778,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//通过ids 更新自动化测状态processStatus为待投保
LambdaUpdateWrapper<TEmployeeInsurancePre> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.in(TEmployeeInsurancePre::getInsurancesId, ids)
.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.SEVEN_STRING);
.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.THREE_STRING);
employeeInsurancePreMapper.update(null, updateDiyInfoWrapper);
}
}
......@@ -9771,26 +9800,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public void callBackInsuranceBuyHandleStatusSub(EkpStatusParamVo vo) {
try {
//根据结算单号获取明细id和结算状态
List<EkpInsuranceViewVo> viewVoList;
TInsuranceDetail detail;
viewVoList = ekpSettleService.selectViewBySettleNo(vo.getSettleNo(), vo.getPayFlag());
if (viewVoList != null && !viewVoList.isEmpty()) {
String insuranceId;
List<String> detailIds = null;
if (null != vo && Common.isNotNull(vo.getDetailIds())){
detailIds = Arrays.asList(vo.getDetailIds().split(CommonConstants.COMMA_STRING));
}
if (detailIds != null && !detailIds.isEmpty()) {
List<String> insuranceIds = new ArrayList<>();
for (EkpInsuranceViewVo viewVo : viewVoList) {
TInsuranceDetail detailOld = null;
TInsuranceDetail detail = null;
for (String id : detailIds) {
//获取所有的明细id
if (Common.isNotNull(viewVo.getId())) {
insuranceId = viewVo.getId().substring(0, 19);
detail = baseMapper.selectById(insuranceId);
if (Common.isNotNull(id)) {
detail = baseMapper.selectById(id);
detailOld = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailOld);
//见费出单且是待投保状态 直接回退到 待缴费 并清空缴费时间和缴费状态
if (Common.isNotNull(detail)
&& CommonConstants.ONE_STRING.equals(detail.getBuyHandleStatus())
&& CommonConstants.ONE_INT == detail.getBuyHandleStatus().intValue()
&& CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())) {
detail.setPaymentTime(CommonConstants.EMPTY_STRING);
detail.setPaymentStatus(CommonConstants.ZERO_STRING);
detail.setBuyHandleStatus(CommonConstants.SIX_INT);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(detail);
insuranceIds.add(insuranceId);
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费");
insuranceIds.add(id);
}
}
}
......@@ -9798,8 +9833,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//通过ids 更新自动化测状态processStatus为待投保
LambdaUpdateWrapper<TEmployeeInsurancePre> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.in(TEmployeeInsurancePre::getInsurancesId, insuranceIds)
.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING);
.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.SEVEN_STRING);
employeeInsurancePreMapper.update(null, updateDiyInfoWrapper);
LambdaUpdateWrapper<TInsurancePreRenewDetail> updateReNewInfoWrapper = new LambdaUpdateWrapper<>();
updateReNewInfoWrapper.in(TInsurancePreRenewDetail::getInsurancesId, insuranceIds)
.set(TInsurancePreRenewDetail::getProcessStatus,CommonConstants.SEVEN_STRING);
tInsurancePreRenewDetailMapper.update(null, updateReNewInfoWrapper);
}
}
} catch (Exception e) {
......
......@@ -379,10 +379,10 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
List<InsuranceAutoParam> autoAddParamList = this.getInsuranceAutoParamList(paramList, batchParamList, replaceParamList);
if (autoAddParamList.isEmpty()) {
LambdaUpdateWrapper<TInsurancePreRenewDetail> updateWrapper = new LambdaUpdateWrapper<>();
/*LambdaUpdateWrapper<TInsurancePreRenewDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TInsurancePreRenewDetail::getId, pushIdList)
.set(TInsurancePreRenewDetail::getProcessStatus, CommonConstants.THREE_STRING);
this.update(updateWrapper);
this.update(updateWrapper);*/
} else {
// 将 autoAddParamList 中的id等信息提取出来,放入一个 Set 中
Set<String> autoAddParamSet = new HashSet<>();
......
......@@ -17,9 +17,12 @@ import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpInsurancesInfoMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancePreRenewDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TUpdateStatusErrorMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TBusinessOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleCancelService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService;
......@@ -78,7 +81,14 @@ public class DoJointInsuranceTask {
@Autowired
private EkpInsurancesInfoMapper insurancesInfoMapper;
@Autowired
private TEmployeeInsurancePreMapper tEmployeeInsurancePreMapper;
@Autowired
private TInsurancePreRenewDetailMapper tInsurancePreRenewDetailMapper;
@Autowired
private TBusinessOperateService tBusinessOperateService;
/**
* @Description: 商险明细推送
* @Author: huyc
......@@ -240,6 +250,8 @@ public class DoJointInsuranceTask {
detail = insuranceDetailMapper.selectById(insuranceId);
log.error("更新状态商险ID:"+detail.getId() +"|"+insuranceId);
if (Common.isNotNull(detail)) {
TInsuranceDetail detailOld = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailOld);
//判断订单类型是预估还是实缴
if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(viewVo.getOrderType())) {
//判断是收入还是支出结算单号
......@@ -254,19 +266,37 @@ public class DoJointInsuranceTask {
if (CommonConstants.ZERO_STRING.equals(vo.getPayFlag())) {
detail.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
// 这里就是EKP 同步已收及垫付后同步HRO的特殊处理
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd()) && "0".equals(vo.getPaymentStatsus())){
if (CommonConstants.ZERO_STRING.equals(detail.getPaymentStatus())
&&("0".equals(viewVo.getIncomeCollectFlag())
|| "2".equals(viewVo.getIncomeCollectFlag()))){
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND));
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
//添加日期
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保");
//更新自动化
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
updateWrapper.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.THREE_STRING);
tEmployeeInsurancePreMapper.update(null, updateWrapper);
LambdaUpdateWrapper<TInsurancePreRenewDetail> updateReNewInfoWrapper = new LambdaUpdateWrapper<>();
updateReNewInfoWrapper.eq(TInsurancePreRenewDetail::getInsurancesId, detail.getId())
.set(TInsurancePreRenewDetail::getProcessStatus,CommonConstants.SEVEN_STRING);
tInsurancePreRenewDetailMapper.update(null, updateReNewInfoWrapper);
}
if (CommonConstants.ONE_STRING.equals(detail.getPaymentStatus())
&& "1".equals(viewVo.getIncomeCollectFlag())){
detail.setBuyHandleStatus(CommonConstants.SIX_INT);
detail.setPaymentStatus(CommonConstants.ZERO_STRING);
detail.setPaymentTime(CommonConstants.EMPTY_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费");
}
}
} else {
......
......@@ -13,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
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.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoPreService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo;
......@@ -402,4 +403,15 @@ public class TDispatchInfoPreController {
public void pushDisConfrimSocial() {
tDispatchInfoPreService.pushDisConfrimSocial();
}
/**
* 通过id查询社保或公积金待签订任务记录表
* @param registId
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " )
public R<TDispatchInfoPre> getInfoByRegistId(@RequestParam("registId" ) String registId, @RequestParam("type" ) String type) {
return tDispatchInfoPreService.getInfoByRegistId(registId,type);
}
}
......@@ -106,4 +106,7 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
R confirmFund(List<String> idList);
Boolean getFundPreStatus(String id);
R<TDispatchInfoPre> getInfoByRegistId(String registId,String type);
}
......@@ -1062,4 +1062,11 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
}
}
@Override
public R<TDispatchInfoPre> getInfoByRegistId(String registId,String type) {
if (Common.isEmpty(registId) || Common.isEmpty(type)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR);
}
return R.ok(baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda().eq(TDispatchInfoPre::getTypeSub,type).eq(TDispatchInfoPre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL)));
}
}
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