Commit cb40f4e1 authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent efc91385
......@@ -100,6 +100,9 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "档案所在地-市编号")
private String cityCode;
@Schema(description = "商险是否已购买 0 是 1 否")
private String insuranceIsBuy;
@Schema(description = "档案所在地-县编号")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String townCode;
......
......@@ -116,6 +116,9 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "更新人")
private String updateBy;
@Schema(description = "商险是否已购买 0 是 1 否")
private String insuranceIsBuy;
@Schema(description = "身份证合集")
private List<String> idcardList;
......
......@@ -37,6 +37,7 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="customerUsernameNew" column="customer_username_new"/>
<result property="insuranceIsBuy" column="insurance_is_buy"/>
</resultMap>
<resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo">
......@@ -113,7 +114,7 @@
a.update_time,
a.contract_sub_name,
a.customer_username_new,
province_code,city_code,town_code
province_code,city_code,town_code,insurance_is_buy
</sql>
<sql id="employeeRegistrationPre_where">
<if test="employeeRegistrationPre != null">
......
......@@ -104,6 +104,10 @@ public class InsurancesConstants {
* 投保记录已存在
*/
public static final String DATA_IS_EXIST = "投保记录已存在";
/**
* 本次派单前系统已有该人员在途/在保数据
*/
public static final String DIS_PERSON_DATA_IS_EXIST = "本次派单前系统已有该人员在途/在保数据";
/**
* 投保记录不存在
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Data
@TableName("t_insurance_pre_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "入职确认信息已购买商险明细")
public class TInsurancePreDetail extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
@Schema(description = "身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String deptNo;
/**
* 投保岗位
*/
@ExcelAttribute(name = "投保岗位", maxLength = 32)
@Length(max = 32, message = "投保岗位不能超过32个字符")
@ExcelProperty("投保岗位")
@Schema(description = "投保岗位")
private String post;
/**
* 保险公司名称
*/
@ExcelAttribute(name = "保险公司名称", maxLength = 60)
@Length(max = 60, message = "保险公司名称不能超过60个字符")
@ExcelProperty("保险公司名称")
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@ExcelAttribute(name = "险种名称", maxLength = 50)
@Length(max = 50, message = "险种名称不能超过50个字符")
@ExcelProperty("险种名称")
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@ExcelAttribute(name = "购买标准", maxLength = 32)
@Length(max = 32, message = "购买标准不能超过32个字符")
@ExcelProperty("购买标准")
@Schema(description = "购买标准")
private String buyStandard;
/**
* 保单开始时间
*/
@ExcelAttribute(name = "保单开始时间", isDate = true)
@ExcelProperty("保单开始时间")
@Schema(description = "保单开始时间")
private Date policyStart;
/**
* 保单结束时间
*/
@ExcelAttribute(name = "保单结束时间", isDate = true)
@ExcelProperty("保单结束时间")
@Schema(description = "保单结束时间")
private Date policyEnd;
/**
* 保单生效日期
*/
@ExcelAttribute(name = "保单生效日期", isDate = true)
@ExcelProperty("保单生效日期")
@Schema(description = "保单生效日期")
private Date policyEffect;
/**
* 购买类型, 1新增、3批增、4替换
*/
@ExcelAttribute(name = "购买类型, 1新增、3批增、4替换")
@ExcelProperty("购买类型, 1新增、3批增、4替换")
@Schema(description = "购买类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@ExcelAttribute(name = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@ExcelProperty("投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 结算主体名称
*/
@ExcelAttribute(name = "结算主体名称", maxLength = 50)
@Length(max = 50, message = "结算主体名称不能超过50个字符")
@ExcelProperty("结算主体名称")
@Schema(description = "结算主体名称")
private String deptName;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
@Schema(description = "客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
@Schema(description = "客户编码")
private String unitNo;
/**
* 是否地市自购0是 1 否
*/
@ExcelAttribute(name = "是否地市自购0是 1 否", maxLength = 1)
@Length(max = 1, message = "是否地市自购0是 1 否不能超过1个字符")
@ExcelProperty("是否地市自购0是 1 否")
@Schema(description = "是否地市自购0是 1 否")
private String isAdress;
/**
* 入离职登记id
*/
@ExcelAttribute(name = "入离职登记id", maxLength = 32)
@Length(max = 32, message = "入离职登记id不能超过32个字符")
@ExcelProperty("入离职登记id")
@Schema(description = "入离职登记id")
private String registerId;
}
......@@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author licancan
......@@ -214,4 +215,12 @@ public class InsuranceAddParam implements Serializable {
*/
@Schema(description = "是否地市自购")
private String isAdress;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
}
......@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author huyc
......@@ -156,4 +157,12 @@ public class InsuranceAutoParam implements Serializable {
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
}
......@@ -8,6 +8,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* @author licancan
......@@ -221,4 +222,12 @@ public class InsuranceBatchParam implements Serializable {
*/
@Schema(description = "是否地市自购")
private String isAdress;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
}
......@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author licancan
......@@ -151,11 +152,18 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "是否地市自购")
private String isAdress;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
}
......@@ -230,6 +230,13 @@ public class InsuredListVo implements Serializable {
@ExcelIgnore
private Integer insuranceCity;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@ExcelIgnore
private Integer buyHandleStatus;
/**
* 商险购买地市
*/
......
......@@ -163,7 +163,7 @@ public class TEmployeeInsurancePreController {
@Operation(description = "商险派单信息单个/批量派单")
@PostMapping("/batchDispatcherInsurance")
public R batchDispatcherInsurance(@RequestBody List<String> idList) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList);
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, null);
}
/**
......
......@@ -874,4 +874,15 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.policyPageToAutoSelect(page, param, mId));
}
/**
* 查询在用或者在途的商险数据
* @param empIdcard 身份证号
* @return
*/
@Operation(description = "查询在用或者在途的商险数据")
@GetMapping("/getOnProcessInsurancesInfo")
public R<List<InsuredListVo>> getInProcessInsurancesInfo(@RequestParam String empIdcard) {
return R.ok(tInsuranceDetailService.getOnProcessInsurancesInfo(empIdcard));
}
}
......@@ -334,5 +334,9 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, @Param("param") InsuredParam param);
/**
* 派单前系统已有在途/在保数据的人员明细
*/
List<InsuredListVo> getOnProcessInsuredList(@Param("empIdCard") String empIdCard);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import org.apache.ibatis.annotations.Mapper;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Mapper
public interface TInsurancePreDetailMapper extends BaseMapper<TInsurancePreDetail> {
}
......@@ -59,9 +59,10 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
/**
* 商险派单信息批量派单
* @param idList id集合
* @param sameFlag 是否要做重复人员明细校验的标识 1 不需要 空需要
* @return
*/
R batchDispatcherInsurance(List<String> idList);
R batchDispatcherInsurance(List<String> idList,String sameFlag);
/**
* 新增商险待购买信息
......
......@@ -575,5 +575,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, InsuredParam param, String mId);
List<InsuredListVo> getOnProcessInsurancesInfo(String empIdCard);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
public interface TInsurancePreDetailService extends IService<TInsurancePreDetail> {
}
......@@ -53,7 +53,7 @@ public class ScheduleServiceImpl implements ScheduleService {
transactionTemplate.execute(status -> {
List<String> idList = new ArrayList<>();
idList.add(aId);
insurancePreService.batchDispatcherInsurance(idList);
insurancePreService.batchDispatcherInsurance(idList,CommonConstants.ONE_STRING);
return null;
});
}
......
......@@ -179,7 +179,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
}
@Override
public R batchDispatcherInsurance(List<String> idList) {
public R batchDispatcherInsurance(List<String> idList, String sameFlag) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query()
.lambda().in(TEmployeeInsurancePre::getId, idList)
.in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus));
......@@ -209,6 +209,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setIsExit(sameFlag);
addParamList.add(addParam);
}
if (CommonConstants.THREE_INT == insurancePre.getBuyType()) {
......@@ -229,6 +230,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setPolicyStart(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT)));
addParam.setPolicyEnd(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)));
addParam.setIsExit(sameFlag);
batchAddParamList.add(addParam);
}
if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) {
......@@ -248,6 +250,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setIsExit(sameFlag);
replaceAddParamList.add(addParam);
}
}
......@@ -433,7 +436,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING);
this.update(updateWrapper);
try {
this.batchDispatcherInsurance(unConfirmList);
this.batchDispatcherInsurance(unConfirmList,CommonConstants.ONE_STRING);
} catch (Exception e) {
log.error("执行异常", e);
}
......@@ -495,6 +498,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(addParam.getErrorMessage());
autoParam.setInsurancePreId(addParam.getInsurancePreId());
autoParam.setCustomerUserName(addParam.getCustomerUserName());
autoParam.setIsExit(addParam.getIsExit());
autoParam.setInProgressList(addParam.getInProgressList());
return autoParam;
}
......@@ -516,6 +521,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(batchParam.getErrorMessage());
autoParam.setInsurancePreId(batchParam.getInsurancePreId());
autoParam.setCustomerUserName(batchParam.getCustomerUserName());
autoParam.setIsExit(batchParam.getIsExit());
autoParam.setInProgressList(batchParam.getInProgressList());
return autoParam;
}
......@@ -537,6 +544,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(replaceParam.getErrorMessage());
autoParam.setInsurancePreId(replaceParam.getInsurancePreId());
autoParam.setCustomerUserName(replaceParam.getCustomerUserName());
autoParam.setIsExit(replaceParam.getIsExit());
autoParam.setInProgressList(replaceParam.getInProgressList());
return autoParam;
}
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancePreDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreDetailService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Log4j2
@Service
public class TInsurancePreDetailServiceImpl extends ServiceImpl<TInsurancePreDetailMapper, TInsurancePreDetail> implements TInsurancePreDetailService {
}
......@@ -593,6 +593,36 @@
</foreach>
</update>
<!-- 派单人员系统已有参保明细查询-->
<select id="getOnProcessInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
a.id as id,
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
a.BUY_TYPE as buyType,
a.DEPT_NO as deptNo,
a.DEPT_NAME as projectName,
a.POST as post,
a.POLICY_START as policyStart,
a.POLICY_END as policyEnd,
a.POLICY_EFFECT as policyEffect,
a.INSURANCE_COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_TYPE_NAME as insuranceTypeName,
a.BUY_STANDARD as buyStandard,
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.CREATE_TIME as createTime,
a.CREATE_NAME as createName,
a.UNIT_NAME as unitName,
a.UNIT_NO as unitNo,
a.IS_ADRESS as isAdress
from
t_insurance_detail a
where
a.DELETE_FLAG = 0
and (a.BUY_HANDLE_STATUS = 2 or (a.BUY_HANDLE_STATUS = 3 and a.isEffect = 0 and a.isOverdue = 0))
AND EMP_IDCARD_NO = #{empIdCard}
</select>
<!-- ***********************减员办理******************************** -->
<!-- 已投保列表分页查询-->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancePreDetailMapper">
<resultMap id="tInsurancePreDetailMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcardNo" column="EMP_IDCARD_NO"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="post" column="POST"/>
<result property="insuranceCompanyName" column="INSURANCE_COMPANY_NAME"/>
<result property="insuranceTypeName" column="INSURANCE_TYPE_NAME"/>
<result property="buyStandard" column="BUY_STANDARD"/>
<result property="policyStart" column="POLICY_START"/>
<result property="policyEnd" column="POLICY_END"/>
<result property="policyEffect" column="POLICY_EFFECT"/>
<result property="buyType" column="BUY_TYPE"/>
<result property="buyHandleStatus" column="BUY_HANDLE_STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="isAdress" column="IS_ADRESS"/>
<result property="registerId" column="REGISTER_ID"/>
</resultMap>
</mapper>
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