Переглянути джерело

修改子订单添加险种信息的字段,先看数据库是否保存正确,后续在需改查询为险种信息为子订单的险种信息,脚本已更新

hxl13994548489 2 роки тому
батько
коміт
37a10c29fc

+ 26 - 1
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -35,7 +35,6 @@ import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.idgen.IdGenerate;
 import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.AfterReturning;
 import org.aspectj.lang.annotation.Aspect;
@@ -238,4 +237,30 @@ public class QuoteVerificationAspect {
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
     }
 
+
+   /**
+    *  @version
+    *  @author: hxl
+    *  @Date: 2024/5/10 15:38
+    *  @Description:   后置处理器更新子订单的险种类型
+    */
+   @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
+     public void afterUpdatePruduct(HttpResult<QuoteRespVo> result) {
+       //计算费用因子
+       if(result.getCode() == 200) {
+           InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(result.getData().getCompanyId());
+           InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+           //通过主订单的信息判断
+           List<RiskInfoVo> risks = insOrders.getRisk().toJavaList(RiskInfoVo.class);
+           List<KindInfoVo> kinds = insOrders.getKing().toJavaList(KindInfoVo.class);
+           //获取订单的险种信息
+           insOrders.productInformation(risks, kinds);
+           String product = insOrders.getProduct();
+           String productid = insOrders.getProductid();
+           insAreaCompany.setProduct(product);
+           insAreaCompany.setProductid(productid);
+           //更新子订单的险种信息
+           insAreaCompanyService.updateById(insAreaCompany);
+       }
+    }
 }

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -423,6 +423,18 @@ public class InsAreaCompany implements Serializable {
      */
     //@TableField(value = "error_status")
     //private Integer errorStatus;
+    // add by  hxl  2024-05-10  子订单添加产品信息 更新   险种信息从子订单中获取
+    /**
+     * 产品id
+     */
+    @TableField(value = "productid")
+    private String productid;
+
+    /**
+     * 产品名称
+     */
+    @TableField(value = "product")
+    private String product;
 
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -310,7 +310,7 @@ public class InsOrders implements Serializable {
      * @param risks 主险种
      * @param kinds 商业险险种
      */
-    private void productInformation(List<RiskInfoVo> risks, List<KindInfoVo> kinds) {
+    public void productInformation(List<RiskInfoVo> risks, List<KindInfoVo> kinds) {
         /**
          * 投保险种逻辑
          * 单交-单交强