Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

wanghao 3 miesięcy temu
rodzic
commit
aadea10b58

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/po/InsFeeOrders.java

@@ -222,18 +222,27 @@ public class InsFeeOrders {
     @Schema(description = "一级分销员id")
     private String firstDistributorId;
 
+    @Schema(description = "一级分销比例")
+    private BigDecimal firstDistributionRatio;
+
     @Schema(description = "二级分销费")
     private BigDecimal secondDistributionFee;
 
     @Schema(description = "二级分销员id")
     private String secondDistributorId;
 
+    @Schema(description = "二级分销比例")
+    private BigDecimal secondDistributionRatio;
+
     @Schema(description = "三级分销费")
     private BigDecimal thirdDistributionFee;
 
     @Schema(description = "三级分销员id")
     private String thirdDistributorId;
 
+    @Schema(description = "三级分销比例")
+    private BigDecimal thirdDistributionRatio;
+
     @Schema(description = "车牌号")
     @TableField(exist = false)
     private String licenseNo;

+ 6 - 6
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java

@@ -122,36 +122,36 @@ public interface OrgClient {
     /**
      * 获取租户分销设置
      */
-    @PostMapping(value = "/sysDistributionSetting/getSettingBySystemCode")
+    @GetMapping(value = "/sysDistributionSetting/getSettingBySystemCode")
     HttpResult<SysDistributionSetting> getSettingBySystemCode();
 
     /**
      * 获取机构
      */
     @GetMapping(value = "/dept/deptGet")
-    HttpResult<SysDeptVo> deptGet(String id);
+    HttpResult<SysDeptVo> deptGet(@RequestParam String id);
 
     /**
      * 获取租户用户
      */
     @GetMapping(value = "userInfo/getUserInfoByMobile")
-    HttpResult<SysUserJzgInfo> getUserInfoByMobile(String mobile);
+    HttpResult<SysUserJzgInfo> getUserInfoByMobile(@RequestParam String mobile);
 
     /**
      * 获取上级推荐人
      */
     @GetMapping(value = "esmUserReferrer/getReferrer")
-    HttpResult<EsmUserReferrer> getReferrer(String id);
+    HttpResult<EsmUserReferrer> getReferrer(@RequestParam String id);
 
 
     /**
      * 获取租户用户
      */
     @GetMapping(value = "userInfo/getUserInfo")
-    HttpResult<SysUserJzgInfo> getUserInfo(String id);
+    HttpResult<SysUserJzgInfo> getUserInfo(@RequestParam String id);
 
     @GetMapping(value = "userInfo/getUserInfoById")
-    HttpResult<SysUserJzgInfo> getUserInfoById(String id);
+    HttpResult<SysUserJzgInfo> getUserInfoById(@RequestParam String id);
 
     @PostMapping(value = "receivable/restockInsPlyIncome")
     void restockInsPlyIncome(@RequestBody InsOrderAdjust insOrderAdjust);

+ 28 - 8
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java

@@ -1,10 +1,13 @@
 package com.jzg.quotation.huatai.crawler.service.Impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.json.JsonReadFeature;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectReader;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.entity.po.jyxSetting;
@@ -238,17 +241,19 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
     // ====================== 报价主流程 ======================
     @Override
     public QuoteResultsVo quote(QuoteVo quoteVo) throws Exception {
+        // 构造登录参数
         AttributionInformationVo attr = quoteVo.getOrder().getAttributionInformationVo();
         LoginDTO dto = buildLoginDTO(attr);
+        // 获取登录相关信息
         Map<String, Object> mmap = login(dto);
-        //归属信息
+        // 归属信息
         Map<String, Object> gsInfo = parseToMap(mmap.get("gsInfo").toString());
         log.info("gsInfo: {}", JSONObject.toJSONString(mmap));
 
         String cookie = extractCookie(mmap);
         CarInfoVo car = quoteVo.getCarInfoVo();
 
-        //带重试的获取报价编号、车型型号
+        // 带重试的获取报价编号、车型型号
         Map<String, Object> xbResult = retry(() -> {
             try { return xbQuery(dto.getUsername(), cookie, car); }
             catch (Exception e) { refreshLogin(dto); throw new Exception(e); }
@@ -256,14 +261,14 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
 
         String quotationNo = str(xbResult, "quotationNo");
         String modelcodexh = str(xbResult, "modelcodexh");
-        //报价前预处理-保存车辆信息、过滤车型等处理
+        // 报价前预处理-保存车辆信息、过滤车型等处理
         PreResult pre = prepareQuote(attr, mmap, car, modelcodexh, cookie, quotationNo);
-        //报价
+        // 报价
         CoreResult core = executeQuote(quoteVo, quotationNo, dto, cookie, pre, gsInfo, attr);
         if (!core.success()) throw new SystemException("报价失败");
-        //保存订单到MongoDB
+        // 保存订单到MongoDB
         saveOrder(quoteVo, core);
-        //组装费用
+        // 组装费用
         return HuaTaiCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(quoteVo, core.data(), core.fcPrice());
     }
 
@@ -836,12 +841,27 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
 
         Map<String, Object> map = new HashMap<>();
         try {
-            map = MAPPER.readValue(res, Map.class);
+            // 忽略未知字段
+            MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+            // 空字符串转null
+            MAPPER.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+            // 允许单引号、宽松JSON格式(第三方不规范返回必备)
+            MAPPER.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
+            MAPPER.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
+            // 允许换行符、回车符存在于字符串值中
+            // MAPPER.configure(JsonParser.Feature.ALLOW_UNESCAPED_CONTROL_CHARS, true);
+
+            ObjectReader reader = MAPPER.readerFor(Map.class)
+                    .with(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS)
+                    .with(JsonReadFeature.ALLOW_SINGLE_QUOTES)
+                    .with(JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES);
+
+            map = reader.readValue(res);
         } catch (JsonProcessingException e) {
             throw new SystemException("核保失败, {}", convertResponseMsg(res));
         }
 
-        if (!"1,2,3,4".contains(order.getCiCategory()) || "Y".equals(str(map, "isOver")) || "Y".equals(str(map, "isOver1"))
+        if (!"1,2,3,4,Y1,Y2,Y3".contains(order.getCiCategory()) || "Y".equals(str(map, "isOver")) || "Y".equals(str(map, "isOver1"))
                 || "重新计算保费".equals(str(map, "MSG")) || (res.contains("下发修改意见") && !res.contains("isPassHB")) || res.contains("转人工意见")) {
             throw new SystemException("核保失败-------" + convertResponseMsg(res));
         }

+ 4 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -600,7 +600,7 @@ public class QuoteVerificationAspect {
                         }
                         break;
                     case "3":
-                        String level1Id = calculateLevel1Distribution(insFeeOrders, totalPremium, currentUser.getUserId(), sysDistributionSetting);
+                        String level1Id = calculateLevel1Distribution(insFeeOrders, totalPremium, currentUser.getId(), sysDistributionSetting);
                         if (level1Id != null) {
                             String level2Id = calculateLevel2Distribution(insFeeOrders, totalPremium, level1Id, sysDistributionSetting);
                             if (level2Id != null) {
@@ -627,6 +627,7 @@ public class QuoteVerificationAspect {
                 String distributorId = referrer.getReferrerId();
                 insFeeOrders.setFirstDistributorId(distributorId);
                 insFeeOrders.setFirstDistributionFee(totalPremium.multiply(setting.getCommissionRatioLevel1()));
+                insFeeOrders.setFirstDistributionRatio(setting.getCommissionRatioLevel1());
                 return distributorId;
             }
         }
@@ -647,6 +648,7 @@ public class QuoteVerificationAspect {
                 String distributorId = referrer.getReferrerId();
                 insFeeOrders.setSecondDistributorId(distributorId);
                 insFeeOrders.setSecondDistributionFee(totalPremium.multiply(setting.getCommissionRatioLevel2()));
+                insFeeOrders.setSecondDistributionRatio(setting.getCommissionRatioLevel2());
                 return distributorId;
             }
         }
@@ -666,6 +668,7 @@ public class QuoteVerificationAspect {
                     && "1".equals(referrerInfoResult.getData().getIsDistribution())) {
                 insFeeOrders.setThirdDistributorId(referrer.getReferrerId());
                 insFeeOrders.setThirdDistributionFee(totalPremium.multiply(setting.getCommissionRatioLevel3()));
+                insFeeOrders.setThirdDistributionRatio(setting.getCommissionRatioLevel3());
             }
         }
     }

+ 1 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysDistributionSettingServiceImpl.java

@@ -191,6 +191,7 @@ public class SysDistributionSettingServiceImpl extends ServiceImpl<SysDistributi
             // 审核通过 改为分销员身份
             sysDistributionAudit.setAuditApprovalTime(LocalDateTime.now());
             sysUserJzgInfo.setIsDistribution("1");
+            sysUserJzgInfo.setDistributionTime(LocalDateTime.now());
             sysUserJzgInfoMapper.updateById(sysUserJzgInfo);
             // 添加分销推荐关系
             SysUserJzgInfo inviter = sysUserJzgInfoMapper.selectById(sysUserJzgInfo.getReferrerId());

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java

@@ -102,6 +102,9 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         // 获取个人中心信息
         String mobile = baseController.getUserName();
         String systemCode = baseController.getSystemCode();
+        if (systemCode == null) {
+            systemCode = baseController.getAppSystemCode();
+        }
         String userId  = baseController.getUserId();
         log.info("查询用户的钱包信息:mobile=[{}], systemCode=[{}],userId=[{}]", mobile, systemCode, userId);
         SysUser sysUser = sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getMobile, mobile));

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserServiceImpl.java

@@ -1041,7 +1041,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      */
     @Override
     public HttpResult<SysUserJzgInfo> getUserInfoByUserId(String id) {
-        SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getUserByUserId(id);
+        SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getById(id);
         log.info("根据id=[{}]查询用户信息sysUserJzgInfo=[{}]",id, JSONUtil.toJsonStr(sysUserJzgInfo));
         if (sysUserJzgInfo == null) {
             throw new SystemException("该用户不存在");

+ 0 - 1
tenant/organization/src/main/resources/mapper/SysDistributionSettingMapper.xml

@@ -240,7 +240,6 @@
             and sda.audit_status = '1'
             AND suji3.id IS NOT NULL
         </if>
-        ORDER BY eur1.id DESC
     </select>
 
     <select id="getDistributionOrder" resultType="com.jzg.commons.entity.vo.DistributionOrder">