Commit a674ae2f authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

Feature licancan

See merge request fangxinjiang/yifu!204
parents b59a0326 5cda2421
...@@ -84,6 +84,15 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -84,6 +84,15 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/ */
void updatePolicyNoBatch(@Param("details") List<TInsuranceDetail> details); void updatePolicyNoBatch(@Param("details") List<TInsuranceDetail> details);
/**
* 批量更新发票号
*
* @author licancan
* @param details
* @return void
*/
void updateInvoiceNoBatch(@Param("details") List<TInsuranceDetail> details);
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
......
...@@ -417,6 +417,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -417,6 +417,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setCreateName(user.getNickname()); newDetail.setCreateName(user.getNickname());
//替换不参与结算 //替换不参与结算
newDetail.setDefaultSettleId(null); newDetail.setDefaultSettleId(null);
//替换不继承备注
newDetail.setRemark(null);
//保费都默认是0 //保费都默认是0
newDetail.setActualPremium(new BigDecimal("0.00")); newDetail.setActualPremium(new BigDecimal("0.00"));
newDetail.setEstimatePremium(new BigDecimal("0.00")); newDetail.setEstimatePremium(new BigDecimal("0.00"));
...@@ -1314,6 +1316,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1314,6 +1316,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
); );
if (StringUtils.isNotBlank(success.getInvoiceNo())){ if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo()); detail.setInvoiceNo(success.getInvoiceNo());
//如果发票号不为空,将替换类型的发票号也全部更新
List<TInsuranceReplace> list = tInsuranceReplaceService.list(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getOriginInsuranceDetailId, detail.getId()));
if (CollectionUtils.isNotEmpty(list)){
List<String> collect = list.stream().map(TInsuranceReplace::getToInsuranceDetailId).distinct().collect(Collectors.toList());
List<TInsuranceDetail> details = this.baseMapper.selectBatchIds(collect);
if (CollectionUtils.isNotEmpty(details)){
details.stream().forEach(e -> e.setInvoiceNo(success.getInvoiceNo()));
//这里自己写sql更新发票号,防止用mybatisPlus批量更新,把updateTime更新了(updateTime不能更新)
baseMapper.updateInvoiceNoBatch(details);
}
}
} }
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
......
...@@ -392,6 +392,12 @@ ...@@ -392,6 +392,12 @@
</foreach> </foreach>
</update> </update>
<update id="updateInvoiceNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set INVOICE_NO = #{item.invoiceNo} where ID = #{item.id}
</foreach>
</update>
<!-- ***********************减员办理******************************** --> <!-- ***********************减员办理******************************** -->
<!-- 已投保列表分页查询--> <!-- 已投保列表分页查询-->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo"> <select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......
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