Commit a6a966a4 authored by fangxinjiang's avatar fangxinjiang

EKP项目是否BPO结算模式字段同步-fxj

parent 0118f33d
...@@ -1639,7 +1639,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1639,7 +1639,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (Common.isNotNull(oldInsurance.getProcessStatus()) if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus()) && (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus()) || CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) { || CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SEVEN_STRING.equals(oldInsurance.getProcessStatus()))) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING); oldInsurance.setModelType(CommonConstants.FOUR_STRING);
} }
} }
......
...@@ -412,4 +412,36 @@ public class InsuranceDetailVO implements Serializable { ...@@ -412,4 +412,36 @@ public class InsuranceDetailVO implements Serializable {
*/ */
@Schema(description = "是否地市自购") @Schema(description = "是否地市自购")
private String isAdress; private String isAdress;
/**
* 预估缴费状态 0待缴费、1已缴费
*/
@Schema(description = "预估缴费状态 0待缴费、1已缴费")
private String paymentStatus;
/**
* 缴费时间: EKP已收/已垫付 更新时间, 退单或撤销匹配 清空时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "缴费时间")
private String paymentTime;
/**
* 是否见费出单 0是 1 否 (新增或批增且启用‘是否启用BPO结算模式’且险种配置‘是否见费出单’为是时 此字段为是,否则为否)
*/
@Schema(description = "是否见费出单")
private String isJfcd;
/**
* 购买周期 (格式:4个月/117天)
*/
@Schema(description = "购买周期")
private String purchaseCycle;
/**
* 预计办理日期
*/
@Schema(description = "预计办理日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private LocalDate preHandleTime;
} }
...@@ -18,6 +18,11 @@ import java.util.List; ...@@ -18,6 +18,11 @@ import java.util.List;
@Schema(description = "投保列表请求参数") @Schema(description = "投保列表请求参数")
public class InsuranceListParam extends BaseEntity { public class InsuranceListParam extends BaseEntity {
/**
* 派单ID
*/
@Schema(description = "派单ID")
private String id;
/** /**
* 项目编码 * 项目编码
*/ */
......
...@@ -1011,7 +1011,7 @@ public class TInsuranceDetailController { ...@@ -1011,7 +1011,7 @@ public class TInsuranceDetailController {
if (detail == null) { if (detail == null) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
if (!CommonConstants.SIX_STRING.equals(detail.getBuyHandleStatus())){ if (null != detail.getBuyHandleStatus() && CommonConstants.SIX_INT != detail.getBuyHandleStatus().intValue()){
return R.failed("请选择待缴费状态的投保记录!"); return R.failed("请选择待缴费状态的投保记录!");
} }
return tInsuranceDetailService.callBack(detail); return tInsuranceDetailService.callBack(detail);
......
...@@ -87,4 +87,6 @@ public interface EkpSettleMapper { ...@@ -87,4 +87,6 @@ public interface EkpSettleMapper {
List<EkpSettleStatusVo> getBalanceByInsuranceId(@Param("id")String id); List<EkpSettleStatusVo> getBalanceByInsuranceId(@Param("id")String id);
void deleteEkpInsuranceDetailAsso(@Param("id")String id); void deleteEkpInsuranceDetailAsso(@Param("id")String id);
void callBackBalance(@Param("id")String id);
} }
...@@ -80,4 +80,6 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> { ...@@ -80,4 +80,6 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> {
List<EkpSettleStatusVo> getBalanceByInsuranceId(String id); List<EkpSettleStatusVo> getBalanceByInsuranceId(String id);
void deleteEkpInsuranceDetailAsso(String id); void deleteEkpInsuranceDetailAsso(String id);
void callBackBalance(String id);
} }
...@@ -155,4 +155,16 @@ public class EkpSettleServiceImpl implements EkpSettleService { ...@@ -155,4 +155,16 @@ public class EkpSettleServiceImpl implements EkpSettleService {
public void deleteEkpInsuranceDetailAsso(String id) { public void deleteEkpInsuranceDetailAsso(String id) {
ekpSettleMapper.deleteEkpInsuranceDetailAsso(id); ekpSettleMapper.deleteEkpInsuranceDetailAsso(id);
} }
/**
* @Author fxj
* @Description 见费出单直接删除实缴与预估的差额
* @Date 15:45 2026/1/22
* @Param
* @return
**/
@Override
public void callBackBalance(String id) {
ekpSettleMapper.callBackBalance(id);
}
} }
...@@ -436,6 +436,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -436,6 +436,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(null == user ? "1" : user.getId()); detail.setCreateBy(null == user ? "1" : user.getId());
detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname()); detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname());
detail.setId(RandomStringUtils.randomNumeric(19));
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
//生成收入数据 //生成收入数据
...@@ -511,7 +512,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -511,7 +512,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private void initJfcdInfo(Date preDispatchDate, TInsuranceDetail detail,List<TInsuranceSettle> settleList) { private void initJfcdInfo(Date preDispatchDate, TInsuranceDetail detail,List<TInsuranceSettle> settleList) {
//购买周期 //购买周期
String purchaseCycle = null; String purchaseCycle = "0";
LocalDate buyStartDate; LocalDate buyStartDate;
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//计算预计办理日期:若派单当日为工作日3点20之前,则预计办理日期为派单日期,若为3点20之后或派单日为非工作日,则预计办理日期为派单日后最近的一个工作日 //计算预计办理日期:若派单当日为工作日3点20之前,则预计办理日期为派单日期,若为3点20之后或派单日为非工作日,则预计办理日期为派单日后最近的一个工作日
...@@ -524,33 +525,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -524,33 +525,30 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//计算购买周期:购买周期=保单结束日期-参保开始日期+1(天数);购买周期=保单结束日期-参保开始日期+1(天数)推算出月数; //计算购买周期:购买周期=保单结束日期-参保开始日期+1(天数);购买周期=保单结束日期-参保开始日期+1(天数)推算出月数;
//按天计费方式 //按天计费方式
if (CommonConstants.ZERO_STRING.equals(detail.getBillingType())){ if (null != detail.getBillingType() && CommonConstants.ZERO_INT == detail.getBillingType().intValue()){
purchaseCycle = String.valueOf(LocalDateUtil.betweenDay(buyStartDate.toString(), detail.getPolicyEnd().toString())+1); purchaseCycle = String.valueOf(LocalDateUtil.betweenDay(buyStartDate.toString(), detail.getPolicyEnd().toString())+1);
//按月计费方式
}else if (CommonConstants.ONE_STRING.equals(detail.getBillingType())){
purchaseCycle = String.valueOf(LocalDateUtil.betweenMonthTwo(buyStartDate.toString(), detail.getPolicyEnd().toString())+1);
}
//计算预计保费:根据计费方式、购买标准、购买天数/月数等计算: //计算预计保费:根据计费方式、购买标准、购买天数/月数等计算:
//“计费方式”为“按天”的,预估保费=购买周期天数/365*购买标准+5元; //“计费方式”为“按天”的,预估保费=购买周期天数/365*购买标准+5元;
//“计费方式”为“按月”的,预估保费=购买周期月数对应的费率*购买标准+5元 //“计费方式”为“按月”的,预估保费=购买周期月数对应的费率*购买标准+5元
//按天计费方式 //按天计费方式
if (CommonConstants.ZERO_STRING.equals(detail.getBillingType())){
detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard()) detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard())
.multiply(new BigDecimal(purchaseCycle)) .multiply(new BigDecimal(purchaseCycle))
.divide(new BigDecimal("365")) .divide(new BigDecimal("365"), 2, RoundingMode.HALF_UP)
.add(new BigDecimal("5.00"))); .add(new BigDecimal("5.00")));
//按月计费方式 //按月计费方式
}else if (CommonConstants.ONE_STRING.equals(detail.getBillingType())){ }else if (null != detail.getBillingType() && CommonConstants.ONE_INT == detail.getBillingType().intValue()){
purchaseCycle = String.valueOf(LocalDateUtil.betweenMonthTwo(buyStartDate.toString(), detail.getPolicyEnd().toString())+1);
detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard()) detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard())
.multiply(new BigDecimal(purchaseCycle)) .multiply(new BigDecimal(purchaseCycle))
.multiply(null== detail.getRate()?BigDecimal.ZERO: detail.getRate()) .multiply(null== detail.getRate()?BigDecimal.ZERO: detail.getRate())
.add(new BigDecimal("5.00"))); .add(new BigDecimal("5.00")));
} }
//购买周期 //购买周期
detail.setPurchaseCycle(purchaseCycle); detail.setPurchaseCycle(purchaseCycle);
//预估缴费状态 0待缴费、1已缴费 //预估缴费状态 0待缴费、1已缴费
detail.setPaymentStatus(CommonConstants.ZERO_STRING); detail.setPaymentStatus(CommonConstants.ZERO_STRING);
detail.setBuyHandleStatus(CommonConstants.SIX_INT);
//保费存储 //保费存储
TInsuranceSettle settle = new TInsuranceSettle(); TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId()); settle.setInsDetailId(detail.getId());
...@@ -1178,10 +1176,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1178,10 +1176,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
//购买周期 //购买周期
String buyCycle = month + "个月/" + day + "天"; //计费方式(0:按天,1:按月)
insuranceDetailVO.setBuyCycle(buyCycle); if (null != insuranceDetailVO.getBillingType()){
if (CommonConstants.ZERO_INT == insuranceDetailVO.getBillingType().intValue()){
insuranceDetailVO.setPurchaseCycle(insuranceDetailVO.getPurchaseCycle() + "天");
}else if (CommonConstants.ONE_INT == insuranceDetailVO.getBillingType().intValue()){
insuranceDetailVO.setPurchaseCycle(insuranceDetailVO.getPurchaseCycle() + "个月");
}
}
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算 //如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == insuranceDetailVO.getBuyType()){ /*if (CommonConstants.THREE_INT == insuranceDetailVO.getBuyType()){
if (Objects.isNull(insuranceDetailVO.getPolicyEffect())){ if (Objects.isNull(insuranceDetailVO.getPolicyEffect())){
insuranceDetailVO.setBuyCycle(null); insuranceDetailVO.setBuyCycle(null);
}else { }else {
...@@ -1190,7 +1196,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1190,7 +1196,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
buyCycle = month + "个月/" + day + "天"; buyCycle = month + "个月/" + day + "天";
insuranceDetailVO.setBuyCycle(buyCycle); insuranceDetailVO.setBuyCycle(buyCycle);
} }
} }*/
//派单类型 //派单类型
insuranceDetailVO.setDistributeType(insuranceDetailVO.getReduceHandleStatus() == null?insuranceDetailVO.getBuyType():CommonConstants.FIVE_INT); insuranceDetailVO.setDistributeType(insuranceDetailVO.getReduceHandleStatus() == null?insuranceDetailVO.getBuyType():CommonConstants.FIVE_INT);
//派单状态 //派单状态
...@@ -1787,11 +1793,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1787,11 +1793,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//实缴结算状态 //实缴结算状态
String actualStatus = settleVo.getActualStatus(); String actualStatus = settleVo.getActualStatus();
String pushResult = null; String pushResult = null;
//如果是见费出单,投保中,推送作废 //如果是见费出单,投保中,推送作废 2026-01-22 v1.7.19
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//红冲预估推送 //红冲预估推送
pushResult = pushEstimate(detail, CommonConstants.THREE_INT); pushResult = pushEstimate(detail, CommonConstants.THREE_INT);
//已投保 需要处理实缴和差额数据 //已投保 需要处理实缴和差额数据 (已支出或支出中禁止退保)
if (CommonConstants.THREE_STRING.equals(detail.getBuyHandleStatus())){ if (CommonConstants.THREE_STRING.equals(detail.getBuyHandleStatus())){
//直接删除实缴及实缴与预估的差额 //直接删除实缴及实缴与预估的差额
ekpSettleService.deleteEkpInsuranceDetailAsso(detail.getId()); ekpSettleService.deleteEkpInsuranceDetailAsso(detail.getId());
...@@ -1859,7 +1865,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1859,7 +1865,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operateList.add(e); operateList.add(e);
} }
}); });
//如果是见费出单,投保中,推送作废 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);
}else {
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING); 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);
} }
//更新状态 //更新状态
...@@ -2500,24 +2511,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2500,24 +2511,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
//实缴导入时根据条件取生成差额数据,其他情况会在推送数据时去规整 对应的应收和应支 //实缴导入时根据条件取生成差额数据,其他情况会在推送数据时去规整 对应的应收和应支
if ("是".equals(detail.getIsJfcd())) { if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())) {
//查询下是否已经生成了差额,生成的差额的金额 要在本次生成的差额里面扣除,也就是 要加到预估金额里面去 //登记保单保费时为已投保,已投保无法退回,故直接删除差额重新生成即可
List<EkpSettleStatusVo> exists = ekpSettleService.getBalanceByInsuranceId(detail.getId()); ekpSettleService.callBackBalance(detail.getId());
BigDecimal balance = BigDecimal.ZERO; tInsuranceSettleService.remove(Wrappers.<TInsuranceSettle>query().lambda()
if (CollectionUtils.isNotEmpty(exists)){ .eq(TInsuranceSettle::getInsDetailId, detail.getId())
for (EkpSettleStatusVo vo : exists){ .eq(TInsuranceSettle::getSettleType, CommonConstants.TWO_INT));
if (Common.isNotNull(vo.getPaymentBalance())){
balance = balance.add(BigDecimal.valueOf(vo.getPaymentBalance()));
}
}
}
TInsuranceSettle settleNew = new TInsuranceSettle(); TInsuranceSettle settleNew = new TInsuranceSettle();
settleNew.setInsDetailId(detail.getId()); settleNew.setInsDetailId(detail.getId());
settleNew.setSettleType(CommonConstants.TWO_INT); settleNew.setSettleType(CommonConstants.TWO_INT);
settleNew.setSettleHandleStatus(CommonConstants.ONE_STRING); settleNew.setSettleHandleStatus(CommonConstants.ONE_STRING);
settleNew.setActualPremium(bigDecimalAct); settleNew.setActualPremium(bigDecimalAct);
settleNew.setIsEstimatePush(CommonConstants.ZERO_INT); settleNew.setIsEstimatePush(CommonConstants.ZERO_INT);
settleNew.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getEstimatePremium(),balance)); settleNew.setEstimatePremium(detail.getEstimatePremium());
//调完ekp接口才会是1 //调完ekp接口才会是1
settleNew.setCreateTime(LocalDateTime.now()); settleNew.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settleNew); tInsuranceSettleService.save(settleNew);
...@@ -3001,13 +3007,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3001,13 +3007,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param paramList * @param paramList
* @return {@link Map<String, List<InsuranceAddParam>>} * @return {@link Map<String, List<InsuranceAddParam>>}
*/ */
private Map<String,List<InsuranceAddParam>> addInsuranceCheck(List<InsuranceAddParam> paramList,YifuUser user,boolean autoFlag, private Map<String,List<InsuranceAddParam>> addInsuranceCheck(List<InsuranceAddParam> paramList,
YifuUser user,boolean autoFlag,
Map<String,TSettleDomainSelectVo> mapSelectVo){ Map<String,TSettleDomainSelectVo> mapSelectVo){
//1.9.11超管无需校验项目权限 //1.9.11超管无需校验项目权限
List<String> deptNoList = new ArrayList<>(); List<String> deptNoList = new ArrayList<>();
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) { if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
//deptNoList = getDeptNoList(user.getId()); //deptNoList = getDeptNoList(user.getId());
deptNoList = getDeptNoMapAndDeptNo(user.getId(),mapSelectVo); deptNoList = getDeptNoMapAndDeptNo(user.getId());
} }
Map<String,List<InsuranceAddParam>> map = new HashMap<>(); Map<String,List<InsuranceAddParam>> map = new HashMap<>();
List<InsuranceAddParam> listResult = new ArrayList<>(); List<InsuranceAddParam> listResult = new ArrayList<>();
...@@ -3019,10 +3026,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3019,10 +3026,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// List<InsuredListVo> listInProgress = new ArrayList<>(); // List<InsuredListVo> listInProgress = new ArrayList<>();
TInsuranceType insuranceType = null; TInsuranceType insuranceType = null;
TSettleDomainSelectVo settleDomainSelectVo = null; TSettleDomainSelectVo settleDomainSelectVo = null;
TSettleDomainSelectVo settleResult = null;
//定义外层循环标识,方便去重的时候跳出 //定义外层循环标识,方便去重的时候跳出
outer: outer:
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceAddParam param = distinctList.get(i); InsuranceAddParam param = distinctList.get(i);
if (!mapSelectVo.containsKey(param.getDeptNo())){
// 1. 查询项目信息获取客户信息
settleResult = archivesDaprUtil.selectDeptByNo(param.getDeptNo());
if (settleResult == null) {
param.setErrorMessage("项目编码[" + param.getDeptNo() + "]信息不存在");
listResult.add(param);
continue;
}else {
mapSelectVo.put(param.getDeptNo(),settleResult);
}
}
param.setBuyType(CommonConstants.ONE_INT); param.setBuyType(CommonConstants.ONE_INT);
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getEmpName())) { if (StringUtils.isBlank(param.getEmpName())) {
...@@ -3424,7 +3444,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3424,7 +3444,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(insuranceType) && if (Common.isNotNull(insuranceType) &&
Common.isNotNull(settleDomainSelectVo) && Common.isNotNull(settleDomainSelectVo) &&
CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) && CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) &&
CommonConstants.IS_TRUE.equals(settleDomainSelectVo.getBpoEnable())) { CommonConstants.IS_FALSE.equals(settleDomainSelectVo.getBpoEnable())) {
param.setIsJfcd(CommonConstants.ZERO_STRING); param.setIsJfcd(CommonConstants.ZERO_STRING);
} }
} }
...@@ -3437,7 +3457,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3437,7 +3457,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(insuranceType) && if (Common.isNotNull(insuranceType) &&
Common.isNotNull(settleDomainSelectVo) && Common.isNotNull(settleDomainSelectVo) &&
CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) && CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) &&
CommonConstants.IS_TRUE.equals(settleDomainSelectVo.getBpoEnable())) { CommonConstants.IS_FALSE.equals(settleDomainSelectVo.getBpoEnable())) {
param.setIsJfcd(CommonConstants.ZERO_STRING); param.setIsJfcd(CommonConstants.ZERO_STRING);
} }
} }
...@@ -3601,7 +3621,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3601,7 +3621,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//1.9.11超管无需校验项目权限 //1.9.11超管无需校验项目权限
List<String> deptNoList = new ArrayList<>(); List<String> deptNoList = new ArrayList<>();
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) { if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
deptNoList = getDeptNoMapAndDeptNo(user.getId(),mapSelectVo); deptNoList = getDeptNoMapAndDeptNo(user.getId());
} }
Map<String,List<InsuranceBatchParam>> map = new HashMap<>(); Map<String,List<InsuranceBatchParam>> map = new HashMap<>();
List<InsuranceBatchParam> listResult = new ArrayList<>(); List<InsuranceBatchParam> listResult = new ArrayList<>();
...@@ -3611,10 +3631,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3611,10 +3631,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, String> insurAutoMap = getBatchInsurAutoMap(paramList); Map<String, String> insurAutoMap = getBatchInsurAutoMap(paramList);
TInsuranceType insuranceType = null; TInsuranceType insuranceType = null;
TSettleDomainSelectVo settleDomainSelectVo = null; TSettleDomainSelectVo settleDomainSelectVo = null;
TSettleDomainSelectVo settleResult = null;
//定义外层循环标识,方便去重的时候跳出 //定义外层循环标识,方便去重的时候跳出
outer: outer:
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceBatchParam param = distinctList.get(i); InsuranceBatchParam param = distinctList.get(i);
if (!mapSelectVo.containsKey(param.getDeptNo())){
// 1. 查询项目信息获取客户信息
settleResult = archivesDaprUtil.selectDeptByNo(param.getDeptNo());
if (settleResult == null) {
param.setErrorMessage("项目编码[" + param.getDeptNo() + "]信息不存在");
listResult.add(param);
continue;
}else {
mapSelectVo.put(param.getDeptNo(),settleResult);
}
}
param.setBuyType(CommonConstants.THREE_INT); param.setBuyType(CommonConstants.THREE_INT);
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getDeptNo())){ if (StringUtils.isBlank(param.getDeptNo())){
...@@ -3999,6 +4032,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3999,6 +4032,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
} }
if (null != mapSelectVo && mapSelectVo.size() > 0){
settleDomainSelectVo = mapSelectVo.get(param.getDeptNo());
}
//初始化是否见费出单字段值 //初始化是否见费出单字段值
initJfcdBatch(insuranceType, settleDomainSelectVo, param); initJfcdBatch(insuranceType, settleDomainSelectVo, param);
listSuccess.add(param); listSuccess.add(param);
...@@ -8239,7 +8275,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8239,7 +8275,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param userId * @param userId
* @return {@link List< String>} * @return {@link List< String>}
*/ */
public List<String> getDeptNoMapAndDeptNo(String userId,Map<String,TSettleDomainSelectVo> mapSelectVo){ public List<String> getDeptNoMapAndDeptNo(String userId){
List<String> deptList = new ArrayList<>(16); List<String> deptList = new ArrayList<>(16);
try{ try{
R<TSettleDomainListVo> settleDomainList = archivesDaprUtil.getSettleDomainIdsByUserId(userId); R<TSettleDomainListVo> settleDomainList = archivesDaprUtil.getSettleDomainIdsByUserId(userId);
...@@ -8247,10 +8283,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8247,10 +8283,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TSettleDomainListVo data = settleDomainList.getData(); TSettleDomainListVo data = settleDomainList.getData();
if (Optional.ofNullable(data).isPresent()){ if (Optional.ofNullable(data).isPresent()){
deptList = data.getDeptNos(); deptList = data.getDeptNos();
if (Optional.ofNullable(data.getMapSelectVo()).isPresent()){
mapSelectVo.clear();
mapSelectVo.putAll(data.getMapSelectVo());
}
} }
} }
}catch (Exception e){ }catch (Exception e){
...@@ -9633,7 +9665,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9633,7 +9665,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String id = detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId(); String id = detail.getId()+CommonConstants.DOWN_LINE_STRING+detail.getDefaultSettleId();
EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetailAsso(id); 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("已结算的投保记录不可撤回"); return R.failed("已结算或结算中的投保记录不可撤回");
} }
try { try {
//未结算删除 EKP 的预估数据 //未结算删除 EKP 的预估数据
...@@ -9642,6 +9674,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9642,6 +9674,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
baseMapper.deleteById(detail.getId()); baseMapper.deleteById(detail.getId());
//未结算删除 HRO的预估结算数据 //未结算删除 HRO的预估结算数据
tInsuranceSettleService.removeById(detail.getDefaultSettleId()); tInsuranceSettleService.removeById(detail.getDefaultSettleId());
//查询并删除收入信息
TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(detail.getId());
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& !detailList.getData().getDetailList().isEmpty()){
List<TIncomeDetail> incomeDetailList = detailList.getData().getDetailList();
BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : incomeDetailList) {
socialDaprUtils.deleteById(income);
}
}
//未结算更新自动化测的状态为待派单 temployeeinsurancepre //未结算更新自动化测的状态为待派单 temployeeinsurancepre
employeeInsurancePreMapper.delete(Wrappers.<TEmployeeInsurancePre>query().lambda().eq(TEmployeeInsurancePre::getInsurancesId,detail.getId())); employeeInsurancePreMapper.delete(Wrappers.<TEmployeeInsurancePre>query().lambda().eq(TEmployeeInsurancePre::getInsurancesId,detail.getId()));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -93,6 +93,9 @@ public class DoJointInsuranceTask { ...@@ -93,6 +93,9 @@ public class DoJointInsuranceTask {
if (type == CommonConstants.ONE_INT) { if (type == CommonConstants.ONE_INT) {
settle.setIsEstimatePush(CommonConstants.ONE_INT); settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now()); settle.setEstimatePushTime(LocalDateTime.now());
}else if (type == CommonConstants.SEVEN_INT) {
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
} else { } else {
settle.setIsActualPush(CommonConstants.ONE_INT); settle.setIsActualPush(CommonConstants.ONE_INT);
settle.setActualPushTime(LocalDateTime.now()); settle.setActualPushTime(LocalDateTime.now());
......
...@@ -110,6 +110,9 @@ ...@@ -110,6 +110,9 @@
delete from ekp_insurances_info where fd_3b0a5743acab7e like concat(#{id},'%') and fd_jfcd='是' and (fd_3adfe6af71a1cc = '差额' or fd_3adfe6af71a1cc = '实缴') delete from ekp_insurances_info where fd_3b0a5743acab7e like concat(#{id},'%') and fd_jfcd='是' and (fd_3adfe6af71a1cc = '差额' or fd_3adfe6af71a1cc = '实缴')
</delete> </delete>
<delete id="callBackBalance">
delete from ekp_insurances_info where fd_3b0a5743acab7e like concat(#{id},'%') and fd_jfcd='是' and fd_3adfe6af71a1cc = '差额'
</delete>
<select id="getDeptSettle" resultMap="BaseDeptResultMap"> <select id="getDeptSettle" resultMap="BaseDeptResultMap">
select select
<include refid="Base_Column_Dept"></include> <include refid="Base_Column_Dept"></include>
......
...@@ -71,6 +71,14 @@ ...@@ -71,6 +71,14 @@
<result property="spaySettleFlag" column="SPAY_COLLECT_FLAG"/> <result property="spaySettleFlag" column="SPAY_COLLECT_FLAG"/>
<result property="spayCollectFlag" column="SPAY_SETTLE_FLAG"/> <result property="spayCollectFlag" column="SPAY_SETTLE_FLAG"/>
<result property="isAdress" column="IS_ADRESS" jdbcType="VARCHAR"/> <result property="isAdress" column="IS_ADRESS" jdbcType="VARCHAR"/>
<result property="paymentStatus" column="PAYMENT_STATUS" jdbcType="VARCHAR"/>
<result property="paymentTime" column="PAYMENT_TIME" jdbcType="VARCHAR"/>
<result property="isJfcd" column="IS_JFCD" jdbcType="VARCHAR"/>
<result property="purchaseCycle" column="PURCHASE_CYCLE" jdbcType="VARCHAR"/>
<result property="preHandleTime" column="PRE_HANDLE_TIME" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<resultMap id="UpdateMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceUpdateVO"> <resultMap id="UpdateMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceUpdateVO">
<id property="id" column="ID" jdbcType="VARCHAR"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
...@@ -90,7 +98,7 @@ ...@@ -90,7 +98,7 @@
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK, IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,BPO_FLAG, CREATE_BY,CREATE_NAME,CREATE_TIME,BPO_FLAG,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME, UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME,
DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,IS_ADRESS DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,IS_ADRESS,PAYMENT_STATUS,PAYMENT_TIME,IS_JFCD,PURCHASE_CYCLE,PRE_HANDLE_TIME
</sql> </sql>
...@@ -125,12 +133,16 @@ ...@@ -125,12 +133,16 @@
a.IS_JFCD as isJfcd, a.IS_JFCD as isJfcd,
a.PURCHASE_CYCLE as purchaseCycle, a.PURCHASE_CYCLE as purchaseCycle,
a.BILLING_TYPE as billingType, a.BILLING_TYPE as billingType,
a.PRE_HANDLE_TIME as preHandleTime a.PRE_HANDLE_TIME as preHandleTime,
a.ESTIMATE_PREMIUM as estimatePremium
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 where a.DELETE_FLAG = 0
<if test="param.isEffect != null"> <if test="param.isEffect != null">
and a.IS_EFFECT = #{param.isEffect} and a.IS_EFFECT = #{param.isEffect}
</if> </if>
<if test="param.id != null">
and a.id = #{param.id}
</if>
<if test="param.unitName != null and param.unitName.trim() != ''"> <if test="param.unitName != null and param.unitName.trim() != ''">
and a.UNIT_NAME like concat(replace(replace(#{param.unitName},'_','\_'),'%','\%'),'%') and a.UNIT_NAME like concat(replace(replace(#{param.unitName},'_','\_'),'%','\%'),'%')
</if> </if>
...@@ -191,10 +203,10 @@ ...@@ -191,10 +203,10 @@
<if test="param.isJfcd != null and param.isJfcd.trim() != ''"> <if test="param.isJfcd != null and param.isJfcd.trim() != ''">
and a.IS_JFCD = #{param.isJfcd} and a.IS_JFCD = #{param.isJfcd}
</if> </if>
<if test="param.estimatePremiumStart != null and param.estimatePremiumStart.trim() != '' "> <if test="param.estimatePremiumStart != null">
and a.ESTIMATE_PREMIUM <![CDATA[ >= ]]> #{param.estimatePremiumStart} and a.ESTIMATE_PREMIUM <![CDATA[ >= ]]> #{param.estimatePremiumStart}
</if> </if>
<if test="param.estimatePremiumEnd != null and param.estimatePremiumEnd.trim() != ''"> <if test="param.estimatePremiumEnd != null">
and a.ESTIMATE_PREMIUM <![CDATA[ <= ]]> #{param.estimatePremiumEnd} and a.ESTIMATE_PREMIUM <![CDATA[ <= ]]> #{param.estimatePremiumEnd}
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''"> <if test="param.authSql != null and param.authSql.trim() != ''">
...@@ -231,12 +243,16 @@ ...@@ -231,12 +243,16 @@
a.IS_JFCD as isJfcd, a.IS_JFCD as isJfcd,
a.PURCHASE_CYCLE as purchaseCycle, a.PURCHASE_CYCLE as purchaseCycle,
a.PRE_HANDLE_TIME as preHandleTime, a.PRE_HANDLE_TIME as preHandleTime,
a.ESTIMATE_PREMIUM as estimatePremium a.ESTIMATE_PREMIUM as estimatePremium,
a.BILLING_TYPE as billingType
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 where a.DELETE_FLAG = 0
<if test="param.isEffect != null"> <if test="param.isEffect != null">
and a.IS_EFFECT = #{param.isEffect} and a.IS_EFFECT = #{param.isEffect}
</if> </if>
<if test="param.id != null">
and a.id = #{param.id}
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo} and a.DEPT_NO = #{param.deptNo}
</if> </if>
...@@ -288,10 +304,10 @@ ...@@ -288,10 +304,10 @@
<if test="param.isJfcd != null and param.isJfcd.trim() != ''"> <if test="param.isJfcd != null and param.isJfcd.trim() != ''">
and a.IS_JFCD = #{param.isJfcd} and a.IS_JFCD = #{param.isJfcd}
</if> </if>
<if test="param.estimatePremiumStart != null and param.estimatePremiumStart.trim() != '' "> <if test="param.estimatePremiumStart != null">
and a.ESTIMATE_PREMIUM <![CDATA[ >= ]]> #{param.estimatePremiumStart} and a.ESTIMATE_PREMIUM <![CDATA[ >= ]]> #{param.estimatePremiumStart}
</if> </if>
<if test="param.estimatePremiumEnd != null and param.estimatePremiumEnd.trim() != ''"> <if test="param.estimatePremiumEnd != null">
and a.ESTIMATE_PREMIUM <![CDATA[ <= ]]> #{param.estimatePremiumEnd} and a.ESTIMATE_PREMIUM <![CDATA[ <= ]]> #{param.estimatePremiumEnd}
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''"> <if test="param.authSql != null and param.authSql.trim() != ''">
...@@ -419,7 +435,7 @@ ...@@ -419,7 +435,7 @@
a.REFUND_ID as refundId, a.REFUND_ID as refundId,
a.EXPIRE_REMARK, a.EXPIRE_REMARK,
a.EXPIRE_IGNORE_FLAG, a.EXPIRE_IGNORE_FLAG,
a.IS_ADRESS as isAdress a.IS_ADRESS as isAdress,PAYMENT_STATUS,PAYMENT_TIME,IS_JFCD,PURCHASE_CYCLE,PRE_HANDLE_TIME
from t_insurance_detail a from t_insurance_detail a
left join t_insurance_settle tis on a.DEFAULT_SETTLE_ID = tis.ID left join t_insurance_settle tis on a.DEFAULT_SETTLE_ID = tis.ID
where a.ID = #{id} where a.ID = #{id}
......
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