From 5792e36950d6699aa6b52122d84770051213c141 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期三, 03 四月 2024 18:32:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/1.0.1' into 1.0.1
---
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
index d4ed737..895e124 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -12,10 +12,7 @@
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dto.*;
-import com.doumee.dao.business.join.ApplyDetailJoinMapper;
-import com.doumee.dao.business.join.ApplyLogJoinMapper;
-import com.doumee.dao.business.join.InsuranceApplyJoinMapper;
-import com.doumee.dao.business.join.UnionApplyJoinMapper;
+import com.doumee.dao.business.join.*;
import com.doumee.dao.business.model.*;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.SmsEmailService;
@@ -80,6 +77,8 @@
@Autowired
private ApplyLogJoinMapper applyLogJoinMapper;
+ @Autowired
+ private MemberInsuranceJoinMapper memberInsuranceJoinMapper;
@Value("${debug_model}")
private boolean debugModel;
@@ -746,6 +745,8 @@
continue;
}
BigDecimal price = Constants.formatBigdecimal(applyDetails.get(Constants.ZERO).getPrice());
+
+
Optional<UnionApplyBXDDetailDTO> unionApplyBXDDDetailTO= unionApplyBXDDetailDTOList.stream().filter(
m->m.getApplyId().equals(insuranceApply.getId())).findFirst();
if(unionApplyBXDDDetailTO.isPresent()){
@@ -775,6 +776,19 @@
}else if(useDays>0){
currentFee = new BigDecimal(useDays).multiply(price);
}
+ //鐢熸垚鎶曚繚璁板綍
+ if(CollectionUtils.isNotEmpty(applyDetailList)){
+ List<MemberInsurance> memberInsuranceList = new ArrayList<>();
+ for (ApplyDetail applyDetail:applyDetailList) {
+ applyDetail.setPrice(price);
+ applyDetail.setFee(price.multiply(new BigDecimal(maxDays)));
+ MemberInsurance memberInsurance = new MemberInsurance(applyDetail,user.getId());
+ memberInsurance.setRelationType(Constants.ZERO);
+ memberInsuranceList.add(memberInsurance);
+ }
+ memberInsuranceJoinMapper.insertBatchSomeColumn(memberInsuranceList);
+ }
+
//鏇存柊鎶曚繚鐢宠鍗�
insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
.set(InsuranceApply::getUnionApplyTbdStatus,Constants.THREE)
--
Gitblit v1.9.3