Commit 2141d2a8 authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent 3b32985a
......@@ -262,9 +262,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
isModifyInsurance = true;
detailList.add(detailInsuranceLog);
}
//如果是否已购买商险为是,则需要处理商险明细数据
if (CommonConstants.ZERO_STRING.equals(isBuyNew)) {
//如果服务类型包含商险处理商险明细数据
if (Common.isNotNull(newInfo.getServerItem()) && newInfo.getServerItem().contains("商险")) {
newInfo.setId(empPreId);
if (!newInfo.getExitInsuranceInfoList().isEmpty()) {
newInfo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(empPreId));
}
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/updateInfoSaveInsurancePreInfo"
, newInfo, Boolean.class, SecurityConstants.FROM_IN);
......
......@@ -667,7 +667,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo);
} else if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
} else if (preVo.getServerItem().contains("商险")
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ONE_STRING)
&& !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData());
......
......@@ -190,13 +190,11 @@ public class InsuranceBatchParam implements Serializable {
/**
* 保单开始时间
*/
@JsonIgnore
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonIgnore
private LocalDate policyEnd;
@Schema(description = "项目名称")
......
......@@ -572,6 +572,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
TEmployeeInsurancePre preExit;
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
try {
//删除已存在的入职确认信息对应的商险明细
preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
.eq(TInsurancePreDetail::getRegisterId, registrationPreVo.getExitInsuranceInfoList()
.get(0).getRegisterId()));
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
//判断是否存在商险待购买信息
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
......@@ -631,6 +635,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
//批量新增
preDetailService.saveBatch(registrationPre.getExitInsuranceInfoList());
}
//如果商险是否已购买为否,删除商险已购买明细
if (Common.isNotNull(registrationPre.getInsuranceIsBuy())
&& registrationPre.getInsuranceIsBuy().equals(CommonConstants.ONE_STRING)) {
//删除已存在的入职确认信息对应的商险明细
preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
.eq(TInsurancePreDetail::getRegisterId, registrationPre.getId()));
}
return true;
}
......@@ -810,6 +821,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setDeptName(batchParam.getDeptName());
autoParam.setBuyType(batchParam.getBuyType());
autoParam.setInProgressList(batchParam.getInProgressList());
autoParam.setPolicyEnd(LocalDateUtil.getDateSrt(batchParam.getPolicyEnd()));
autoParam.setPolicyStart(LocalDateUtil.getDateSrt(batchParam.getPolicyStart()));
return autoParam;
}
......
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