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

Merge remote-tracking branch 'origin/test' into test

Qchen 2 роки тому
батько
коміт
18bb7a9829
41 змінених файлів з 760 додано та 147 видалено
  1. 5 0
      pom.xml
  2. 0 1
      src/main/java/com/ydtech/config/properties/BohaiApiConfigurationProperties.java
  3. 33 0
      src/main/java/com/ydtech/config/properties/PingAnApiConfigurationProperties.java
  4. 1 1
      src/main/java/com/ydtech/constants/InsuranceEnum.java
  5. 1 0
      src/main/java/com/ydtech/modules/esm/service/EsmUserReferrerService.java
  6. 27 0
      src/main/java/com/ydtech/modules/esm/service/impl/EsmUserReferrerServiceImpl.java
  7. 16 46
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  8. 3 0
      src/main/java/com/ydtech/modules/ins/model/InsOrdersExcel.java
  9. 21 3
      src/main/java/com/ydtech/modules/ins/model/guoren/InsuranceSlipReq.java
  10. 17 0
      src/main/java/com/ydtech/modules/ins/model/guoren/PremiumResp.java
  11. 12 4
      src/main/java/com/ydtech/modules/order/aop/aspect/AuditVerificationAspect.java
  12. 3 2
      src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java
  13. 2 5
      src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRequestApiComponents.java
  14. 66 0
      src/main/java/com/ydtech/modules/order/components/pingan/PinganRequestApiComponents.java
  15. 1 1
      src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java
  16. 8 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java
  17. 15 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java
  18. 2 2
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/UnderwritingResponse.java
  19. 41 0
      src/main/java/com/ydtech/modules/order/entity/api/pingan/constants/RequestUrl.java
  20. 0 1
      src/main/java/com/ydtech/modules/order/entity/api/pingan/request/PingAnBaseRequest.java
  21. 19 0
      src/main/java/com/ydtech/modules/order/entity/config/PingAnConfigureParameters.java
  22. 1 1
      src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java
  23. 1 3
      src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java
  24. 12 6
      src/main/java/com/ydtech/modules/order/service/impl/IdentifyServiceImpl.java
  25. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  26. 84 41
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  27. 3 1
      src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java
  28. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  29. 222 0
      src/main/java/com/ydtech/modules/order/utils/PingAnRSAUtils.java
  30. 24 0
      src/main/java/com/ydtech/modules/protocols/entity/po/InsFeeOrderNew.java
  31. 1 1
      src/main/java/com/ydtech/modules/xxl/handler/QueryStatusHandler.java
  32. 1 1
      src/main/java/com/ydtech/modules/xxl/handler/SyncStatusHandler.java
  33. 2 0
      src/main/java/com/ydtech/modules/xxl/mapper/XxlInsAreaCompanyMapper.java
  34. 13 0
      src/main/java/com/ydtech/utils/baidu/Idcard.java
  35. 24 0
      src/main/java/com/ydtech/utils/baidu/MultiObjectDetect.java
  36. 9 0
      src/main/resources/application-pre.yml
  37. 9 0
      src/main/resources/application-prod.yml
  38. 10 0
      src/main/resources/application-test.yml
  39. 37 17
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  40. 2 0
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml
  41. 10 7
      src/main/resources/mapper/modules/xxl/XxlInsAreaCompanyMapper.xml

+ 5 - 0
pom.xml

@@ -561,6 +561,11 @@
             <version>2.3.0</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <version>1.56</version>
+        </dependency>
     </dependencies>
 
 

+ 0 - 1
src/main/java/com/ydtech/config/properties/BohaiApiConfigurationProperties.java

@@ -26,5 +26,4 @@ public class BohaiApiConfigurationProperties {
     private String insurerCode;
 
 
-
 }

+ 33 - 0
src/main/java/com/ydtech/config/properties/PingAnApiConfigurationProperties.java

@@ -0,0 +1,33 @@
+package com.ydtech.config.properties;
+
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @description: 平安财险 配置文件
+ * @author: wenks
+ * @date: 2024/3/25 9:47
+ **/
+@Data
+@Component
+@ConfigurationProperties(prefix = "pingan.api")
+public class PingAnApiConfigurationProperties {
+
+    // 接口地址
+    private String url;
+
+    // 令牌地址
+    private String accessUrl;
+
+    // 我司公钥
+    private String selfPublicKey;
+
+    // 我司私钥
+    private String selfPrivateKey;
+
+    // 平安财险方公钥
+    private String pingAnPublicKey;
+
+}

+ 1 - 1
src/main/java/com/ydtech/constants/InsuranceEnum.java

@@ -55,7 +55,7 @@ public enum InsuranceEnum {
     LIHI("LIHI", "利宝保险有限公司", ""),
     MACN("MACN", "亚太财产保险有限公司", ""),
     MSIC("MSIC", "三井住友海上火灾保险(中国)有限公司", ""),
-    PAIC("PAIC", "中国平安财产保险股份有限公司", ""),
+    PAIC("PAIC", "中国平安财产保险股份有限公司", "pingan"),
     PICC("PICC", "中国人民财产保险股份有限公司", ""),
     QHIC("QHIC", "新疆前海联合财产保险股份有限公司", ""),
     RSIC("RSIC", "融盛财产保险股份有限公司", ""),

+ 1 - 0
src/main/java/com/ydtech/modules/esm/service/EsmUserReferrerService.java

@@ -22,6 +22,7 @@ import java.util.Map;
 public interface EsmUserReferrerService extends IService<EsmUserReferrer> {
 
 
+    List<EsmUserReferrer> findParents(String userId);
     Map buildLevelInfo(SysUser agent);
 
     boolean deldeleteByReferrerId(String userId);

+ 27 - 0
src/main/java/com/ydtech/modules/esm/service/impl/EsmUserReferrerServiceImpl.java

@@ -31,6 +31,7 @@ import javax.sql.DataSource;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Service
@@ -46,6 +47,32 @@ public class EsmUserReferrerServiceImpl extends ServiceImpl<EsmUserReferrerMappe
     @Autowired
     private EsmUserReferrerService esmUserReferrerService;
 
+
+    // 递归查找节点的所有父级节点
+    public List<EsmUserReferrer> findParents(String userId) {
+        List<EsmUserReferrer> referrers = new ArrayList<>();
+        EsmUserReferrer esmUserReferrer = esmUserReferrerService.getById(userId);
+        //找不到用户的推荐关系
+        if(esmUserReferrer == null){
+            return null;
+        }
+        List<EsmUserReferrer> esmUserReferrers = esmUserReferrerService.list(new LambdaQueryWrapper<EsmUserReferrer>().eq(EsmUserReferrer::getAffiliation, esmUserReferrer.getAffiliation()));
+        findParentsRecursive(userId, esmUserReferrers, referrers);
+        return referrers;
+    }
+
+    private static void findParentsRecursive(String userId, List<EsmUserReferrer> esmUserReferrers,List<EsmUserReferrer> referrers) {
+        EsmUserReferrer collect = esmUserReferrers.stream().filter(item -> item.getId().equals(userId)).findFirst().get();
+        if(collect != null){
+            if(collect.getId().equals(collect.getReferrerId())){
+                referrers.add(collect);
+            }else{
+                referrers.add(collect);
+                findParentsRecursive(collect.getReferrerId(), esmUserReferrers, referrers);
+            }
+        }
+    }
+
     @Override
     public Map buildLevelInfo(SysUser agent) {
         Map m = new HashMap();

+ 16 - 46
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -355,69 +355,39 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //计算分销费用
         InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
         SysUser sysUser = sysUserService.findByUserId(insOrders.getUserid());
+
+        //获取分销比例
         List<EsmRetail> esmRetailList = esmRetailService.selectList(" where t.deptid=? and t.status = '1' ",
                 new Object[]{sysUser.getDeptId()});
 
+
         if (esmRetailList != null && !esmRetailList.isEmpty()) {
             EsmRetail esmRetail = esmRetailList.get(0);
+            //分销等级
+            insFeeOrderNew.setDistributionStatus(esmRetailList.get(0).getRetailtype());
+            //用户分销人员id
+            List<EsmUserReferrer> parents = esmUserReferrerService.findParents(sysUser.getId());
+
             if (esmRetail != null) {
                 if(Integer.parseInt(esmRetail.getRetailtype()) >= 3){
                     insFeeOrderNew.setFirstDetailProportion(new BigDecimal(esmRetail.getDisrate1()));
                     insFeeOrderNew.setFirstDetailPremiums(insFeeOrderNew.getJqNoTaxPremium().multiply(new BigDecimal(esmRetail.getDisrate1())).divide(new BigDecimal("100")));
+                    if(parents.size() > 2){
+                        insFeeOrderNew.setThreeLevelUserId(parents.get(2).getId());
+                    }
                 }
                 if(Integer.parseInt(esmRetail.getRetailtype()) >= 2){
                     insFeeOrderNew.setSecondDetailProportion(new BigDecimal(esmRetail.getDisrate2()));
                     insFeeOrderNew.setSecondDetailPremiums(insFeeOrderNew.getJqNoTaxPremium().multiply(new BigDecimal(esmRetail.getDisrate2())).divide(new BigDecimal("100")));
+                    if(parents.size() > 1){
+                        insFeeOrderNew.setTwoLevelUserId(parents.get(1).getId());
+                    }
                 }
                 if(Integer.parseInt(esmRetail.getRetailtype()) >= 1){
                     insFeeOrderNew.setThirdDetailProportion(new BigDecimal(esmRetail.getDisrate3()));
                     insFeeOrderNew.setThirdDetailPremiums(insFeeOrderNew.getJqNoTaxPremium().multiply(new BigDecimal(esmRetail.getDisrate3())).divide(new BigDecimal("100")));
-                }
-            }
-        }
-//      判断分销等级   通过userId  去查询  esm_user_referrer  如果 referrer_id  与 userId  相同时 一级分销   不同且还有上级为三级分销   其余  则二级分销
-        String userId = insFeeOrderNew.getUserId();
-        EsmUserReferrer esmUserReferrerServiceById = esmUserReferrerService.getById(userId);
-        if (ObjectUtils.isNotEmpty(esmUserReferrerServiceById)) {
-            String referrerId = esmUserReferrerServiceById.getReferrerId();
-//              如果相等则为一级
-            if (StringUtils.isNotEmpty(referrerId) && referrerId.equals(userId)) {
-                BigDecimal jqPremium = insFeeOrderNew.getJqPremium();  // 交强
-                BigDecimal bigdecimalFomat = new BigDecimal("100");
-                BigDecimal firstDetailProportion = insFeeOrderNew.getFirstDetailProportion();   // 一级分销比例
-                BigDecimal divide = firstDetailProportion.divide(bigdecimalFomat, 2, RoundingMode.HALF_UP);
-                BigDecimal jqAmount = jqPremium.multiply(divide);    //交强分销费用
-
-                BigDecimal jaLevelAmount1 = insFeeOrderNew.getJqDeptProportionLevel1() != null ? jqAmount.multiply(insFeeOrderNew.getJqDeptProportionLevel1().divide(bigdecimalFomat, 2, RoundingMode.HALF_UP)) : BigDecimal.ZERO;
-                BigDecimal jaLevelAmount2 = insFeeOrderNew.getJqDeptProportionLevel2() != null ? jqAmount.multiply(insFeeOrderNew.getJqDeptProportionLevel2().divide(bigdecimalFomat, 2, RoundingMode.HALF_UP)) : BigDecimal.ZERO;
-                BigDecimal jaLevelAmount3 = insFeeOrderNew.getJqDeptProportionLevel3() != null ? jqAmount.multiply(insFeeOrderNew.getJqDeptProportionLevel3().divide(bigdecimalFomat, 2, RoundingMode.HALF_UP)) : BigDecimal.ZERO;
-                BigDecimal jaLevelAmount4 = insFeeOrderNew.getJqDeptProportionLevel4() != null ? jqAmount.multiply(insFeeOrderNew.getJqDeptProportionLevel4().divide(bigdecimalFomat, 2, RoundingMode.HALF_UP)) : BigDecimal.ZERO;
-                BigDecimal jaLevelAmount5 = insFeeOrderNew.getJqDeptProportionLevel4() != null ? jqAmount.multiply(insFeeOrderNew.getJqDeptProportionLevel5().divide(bigdecimalFomat, 2, RoundingMode.HALF_UP)) : BigDecimal.ZERO;
-
-                insFeeOrderNew.setJqDeptPremiumsLevel1(insFeeOrderNew.getJqDeptPremiumsLevel1().add(jaLevelAmount1));//    交强一级机构管理费
-                insFeeOrderNew.setJqDeptPremiumsLevel2(insFeeOrderNew.getJqDeptPremiumsLevel2().add(jaLevelAmount2));//    交强二级机构管理费
-                insFeeOrderNew.setJqDeptPremiumsLevel3(insFeeOrderNew.getJqDeptPremiumsLevel3().add(jaLevelAmount3));//    交强三级机构管理费
-                insFeeOrderNew.setJqDeptPremiumsLevel4(insFeeOrderNew.getJqDeptPremiumsLevel4().add(jaLevelAmount4));//    交强四级机构管理费
-                insFeeOrderNew.setJqDeptPremiumsLevel5(insFeeOrderNew.getJqDeptPremiumsLevel5().add(jaLevelAmount5));//    交强五级机构管理费
-
-            } else {
-                EsmUserReferrer secondReferrer = esmUserReferrerService.getById(referrerId);
-                if (ObjectUtils.isNotEmpty(secondReferrer)) {
-                    //                二级分销
-                    BigDecimal secondDetailPremiums = insFeeOrderNew.getSecondDetailPremiums();
-                    BigDecimal thirdDetailPremiums = insFeeOrderNew.getThirdDetailPremiums();
-                    if (StringUtils.isNotEmpty(secondReferrer.getReferrerId()) && secondReferrer.getReferrerId().equals(referrerId)) {
-//                     二级分销  则  添加到 sys_user_account  表的 promotion  推广金 字段里
-                        SysUserAccount sysUserAccount = new SysUserAccount();
-                        sysUserAccount.setUserId(referrerId);
-                        sysUserAccount.setPromotion(secondDetailPremiums);
-                        sysUserAccountService.addOrUpdate(sysUserAccount);
-                    } else {
-//                     最后为三级
-                        SysUserAccount sysUserAccount = new SysUserAccount();
-                        sysUserAccount.setUserId(secondReferrer.getReferrerId());
-                        sysUserAccount.setPromotion(thirdDetailPremiums);
-                        sysUserAccountService.addOrUpdate(sysUserAccount);
+                    if(parents.size() > 0) {
+                        insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
                     }
                 }
             }

+ 3 - 0
src/main/java/com/ydtech/modules/ins/model/InsOrdersExcel.java

@@ -19,6 +19,9 @@ public class InsOrdersExcel {
     @ExcelProperty(value = "协议号")
     private String agreementId;
 
+    @ExcelIgnore
+    private String apiType;
+
     @ExcelProperty(value = "工号")
     private String userId;
 

+ 21 - 3
src/main/java/com/ydtech/modules/ins/model/guoren/InsuranceSlipReq.java

@@ -4,11 +4,14 @@ import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.order.entity.api.guoren.constants.GuoRenRiskCode;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 投保单保存 入参
@@ -30,6 +33,7 @@ public class InsuranceSlipReq {
     @JsonProperty(value = "biPrptenages")
     @JSONField(name = "biPrptenages")
     private List<PremiumResp.DataDTO.BiPrptenagesDTO> biPrptenages;
+
     @JsonProperty(value = "ciPrptenages")
     @JSONField(name = "ciPrptenages")
     private List<PremiumResp.DataDTO.CiPrptenagesDTO> ciPrptenages;
@@ -41,7 +45,10 @@ public class InsuranceSlipReq {
      * 构造请求参数
      */
     @JsonIgnore
-    public static InsuranceSlipReq buildParam(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode, PremiumResp.DataDTO premiumResult) {
+    public static InsuranceSlipReq buildParam(BaseQuoteInfoVo yaQuoteInfoVo,
+                                              String carPriceNum,
+                                              String orderCode,
+                                              List<GuoRenSpecialAgreementVo> specialAgreementVo) {
         //投保人
         CustomerInfoVo policyHolderInfo = yaQuoteInfoVo.getPolicyHolderInfo();
         //被保人
@@ -86,8 +93,19 @@ public class InsuranceSlipReq {
 
         req.setOrder(orderCode);
         req.setPrpTinsured(prpTinsured);
-        req.setBiPrptenages(premiumResult.getBiPrptenages());
-        req.setCiPrptenages(premiumResult.getCiPrptenages());
+
+        List<PremiumResp.DataDTO.CiPrptenagesDTO> ciPrptenages = specialAgreementVo.stream()
+                .filter(x -> GuoRenRiskCode.R_0507.getCode().equals(x.getRiskCode()))
+                .map(PremiumResp.DataDTO.CiPrptenagesDTO::new)
+                .collect(Collectors.toList());
+
+        List<PremiumResp.DataDTO.BiPrptenagesDTO> biPrptenages = specialAgreementVo.stream()
+                .filter(x -> GuoRenRiskCode.R_0518.getCode().equals(x.getRiskCode()))
+                .map(PremiumResp.DataDTO.BiPrptenagesDTO::new)
+                .collect(Collectors.toList());
+
+        req.setBiPrptenages(biPrptenages);
+        req.setCiPrptenages(ciPrptenages);
         return req;
 
     }

+ 17 - 0
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumResp.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.ins.model.guoren;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import net.minidev.json.annotate.JsonIgnore;
@@ -824,6 +825,15 @@ public class PremiumResp {
             @JsonProperty(value = "flag")
             @JSONField(name = "flag")
             private String flag;
+
+
+            public BiPrptenagesDTO(GuoRenSpecialAgreementVo guoRenSpecialAgreementVo) {
+                this.riskCode = guoRenSpecialAgreementVo.getRiskCode();
+                this.clauseCode = guoRenSpecialAgreementVo.getClauseCode();
+                this.clauses = guoRenSpecialAgreementVo.getClauses();
+                this.clausesContext = guoRenSpecialAgreementVo.getClausesContext();
+            }
+
         }
 
         @NoArgsConstructor
@@ -859,6 +869,13 @@ public class PremiumResp {
             @JsonProperty(value = "flag")
             @JSONField(name = "flag")
             private String flag;
+
+            public CiPrptenagesDTO(GuoRenSpecialAgreementVo guoRenSpecialAgreementVo) {
+                this.riskCode = guoRenSpecialAgreementVo.getRiskCode();
+                this.clauseCode = guoRenSpecialAgreementVo.getClauseCode();
+                this.clauses = guoRenSpecialAgreementVo.getClauses();
+                this.clausesContext = guoRenSpecialAgreementVo.getClausesContext();
+            }
         }
     }
 }

+ 12 - 4
src/main/java/com/ydtech/modules/order/aop/aspect/AuditVerificationAspect.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.aop.aspect;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUserRole;
@@ -12,6 +13,7 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
@@ -50,14 +52,20 @@ public class AuditVerificationAspect {
     public void doBefore(JoinPoint point) {
         Object[] args = point.getArgs();
         for (Object arg : args) {
-            //接收保险公司id参数
-            String companyId = arg.toString();
+            String companyId = "";
+            if (arg instanceof SpecialAuditVo) {
+                JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(arg));
+                companyId = jsonObject.getString("companyId");
+            }else {
+                //接收保险公司id参数
+                companyId = arg.toString();
+            }
             InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
             InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
             //先进行承保规则判断
-            feeRuleSchemeNewService.verificationRuleFactor(insAreaCompany,insOrders);
+            feeRuleSchemeNewService.verificationRuleFactor(insAreaCompany, insOrders);
             //再进行费用因子判断
-            feeRuleSchemeNewService.verificationCostFactor(insAreaCompany,insOrders);
+            feeRuleSchemeNewService.verificationCostFactor(insAreaCompany, insOrders);
         }
     }
 

+ 3 - 2
src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java

@@ -20,6 +20,7 @@ import com.ydtech.modules.order.entity.api.guoren.response.QueryNoCarPolicyNoRes
 import com.ydtech.modules.order.entity.api.guoren.response.SignatureResponse;
 import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
 import com.ydtech.modules.order.utils.InsuranceLog;
 import com.ydtech.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -99,9 +100,9 @@ public class GuorenRequestApiComponent {
     /**
      * 投保单保存
      */
-    public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode, PremiumResp.DataDTO premiumResult) {
+    public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum, String orderCode,  List<GuoRenSpecialAgreementVo> specialAgreementVo) {
         //构造请求参数
-        InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum, orderCode, premiumResult);
+        InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum, orderCode, specialAgreementVo);
         return request(req, PlatformInterfaceCode.API_IIRBT00006, InsuranceSlipResp.class);
     }
 

+ 2 - 5
src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRequestApiComponents.java

@@ -16,6 +16,7 @@ import com.ydtech.modules.order.utils.AESUtilsWithDataBase;
 import com.ydtech.modules.order.utils.InsuranceLog;
 import com.ydtech.utils.Base64Utils;
 import com.ydtech.utils.RSA.RSAUtils;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.http.HttpEntity;
@@ -38,6 +39,7 @@ import java.util.List;
  */
 @Slf4j
 @Component
+@RequiredArgsConstructor
 public class HuaTaiRequestApiComponents {
 
 
@@ -45,11 +47,6 @@ public class HuaTaiRequestApiComponents {
 
     private final RestTemplate restTemplate;
 
-    public HuaTaiRequestApiComponents(HuaTaiApiConfigurationProperties huaTaiApiConfigurationProperties, RestTemplate restTemplate) {
-        this.properties = huaTaiApiConfigurationProperties;
-        this.restTemplate = restTemplate;
-    }
-
 
     /**
      * 加密请求

+ 66 - 0
src/main/java/com/ydtech/modules/order/components/pingan/PinganRequestApiComponents.java

@@ -1,16 +1,82 @@
 package com.ydtech.modules.order.components.pingan;
 
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.ydtech.config.properties.PingAnApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.modules.order.entity.api.bohai.BoHaiEncrypted;
+import com.ydtech.modules.order.entity.api.bohai.constants.RequestType;
+import com.ydtech.modules.order.entity.api.bohai.request.BoHaiBaseRequest;
+import com.ydtech.modules.order.entity.api.bohai.response.BoHaiBaseResponse;
+import com.ydtech.modules.order.entity.api.pingan.constants.RequestUrl;
+import com.ydtech.modules.order.entity.api.pingan.request.PingAnBaseRequest;
+import com.ydtech.modules.order.entity.api.pingan.response.PingAnBaseResponse;
+import com.ydtech.modules.order.entity.config.PingAnConfigureParameters;
+import com.ydtech.modules.order.utils.InsuranceLog;
+import com.ydtech.modules.order.utils.PingAnRSAUtils;
+import com.ydtech.modules.order.utils.SignatureUtils;
 import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
+import java.util.Map;
+
 @Component
 @RequiredArgsConstructor
 public class PinganRequestApiComponents {
 
     private final RestTemplate restTemplate;
 
+    private final PingAnApiConfigurationProperties properties;
+
+    /**
+     * 加密请求
+     *
+     * @param q      请求参数
+     * @param url    请求url
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+//    private <Q extends PingAnBaseRequest, S extends PingAnBaseResponse> S post(Q q, String url, Class<S> tClass, String sysSourceCode,
+//                                                                               RequestUrl requestUrl) throws Exception {
+//
+//        HttpHeaders httpHeaders = new HttpHeaders();
+//        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+//        String busReqString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+//        InsuranceLog.infoLog(InsuranceEnum.PAIC.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+//                requestUrl.getDesc(), url, busReqString);
+//
+//        JSONObject jsonObject = (JSONObject) JSON.toJSON(q);
+//
+//        // TODO
+//        String signature = PingAnRSAUtils.sortParametersWithASCII(jsonObject);
+//        String signData = PingAnRSAUtils.sign(signature, properties.getSelfPrivateKey());
+//
+//        InsuranceLog.infoLog(InsuranceEnum.PAIC.getPinyin(), "\n\t---------> {} \n\t---------> 加密后的参数:{} \n\t---------> " +
+//                "请求头内容signature:{}", requestUrl.getDesc(), signData, signature);
+//
+//        // 请求
+//        HttpEntity<String> httpEntity = new HttpEntity<>(signData, httpHeaders);
+//        ResponseEntity<String> response = restTemplate.postForEntity(url, httpEntity, String.class);
+//
+//        String body = response.getBody();
+//        InsuranceLog.infoLog(InsuranceEnum.PAIC.getPinyin(), "\n\t---------> {} \n\t---------> 解密前的参数:{}", requestUrl.getDesc(), body);
+//
+//        // 解密响应
+//        BoHaiEncrypted encrypted = JSON.parseObject(body).toJavaObject(BoHaiEncrypted.class);
+//        String info = SignatureUtils.decryptByPrivateKey(encrypted.getBizContent(), properties.getSelfPrivateKey());
+//        InsuranceLog.infoLog(InsuranceEnum.PAIC.getPinyin(), "\n\t---------> {} \n\t---------> 解密后的参数:{}", requestUrl.getDesc(), info);
+//        return JSON.parseObject(info).toJavaObject(tClass);
+//    }
+
 
 
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java

@@ -38,7 +38,7 @@ public interface InsAreaCompanyMapper extends BaseMapper<InsAreaCompany> {
      * @param orderNo 订单号
      * @return
      */
-    InsAreaCompany queryLatestStatus(@Param("orderNo") String orderNo);
+    String queryLatestStatus(@Param("orderNo") String orderNo);
 
 
     List<InsAreaCompany> getorDerIds();

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

@@ -13,6 +13,7 @@ import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.utils.idgen.IdGenerate;
 import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -29,6 +30,7 @@ import java.time.LocalDateTime;
 @Data
 @ApiModel(value = "报价渠道")
 @NoArgsConstructor
+@AllArgsConstructor
 public class InsAreaCompany implements Serializable {
     /**
      * 主键
@@ -332,6 +334,12 @@ public class InsAreaCompany implements Serializable {
     @TableField(exist = false)
     private String userId;
 
+    @TableField(value = "inside_order_status")
+    private Integer insideOrderStatus;
+
+    @TableField(value = "inside_pay_time")
+    private String insidePayTime;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 

+ 15 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleConfirmationReqeust.java

@@ -10,12 +10,14 @@ import com.ydtech.modules.order.entity.api.bohai.constants.*;
 import com.ydtech.modules.order.entity.api.bohai.response.VehicleTypeQueryResponse;
 import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.utils.IDCardUtils;
 import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -325,6 +327,9 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         @JsonProperty("residentialAddress")
         private String residentialAddress;
 
+        @JsonProperty("birthday")
+        private String birthday;
+
         public CarOwnerDTO(CustomerInfoVo ownerInfo, PersonAreaVo ownerInfoArea) {
             this.certType = CertType.CT_111.getCode();
             this.ownerName = ownerInfo.getName();
@@ -341,6 +346,7 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
             this.cityName = ownerInfoArea.getCityName();
             this.distCode = ownerInfoArea.getCountyCode();
             this.distName = ownerInfoArea.getCountyName();
+            this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
         }
     }
 
@@ -433,6 +439,8 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         @JsonProperty("residentialAddress")
         private String residentialAddress;
 
+        @JsonProperty("birthday")
+        private String birthday;
 
         public HolderDTO(CustomerInfoVo policyHolderInfo, PersonAreaVo policyHolderArea) {
             // 通用参数
@@ -459,7 +467,7 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
             this.distName = policyHolderArea.getCountyName();
 
             this.residentialAddress = policyHolderInfo.getAddr();
-
+            this.birthday = IDCardUtils.GetBirthday(policyHolderInfo.getIdentifyNumber());
         }
     }
 
@@ -538,6 +546,9 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
         private String residentialAddress;
 
 
+        @JsonProperty("birthday")
+        private String birthday;
+
         public InsurederDTO(CustomerInfoVo insuredPersonInfo, PersonAreaVo insuredPersonArea) {
             // 通用参数
             this.certType = CertType.CT_111.getCode();
@@ -556,8 +567,11 @@ public class VehicleConfirmationReqeust extends BoHaiBaseRequest {
             this.cityName = insuredPersonArea.getCityName();
             this.distCode = insuredPersonArea.getCountyCode();
             this.distName = insuredPersonArea.getCountyName();
+            this.birthday = IDCardUtils.GetBirthday(insuredPersonInfo.getIdentifyNumber());
 
         }
 
     }
+
+
 }

+ 2 - 2
src/main/java/com/ydtech/modules/order/entity/api/bohai/response/UnderwritingResponse.java

@@ -185,8 +185,8 @@ public class UnderwritingResponse extends BoHaiBaseResponse {
 
 
             public DrivingInsuranceDto toDrivingInsuranceDto() {
-                if (StringUtils.isNotEmpty(resultMsg)) {
-                    throw new SystemException(resultMsg);
+                if (StringUtils.isNotEmpty(this.getResultMsg())) {
+                    throw new SystemException(this.getResultMsg());
                 }
 
                 DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();

+ 41 - 0
src/main/java/com/ydtech/modules/order/entity/api/pingan/constants/RequestUrl.java

@@ -0,0 +1,41 @@
+package com.ydtech.modules.order.entity.api.pingan.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+
+/**
+ * @version
+ * @description: 平安
+ * @author: wenks
+ * @date: 2024/3/25 14:16
+ **/
+@AllArgsConstructor
+@Getter
+public enum RequestUrl {
+
+    R_001("001", "/property/chexian/query/searchPAVehicleList", "平安车型搜索接口"),
+    R_002("002", "/property/chexian/query/getPolicyPdf", "电子保单"),
+    R_31("31", "/property/chexian/insure/index", "标的检查"),
+    R_41("41", "/property/chexian/insure/renewalConfirm", "续保确认"),
+    R_42("42", "/property/chexian/insure/carConfirm", "车辆信息确认"),
+    R_43("43", "/property/chexian/insure/getDmvehicleInfo", "交管车辆验证码"),
+    R_44("44", "/property/chexian/insure/getUnAutoProductList", "获取财意险险种套餐列表"),
+    R_45("45", "/property/chexian/insure/ getUnAutoProductDetail", "获取财意险险种套餐责任信息"),
+    R_51("51", "/property/chexian/insure/quote", "保费计算"),
+    R_52("52", "/property/chexian/insure/queryServiceContract", "服务类特约检索"),
+    R_61("61", "/property/chexian/insure/submitApply", "补充信息并核保"),
+    R_78("78", "/property/getScanCodeURL", "二维码支付"),
+    R_82("82", "/property/chexian/insure/accept", "承保接口"),
+    R_91("91", "/property/chexian/insure/getDocumentStatusList", "单证状态查询"),
+    R_92("92", "/property/chexian/insure/repealDocument", "撤销单证"),
+    R_93("93", "/property/chexian/insure/uploadFiles", "资料上传");
+
+    private final String code;
+
+    private final String url;
+
+    private final String desc;
+
+}

+ 0 - 1
src/main/java/com/ydtech/modules/order/entity/api/pingan/request/PingAnBaseRequest.java

@@ -18,5 +18,4 @@ public class PingAnBaseRequest implements Serializable {
      */
     private String flowid;
 
-
 }

+ 19 - 0
src/main/java/com/ydtech/modules/order/entity/config/PingAnConfigureParameters.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.order.entity.config;
+
+
+import lombok.Data;
+
+
+/**
+ * @version
+ * @description: 平安财险配置
+ * @author: wenks
+ * @date: 2024/3/25 9:46
+ **/
+@Data
+public class PingAnConfigureParameters implements ConfigureParameters {
+
+
+
+
+}

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java

@@ -57,7 +57,7 @@ public interface InsAreaCompanyService extends IService<InsAreaCompany> {
      *
      * @param orderNo 主订单号
      */
-    InsAreaCompany queryLatestStatus(String orderNo);
+    String queryLatestStatus(String orderNo);
 
     List<InsAreaCompany> getorDerIds();
 

+ 1 - 3
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -215,13 +215,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         }
         // 特别约定
         List<GuoRenSpecialAgreementVo> specialAgreementVo = quoteVo.getGuoRenSpecialAgreementVo();
-
         // 4、保费计算
         PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ, isNoCar,
                 specialAgreementVo);
         AssertionUtils.isEmpty(premiumResult, "保费计算失败");
 
-
         // 5、 生成订单
         QuoteRespVo quoteRespVo = buildQuoteRespVo(order, premiumResult, yaQuoteInfoVo, jsPremium);
         // 账号信息
@@ -231,7 +229,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         InsAreaCompany iac = responseOrder(order, quoteRespVo, quoteVo, ptlAgreementAttribution);
         //  6、 投保单保存
         InsuranceSlipResp insuranceSlip = guorenRequestApiComponent.insuranceSlip(yaQuoteInfoVo,
-                carPriceResult.getInputvo(), orderCode, premiumResult);
+                carPriceResult.getInputvo(), orderCode, specialAgreementVo);
         if (insuranceSlip.getResultCode() == 1) {
             return HttpResult.error(insuranceSlip.getResultMsg());
         }

+ 12 - 6
src/main/java/com/ydtech/modules/order/service/impl/IdentifyServiceImpl.java

@@ -53,11 +53,12 @@ public class IdentifyServiceImpl implements IdentifyService {
             String s1Key = IMAGE_IDENTIFY_KEY + "idCard:" + "front:" + s1MD5;
             if (StringUtils.isNotBlank(s1) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s1Key))) {
                 //走缓存
-                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), customerInfoVO);
+                CustomerInfoVO customerInfoVO1 = new CustomerInfoVO();
+                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), customerInfoVO1);
+                Idcard.conversionFront(customerInfoVO, customerInfoVO1);
             } else {
                 //识别身份证正面
                 Idcard.getIdCardFront(s1, customerInfoVO);
-                AssertionUtils.isEmpty(customerInfoVO, "身份证识别失败");
                 //设置缓存
                 redisTemplate.opsForValue().set(s1Key, customerInfoVO, 1, TimeUnit.DAYS);
             }
@@ -69,11 +70,12 @@ public class IdentifyServiceImpl implements IdentifyService {
             String s2Key = IMAGE_IDENTIFY_KEY + "idCard:" + "back:" + s2MD5;
             if (StringUtils.isNotBlank(s2) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s2Key))) {
                 //走缓存
+                CustomerInfoVO customerInfoVO2 = new CustomerInfoVO();
                 BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), customerInfoVO);
+                Idcard.conversionBack(customerInfoVO, customerInfoVO2);
             } else {
                 //识别身份证背面
                 Idcard.getIdCardBack(s2, customerInfoVO);
-                AssertionUtils.isEmpty(customerInfoVO, "身份证识别失败");
                 //设置缓存
                 redisTemplate.opsForValue().set(s2Key, customerInfoVO, 1, TimeUnit.DAYS);
             }
@@ -94,11 +96,13 @@ public class IdentifyServiceImpl implements IdentifyService {
             String s1Key = IMAGE_IDENTIFY_KEY + "drivingPermit:" + "front:" + s1MD5;
             if (StringUtils.isNotBlank(s1) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s1Key))) {
                 //走缓存
+                CardUserInfo cardUserInfo1 = new CardUserInfo();
                 BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), cardUserInfo);
+                MultiObjectDetect.conversionFront(cardUserInfo, cardUserInfo1);
+
             } else {
                 //行驶证正面识别
                 MultiObjectDetect.drivingPermitFront(s1, cardUserInfo);
-                AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
                 //设置缓存
                 redisTemplate.opsForValue().set(s1Key, cardUserInfo, 1, TimeUnit.DAYS);
             }
@@ -110,15 +114,17 @@ public class IdentifyServiceImpl implements IdentifyService {
             String s2Key = IMAGE_IDENTIFY_KEY + "drivingPermit:" + "back:" + s2MD5;
             if (StringUtils.isNotBlank(s2) && !ObjectUtil.isAllFieldNull(redisTemplate.opsForValue().get(s2Key))) {
                 //走缓存
-                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), cardUserInfo);
+                CardUserInfo cardUserInfo2 = new CardUserInfo();
+                BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s2Key)), cardUserInfo2);
+                MultiObjectDetect.conversionBack(cardUserInfo, cardUserInfo2);
             } else {
                 //行驶证反面识别
                 MultiObjectDetect.drivingPermitBack(s2, cardUserInfo);
-                AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
                 //设置缓存
                 redisTemplate.opsForValue().set(s2Key, cardUserInfo, 1, TimeUnit.DAYS);
             }
         }
+
         AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
         map.put("carInfo", cardUserInfo);
         return HttpResult.ok("success", map);

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -77,7 +77,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     }
 
     @Override
-    public InsAreaCompany queryLatestStatus(String orderNo) {
+    public String queryLatestStatus(String orderNo) {
         return baseMapper.queryLatestStatus(orderNo);
     }
 

+ 84 - 41
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -46,6 +46,7 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.InsOrdersTrack;
 import com.ydtech.modules.order.entity.bo.UnderwritingRulesBo;
+import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
 import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
 import com.ydtech.modules.order.entity.vo.*;
@@ -53,6 +54,7 @@ import com.ydtech.modules.order.entity.vo.ya.YaExtendInfoDto;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.service.InsOrdersTrackService;
+import com.ydtech.modules.protocol.entity.constants.PtlApiType;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -115,10 +117,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Value("${upload.file.path}")
     private String uploadFilePath;
 
-    public InsOrdersServiceImpl(OrderComponents orderComponents, SysUserService sysUserService, SysUserRoleService sysUserRoleService,
+    public InsOrdersServiceImpl(OrderComponents orderComponents, SysUserService sysUserService,
+                                SysUserRoleService sysUserRoleService,
                                 EsmUserReferrerService esmUserReferrerService, SysDeptService sysDeptService,
                                 StringRedisTemplate redisTemplate, @Lazy InsAreaCompanyService insAreaCompanyService,
-                                PtlAgreementService ptlAgreementService, @Lazy FeeRuleSchemeServiceImpl feeRuleSchemeService,
+                                PtlAgreementService ptlAgreementService,
+                                @Lazy FeeRuleSchemeServiceImpl feeRuleSchemeService,
                                 InsFeeAuditService insFeeAuditService, InsOrdersTrackService insOrdersTrackService,
                                 InsFileMapper insFileMapper) {
 
@@ -156,12 +160,14 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             return;
         }
 
+        String orderStatus = insAreaCompany.getOrderstatus();
+
         if (!ObjectUtils.isEmpty(insAreaCompany)) {
             InsOrders insOrders = getById(insAreaCompany.getOrderno());
 
+            // 查出最新状态的子订单修改
             if (!InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insAreaCompany.getOrderstatus())) {
-                // 查出最新状态的子订单修改
-                insAreaCompany = insAreaCompanyService.queryLatestStatus(insAreaCompany.getOrderno());
+                orderStatus = insAreaCompanyService.queryLatestStatus(insAreaCompany.getOrderno());
             } else {
                 insOrders.setCompanyId(insAreaCompany.getCompanyId());
                 insOrders.setInsCompany(insAreaCompany.getInscompany());
@@ -171,7 +177,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 return;
             }
 
-            insOrders.setOrderstatus(insAreaCompany.getOrderstatus());
+            insOrders.setOrderstatus(orderStatus);
             LambdaQueryWrapper<InsOrders> insOrdersLambdaQueryWrapper = new LambdaQueryWrapper<>();
             insOrdersLambdaQueryWrapper.ne(InsOrders::getOrderstatus, InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
             insOrdersLambdaQueryWrapper.eq(InsOrders::getOrderno, insAreaCompany.getOrderno());
@@ -184,7 +190,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     public List<CarModelDTO> vinSearch(String vin) {
         LambdaQueryWrapper<InsOrders> wrapper = new LambdaQueryWrapper<>();
         wrapper.select(InsOrders::getCarinfo);
-        wrapper.eq(InsOrders::getFrameno, vin).eq(InsOrders::getOrderstatus, InsOrderStatusEnum.ACCEPT_INSURANCE.getCode()).orderByAsc(InsOrders::getCreatetime).last("limit 1");
+        wrapper.eq(InsOrders::getFrameno, vin).eq(InsOrders::getOrderstatus,
+                InsOrderStatusEnum.ACCEPT_INSURANCE.getCode()).orderByAsc(InsOrders::getCreatetime).last("limit 1");
         InsOrders insOrders = baseMapper.selectOne(wrapper);
         if (!ObjectUtils.isEmpty(insOrders)) {
             JSONObject carinfo = insOrders.getCarinfo();
@@ -283,7 +290,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         // 5 生成承包规则参数
         UnderwritingRulesBo underwritingRulesBo = new UnderwritingRulesBo(quoteInfoVo);
         String rules = JSON.toJSONString(underwritingRulesBo);
-        redisTemplate.opsForValue().set(QUOTE_RULES_KEY + insOrders.getOrderno(), rules, QUOTE_RULES_KEY_TIME, TimeUnit.HOURS);
+        redisTemplate.opsForValue().set(QUOTE_RULES_KEY + insOrders.getOrderno(), rules, QUOTE_RULES_KEY_TIME,
+                TimeUnit.HOURS);
 
         return insOrders;
     }
@@ -304,7 +312,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         boolean isCdy = false;
         if (StringUtils.isNotEmpty(orderQueryVo.getUserId())) {
             SysUserRole userRole = sysUserRoleService.selectByUserId(orderQueryVo.getUserId());
-            if (Arrays.asList(SystemConstant.getSysRoleTeamLeader()).contains(userRole.getRoleId().toString())) { //团队长可查询下面所有人员订单
+            if (Arrays.asList(SystemConstant.getSysRoleTeamLeader()).contains(userRole.getRoleId().toString())) {
+                //团队长可查询下面所有人员订单
                 isTeamLeader = true;
             }
             if (19 == userRole.getRoleId()) {
@@ -316,7 +325,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         Page<InsOrders> orderVoPage = baseMapper.queryPageOrder(page, orderQueryVo, isTeamLeader, isCdy);
         Long total = baseMapper.queryPageOrderCount(orderQueryVo, isTeamLeader, isCdy);
         orderVoPage.setTotal(total);
-        return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(), orderVoPage.getPages()
+        return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
+                orderVoPage.getPages()
                 , orderVoPage.getRecords());
     }
 
@@ -330,7 +340,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         if (StringUtils.isNotEmpty(orderQueryVo.getUserId())) {
             SysUserRole userRole = sysUserRoleService.selectByUserId(orderQueryVo.getUserId());
 
-            if (Arrays.asList(SystemConstant.getSysRoleTeamLeader()).contains(userRole.getRoleId().toString())) { //团队长可查询下面所有人员订单
+            if (Arrays.asList(SystemConstant.getSysRoleTeamLeader()).contains(userRole.getRoleId().toString())) {
+                //团队长可查询下面所有人员订单
                 isTeamLeader = true;
             }
 
@@ -343,20 +354,27 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         // 构造查询条件
         LambdaQueryWrapper<InsOrders> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getOrderNo()), InsOrders::getOrderno, orderQueryVo.getOrderNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getDeptId()) && isTeamLeader, InsOrders::getDeptid, orderQueryVo.getDeptId())
-                .eq(StringUtils.isNotEmpty(orderQueryVo.getOrderStatus()), InsOrders::getOrderstatus, orderQueryVo.getOrderStatus())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getFrameNo()), InsOrders::getFrameno, orderQueryVo.getFrameNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getLicenseNo()), InsOrders::getLicenseno, orderQueryVo.getLicenseNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getInsuredName()), InsOrders::getInsuredname, orderQueryVo.getInsuredName())
+                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getDeptId()) && isTeamLeader, InsOrders::getDeptid,
+                        orderQueryVo.getDeptId())
+                .eq(StringUtils.isNotEmpty(orderQueryVo.getOrderStatus()), InsOrders::getOrderstatus,
+                        orderQueryVo.getOrderStatus())
+                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getFrameNo()), InsOrders::getFrameno,
+                        orderQueryVo.getFrameNo())
+                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getLicenseNo()), InsOrders::getLicenseno,
+                        orderQueryVo.getLicenseNo())
+                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getInsuredName()), InsOrders::getInsuredname,
+                        orderQueryVo.getInsuredName())
                 .between(!ObjectUtils.isEmpty(orderQueryVo.getStartDate()) && !ObjectUtils.isEmpty(orderQueryVo.getEndDate()),
                         InsOrders::getCreatetime, orderQueryVo.getStartDate(), orderQueryVo.getEndDatePlusOneDay())
                 .orderBy(true, false, InsOrders::getCreatetime);
 
 
         if (isCdy) {//如果是出单员查询时,只查自己的  与代客录单一致,查operatorid (手机前端userid传过来是出单用户,直接用该字段查询查operatorid)
-            wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getOperatorid, orderQueryVo.getUserId());
+            wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getOperatorid,
+                    orderQueryVo.getUserId());
         } else {
-            wrapper.eq(!isTeamLeader && StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getUserid, orderQueryVo.getUserId());
+            wrapper.eq(!isTeamLeader && StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getUserid,
+                    orderQueryVo.getUserId());
         }
 
         Page<InsOrders> page = new Page<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize());
@@ -364,7 +382,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         if (StringUtils.isNotEmpty(orderQueryVo.getCompanyId())) {
             List<InsAreaCompany> list = insAreaCompanyService.query().select("DISTINCT orderno").eq("company_id",
                     orderQueryVo.getCompanyId()).list();
-            List<String> collect = list.stream().map(InsAreaCompany::getOrderno).distinct().collect(Collectors.toList());
+            List<String> collect =
+                    list.stream().map(InsAreaCompany::getOrderno).distinct().collect(Collectors.toList());
             if (!collect.isEmpty()) {
                 wrapper.in(InsOrders::getOrderno, collect);
             }
@@ -380,7 +399,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         }
 
         if (StringUtils.isNotEmpty(orderQueryVo.getAuditStatus()) && orderQueryVo.getAuditStatus().equals("0")) {
-            List<InsFeeAudit> list = insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus", "1").list();
+            List<InsFeeAudit> list =
+                    insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus", "1").list();
             List<String> collect = list.stream().map(InsFeeAudit::getOrderno).distinct().collect(Collectors.toList());
 
             if (!collect.isEmpty()) {
@@ -389,10 +409,11 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         }
 
         //查出报价状态为 3
-        List<InsAreaCompany>   insAreaCompanies = insAreaCompanyService.getorDerIds();
+        List<InsAreaCompany> insAreaCompanies = insAreaCompanyService.getorDerIds();
 //      新的费用订单表
-        if(insAreaCompanies.size()>0){
-            List<String> collect = insAreaCompanies.stream().map(insAreaCompany -> insAreaCompany.getOrderno()).collect(Collectors.toList());
+        if (insAreaCompanies.size() > 0) {
+            List<String> collect =
+                    insAreaCompanies.stream().map(insAreaCompany -> insAreaCompany.getOrderno()).collect(Collectors.toList());
             if (!collect.isEmpty()) {
                 wrapper.in(InsOrders::getOrderno, collect);
             }
@@ -400,7 +421,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         Page<InsOrders> insOrdersPage = page(page, wrapper);
 
-        return new BasePageResult<>(orderQueryVo.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
+        return new BasePageResult<>(orderQueryVo.getPageNum(), page.getSize(), insOrdersPage.getTotal(),
+                page.getPages(),
                 insOrdersPage.getRecords());
     }
 
@@ -426,7 +448,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             insOrdersExcel.setRegisterDate(carInfoVo.getRegisterDate());
             insOrdersExcel.setIssueDate(carInfoVo.getIssueDate());
 
-            String natureOfVehicleUse = NatureOfVehicleUse.getNatureOfVehicleUse(carInfoVo.getCarnature(), carInfoVo.getVehicleUse());
+            String natureOfVehicleUse = NatureOfVehicleUse.getNatureOfVehicleUse(carInfoVo.getCarnature(),
+                    carInfoVo.getVehicleUse());
             insOrdersExcel.setVehicleUse(natureOfVehicleUse);
 
             insOrdersExcel.setCarNature(NatureOfVehicleUse.getDesc(carInfoVo.getCarnature()));
@@ -458,11 +481,24 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
             //非车
             if (!ObjectUtils.isEmpty(insOrdersExcel.getCrossInsurance())) {
-                List<DrivingInsuranceDto> drivingInsuranceDtos = insOrdersExcel.getCrossInsurance().toJavaList(DrivingInsuranceDto.class);
-                if (!drivingInsuranceDtos.isEmpty()) {
-                    String policyNumber = drivingInsuranceDtos.get(0).getPolicyNumber();
-                    insOrdersExcel.setJyPolicyno(policyNumber);
+
+                if(String.valueOf(PtlApiType.PTL_API_2.getCode()).equals(insOrdersExcel.getApiType())){
+                    List<CrawlerVerifyPaymentResponse.DrivingInsurancesDTO> drivingInsurancesDTOS =
+                            insOrdersExcel.getCrossInsurance().toJavaList(CrawlerVerifyPaymentResponse.DrivingInsurancesDTO.class);
+                    if (!drivingInsurancesDTOS.isEmpty()) {
+                        String policyNumber = drivingInsurancesDTOS.get(0).getPolicy();
+                        insOrdersExcel.setJyPolicyno(policyNumber);
+                    }
+                }else {
+                    List<DrivingInsuranceDto> drivingInsuranceDtos =
+                            insOrdersExcel.getCrossInsurance().toJavaList(DrivingInsuranceDto.class);
+                    if (!drivingInsuranceDtos.isEmpty()) {
+                        String policyNumber = drivingInsuranceDtos.get(0).getPolicyNumber();
+                        insOrdersExcel.setJyPolicyno(policyNumber);
+                    }
                 }
+
+
             }
 
             // 设置险种信息
@@ -494,12 +530,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             }
         }
         File folder = new File(uploadFilePath);
-        if (folder.exists()){
+        if (folder.exists()) {
             return HttpResult.ok("", EasyExcelUtils.downExcel(uploadFilePath, InsOrdersExcel.class, insOrdersExcels));
-        }else {
-            if (folder.mkdirs()){
-                return HttpResult.ok("", EasyExcelUtils.downExcel(uploadFilePath, InsOrdersExcel.class, insOrdersExcels));
-            }else {
+        } else {
+            if (folder.mkdirs()) {
+                return HttpResult.ok("", EasyExcelUtils.downExcel(uploadFilePath, InsOrdersExcel.class,
+                        insOrdersExcels));
+            } else {
                 throw new SystemException("文件导出失败");
             }
         }
@@ -522,8 +559,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             JSONObject reptxt = orderAndAreaCompany.getReptxt();
             ResponseDataC2 responseDataC2 = JSON.toJavaObject(reptxt, ResponseDataC2.class);
             List<ExtendInfoDto> extendInfoDtos = responseDataC2.getResponseBody().getExtendInfo();
-            Map<String, String> stringStringMap = extendInfoDtos.stream().collect(LinkedHashMap::new, (m, v) -> m.put(v.getKey(),
-                    v.getValue()), LinkedHashMap::putAll);
+            Map<String, String> stringStringMap = extendInfoDtos.stream().collect(LinkedHashMap::new,
+                    (m, v) -> m.put(v.getKey(),
+                            v.getValue()), LinkedHashMap::putAll);
             yaExtendInfoDto = MapToYaExtendInfoDto.INSTANCE.mapToYaExtendInfoDto(stringStringMap);
             orderAndAreaCompany.setExtendInfo(yaExtendInfoDto);
         }
@@ -567,7 +605,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 //                orderAndAreaCompany.setOrderFeeResult(orderFeeVoList);
 //            }
 //        }
-        if(!Objects.isNull(insFeeOrderNew)) {
+        if (!Objects.isNull(insFeeOrderNew)) {
             List<QueryOrderFeeResultVo> orderFeeVoList = feeRuleSchemeService.convertOrderFeeVoData(insFeeOrderNew);
             orderAndAreaCompany.setOrderFeeResult(orderFeeVoList);
         }
@@ -578,7 +616,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         }
         //add 解决返回null页面错误  lig 2023-09-14
         if (null == orderAndAreaCompany.getExtendInfo()) orderAndAreaCompany.setExtendInfo("");
-        if (null == orderAndAreaCompany.getCrossInsurance()) orderAndAreaCompany.setCrossInsurance(JSON.parseArray("[]"));
+        if (null == orderAndAreaCompany.getCrossInsurance())
+            orderAndAreaCompany.setCrossInsurance(JSON.parseArray("[]"));
         if (null == orderAndAreaCompany.getKindinfo()) orderAndAreaCompany.setKindinfo(JSON.parseArray("[]"));
         if (null == orderAndAreaCompany.getFeeStatus()) orderAndAreaCompany.setFeeStatus("0");
 
@@ -620,7 +659,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             queryFlag = "queryPayTime";
         }
         policyInsuranceReportReqVo.setQueryFlag(queryFlag);
-        Page<InsOrders> page = new Page<>(policyInsuranceReportReqVo.getPageNum(), policyInsuranceReportReqVo.getPageSize());
+        Page<InsOrders> page = new Page<>(policyInsuranceReportReqVo.getPageNum(),
+                policyInsuranceReportReqVo.getPageSize());
         page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
         Page<PolicyInsuranceReportResVo> policyInsuranceReportResVoPage = baseMapper.getPolicyInsuranceReport(page,
                 policyInsuranceReportReqVo);
@@ -632,7 +672,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     }
 
     @Override
-    public HttpResult<String> exportPolicyInsuranceReport(PolicyInsuranceReportReqVo policyInsuranceReportReqVo, String userId) {
+    public HttpResult<String> exportPolicyInsuranceReport(PolicyInsuranceReportReqVo policyInsuranceReportReqVo,
+                                                          String userId) {
         String queryFlag = "queryPayDate";
         //判断当前登录人员是否为管理人员和财务人员;要求管理人员查询paytime,其他查询paydate
         List<SysUser> userList = sysUserService.findAllAgentRoleUser(userId, "22");
@@ -640,8 +681,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             queryFlag = "queryPayTime";
         }
         policyInsuranceReportReqVo.setQueryFlag(queryFlag);
-        List<PolicyInsuranceReportResVo> policyInsuranceReportResVoPage = baseMapper.getPolicyInsuranceReport(policyInsuranceReportReqVo);
-        String s = EasyExcelUtils.downExcel(uploadFilePath, PolicyInsuranceReportResVo.class, policyInsuranceReportResVoPage);
+        List<PolicyInsuranceReportResVo> policyInsuranceReportResVoPage =
+                baseMapper.getPolicyInsuranceReport(policyInsuranceReportReqVo);
+        String s = EasyExcelUtils.downExcel(uploadFilePath, PolicyInsuranceReportResVo.class,
+                policyInsuranceReportResVoPage);
         return HttpResult.ok("", s);
     }
 

+ 3 - 1
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -15,9 +15,11 @@ import java.util.List;
 @Service
 public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
 
-
     @Override
     public HttpResult<QuoteRespVo> quote(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo) {
+
+
+
         return null;
     }
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -1006,7 +1006,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         redisKey.append(YC_AGREEMENT_INFO_KEY);
         redisKey.append(accidentalDrivingVo.getCompanyCode());
         redisKey.append(accidentalDrivingVo.getSeatNum());
-        redisKey.append(accidentalDrivingVo.getCompanyCode());
+        redisKey.append(accidentalDrivingVo.getCode());
 
         //查询redis
         if (!Objects.isNull(redisTemplate.opsForValue().get(redisKey.toString()))) {

+ 222 - 0
src/main/java/com/ydtech/modules/order/utils/PingAnRSAUtils.java

@@ -0,0 +1,222 @@
+package com.ydtech.modules.order.utils;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.lf5.util.StreamUtils;
+
+import javax.crypto.Cipher;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.security.*;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.*;
+
+public class PingAnRSAUtils {
+
+    private static String algorithm = "SHA256withRSA";
+
+    public static void main(String[] args) {
+        String keyword = "奥迪";
+        String userId = "123456789";
+        String oldSign = "Ugaug0keK0tm/4Aq9easzvNUDtnEELnXq6IS52tPSCmRVccfYZe3WvOt/RmIaO2JX8vDTHcA4X3zEzXTNpJ80+75Q1t" +
+                "/5hl5HafoWOYumRsbbywEtGtRZgngxKtNeQ6Jz/Jr6YlAki6g3y5XyKBKfE5EUpwjesR5QAZU7vs0vUY=";
+        String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUoFBcJMk+rQhs" +
+                "/MpXcxY8ltZ3Pjxsxec9cIyJ8GIKHvueh92gstmvR4ebNV3PPD4LmL7yJlycz4n17+HGF1uGpNMN5j/EFds0boan5jpetLlQ43ylzqrzq+5VG7l2Gwe" +
+                "+YO6GSaJsstP0Av8GaXEZcGT2B0E1c5gx3XTo9th+uQIDAQAB";
+        String privateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJSgUFwkyT6tCGz8yldzFjyW1nc+PGzF5z1wjInwYgoe" +
+                "+56H3aCy2a9Hh5s1Xc88PguYvvImXJzPifXv4cYXW4ak0w3mP8QV2zRuhqfmOl60uVDjfKXOqvOr7lUbuXYbB75g7oZJomyy0/QC" +
+                "/wZpcRlwZPYHQTVzmDHddOj22H65AgMBAAECgYBKTh" +
+                "//AVEvqZiFzJhowhwC7LKKaS4Sf5rNZ8CLkgeh4b2Qk4KlPeWBMTTFzxd4bTjj2VjVfYJdz5C8yVJKFBFoa0w+P/g" +
+                "/YT5V8IqsRuF74eJeVScrBDqk5Tk5WpE/P" +
+                "+au8gWamHrJnsansfYDCArCfOf4T48pxq4i0LXgkbg6pQJBAMj2343kFRE1ViPI87F3g7dWJv2qLgEWX9xPM4HJdtQsRpuyV5n9UGp7Nn7i08sv4Rg9aLMOjtS97Sn4M6zssKcCQQC9VCQPsPxRejznNCVYTiq6hRhCXaK5ysrVLQXFs9I7gVX3CEA746GMV8iNIv7K7q9ZnKuj2ZHcreSriyMRTOGfAkBJQcUIYkZTuY+nB8/dt2VqZZtdCLYwa0mSc8Sg4SHSAjnS89X/KlowFq4s3t65yMBTJ7+M1he28W0MyY98z+MtAkAG7jCPvnvOA7p9ACSp0dqwjzSvITxWrry0BvziGs4ETZy2+T9YseF1ALWfrPtEtG4IyrphuhIj0N3BBcvX00ejAkBkc7AXJAb+Cn0rsGZe9ZdLogVWJKA5gTYy0ThSQ2SocoCLuy+rRlBX67rHN3/0BKF+byWaf/MTdc5QtbH5pK9J";
+        Map<String, String> bizdata = new HashMap<String, String>();
+        bizdata.put("keyword", keyword);
+        bizdata.put("userId", userId);
+        // 签名前先排序
+        String wtsign = sortParametersWithASCII(bizdata);
+        System.out.println(wtsign);
+        String signData = "";
+        try {
+            // 加签
+            signData = sign(wtsign, privateKey);
+            System.out.println(signData);
+        } catch (Exception se) {
+        }
+        //验签
+        Boolean verifyresult = verifySignRsa(bizdata, oldSign, publicKey);
+        System.out.println(verifyresult);
+        //解密方式
+        //原始加密串
+        String pwd = "g4otiaYyELiIEv2x9X4CDvMYfmWFZzV3VRDgzGCSjgyVR4FWxEKneEYJp" +
+                "/MvOfqkHfseuDnJvgnNKXDOUY37q40w4GoUiurIyXOaorhpjtrBJ9jmL3n3ExDHrq0kARnUjRuw3Y2dio9WocfpCMyW0XEAYaQQZtHcIs3k2lWbLYc=";
+        //解密
+        try {
+            System.out.println("解密后值为:" + rsaDecrypt(pwd, privateKey, "UTF-8"));
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+    }
+
+    public static String sign(String responseBody, String inPrivateKey) throws Exception {
+        byte[] dataEncode = Base64.encodeBase64(responseBody.getBytes("UTF-8"));
+        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(inPrivateKey.getBytes()));
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+        PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
+        Signature signatureChecker;
+        Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
+        signatureChecker = Signature.getInstance(algorithm);
+        signatureChecker.initSign(privateKey);
+        signatureChecker.update(dataEncode);
+        byte[] sign = signatureChecker.sign();
+        return new String(Base64.encodeBase64(sign));
+    }
+
+    public static Boolean verifySignRsa(Map param, String signature, String verifyKey) {
+        if (!hasText(signature)) {
+            return false;
+        }
+        String wtsign = "";
+        wtsign = sortParametersWithASCII(param);
+        Boolean verifyresult = false;
+        verifyresult = verify(wtsign, signature, verifyKey);
+        //兼容partnerId不加密
+        if (!verifyresult) {
+            param.remove("partnerId");
+            wtsign = sortParametersWithASCII(param);
+            verifyresult = verify(wtsign, signature, verifyKey);
+        }
+        return verifyresult;
+    }
+
+    /**
+     * 验签
+     *
+     * @param businessdata 实际业务数据
+     * @param signedText   加密后待验证数据
+     * @return boolean
+     */
+    public static boolean verify(String businessdata, String signedText, String verifyKey) {
+        try {
+            String dataEncode = new String(Base64.encodeBase64(businessdata.getBytes("UTF-8")));
+            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.decodeBase64(verifyKey.getBytes()));
+            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+            PublicKey publicKey = keyFactory.generatePublic(keySpec);
+            Signature signatureChecker = null;
+            Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
+            signatureChecker = Signature.getInstance(algorithm);
+            signatureChecker.initVerify(publicKey);
+            signatureChecker.update(dataEncode.replace("\n", "").getBytes());
+            byte[] signBytes = signedText.getBytes("UTF-8");
+            byte[] sign = Base64.decodeBase64(signBytes);
+            return signatureChecker.verify(sign);
+        } catch (Exception e) {
+        }
+        return false;
+    }
+
+    public static String rsaDecrypt(String content, String privateKey, String charset) throws Exception {
+        return rsaDecrypt(content, privateKey, charset, null);
+    }
+
+    public static String rsaDecrypt(String content, String privateKey, String charset, String signType) throws Exception {
+        int maxDecryptBlock = 256;
+        try {
+            PrivateKey priKey = getPrivateKeyFromPKCS8("RSA", new ByteArrayInputStream(privateKey.getBytes()));
+            Cipher cipher = Cipher.getInstance("RSA");
+            cipher.init(2, priKey);
+            byte[] encryptedData = StringUtils.isEmpty(charset) ? Base64.decodeBase64(content.getBytes()) :
+                    Base64.decodeBase64(content.getBytes(charset));
+            int inputLen = encryptedData.length;
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            int offSet = 0;
+            int i = 0;
+            while (inputLen - offSet > 0) {
+                byte[] cache;
+                if (inputLen - offSet > maxDecryptBlock) {
+                    cache = cipher.doFinal(encryptedData, offSet, maxDecryptBlock);
+                } else {
+                    cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
+                }
+                out.write(cache, 0, cache.length);
+                i++;
+                offSet = i * maxDecryptBlock;
+            }
+            byte[] decryptedData = out.toByteArray();
+            out.close();
+
+            return StringUtils.isEmpty(charset) ? new String(decryptedData) : new String(decryptedData, charset);
+        } catch (Exception e) {
+            throw new Exception("RSA解密失败. EncodeContent = " + content + ",charset = " + charset, e);
+        }
+    }
+
+    public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, InputStream ins) throws Exception {
+        if ((ins == null) || (StringUtils.isEmpty(algorithm))) {
+            return null;
+        }
+        KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
+        byte[] encodedKey = StreamUtils.getBytes(ins);
+        encodedKey = Base64.decodeBase64(encodedKey);
+        return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey));
+    }
+
+    public static boolean hasText(String str) {
+        if (!hasLength(str)) {
+            return false;
+        } else {
+            int strLen = str.length();
+
+            for (int i = 0; i < strLen; ++i) {
+                if (!Character.isWhitespace(str.charAt(i))) {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+    }
+
+    public static boolean hasLength(String str) {
+        return str != null && str.length() > 0;
+    }
+
+    public static String sortParametersWithASCII(Map param) {
+        List sortList = new LinkedList<String>();
+        Iterator listadd = param.keySet().iterator();
+        while (listadd.hasNext()) {
+            Object obj = listadd.next();
+            sortList.add(obj.toString());
+        }
+        //参数排序
+        Collections.sort(sortList);
+        String sortStr = "";
+        for (int i = 0; i < sortList.size(); i++) {
+            String paramListStr = "";
+            //对List数据进行排序
+            if (param.get(sortList.get(i)) instanceof java.util.List) {
+                List dataList = (List) param.get(sortList.get(i));
+                if (null != dataList && dataList.size() > 0) {
+                    Collections.sort(dataList);
+                    for (int k = 0; k < dataList.size(); k++) {
+                        paramListStr = paramListStr + dataList.get(k) + ",";
+                    }
+                    paramListStr = paramListStr.substring(0, paramListStr.length() - 1);
+
+                }
+                sortStr = sortStr + sortList.get(i) + "=" + paramListStr + "&";
+
+            } else {
+                sortStr = sortStr + sortList.get(i) + "=" + param.get(sortList.get(i)) + "&";
+
+            }
+
+        }
+        sortStr = sortStr.substring(0, sortStr.length() - 1);
+        return sortStr;
+
+    }
+}

+ 24 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/InsFeeOrderNew.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.apache.poi.hpsf.Decimal;
 
 import javax.persistence.Table;
 import java.math.BigDecimal;
@@ -319,5 +320,28 @@ public class InsFeeOrderNew {
     @TableField(value = "third_detail_premiums")
     private BigDecimal thirdDetailPremiums;
 
+    @ApiModelProperty(value = "一级分销用户id")
+    @TableField(value = "first_level_user_id")
+    private String firstLevelUserId;
+
+    @ApiModelProperty(value = "二级分销用户id")
+    @TableField(value = "two_level_user_id")
+    private String twoLevelUserId;
+
+    @ApiModelProperty(value = "三级分销用户id")
+    @TableField(value = "three_level_user_id")
+    private String threeLevelUserId;
+
+    @ApiModelProperty(value = "分销等级")
+    @TableField(value = "distribution_status")
+    private String distributionStatus;
+
+
+    @ApiModelProperty(value = "机构分销费用")
+    @TableField(value = "dept_distribution")
+    private BigDecimal deptDistribution;
+
+
+
 
 }

+ 1 - 1
src/main/java/com/ydtech/modules/xxl/handler/QueryStatusHandler.java

@@ -87,7 +87,7 @@ public class QueryStatusHandler {
                             //更新 ins_area_company
                             insAreaCompany.setInsideOrderStatus(Integer.parseInt(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode()));
                             insAreaCompany.setInsidePayTime(queryStatusResult.getPayTime());
-                            insAreaCompanyMapper.updateById(insAreaCompany);
+                            insAreaCompanyMapper.updateInsideOrder(insAreaCompany);
                         }
                     }
                 }catch(Exception e){

+ 1 - 1
src/main/java/com/ydtech/modules/xxl/handler/SyncStatusHandler.java

@@ -40,7 +40,7 @@ public class SyncStatusHandler {
             }else{
                 insAreaCompany.setInsidePayTime(insAreaCompany.getPayDate().format(formatter));
             }
-            insAreaCompanyMapper.updateById(insAreaCompany);
+            insAreaCompanyMapper.updateInsideOrder(insAreaCompany);
         });
     }
 

+ 2 - 0
src/main/java/com/ydtech/modules/xxl/mapper/XxlInsAreaCompanyMapper.java

@@ -12,4 +12,6 @@ public interface XxlInsAreaCompanyMapper extends BaseMapper<InsAreaCompany> {
     List<InsAreaCompany> getNoPayList(String startTime, String endTime);
 
     List<InsAreaCompany> getNoSyncList(String startTime,String endTime);
+
+    boolean updateInsideOrder(InsAreaCompany insAreaCompany);
 }

+ 13 - 0
src/main/java/com/ydtech/utils/baidu/Idcard.java

@@ -121,6 +121,15 @@ public class Idcard {
         }
     }
 
+    public static void conversionFront(CustomerInfoVO customerInfo, CustomerInfoVO customerInfoNew) {
+        customerInfo.setName(customerInfoNew.getName());
+        customerInfo.setIdentifyNumber(customerInfoNew.getIdentifyNumber());
+        customerInfo.setAddr(customerInfoNew.getAddr());
+        customerInfo.setIdentifyType(customerInfoNew.getIdentifyType());
+        customerInfo.setIdentifyIssuedCom(customerInfoNew.getIdentifyIssuedCom());
+    }
+
+
     public static void getIdCardBack(String images, CustomerInfoVO customerInfo) {
         if (StringUtils.isEmpty(images)) {
             return;
@@ -135,5 +144,9 @@ public class Idcard {
         }
     }
 
+    public static void conversionBack(CustomerInfoVO customerInfo, CustomerInfoVO customerInfoNew) {
+        customerInfo.setIdentifyValidDate(customerInfoNew.getName());
+        customerInfo.setIdentifyValidEndDate(customerInfoNew.getIdentifyValidEndDate());
+    }
 
 }

+ 24 - 0
src/main/java/com/ydtech/utils/baidu/MultiObjectDetect.java

@@ -173,6 +173,22 @@ public class MultiObjectDetect {
         }
     }
 
+    public static void conversionFront(CardUserInfo cardUserInfo, CardUserInfo cardUserInfoNew){
+        cardUserInfo.setVIN(cardUserInfoNew.getVIN());
+        cardUserInfo.setIssueDate(cardUserInfoNew.getIssueDate());
+        cardUserInfo.setCategory(cardUserInfoNew.getCategory());
+        cardUserInfo.setPlateType(cardUserInfoNew.getPlateType());
+        cardUserInfo.setVehicleUse(cardUserInfoNew.getVehicleUse());
+        cardUserInfo.setUseNature(cardUserInfoNew.getUseNature());
+        cardUserInfo.setMotorUsageTypeCode(cardUserInfoNew.getMotorUsageTypeCode());
+        cardUserInfo.setMotorTypeCode(cardUserInfoNew.getMotorTypeCode());
+        cardUserInfo.setRegisterDate(cardUserInfoNew.getRegisterDate());
+        cardUserInfo.setEngine(cardUserInfoNew.getEngine());
+        cardUserInfo.setPlateNo(cardUserInfoNew.getPlateNo());
+        cardUserInfo.setBackOcrID(cardUserInfoNew.getBackOcrID());
+        cardUserInfo.setCarOwner(cardUserInfoNew.getCarOwner());
+    }
+
 
     /**
      * 行驶证背面
@@ -196,4 +212,12 @@ public class MultiObjectDetect {
         }
 
     }
+
+    public static void conversionBack(CardUserInfo cardUserInfo, CardUserInfo cardUserInfoNew){
+        cardUserInfo.setGrossMass(cardUserInfoNew.getGrossMass());
+        cardUserInfo.setApprovedPassengersCapacity(cardUserInfoNew.getApprovedPassengersCapacity());
+        cardUserInfo.setUnladenMass(cardUserInfoNew.getUnladenMass());
+        cardUserInfo.setLimitLoad(cardUserInfoNew.getLimitLoad());
+    }
+
 }

+ 9 - 0
src/main/resources/application-pre.yml

@@ -288,6 +288,15 @@ bohai:
     boHaiPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCIC3wgJd+7Wue63Qjdh3/uscQSKec2m9gaeCq007kjEiSFES5Tfx75VPSxRj6qk6XN4umHOsHY+W9jkv+Cj4+z3XpPozsRdoj21oxPx8fPJzpVeaUHrEkZtj9Yvo/KhByBK5sRjKmlENXVF3wXVfAg48JZR2XUyUcBdZhR9aHhoQIDAQAB
     insurerCode: 'BPIC'
 
+# 平安财险
+pingan:
+  api:
+    url: https://api.pingan.com.cn/open/appsvr
+    accessUrl: https://api.pingan.com.cn/oauth/oauth2/access_token
+    selfPublicKey:
+    selfPrivateKey:
+    pingAnPublicKey:
+
 knife4j:
   enable: false
 

+ 9 - 0
src/main/resources/application-prod.yml

@@ -287,6 +287,15 @@ bohai:
     boHaiPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCIC3wgJd+7Wue63Qjdh3/uscQSKec2m9gaeCq007kjEiSFES5Tfx75VPSxRj6qk6XN4umHOsHY+W9jkv+Cj4+z3XpPozsRdoj21oxPx8fPJzpVeaUHrEkZtj9Yvo/KhByBK5sRjKmlENXVF3wXVfAg48JZR2XUyUcBdZhR9aHhoQIDAQAB
     insurerCode: 'BPIC'
 
+# 平安财险
+pingan:
+  api:
+    url: https://api.pingan.com.cn/open/appsvr
+    accessUrl: https://api.pingan.com.cn/oauth/oauth2/access_token
+    selfPublicKey:
+    selfPrivateKey:
+    pingAnPublicKey:
+
 knife4j:
   enable: false
 

+ 10 - 0
src/main/resources/application-test.yml

@@ -372,6 +372,16 @@ bohai:
     boHaiPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCIC3wgJd+7Wue63Qjdh3/uscQSKec2m9gaeCq007kjEiSFES5Tfx75VPSxRj6qk6XN4umHOsHY+W9jkv+Cj4+z3XpPozsRdoj21oxPx8fPJzpVeaUHrEkZtj9Yvo/KhByBK5sRjKmlENXVF3wXVfAg48JZR2XUyUcBdZhR9aHhoQIDAQAB
     insurerCode: 'BPIC'
 
+
+# 平安财险
+pingan:
+  api:
+    url: https://test-api.pingan.com.cn:20443/open/appsvr
+    accessUrl: https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token
+    selfPublicKey:
+    selfPrivateKey:
+    pingAnPublicKey:
+
 xxl:
   job:
     admin:

+ 37 - 17
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -6,26 +6,35 @@
 
     <resultMap id="BaseResultMap" type="com.ydtech.modules.order.entity.InsAreaCompany">
         <id property="id" column="id" jdbcType="VARCHAR"/>
-        <result property="orderno" column="orderno" jdbcType="VARCHAR"/>
-        <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
-        <result property="agreementId" column="agreement_id" jdbcType="VARCHAR"/>
-        <result property="inscompany" column="inscompany" jdbcType="VARCHAR"/>
         <result property="reqtxt" column="reqtxt" javaType="com.alibaba.fastjson.JSONObject"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
         <result property="reptxt" column="reptxt" javaType="com.alibaba.fastjson.JSONObject"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
-        <result property="jqapplyno" column="jqapplyno" jdbcType="VARCHAR"/>
-        <result property="jqpolicyno" column="jqpolicyno" jdbcType="VARCHAR"/>
-        <result property="syapplyno" column="syapplyno" jdbcType="VARCHAR"/>
-        <result property="sypolicyno" column="sypolicyno" jdbcType="VARCHAR"/>
         <result property="riskinfo" column="riskinfo" javaType="com.alibaba.fastjson.JSONArray"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
         <result property="kindinfo" column="kindinfo" javaType="com.alibaba.fastjson.JSONArray"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="accidentInfo" column="accident_info" javaType="com.alibaba.fastjson.JSONArray"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="taxArrears" column="tax_arrears" javaType="com.alibaba.fastjson.JSONArray"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="crossInsurance" column="cross_insurance" javaType="com.alibaba.fastjson.JSONArray"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="orderno" column="orderno" jdbcType="VARCHAR"/>
+        <result property="agreementId" column="agreement_id" jdbcType="BIGINT"/>
+        <result property="apiType" column="api_type" jdbcType="TINYINT"/>
+        <result property="orderstatus" column="orderstatus" jdbcType="VARCHAR"/>
+        <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
+        <result property="inscompany" column="inscompany" jdbcType="VARCHAR"/>
+        <result property="jqapplyno" column="jqapplyno" jdbcType="VARCHAR"/>
+        <result property="jqpolicyno" column="jqpolicyno" jdbcType="VARCHAR"/>
+        <result property="syapplyno" column="syapplyno" jdbcType="VARCHAR"/>
+        <result property="sypolicyno" column="sypolicyno" jdbcType="VARCHAR"/>
         <result property="jqpremium" column="jqpremium" jdbcType="DECIMAL"/>
         <result property="sypremium" column="sypremium" jdbcType="DECIMAL"/>
-        <result property="taxamount" column="taxamount" jdbcType="DECIMAL"/>
+        <result property="jypremium" column="jypremium" jdbcType="DECIMAL"/>
         <result property="sumpremium" column="sumpremium" jdbcType="DECIMAL"/>
+        <result property="taxamount" column="taxamount" jdbcType="DECIMAL"/>
         <result property="jqdiscountrate" column="jqdiscountrate" jdbcType="DOUBLE"/>
         <result property="sydiscountrate" column="sydiscountrate" jdbcType="DOUBLE"/>
         <result property="feerate" column="feerate" jdbcType="DOUBLE"/>
@@ -37,14 +46,25 @@
         <result property="jqappoint" column="jqappoint" jdbcType="VARCHAR"/>
         <result property="syappoint" column="syappoint" jdbcType="VARCHAR"/>
         <result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
+        <result property="payDate" column="pay_date" jdbcType="TIMESTAMP"/>
         <result property="paymentLink" column="payment_link" jdbcType="VARCHAR"/>
+        <result property="insOrderNo" column="ins_order_no" jdbcType="VARCHAR"/>
         <result property="attributionId" column="attribution_id" jdbcType="VARCHAR"/>
-        <result property="accidentInfo" column="accident_info" javaType="com.alibaba.fastjson.JSONArray"
-                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
-        <result property="taxArrears" column="tax_arrears" javaType="com.alibaba.fastjson.JSONArray"
-                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
-        <result property="crossInsurance" column="cross_insurance" javaType="com.alibaba.fastjson.JSONArray"
-                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="jqStartDate" column="jq_start_date" jdbcType="VARCHAR"/>
+        <result property="jqEndDate" column="jq_end_date" jdbcType="VARCHAR"/>
+        <result property="syStartDate" column="sy_start_date" jdbcType="VARCHAR"/>
+        <result property="syEndDate" column="sy_end_date" jdbcType="VARCHAR"/>
+        <result property="accidentStrInfo" column="accident_str_info" jdbcType="VARCHAR"/>
+        <result property="score" column="score" jdbcType="VARCHAR"/>
+        <result property="jqScore" column="jq_score" jdbcType="VARCHAR"/>
+        <result property="syScore" column="sy_score" jdbcType="VARCHAR"/>
+        <result property="lossRation" column="loss_ration" jdbcType="DOUBLE"/>
+        <result property="jqLossRation" column="jq_loss_ration" jdbcType="DOUBLE"/>
+        <result property="syLossRation" column="sy_loss_ration" jdbcType="DOUBLE"/>
+        <result property="insideOrderStatus" column="inside_order_status" jdbcType="TINYINT"/>
+        <result property="insidePayTime" column="inside_pay_time" jdbcType="TIMESTAMP"/>
+        <result property="signingTime" column="signing_time" jdbcType="TIMESTAMP"/>
+
     </resultMap>
 
     <resultMap id="InsAreaCompanyQueryDto" type="com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto"
@@ -85,8 +105,8 @@
 
 
 
-    <select id="queryLatestStatus"  resultMap="BaseResultMap">
-        SELECT iac.*
+    <select id="queryLatestStatus"  resultType="java.lang.String">
+        SELECT iac.orderstatus
         FROM ins_area_company as iac
                  INNER JOIN (SELECT company_id, max(createtime) AS max_createtime
                              FROM ins_area_company

+ 2 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -119,6 +119,7 @@
         <result property="score" column="score" jdbcType="VARCHAR"/>
         <result property="ownerInfo" column="ownerinfo" javaType="com.alibaba.fastjson.JSONObject"  typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
         <result property="jqpRemIum" column="jqpremium" jdbcType="VARCHAR"/>
+        <result property="apiType" column="api_type" jdbcType="VARCHAR"/>
         <result property="jqPolicyno" column="jqpolicyno" jdbcType="VARCHAR"/>
         <result property="sypRemIum" column="sypremium" jdbcType="VARCHAR"/>
         <result property="syPolicyno" column="sypolicyno" jdbcType="VARCHAR"/>
@@ -354,6 +355,7 @@
         a.licenseno,
         a.frameno,
         a.carinfo,
+        b.api_type,
         b.score,
         a.ownerinfo,
         b.jqpremium,

+ 10 - 7
src/main/resources/mapper/modules/xxl/XxlInsAreaCompanyMapper.xml

@@ -64,13 +64,10 @@
             iac.syapplyno,
             iac.sypolicyno,
             iac.cross_insurance,
-            iac.riskinfo,
-            iac.kindinfo,
             iac.jqpremium,
             iac.sypremium,
             iac.jypremium,
             iac.sumpremium,
-            iac.taxamount,
             iac.jqdiscountrate,
             iac.sydiscountrate,
             iac.feerate,
@@ -87,7 +84,6 @@
             iac.ins_order_no,
             iac.accident_info,
             iac.attribution_id,
-            iac.tax_arrears,
             iac.jq_start_date,
             iac.jq_end_date,
             iac.sy_start_date,
@@ -103,12 +99,12 @@
             iac.inside_pay_time
         FROM
             ins_orders io
-        LEFT JOIN ins_area_company iac
-            ON iac.orderno = io.orderno
+                LEFT JOIN ins_area_company iac
+                          ON iac.orderno = io.orderno
         WHERE
             io.orderstatus != 3
           AND iac.orderstatus = 2
-        AND
+          AND
             iac.createtime between #{startTime} and #{endTime}
     </select>
 
@@ -129,4 +125,11 @@
           AND createtime BETWEEN #{startTime} AND #{endTime}
     </select>
 
+    <update id="updateInsideOrder" parameterType="com.ydtech.modules.xxl.model.InsAreaCompany">
+        UPDATE ins_area_company
+        SET inside_order_status = #{insideOrderStatus},
+            inside_pay_time = #{insidePayTime}
+        WHERE id = #{id}
+    </update>
+
 </mapper>