Commit 1759d905 authored by fangxinjiang's avatar fangxinjiang

商险替换标签优化-fxj

parent c038fc55
...@@ -296,5 +296,11 @@ public class TInsuranceAlert extends BaseEntity { ...@@ -296,5 +296,11 @@ public class TInsuranceAlert extends BaseEntity {
@Schema(description = "前端客服") @Schema(description = "前端客服")
private String customerUsername; private String customerUsername;
/**
* 替换标签
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@Schema(description = "替换标签")
private String replaceTag;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -865,6 +865,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -865,6 +865,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setReplaceRemark(null); detail.setReplaceRemark(null);
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
this.updateById(detail); this.updateById(detail);
// 同步清空 TInsuranceAlert 表的替换标签
syncUpdateInsuranceAlertReplaceTag(detail.getId(), null);
// 保险公司-险种-购买标准 是否存在 // 保险公司-险种-购买标准 是否存在
insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda() insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, detail.getInsuranceCompanyName()) .eq(TInsuranceCompany::getCompanyName, detail.getInsuranceCompanyName())
...@@ -2012,6 +2015,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2012,6 +2015,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保成功后 退保 清空替换标签和替换说明 //投保成功后 退保 清空替换标签和替换说明
detail.setReplaceTag(null); detail.setReplaceTag(null);
detail.setReplaceRemark(null); detail.setReplaceRemark(null);
// 同步清空 TInsuranceAlert 表的替换标签
LambdaUpdateWrapper<TInsuranceAlert> alertUpdateWrapper = new LambdaUpdateWrapper<>();
alertUpdateWrapper.set(TInsuranceAlert::getReplaceTag, null)
.set(TInsuranceAlert::getUpdateTime, LocalDateTime.now())
.eq(TInsuranceAlert::getId, detail.getId());
tInsuranceWarnMapper.update(null, alertUpdateWrapper);
} }
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
...@@ -5528,6 +5538,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5528,6 +5538,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail::getUpdateTime, updateTime) .set(TInsuranceDetail::getUpdateTime, updateTime)
.eq(TInsuranceDetail::getId, detail.getId()); .eq(TInsuranceDetail::getId, detail.getId());
update(updateWrapper); update(updateWrapper);
// 同步更新 TInsuranceAlert 表的替换标签为"可替换"
syncUpdateInsuranceAlertReplaceTag(detail.getId(), InsurancesConstants.INSURANCE_REPLACE_TAG_REPLACE);
} catch (Exception e) { } catch (Exception e) {
log.error("更新单个商险替换标签异常,商险 ID: {}", detail.getId(), e); log.error("更新单个商险替换标签异常,商险 ID: {}", detail.getId(), e);
} }
...@@ -5540,7 +5553,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5540,7 +5553,36 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
log.error("批量更新商险替换标签异常,参数列表大小:{}", paramVoList.size(), e); log.error("批量更新商险替换标签异常,参数列表大小:{}", paramVoList.size(), e);
} }
} }
/**
* 同步更新商险到期提醒表的替换标签
*
* @param insuranceId 商险 ID
* @param replaceTag 替换标签
* @param updateBy 更新人
* @param updateTime 更新时间
* @author hgw
* @date 2026-03-27
*/
private void syncUpdateInsuranceAlertReplaceTag(String insuranceId, String replaceTag) {
try {
// 查询是否存在对应的商险到期提醒记录
TInsuranceAlert alert = tInsuranceWarnMapper.selectById(insuranceId);
if (alert != null) {
// 存在则更新
LambdaUpdateWrapper<TInsuranceAlert> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(TInsuranceAlert::getReplaceTag, replaceTag)
.eq(TInsuranceAlert::getId, insuranceId);
tInsuranceWarnMapper.update(null, updateWrapper);
log.debug("同步更新商险到期提醒表替换标签成功,商险 ID: {}, 替换标签:{}", insuranceId, replaceTag);
} else {
log.debug("未找到对应的商险到期提醒记录,商险 ID: {}", insuranceId);
}
} catch (Exception e) {
log.error("同步更新商险到期提醒表替换标签异常,商险 ID: {}", insuranceId, e);
}
}
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
...@@ -6163,6 +6205,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6163,6 +6205,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setReplaceRemark(null); tInsuranceDetail.setReplaceRemark(null);
tInsuranceDetail.setReplaceTag(null); tInsuranceDetail.setReplaceTag(null);
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
// 同步清空 TInsuranceAlert 表的替换标签
LambdaUpdateWrapper<TInsuranceAlert> alertUpdateWrapper = new LambdaUpdateWrapper<>();
alertUpdateWrapper.set(TInsuranceAlert::getReplaceTag, null)
.set(TInsuranceAlert::getUpdateTime, LocalDateTime.now())
.eq(TInsuranceAlert::getId, tInsuranceDetail.getId());
tInsuranceWarnMapper.update(null, alertUpdateWrapper);
// 已减员 // 已减员
this.sendLeaveById(tInsuranceDetail.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, remark, user); this.sendLeaveById(tInsuranceDetail.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, remark, user);
...@@ -6250,6 +6299,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6250,6 +6299,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setReplaceTag(null); detail.setReplaceTag(null);
detail.setReplaceRemark(null); detail.setReplaceRemark(null);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.FOUR_INT); refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.FOUR_INT);
// 同步清空 TInsuranceAlert 表的替换标签
LambdaUpdateWrapper<TInsuranceAlert> alertUpdateWrapper = new LambdaUpdateWrapper<>();
alertUpdateWrapper.set(TInsuranceAlert::getReplaceTag, null)
.set(TInsuranceAlert::getUpdateTime, LocalDateTime.now())
.eq(TInsuranceAlert::getId, detail.getId());
tInsuranceWarnMapper.update(null, alertUpdateWrapper);
}else{ }else{
detail.setReduceHandleStatus(CommonConstants.THREE_INT); detail.setReduceHandleStatus(CommonConstants.THREE_INT);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.THREE_INT); refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.THREE_INT);
...@@ -7300,6 +7356,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -7300,6 +7356,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceDetail.setReplaceTag(null); insuranceDetail.setReplaceTag(null);
insuranceDetail.setReplaceRemark(null); insuranceDetail.setReplaceRemark(null);
baseMapper.updateById(insuranceDetail); baseMapper.updateById(insuranceDetail);
// 同步清空 TInsuranceAlert 表的替换标签
LambdaUpdateWrapper<TInsuranceAlert> alertUpdateWrapper = new LambdaUpdateWrapper<>();
alertUpdateWrapper.set(TInsuranceAlert::getReplaceTag, null)
.set(TInsuranceAlert::getUpdateTime, LocalDateTime.now())
.eq(TInsuranceAlert::getId, param.getInsDetailId());
tInsuranceWarnMapper.update(null, alertUpdateWrapper);
} }
} }
...@@ -10481,7 +10544,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -10481,7 +10544,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param insuranceIds 需要清空替换标签的商险 ID 列表 * @param insuranceIds 需要清空替换标签的商险 ID 列表
* @param updateBy 更新人 * @param updateBy 更新人
* @Description: 批量清空商险替换标签和说明(当商险状态变为非已投保且未过期且有效时调用) * @Description: 批量清空商险替换标签和说明(当商险状态变为非已投保且未过期且有效时调用)
* @Author: hgw * @Author: fxj
* @Date: 2026-03-19 * @Date: 2026-03-19
* @return: void * @return: void
**/ **/
...@@ -10504,6 +10567,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -10504,6 +10567,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail::getUpdateTime, updateTime) .set(TInsuranceDetail::getUpdateTime, updateTime)
.eq(TInsuranceDetail::getId, id); .eq(TInsuranceDetail::getId, id);
update(updateWrapper); update(updateWrapper);
// 【新增】同步清空 TInsuranceAlert 表的替换标签
syncUpdateInsuranceAlertReplaceTag(id, null);
} catch (Exception e) { } catch (Exception e) {
log.error("清空单个商险替换标签异常,商险 ID: {}", id, e); log.error("清空单个商险替换标签异常,商险 ID: {}", id, e);
} }
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<result property="policyEndNew" column="POLICY_END_NEW" jdbcType="DATE"/> <result property="policyEndNew" column="POLICY_END_NEW" jdbcType="DATE"/>
<result property="policyEffectNew" column="POLICY_EFFECT_NEW" jdbcType="DATE"/> <result property="policyEffectNew" column="POLICY_EFFECT_NEW" jdbcType="DATE"/>
<result property="customerUsername" column="CUSTOMER_USERNAME" jdbcType="VARCHAR"/> <result property="customerUsername" column="CUSTOMER_USERNAME" jdbcType="VARCHAR"/>
<result property="replaceTag" column="REPLACE_TAG" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 商险续签待办专用 --> <!-- 商险续签待办专用 -->
...@@ -271,6 +272,7 @@ ...@@ -271,6 +272,7 @@
JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID
<where> <where>
a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG=0 and b.is_leave = '0' and a.IS_OVERDUE = 0 a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG=0 and b.is_leave = '0' and a.IS_OVERDUE = 0
AND (a.REPLACE_TAG IS NULL OR a.REPLACE_TAG != '可替换')
<include refid="tInsuranceAlert_where"/> <include refid="tInsuranceAlert_where"/>
<if test="tInsuranceAlert != null"> <if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.isBefore != null and tInsuranceAlert.isBefore.trim() != ''"> <if test="tInsuranceAlert.isBefore != null and tInsuranceAlert.isBefore.trim() != ''">
...@@ -510,7 +512,7 @@ ...@@ -510,7 +512,7 @@
,a.BUY_TYPE ,a.BUY_TYPE
,ep.config_id ,ep.config_id
,ep.config_name ,ep.config_name
,a.IS_ADRESS ,a.IS_ADRESS,a.REPLACE_TAG
FROM FROM
t_insurance_detail a t_insurance_detail a
INNER JOIN ( INNER JOIN (
...@@ -573,7 +575,7 @@ ...@@ -573,7 +575,7 @@
where a.DELETE_FLAG = '0' where a.DELETE_FLAG = '0'
AND a.EXPIRE_IGNORE_FLAG = '1' AND a.EXPIRE_IGNORE_FLAG = '1'
AND a.IS_EFFECT = 0 AND a.IS_EFFECT = 0
AND (a.REPLACE_TAG IS NULL OR a.REPLACE_TAG != '可替换')
</select> </select>
<resultMap id="PushWxResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx"> <resultMap id="PushWxResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx">
<result property="projectName" column="DEPT_NAME" jdbcType="VARCHAR"/> <result property="projectName" column="DEPT_NAME" jdbcType="VARCHAR"/>
......
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