|
@@ -1,7 +1,6 @@
|
|
|
package org.jeecg.modules.app.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -252,9 +251,12 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
.setProductIds(createOrderForm.getProductIds())
|
|
|
.setAmount(createOrderForm.getAmount())
|
|
|
;
|
|
|
+ BigDecimal totalPrice = BigDecimal.ZERO;
|
|
|
|
|
|
List<AppOrderProInfo> proInfoList = new ArrayList<>();
|
|
|
|
|
|
+ List<InsureOrderInfo> insureOrderInfoList = new ArrayList<>();
|
|
|
+
|
|
|
//订单内容
|
|
|
switch (createOrderForm.getType()) {
|
|
|
//场地(学校,包场,无固定场)
|
|
@@ -439,9 +441,9 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
.setUpdateBy(user.getId())
|
|
|
.setStatus(CommonConstant.STATUS_NORMAL)
|
|
|
.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
- if (StrUtil.isNotBlank(createOrderForm.getGameCertificationForm())) {
|
|
|
- appOrder.setGameCertification(createOrderForm.getGameCertificationForm());
|
|
|
- }
|
|
|
+// if (StrUtil.isNotBlank(createOrderForm.getGameCertificationForm())) {
|
|
|
+// appOrder.setGameCertification(createOrderForm.getGameCertificationForm());
|
|
|
+// }
|
|
|
break;
|
|
|
//课程
|
|
|
case 2:
|
|
@@ -513,28 +515,29 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
if (ObjectUtils.isNotEmpty(insureOrderInfoForm)) {
|
|
|
List<String> ids = Arrays.stream(insureOrderInfoForm.getFamilyMembersIds().split(",")).collect(Collectors.toList());
|
|
|
AppInsure appInsure = appInsureMapper.selectById(insureOrderInfoForm.getInsureId());
|
|
|
+ DictAnnotationUtil.translateDict(appInsure);
|
|
|
//保单总价
|
|
|
BigDecimal sumPrice = new BigDecimal(0);
|
|
|
for (String id : ids) {
|
|
|
|
|
|
//查询保单价格
|
|
|
- InsurePrice insurePrice = insurePriceMapper.selectById(insureOrderInfoForm.getInsureId());
|
|
|
+ InsurePrice insurePrice = insurePriceMapper.selectById(insureOrderInfoForm.getInsurePriceId());
|
|
|
|
|
|
//创建保单
|
|
|
InsureOrderInfo insureOrderInfo = new InsureOrderInfo();
|
|
|
insureOrderInfo
|
|
|
.setOrderId(appOrder.getId())
|
|
|
.setBdOrderNo(generateOrderNumber(2))
|
|
|
- .setInsureName(appInsure.getInsuranceType_dictText())
|
|
|
+ .setInsureName(appInsure.getName())
|
|
|
.setInsureCompany(appInsure.getInsuranceName_dictText())
|
|
|
.setInsureId(appInsure.getId())
|
|
|
.setMoney(insurePrice.getInsurePrice())
|
|
|
- .setUserId(id)
|
|
|
+ .setFamilyMembersId(id)
|
|
|
.setAssertStartTime(insureOrderInfoForm.getAssertStartTime())
|
|
|
.setAssertEndTime(insureOrderInfoForm.getAssertEndTime())
|
|
|
.setIsEnterSystem(CommonConstant.STATUS_0_INT)
|
|
|
;
|
|
|
- insureOrderInfoMapper.insert(insureOrderInfo);
|
|
|
+ insureOrderInfoList.add(insureOrderInfo);
|
|
|
|
|
|
sumPrice = sumPrice.add(insurePrice.getInsurePrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
@@ -553,7 +556,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderProInfo.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
}
|
|
|
//计算总价 = 订单金额 + 保单金额
|
|
|
- appOrder.setPrice(appOrder.getPrice().add(sumPrice));
|
|
|
}
|
|
|
|
|
|
appOrderMapper.insert(appOrder);
|
|
@@ -564,6 +566,12 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderProInfoMapper.insert(appOrderProInfo);
|
|
|
}
|
|
|
|
|
|
+ //保存保险
|
|
|
+ for (InsureOrderInfo insureOrderInfo : insureOrderInfoList) {
|
|
|
+ insureOrderInfo.setOrderId(appOrder.getId());
|
|
|
+ insureOrderInfoMapper.insert(insureOrderInfo);
|
|
|
+ }
|
|
|
+
|
|
|
//构建支付表单返回给前端支撑支付调用
|
|
|
UserPayForm payForm = new UserPayForm();
|
|
|
payForm
|