Просмотр исходного кода

1.爬虫接口添加check环境参数

785834757 2 лет назад
Родитель
Сommit
88e29c678d

+ 5 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerLoginRequest.java

@@ -26,6 +26,9 @@ public class CrawlerLoginRequest implements Serializable {
     @JsonProperty(value = "pwd")
     private String password;
 
+    @JsonProperty(value = "check")
+    private String check;
+
     /**
      * 归属信息
      */
@@ -35,6 +38,8 @@ public class CrawlerLoginRequest implements Serializable {
     public CrawlerLoginRequest(PtlAgreementAttributionDto attribution) {
         this.username = attribution.getUsername();
         this.password = attribution.getPassword();
+        // 环境 新增变量
+        this.check = attribution.getCheck();
         this.other = attribution.getFields().stream().collect(LinkedHashMap::new, (m, v) -> m.put(v.getField(), v.getValue()), LinkedHashMap::putAll);
     }
 

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java

@@ -34,5 +34,9 @@ public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
      */
     private String plyappno;
 
+    /**
+     * 环境配置
+     */
+    private String pythonCheck;
 
 }

+ 9 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -145,6 +145,15 @@ public class OrderQueryVo {
     @ApiModelProperty(value = "是否疑问订单")
     private String problemOrder;
 
+    @ApiModelProperty(value = "交强保单号")
+    private String jqPolicyNo;
+
+    @ApiModelProperty(value = "商业保单号")
+    private String syPolicyNo;
+
+    @ApiModelProperty(value = "非车保单号")
+    private String noPolicyNo;
+
     public LocalDate getEndDatePlusOneDay() {
         if(ObjectUtils.isEmpty(endDate)){
             return endDate;

+ 2 - 2
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementAttributionDto.java

@@ -12,7 +12,6 @@ import java.util.List;
 
 @Data
 @ToString
-@EqualsAndHashCode
 @ApiModel("协议归属")
 public class PtlAgreementAttributionDto implements Serializable {
 
@@ -49,5 +48,6 @@ public class PtlAgreementAttributionDto implements Serializable {
     @ApiModelProperty("保险公司密码")
     private String password;
 
-
+    @ApiModelProperty("环境?")
+    private String check;
 }

+ 6 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -34,6 +34,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.beans.factory.annotation.Value;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -81,6 +82,9 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
 
     private final PtlAgreementMapper ptlAgreementMapper;
 
+    @Value("${python.check}")
+    private String pythonCheck;
+
     public PtlAgreementServiceImpl(PtlAgreementProductCostsService ptlAgreementProductCostsService,
                                    PtlAgreementAttributionService ptlAgreementAttributionService,
                                    PtlAgreementDeptService ptlAgreementDeptService,
@@ -161,6 +165,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     public HttpResult<Object> saveAgreement(PtlAgreementSaveVo agreement, String userName) {
         PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
         PtlAgreementAttributionDto attribution = agreement.getAttribution();
+        attribution.setCheck(pythonCheck);
         PtlAgreement ptlAgreement = new PtlAgreement();
         BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
 
@@ -562,6 +567,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     public HttpResult<Object> reviseAgreement(String userName, String agreementId, PtlAgreementSaveVo agreement) {
         PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
         PtlAgreementAttributionDto attribution = agreement.getAttribution();
+        attribution.setCheck(pythonCheck);
         PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
         EsmInsCompany esmInsCompany = proxyObject.verifyLogin(ptlAgreement, agreementSaveDto, attribution,

+ 13 - 0
src/main/java/com/ydtech/modules/protocols/controller/PtlNewAgreementController.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.protocols.controller;
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
@@ -208,4 +209,16 @@ public class PtlNewAgreementController extends BaseController {
     public HttpResult getTrajectory(String costsId){
         return HttpResult.ok(ptlAgreementProductCostsTrajectoryService.getTrajectory(costsId));
     }
+
+    @ApiOperation("获取现询费用")
+    @PostMapping("getInquiryNowFee")
+    public HttpResult getInquiryNowFee(@RequestBody InquiryNowFeeQueryVo inquiryNowFeeQueryVo) {
+        return HttpResult.ok(ptlAgreementProductCostsNewService.getInquiryNowFee(inquiryNowFeeQueryVo));
+    }
+
+    @ApiOperation("获取产品id")
+    @PostMapping("getProductId")
+    public HttpResult getProductId(@RequestBody ProductQueryVo productQueryVo){
+        return HttpResult.ok("",InsuranceRisk.determineInsuranceInformation(productQueryVo.getKindList(), productQueryVo.getRiskList()).getCode());
+    }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java

@@ -143,6 +143,10 @@ public class PtlAgreementProductCostsNew {
     @TableField(value = "audit_time")
     private LocalDateTime auditTime;
 
+    @ApiModelProperty(value = "是否是现询")
+    @TableField(value = "is_inquiry_now")
+    private String isInquiryNow;
+
     @ApiModelProperty(value = "生成的描述")
     @TableField(exist = false)
     private String desc;

+ 19 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/InquiryNowFeeQueryVo.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.protocols.entity.vo;
+
+
+import lombok.Data;
+
+@Data
+public class InquiryNowFeeQueryVo {
+
+    /**
+     * 协议id
+     */
+    private String agreementId;
+
+    /**
+     * 产品id
+     */
+    private String productId;
+
+}

+ 16 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/ProductQueryVo.java

@@ -0,0 +1,16 @@
+package com.ydtech.modules.protocols.entity.vo;
+
+import com.alipay.api.domain.RiskInfo;
+import com.ydtech.modules.ins.model.vo.KindInfoVo;
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ProductQueryVo {
+
+    private List<RiskInfoVo> riskList;
+
+    private List<KindInfoVo> kindList;
+}

+ 7 - 0
src/main/java/com/ydtech/modules/protocols/service/PtlAgreementProductCostsNewService.java

@@ -106,4 +106,11 @@ public interface PtlAgreementProductCostsNewService extends IService<PtlAgreemen
     FeeOrderNewVo costsAdjust(FeeOrderNewRecordVo feeOrderNewRecordVo);
 
     Page<PtlAgreementProductCostsNew> getCostsAuditList(Page page, AgreementProductQueryVo agreementProductQueryVo);
+
+    /**
+     * 获取现询费用
+     * @param inquiryNowFeeQueryVo
+     * @return
+     */
+    List<PtlAgreementProductCostsNew> getInquiryNowFee(InquiryNowFeeQueryVo inquiryNowFeeQueryVo);
 }

+ 21 - 2
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -484,7 +484,8 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 //        }
         for (int i = 0; i < agreementProductCosts.getProductId().size(); i++) {
             PtlAgreement ptlAgreement = ptlAgreementService.getById(agreementProductCosts.getAgreementId());
-            if(ptlAgreement.getIsExternal() == 1) {
+            //是外部订单 并且 是现询的费用 只有一个
+            if(ptlAgreement.getIsExternal() == 1  && agreementProductCosts.getIsInquiryNow().equals("1")) {
                 // 外部订单的检测  每个产品只可有一个费用
                 List<PtlAgreementProductCostsNew> list = ptlAgreementProductCostsNewService.list(new LambdaQueryWrapper<PtlAgreementProductCostsNew>()
                         .eq(PtlAgreementProductCostsNew::getProductId, agreementProductCosts.getProductId().get(i))
@@ -1711,7 +1712,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         //保存新的比例
         insFeeOrderNewService.updateById(insFeeOrderNew);
 
-
+        //添加轨迹
+        InsFeeAuditHistory insFeeAuditHistory = new InsFeeAuditHistory(insAreaCompany,"2",BaseController.getUser().getName());
+        insFeeAuditHistoryService.save(insFeeAuditHistory);
 
         return resultFeeOrderNewVo;
 
@@ -1862,4 +1865,20 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         });
         return pages;
     }
+
+    /**
+     * 获取现询费用
+     * @param inquiryNowFeeQueryVo
+     * @return
+     */
+    @Override
+    public List<PtlAgreementProductCostsNew> getInquiryNowFee(InquiryNowFeeQueryVo inquiryNowFeeQueryVo) {
+        LambdaQueryWrapper<PtlAgreementProductCostsNew> queryWrapper = new LambdaQueryWrapper<>();
+
+        queryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId,inquiryNowFeeQueryVo.getAgreementId());
+        if(inquiryNowFeeQueryVo.getProductId() != null) {
+            queryWrapper.eq(PtlAgreementProductCostsNew::getProductId, inquiryNowFeeQueryVo.getProductId());
+        }
+        return baseMapper.selectList(queryWrapper);
+    }
 }

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

@@ -354,3 +354,6 @@ anti:
   redis:
     redisson:
       file: classpath:redisson-prod.yml
+
+python:
+  check: zs

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

@@ -437,3 +437,6 @@ anti:
   redis:
     redisson:
       file: classpath:redisson-test.yml
+
+python:
+  check: ceshi

+ 9 - 0
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -268,6 +268,15 @@
         <if test="params.isExternal != null and params.isExternal != ''">
             and io.is_external = #{params.isExternal}
         </if>
+        <if test="params.jqPolicyNo != null and params.jqPolicyNo != ''">
+            and iac.jqpolicyno = #{params.jqPolicyNo}
+        </if>
+        <if test="params.syPolicyNo != null and params.syPolicyNo != ''">
+            and iac.sypolicyno = #{params.syPolicyNo}
+        </if>
+        <if test="params.noPolicyNo != null and params.noPolicyNo != ''">
+            and iac.cross_insurance like concat('%', #{params.noPolicyNo}, '%')
+        </if>
         order by iac.createtime desc
     </select>