Przeglądaj źródła

Merge branch 'master' of http://39.101.143.165:8090/785834757/jzg

lipf 1 miesiąc temu
rodzic
commit
e3e4f6da30

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/dto/AgreementCopyParam.java

@@ -18,4 +18,10 @@ public class AgreementCopyParam {
 //    @NotEmpty(message = "费用id不能为空")
     @Schema(description = "费用id数组")
     private List<String> costIds;
+
+    @Schema(description = "对接人")
+    private String dockingPerson;
+
+    @Schema(description = "对接人电话")
+    private String dockingPhone;
 }

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeVo.java

@@ -39,6 +39,8 @@ public class PtlSchemeVo extends PageRequest {
 
     @Schema(description = "规则描述")
     private String ruleDesc;
+    @Schema(description = "排序")
+    private String sort;
 
 
 }

+ 4 - 0
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/component/DaDiCrawlerRequestComponent.java

@@ -510,6 +510,10 @@ public class DaDiCrawlerRequestComponent {
             ciRisk.setStartDate(startTime);
             ciRisk.setEndDate(endTime);
             quoteVo.setCiRiskInfoVo(ciRisk);
+            RiskInfoVo biRisk = quoteVo.getBiRiskInfoVo();
+            biRisk.setStartDate(startTime);
+            biRisk.setEndDate(endTime);
+            quoteVo.setBiRiskInfoVo(biRisk);
             return getDaDiQuote(headers, orderId, new ArrayList<>(), quoteVo, daDiVehicleChannelRequest, vehicleModelVO, agentInfoVo, vehiclePricVo);
         }
 

+ 22 - 9
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/FactorMatch.java

@@ -304,8 +304,6 @@ public class FactorMatch {
                 if (CollUtil.isNotEmpty(collect)) {
                     logs.append("<span style=\"color:red;\">规则匹配失败:" + collect.get(0).getAttrName() + "</span>\n");
                 }
-                //如果有一个匹配上就返回
-                return true;
             }
         }
         log.info("承保规则校验-所有条件均未命中, 规则组通过, useFlag={}", useFlag);
@@ -330,7 +328,22 @@ public class FactorMatch {
         // 字典还原依据:参与比较的这条因子元数据 ptlAgreementUndwrtRulesAttr 自身挂的 dictId,
         // 再到 undwrtRulesDictList 中按 name 找 code(如 "家庭自用" -> "04")。
         Integer dictId = ptlAgreementUndwrtRulesAttr.getDictId();
-
+        // ===== 新增:把传入的 name 还原成 code 再参与比较 =====
+        // 只对依赖字典的 select/radio/checkbox 做还原;input/inputNumber/date 等保留原值
+        if (CollUtil.isNotEmpty(undwrtRulesDictList)
+                && dictId != null
+                && !ptlAgreementCostRule.getAttrCode().equals("LicenseArea") // 车牌归属地无字典,纯文本
+                && !ptlAgreementCostRule.getAttrCode().equals("LicenseNo")) {
+            String normalized = value;
+            for (PtlAgreementUndwrtRulesDictLabal label : undwrtRulesDictList) {
+                if (Objects.equals(label.getDictId(), dictId) && label.getName().equals(value)) {
+                    normalized = label.getCode();
+                    break;
+                }
+            }
+            value = normalized;
+        }
+        // ====================================================
         boolean result = false;
         if (ptlAgreementUndwrtRulesAttr.getAttrType().equals("checkbox")) {
             result = checkBoxEqual(ptlAgreementCostRule, value, dictId, undwrtRulesDictList);
@@ -382,9 +395,6 @@ public class FactorMatch {
         String[] split = ptlAgreementCostRule.getMin().split(",");
         for (String sp : split) {
             String spTrim = sp.trim();
-            if (spTrim.equals(value.trim())) {
-                return true;
-            }
             if (dictId == null && CollUtil.isNotEmpty(undwrtRulesDictList)) {
                 for (PtlAgreementUndwrtRulesDictLabal label : undwrtRulesDictList) {
                     if (label.getCode().equals(spTrim) && value.trim().equals(label.getName())) {
@@ -392,6 +402,9 @@ public class FactorMatch {
                     }
                 }
             }
+            if (spTrim.equals(value.trim())) {
+                return true;
+            }
         }
         return false;
     }
@@ -510,9 +523,6 @@ public class FactorMatch {
             }
         } else {
             // dictId 为空时(无字典):把 min 里的 code 翻成 name,再用实际 value(汉字)与 name 比较
-            if (ptlAgreementCostRule.getMin().contains(value)) {
-                return true;
-            }
             if (dictId == null && CollUtil.isNotEmpty(undwrtRulesDictList)) {
                 for (PtlAgreementUndwrtRulesDictLabal label : undwrtRulesDictList) {
                     if (label.getCode().equals(ptlAgreementCostRule.getMin()) && value.equals(label.getName())) {
@@ -520,6 +530,9 @@ public class FactorMatch {
                     }
                 }
             }
+            if (ptlAgreementCostRule.getMin().contains(value)) {
+                return true;
+            }
         }
         return false;
     }

+ 9 - 6
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/AuditVerificationAspect.java

@@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.orders.po.*;
 import com.jzg.commons.entity.po.*;
 import com.jzg.commons.entity.quote.vo.aggregated.UnderwritingVo;
@@ -25,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.time.format.DateTimeFormatter;
@@ -249,18 +252,18 @@ public class AuditVerificationAspect {
 
             log.info("规则组[{}]匹配结果: ruleMatched={}, 错误日志=[{}]", groupIndex, ruleMatched, ruleLogs);
 
-            if (ruleMatched && StringUtils.isNotBlank(ruleLogs)) {//ruleLogs 不为空 表示有一个匹配上
+            allErrorLogs.append(ruleLogs);
+
+            if (ruleMatched) {
                 anyRuleMatched = true;
                 log.info("规则组[{}]匹配成功, 订单通过!", groupIndex);
-                log.info("=== 承保规则校验成功,规则组[{}]通过 ===", groupIndex);
-                throw new SystemException(ruleLogs.toString());
+                break; // OR关系:任一条规则通过即可
             }
-            allErrorLogs.append(ruleLogs);
         }
 
         if (!anyRuleMatched) {
-            log.info("=== 承保规则校验失败, 所有规则组均未通过 ===");
-            log.info("=== 承保规则校验需要通过 ===");
+            log.info("=== 承保规则校验失败, 所有规则组均未通过, 抛出异常 ===");
+            throw new SystemException(allErrorLogs.toString());
         }
     }
 

+ 4 - 0
tenant/insurance/quotation-zhongan/src/main/java/com/jzg/quotation/zhongan/crawler/entity/request/ZhongAnCrawlerQuoteRequest.java

@@ -140,8 +140,12 @@ public class ZhongAnCrawlerQuoteRequest{
         } else {
             NonAutoInfoDto jtywxV24 = new NonAutoInfoDto("kp_nhjcb_v1", "0", null);
             NonAutoInfoDto wjsGabV6 = new NonAutoInfoDto("wjs_gab_v10", "0", null);
+            NonAutoInfoDto wjs_cwyjtywx_v1 = new NonAutoInfoDto("wjs_cwyjtywx_v1", "0", null);
+            NonAutoInfoDto kp_czwyjcx_v1 = new NonAutoInfoDto("kp_czwyjcx_v1", "0", null);
             nonAutoInfoDtos.add(jtywxV24);
             nonAutoInfoDtos.add(wjsGabV6);
+            nonAutoInfoDtos.add(wjs_cwyjtywx_v1);
+            nonAutoInfoDtos.add(kp_czwyjcx_v1);
         }
         this.nonAutoInfo = JSONObject.toJSONString(nonAutoInfoDtos);
     }

+ 12 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/AgreementController.java

@@ -217,6 +217,18 @@ public class AgreementController extends BaseController {
         return HttpResult.ok("复制成功");
     }
 
+    /**
+     * 协议外部协议复制内部协议
+     * @param param
+     * @return
+     */
+    @Operation(summary = "外部协议复制内部协议")
+    @PostMapping("/agreementCopyOutToIn")
+    public HttpResult agreementCopyOutToIn(@Validated @RequestBody AgreementCopyParam param) {
+        agreementService.agreementCopyOutToIn(param);
+        return HttpResult.ok("复制成功");
+    }
+
     /**
      * 批量修改协议费用有效期
      * @param param 参数

+ 2 - 0
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementService.java

@@ -166,4 +166,6 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @date 2026/7/28 9:14
      */
     List<ContractVO> queryContractVos();
+
+    void agreementCopyOutToIn(AgreementCopyParam param);
 }

+ 120 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementServiceImpl.java

@@ -19,6 +19,7 @@ import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.client.EsmInsCompanyClient;
+import com.jzg.organization.mapper.PtlAgreementCostExternalMapper;
 import com.jzg.organization.mapper.PtlAgreementMapper;
 import com.jzg.organization.mapper.SysUploadFilesMapper;
 import com.jzg.organization.mapper.SysUserMapper;
@@ -83,6 +84,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
 
     @Autowired
     private PtlAgreementCostExternalService ptlAgreementCostExternalService;
+    @Autowired
+    private PtlAgreementCostExternalTypeService ptlAgreementCostExternalTypeService;
 
     /**
      * 协议分页查询
@@ -437,6 +440,123 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         // 复制承保规则和费用
         this.copyRuleAndCost(costGroup, allCostIds, costList, newAgreement);
 
+    }
+
+
+    /**
+     * 内部协议复制到外部协议
+     *
+     */
+    @Override
+    @Transactional(rollbackFor = {Exception.class})
+    public void agreementCopyOutToIn(AgreementCopyParam param) {
+        log.info("内部协议复制到外部协议。 param=[{}]", JSONUtil.toJsonStr(param));
+        if(param.getId().isEmpty()){
+            throw new SystemException("请选择您要复制的协议信息");
+        }
+        if(param.getDockingPerson().isEmpty()){
+            throw new SystemException("请填写对接人信息");
+        }
+        if(param.getDockingPhone().isEmpty()){
+            throw new SystemException("请填写对接人信息");
+        }
+
+        PtlAgreement agreement = getById(param.getId());
+        // 获取保险公司信息
+        HttpResult<EsmInsCompany> result = companyClient.findById(agreement.getCompanyId());
+        String companyCode;
+        if(result.getCode() == 200 && Objects.nonNull(result.getData())){
+            companyCode = result.getData().getCompanyCode();
+        }else{
+            log.info("根据协议agreement[{}]中的companyId[{}]无法获取到保险公司信息", JSONUtil.toJsonStr(agreement), agreement.getId());
+            throw new SystemException("根据公司id"+agreement.getCompanyId()+"无法获取到保险公司信息");
+        }
+        String sysCode = baseController.getUserSystemCode();
+        PtlAgreement newAgreement = new PtlAgreement();
+        BeanUtils.copyProperties(agreement,newAgreement);
+        newAgreement.setId(null);
+        newAgreement.setAgreementTitle(LocalDateTime.now().getSecond() + agreement.getAgreementTitle());
+        newAgreement.setAgreementCode(sysCode + companyCode + System.currentTimeMillis());
+        newAgreement.setAuditStatus(0);
+        newAgreement.setCreateTime(LocalDateTime.now());
+        newAgreement.setUpdateTime(LocalDateTime.now());
+        // 外部协议
+        newAgreement.setIsExternal(1);
+        // 根据测试反馈,复制后的协议,默认应该是停用状态
+        newAgreement.setIsEnable(1);
+        save(newAgreement);
+
+        List<String> costIds = param.getCostIds();
+        if(CollUtil.isEmpty(costIds)){
+            return;
+        }
+        List<PtlAgreementCost> selectedCostList = agreementCostService.listByIds(costIds);
+        if (CollUtil.isEmpty(selectedCostList)) {
+            return;
+        }
+        Set<String> allCostIds = selectedCostList.stream().map(PtlAgreementCost::getId).collect(Collectors.toSet());
+        LambdaQueryWrapper<PtlAgreementCostType> costTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        costTypeLambdaQueryWrapper.in(PtlAgreementCostType::getPtlAgreementCostId, allCostIds);
+        List<PtlAgreementCostType> costTypeList = agreementCostTypeService.list(costTypeLambdaQueryWrapper);
+        Map<String, List<PtlAgreementCostType>> costTypeMap = costTypeList.stream().collect(
+                Collectors.groupingBy(PtlAgreementCostType::getPtlAgreementCostId));
+
+        for(PtlAgreementCost cost :selectedCostList){
+            PtlAgreementCostExternal costExternal = new PtlAgreementCostExternal();
+            // 同名同类型字段直接复制
+            // 关联新协议ID:String -> Long
+            costExternal.setPtlAgreementId(Long.valueOf(newAgreement.getId()));
+            costExternal.setProductName(cost.getProductName());
+            costExternal.setProductId(cost.getProductId());
+            costExternal.setEffectiveTime(cost.getEffectiveTime());
+            costExternal.setFailureTime(cost.getFailureTime());
+            costExternal.setAuditMethod(cost.getAuditMethod());
+            costExternal.setCostDescribe(cost.getCostDescribe());
+            costExternal.setReviewDescription(cost.getReviewDescription());
+            costExternal.setIsEnabled(cost.getIsEnabled());
+            costExternal.setAuditTime(cost.getAuditTime());
+            costExternal.setAuditPerson(cost.getAuditPerson());
+            // 默认非现询,非现询为1
+            costExternal.setIsInquiry(1);
+
+            // 类型转换:Integer -> String
+            if (cost.getPriorityLevel() != null) {
+                costExternal.setPriorityLevel(String.valueOf(cost.getPriorityLevel()));
+            }
+            // 复制的费用默认待审核
+            costExternal.setAuditStatus(0);
+            // 复制对接人信息
+            costExternal.setContactPerson(param.getDockingPerson());
+            costExternal.setContactMobile(param.getDockingPhone());
+            ptlAgreementCostExternalService.save(costExternal);
+
+            List<PtlAgreementCostType> costTypes = costTypeMap.get(cost.getId());
+            if (CollUtil.isNotEmpty(costTypes)) {
+                List<PtlAgreementCostExternalType> costExternalTypes = new ArrayList<>();
+                for(PtlAgreementCostType costType :costTypes){
+                    PtlAgreementCostExternalType costExternalType = new PtlAgreementCostExternalType();
+                    // 同名同类型字段直接复制
+                    costExternalType.setCostType(costType.getCostType());
+                    costExternalType.setInlet(costType.getInlet());
+                    costExternalType.setExport(costType.getExport());
+                    costExternalType.setAddThrow(costType.getAddThrow());
+                    costExternalType.setKeepPointRatio(costType.getKeepPointRatio());
+                    // 关联新外部费用ID:String -> Long
+                    costExternalType.setPtlAgreementCostExternalId(costExternal.getId());
+                    costExternalType.setCreateTime(LocalDateTime.now());
+                    costExternalType.setUpdateTime(LocalDateTime.now());
+                    costExternalTypes.add(costExternalType);
+
+                }
+                ptlAgreementCostExternalTypeService.saveBatch(costExternalTypes);
+            }
+
+
+        }
+
+
+
+
     }
 
     @Override