Parcourir la source

中煤跟单费用因子存表

cuixinpeng il y a 3 ans
Parent
commit
cae47a0e9b

+ 43 - 0
src/main/java/com/ydtech/modules/order/service/InsAgreementOrderService.java

@@ -0,0 +1,43 @@
+package com.ydtech.modules.order.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.order.entity.InsAgreementOrder;
+
+/**
+ * @author CXP
+ * @description 针对表【ins_area_company(费用跟单)】的数据库操作Service
+ * @createDate 2023-9-12 21:30:24
+ */
+public interface InsAgreementOrderService extends IService<InsAgreementOrder> {
+
+    /**
+     * 通过子订单查询费用跟单表
+     *
+     * @param companyId 子订单
+     * @return InsAreaCompany
+     */
+    InsAgreementOrder getByIdIsExist(String companyId);
+
+
+    /**
+     * 通过 保险公司订单号查询费用跟单表
+     *
+     * @param insOrderNo 保险公司订单号
+     * @return InsAreaCompany
+     */
+    InsAgreementOrder getByInsOrderNo(String insOrderNo);
+
+    /**
+     * 修改费用跟单表
+     *
+     * @param insAgreementOrder
+     */
+    void updateCompanyAndOrders(InsAgreementOrder insAgreementOrder);
+
+    /**
+     * 插入费用跟单表
+     *
+     * @param insAgreementOrder
+     */
+    void insertCompanyAndOrders(InsAgreementOrder insAgreementOrder);
+}

+ 52 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsAgreementOrderServiceImpl.java

@@ -0,0 +1,52 @@
+package com.ydtech.modules.order.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.order.dao.InsAgreementOrderMapper;
+import com.ydtech.modules.order.entity.InsAgreementOrder;
+import com.ydtech.modules.order.service.InsAgreementOrderService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
+/**
+ * @author CXP
+ * @description 针对表【ins_agreement_order(费用跟单)】的数据库操作Service实现
+ * @createDate 2023-9-12 21:29:23
+ */
+@Service
+public class InsAgreementOrderServiceImpl extends ServiceImpl<InsAgreementOrderMapper, InsAgreementOrder>
+        implements InsAgreementOrderService {
+
+
+    @Override
+    public InsAgreementOrder getByIdIsExist(String companyId) {
+        InsAgreementOrder insAgreementOrder = this.getById(companyId);
+        if (ObjectUtils.isEmpty(insAgreementOrder)) {
+            throw new SystemException("费用跟单表不存在");
+        }
+        return insAgreementOrder;
+    }
+
+    @Override
+    public InsAgreementOrder getByInsOrderNo(String insOrderNo) {
+        return baseMapper.selectOne(new LambdaQueryWrapper<InsAgreementOrder>().eq(InsAgreementOrder::getOrderno, insOrderNo));
+    }
+
+    @Override
+    @Transactional
+    public void updateCompanyAndOrders(InsAgreementOrder insAreaCompany) {
+        baseMapper.updateById(insAreaCompany);
+    }
+
+    @Override
+    public void insertCompanyAndOrders(InsAgreementOrder insAreaCompany) {
+        baseMapper.insert(insAreaCompany);
+    }
+
+}
+
+
+
+

+ 16 - 9
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

@@ -37,10 +37,7 @@ import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
-import com.ydtech.modules.order.service.InsAreaCompanyService;
-import com.ydtech.modules.order.service.InsOrdersService;
-import com.ydtech.modules.order.service.InsTaskImagesService;
-import com.ydtech.modules.order.service.ZhongMeiOrderApiService;
+import com.ydtech.modules.order.service.*;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.utils.CalculateUtils;
@@ -74,7 +71,12 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
     private final FeeRuleSchemeService feeRuleSchemeService;
 
-    public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService, ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents, ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,FeeRuleSchemeService feeRuleSchemeService) {
+    private final InsAgreementOrderService insAgreementOrderService;
+
+    public ZhongMeiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService,
+                                       ZhongmeiRequestApiComponents zhongmeiRequestApiComponents, ZhongmeiRequestComponents zhongmeiRequestComponents,
+                                       ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,
+                                       FeeRuleSchemeService feeRuleSchemeService,InsAgreementOrderService insAgreementOrderService) {
         this.insOrdersService = insOrdersService;
         this.insAreaCompanyService = insAreaCompanyService;
         this.insTaskImagesService = insTaskImagesService;
@@ -83,6 +85,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         this.configureParametersComponents = configureParametersComponents;
         this.ptlAgreementAttributionService = ptlAgreementAttributionService;
         this.feeRuleSchemeService = feeRuleSchemeService;
+        this.insAgreementOrderService = insAgreementOrderService;
     }
 
     private void modelInquiry(String modelName, List<ModelsQueryResponse.SimpleStadarCarDTO> simpleStadarCarDTOS) {
@@ -151,10 +154,14 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         QuoteRespVo quoteRespVo = getQuoteRespVo(quotedPriceResponse, quoteInfo);
 
         //这里调用费用匹配功能
-        //InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
-        //FeeSchemeReqDto feeSchemeReqDto = feeRuleSchemeService.getFeeSchemeInfo(quoteInfo,quoteRespVo,ptlAgreementAttribution.getId(),insOrders.getProductid());
-        //FeeSchemeResDto feeSchemeResDto = feeRuleSchemeService.matchTheAppropriateFees(feeSchemeReqDto);
-        //InsAgreementOrder insAgreementOrder = new InsAgreementOrder(feeSchemeReqDto,feeSchemeResDto,quotedPriceResponse.getBusinessNo());
+        /*InsOrders insOrders = insOrdersService.getById(quoteRespVo.getOrderno());
+        FeeSchemeReqDto feeSchemeReqDto = feeRuleSchemeService.getFeeSchemeInfo(quoteInfo,quoteRespVo,ptlAgreementAttribution.getId(),insOrders.getProductid());
+       // FeeSchemeResDto feeSchemeResDto = feeRuleSchemeService.matchTheAppropriateFees(feeSchemeReqDto);
+        FeeSchemeResDto feeSchemeResDto = new FeeSchemeResDto();
+        feeSchemeResDto.setJqCostsProportion("50");
+        feeSchemeResDto.setSyCostsProportion("55");
+        InsAgreementOrder insAgreementOrder = new InsAgreementOrder(feeSchemeReqDto,feeSchemeResDto,quotedPriceResponse.getBusinessNo());
+        insAgreementOrderService.insertCompanyAndOrders(insAgreementOrder);*/
         return responseOrder(quotedPriceResponse, quoteRespVo, ptlAgreementAttribution);
     }