Преглед изворни кода

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

jiakai пре 2 месеци
родитељ
комит
9838e70254

+ 2 - 2
commons/src/main/java/com/jzg/commons/entity/vo/RuleAttrMappingVo.java

@@ -81,9 +81,9 @@ public class RuleAttrMappingVo {
         long between = ChronoUnit.YEARS.between(registrationDate, currentDate) + 1;
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleAge", String.valueOf(between)));
         //转续保 交强
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqRenewalOfInsurance", String.valueOf(insOrdersOther.getJqRenewal())));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqRenewalOfInsurance", insOrdersOther.getJqRenewal() != null && insOrdersOther.getJqRenewal() == 2 ? "是" : "否"));
         //转续保 商业
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyRenewalOfInsurance", String.valueOf(insOrdersOther.getSyRenewal())));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyRenewalOfInsurance", insOrdersOther.getSyRenewal() != null && insOrdersOther.getSyRenewal() == 2 ? "是" : "否"));
         // 车主
         InsOrdersCarUserInfo ownerInfo = insOrdersCarUserInfos.stream()
                 .filter(insOrdersCarUserInfo -> insOrdersCarUserInfo.getPolicyPersonType().equals(1)).findFirst().orElse(null);

+ 4 - 1
platform/src/main/resources/mapper/JyxConfigMapper.xml

@@ -39,7 +39,9 @@
 
 
     <sql id="params">
-        jc.`id`, jc.`product_type`,jc.`parent_id`, jc.`product_name`,jc.`alias`,jc.`company`, jc.`product_code`,jc.`connection_method`,jc.`premium_setting`, jc.`coverage` as jsCoverage, jc.`premium` as jsPremium, jc.`system_code`, jc.`is_delete` as isDelete
+        jc.`id`, jc.`product_type`,jc.`parent_id`,
+        CASE WHEN jc.parent_id != '0' AND jc.parent_id IS NOT NULL AND jc1.product_name IS NOT NULL THEN CONCAT(jc1.product_name, '-', jc.product_name) ELSE jc.product_name END as product_name,
+        jc.`alias`,jc.`company`, jc.`product_code`,jc.`connection_method`,jc.`premium_setting`, jc.`coverage` as jsCoverage, jc.`premium` as jsPremium, jc.`system_code`, jc.`is_delete` as isDelete
     </sql>
 
     <select id="jyxList" resultMap="jyxConfigVo">
@@ -48,6 +50,7 @@
         jb.id as blame_id,jb.blame,jb.blame_code,jb.blame_coverage,jb.blame_premium,jb.system_code as blame_system_code,jb.jyx_config_id as blame_jyx_config_id,
         js.id as setting_id,js.seats,js.coverage as setting_coverage,js.premium as setting_premium,js.system_code as setting_system_code,js.jyx_config_id as setting_jyx_config_id
         from jyx_config jc
+        left join jyx_config jc1 on jc.parent_id = jc1.id AND jc1.is_delete = 0
         left join jyx_blame jb on jc.id = jb.jyx_config_id AND jb.is_delete = 0
         left join jyx_setting js on jc.id = js.jyx_config_id AND js.is_delete = 0
         <where>

+ 1 - 1
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/service/impl/ChengTaiApiRequestImpl.java

@@ -156,7 +156,7 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
         PremiumCalculationResponse premiumCalculationResponse = new PremiumCalculationResponse();
         String ciQuestion = null,biQuestion = null;
         while(true) {
-            if(index >=6){
+            if(index >=7){
                 break;
             }
             premiumCalculationResponse = chengTaiRequestApiComponent.premiumCalculation(premiumCalculationRequest,apiUrl);

+ 8 - 10
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -334,10 +334,6 @@ public class UnifyOrderManager {
             insOrdersService.orderAfterUpdateQuote(ordersNo, quoteResultsVo);
             log.info("报价返回:{}", JSON.toJSONString(quoteResultsVo));
 
-            // 处理营销抽奖活动(报价规则 type=6),异常不影响主报价流程
-            handleQuoteLotteryActivity(quoteVo);
-
-
         } catch (Exception e) {
             log.error("车险报价异常", e);
             Throwable root = e.getCause() != null ? e.getCause() : e;
@@ -352,6 +348,9 @@ public class UnifyOrderManager {
                 log.error("更新报价失败状态异常, ordersNo: {}", ordersNo, ex);
             }
             throw new SystemException(errMsg);
+        }finally {
+            // 处理营销抽奖活动(报价规则 type=6),异常不影响主报价流程
+            handleQuoteLotteryActivity(quoteVo);
         }
         return quoteResultsVo.getQuoteStatusEnum()
                 .equals(InsOrderStatusEnum.WAIT_AUDIT) ? HttpResult.ok(quoteResultsVo) : HttpResult.error(500, quoteResultsVo, quoteResultsVo.getErrorMessage());
@@ -604,16 +603,15 @@ public class UnifyOrderManager {
             return;
         }
         // 防止同一次报价重复执行时重复远程发放;这里用当天报价次数作为防重维度。
-        SysUserActivityCompleteInRule exist = insOrdersService.selectByRule(
+        /*SysUserActivityCompleteInRule exist = insOrdersService.selectByRule(
                 tenantId, userId, activity.getId(), String.valueOf(count), 6);
         if (exist != null) {
             return;
         }
-        HttpResult<SysUserJzgInfo> sysUser = orgClient.queryUserByUserId(userId,tenantId);
+        HttpResult<SysUserJzgInfo> sysUser = orgClient.queryUserByUserId(userId,tenantId);*/
 
         // 满足条件,远程调用抽奖次数增加接口,只发放本次新增次数。
         LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
-        lotteryCounDTO.setAppUserId(userId);
         lotteryCounDTO.setActivityId(activity.getId());
         lotteryCounDTO.setCount(currentGrantNum);
         lotteryCounDTO.setPhone(userId);
@@ -627,7 +625,7 @@ public class UnifyOrderManager {
             log.error("业务员报价,远程调用本地生活抽奖次数增加异常", e);
         }
 
-        if (lotteryResult != null && lotteryResult.getData().getSuccess()) {
+        if (lotteryResult != null) {
             completeRule(tenantId, userId, null, activity.getId(),
                     table.getId(), String.valueOf(count), String.valueOf(currentGrantNum),
                     table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 6);
@@ -1200,9 +1198,9 @@ public class UnifyOrderManager {
         // 满足条件,远程调用抽奖次数增加接口
         int qutLotteryNum = Integer.parseInt(table.getQutLotteryNum());
         LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
-        lotteryCounDTO.setAppUserId(userId);
         lotteryCounDTO.setActivityId(activity.getId());
         lotteryCounDTO.setCount(qutLotteryNum);
+        lotteryCounDTO.setPhone(userId);
 
         HttpResult<LotteryCountVO> lotteryResult = null;
         try {
@@ -1212,7 +1210,7 @@ public class UnifyOrderManager {
                     userId, table.getQutLotteryNum(), tenantId);
             log.error("业务员出单,远程调用本地生活抽奖次数增加异常", e);
         }
-        if (lotteryResult != null && lotteryResult.getData().getSuccess()) {
+        if (lotteryResult != null ) {
             MessageAddParam param = new MessageAddParam();
             param.setTitle("抽奖次数下发通知消息");
             param.setContent("{\"eventId\":\"" + activity.getId() + "\",\"localActivityTableId\":\"" + table.getId() + "\",\"message\":\"出单活动:抽奖次数奖励下发\"}");

+ 4 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/entity/vo/ChannelRightsVO.java

@@ -82,6 +82,10 @@ public class ChannelRightsVO {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @Schema(description = "领取时间")
     private Date receiveTime;
+
+    /**可用门店数量*/
+    @Schema(description = "可用门店数量 默认0")
+    private Integer shareableStoreNum = 0;
     @Schema(description = "订单下选择权益套餐数量,默认0")
     private Integer rightsCount = 0;
 }

+ 3 - 2
tenant/insurance/quotation-zhongan/src/main/java/com/jzg/quotation/zhongan/crawler/component/ZhongAnCrawlerRequestComponent.java

@@ -97,8 +97,9 @@ public class ZhongAnCrawlerRequestComponent {
                 "众安爬虫车辆查询接口",RequestUrl.CAR_QUERY.getRequestUrl(zhongAnCrawlerProperties.getBaseUrl()), JSON.toJSONString(carQueryRequest));
         ZhongAnCrawlerCarQueryResponse carQueryResponse = requestComponent.formDataZhongAn(RequestUrl.CAR_QUERY.getRequestUrl(zhongAnCrawlerProperties.getBaseUrl()), carQueryRequest, ZhongAnCrawlerCarQueryResponse.class, headers,"车辆查询").getBody();
         List<ZhongAnCrawlerCarQueryResponse.ValueDTO.DataDTO.ResultDTO.VehicleDTO> vehicleList = carQueryResponse.getValue().getDatas().getResult().getVehicleList();
-        vehicleDTOList.addAll(vehicleList);
-
+        if (vehicleList != null && vehicleList.size() > 0) {
+            vehicleDTOList.addAll(vehicleList);
+        }
         return vehicleDTOList;
     }
 

+ 1 - 1
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Request/ZmCrawlerQuotedPriceRequest.java

@@ -1177,7 +1177,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     }
                     this.expiryDate = riskInfoVo.getEndDate();
                     this.argueSolution = "1";
-                    if (riskInfoVo.isInstantFlag()) {
+                    if (riskInfoVo.isInstantFlag() || !riskInfoVo.getStartDate().endsWith("00:00:00")) {
                         this.reinsuranceFlag = "1";
                     } else {
                         this.reinsuranceFlag = "0";

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/client/PlatformClient.java

@@ -5,8 +5,10 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
 import com.jzg.commons.entity.vo.CompanyClauseVo;
 import com.jzg.commons.entity.vo.InsCompanyClauseVo;
+import com.jzg.commons.entity.vo.JyxConfigVo;
 import io.swagger.v3.oas.annotations.Operation;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -34,4 +36,10 @@ public interface PlatformClient {
     @PostMapping("/manager/clause/getClauseList")
     HttpResult<List<InsCompanyClauseVo>> queryClauseData(@RequestBody CompanyClauseVo companyClauseVo);
 
+    /**
+     * 查询驾意险的信息
+     */
+    @GetMapping("/jyxConfig/getById")
+    HttpResult<JyxConfigVo> jyxConfigGetById(@RequestParam String id);
+
 }

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

@@ -27,6 +27,7 @@ import com.jzg.commons.entity.scheme.vo.*;
 import com.jzg.commons.entity.vo.CompanyClauseVo;
 import com.jzg.commons.entity.vo.EsmInsCompanyResVo;
 import com.jzg.commons.entity.vo.InsCompanyClauseVo;
+import com.jzg.commons.entity.vo.JyxConfigVo;
 import com.jzg.commons.exception.NoneException;
 import com.jzg.commons.exception.ValidateException;
 import com.jzg.commons.util.AssertionUtils;
@@ -149,6 +150,20 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
 
         //驾意险信息
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = ptlSchemeSaveVo.getPtlSchemeInsuranceDrivingIntentionList();
+        //校验驾意险归属:drivingIntentionId 对应的 jyx_config 必须属于当前方案的保险公司
+        if (CollUtil.isNotEmpty(ptlSchemeInsuranceDrivingIntentionList)) {
+            String schemeCompanyId = ptlSchemeSaveVo.getCompanyId();
+            for (PtlSchemeInsuranceDrivingIntention di : ptlSchemeInsuranceDrivingIntentionList) {
+                if (di.getDrivingIntentionId() == null) continue;
+                HttpResult<JyxConfigVo> jyxResult = platformClient.jyxConfigGetById(di.getDrivingIntentionId());
+                if (jyxResult != null && jyxResult.getData() != null) {
+                    JyxConfigVo jyxConfig = jyxResult.getData();
+                    if (!schemeCompanyId.equals(jyxConfig.getCompany())) {
+                        throw new ValidateException("驾意险[" + jyxConfig.getProductName() + "]属于公司[" + jyxConfig.getCompanyName() + "],与当前方案的公司不一致,请检查");
+                    }
+                }
+            }
+        }
         //校验驾意险座位数范围不可重复
         validateDrivingIntentionSeatRange(ptlSchemeInsuranceDrivingIntentionList);
         //清空驾意险信息
@@ -441,7 +456,8 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         //1.过滤方案
         ptlSchemes.removeIf(ptlScheme -> !insSchemeIds.contains(ptlScheme.getId()));
         List<String> companyIds = ptlSchemes.stream().map(ptlScheme -> ptlScheme.getCompanyId()).collect(Collectors.toList());
-        companyList.removeIf(company -> !companyIds.contains(company.getId()));
+        // 移除不匹配方案的保司,以及空协议的保司
+        companyList.removeIf(company -> !companyIds.contains(company.getId()) || CollUtil.isEmpty(company.getAgreements()));
         List<PtlAgreementInsCompanyVo> resVo = new ArrayList<>();
         companyList.forEach(company -> {
             PtlAgreementInsCompanyVo vo = new PtlAgreementInsCompanyVo();

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

@@ -173,7 +173,7 @@
             psi.scheme_type,
             psi.scheme_name,
             jc.id as jc_id,
-            jc.product_name,
+            CASE WHEN jc.parent_id IS NOT NULL AND jc.parent_id != '' AND jc.parent_id != '0' AND jc1.product_name IS NOT NULL AND jc1.product_name != '' THEN CONCAT(jc1.product_name, '-', jc.product_name) ELSE jc.product_name END as product_name,
             jc.alias,
             jc.product_code,
             jc.coverage,