Commit 84b851f6 authored by 李灿灿's avatar 李灿灿

20221108 投保办理--导出办理 支持投保中、投保成功单纯导出

parent 47b7aa4b
......@@ -17,6 +17,12 @@ import java.util.List;
public class InsuranceExportListParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = 3623027153213352936L;
/**
* 投保状态 1待投保 2投保中 3已投保 (4投保退回 5 已减员)不在此列表展示4,5
*/
@Schema(description = "投保状态 1待投保 2投保中 3已投保")
private Integer buyHandleStatus;
/**
* 员工姓名
*/
......
......@@ -115,6 +115,13 @@ public class InsuranceExportListVO implements Serializable {
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 保单生效时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@JsonIgnore
private LocalDate policyEffect;
/**
* 保险公司名称(冗余字段)
*/
......
......@@ -921,26 +921,39 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
//购买天数
record.setBuyDay(LocalDateUtil.betweenDay(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
TInsuranceDetail detail = new TInsuranceDetail();
detail.setId(record.getId());
//update状态由「待投保」置为「投保中」
detail.setBuyHandleStatus(CommonConstants.TWO_INT);
if (record.getBuyType() == CommonConstants.ONE_INT){
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == record.getBuyType()){
if (Objects.isNull(record.getPolicyEffect())){
record.setBuyMonth(null);
record.setBuyDay(null);
}else {
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyEffect().toString(),record.getPolicyEnd().toString()));
record.setBuyDay(LocalDateUtil.betweenDay(record.getPolicyEffect().toString(),record.getPolicyEnd().toString()));
}
}
detail.setHandledBy(user.getId());
detail.setHandledTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if (Common.isNotNull(jsonObject)){
detail.setDeptId(jsonObject.getId());
detail.setDeptName(jsonObject.getDepartName());
detail.setUnitId(jsonObject.getCustomerId());
detail.setUnitName(jsonObject.getCustomerName());
detail.setUnitNo(jsonObject.getCustomerCode());
//如果是待投保,需要处理相关逻辑,投保中、投保成功只是单纯的导出
if(param.getBuyHandleStatus() == CommonConstants.ONE_INT){
TInsuranceDetail detail = new TInsuranceDetail();
detail.setId(record.getId());
//update状态由「待投保」置为「投保中」
detail.setBuyHandleStatus(CommonConstants.TWO_INT);
if (record.getBuyType() == CommonConstants.ONE_INT){
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
detail.setHandledBy(user.getId());
detail.setHandledTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if (Common.isNotNull(jsonObject)){
detail.setDeptId(jsonObject.getId());
detail.setDeptName(jsonObject.getDepartName());
detail.setUnitId(jsonObject.getCustomerId());
detail.setUnitName(jsonObject.getCustomerName());
detail.setUnitNo(jsonObject.getCustomerCode());
}
detailList.add(detail);
}
detailList.add(detail);
}
}
//批量更新
......@@ -971,6 +984,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//购买天数
vo.setBuyDay(LocalDateUtil.betweenDay(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == vo.getBuyType()){
if (Objects.isNull(vo.getPolicyEffect())){
vo.setBuyMonth(null);
vo.setBuyDay(null);
}else {
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyEffect().toString(),vo.getPolicyEnd().toString()));
vo.setBuyDay(LocalDateUtil.betweenDay(vo.getPolicyEffect().toString(),vo.getPolicyEnd().toString()));
}
}
vo.setRemark(InsurancesConstants.QUIT);
vo.setBuyType(CommonConstants.FOUR_INT);
vo.setProjectName(byId.getDeptName());
......
......@@ -339,6 +339,7 @@
a.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
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,
......@@ -371,6 +372,7 @@
a.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
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,
......@@ -382,7 +384,7 @@
a.POLICY_NO as policyNo,
a.REMARK as remark
from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = 1
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
......
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