Prechádzať zdrojové kódy

python对接 协议归属、协议账号配置

wks 3 rokov pred
rodič
commit
24cc0ff447
55 zmenil súbory, kde vykonal 1300 pridanie a 115 odobranie
  1. 53 0
      src/main/java/com/ydtech/modules/order/controller/InsuranceCrawlerOrderController.java
  2. 31 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerLoginRequest.java
  3. 18 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java
  4. 82 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java
  5. 2 2
      src/main/java/com/ydtech/modules/order/service/BaseOrderService.java
  6. 4 0
      src/main/java/com/ydtech/modules/order/service/InsuranceCrawlerOrderService.java
  7. 11 1
      src/main/java/com/ydtech/modules/order/service/ZhongMeiOrderApiService.java
  8. 20 0
      src/main/java/com/ydtech/modules/order/service/impl/InsuranceCrawlerOrderServiceImpl.java
  9. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java
  10. 4 4
      src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java
  11. 55 0
      src/main/java/com/ydtech/modules/protocol/controller/PtlInsAttributionTemplateController.java
  12. 21 21
      src/main/java/com/ydtech/modules/protocol/controller/PtlProductController.java
  13. 0 9
      src/main/java/com/ydtech/modules/protocol/dao/EsProductMapper.java
  14. 18 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementAttributionMapper.java
  15. 18 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementDeptMapper.java
  16. 18 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlCrawlerApiMapper.java
  17. 18 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlInsAttributionTemplateMapper.java
  18. 9 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlProductMapper.java
  19. 17 0
      src/main/java/com/ydtech/modules/protocol/entity/constants/PtlApiType.java
  20. 22 0
      src/main/java/com/ydtech/modules/protocol/entity/constants/PtlCrawlerApiType.java
  21. 51 0
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementAttributionDto.java
  22. 1 1
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementProductCostsSaveDto.java
  23. 2 2
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementUnderwritingRulesSaveDto.java
  24. 26 0
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAttributionTemplateDto.java
  25. 2 1
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java
  26. 83 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementAttribution.java
  27. 49 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementDept.java
  28. 4 4
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementProductCosts.java
  29. 2 2
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementUnderwritingRules.java
  30. 51 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlCrawlerApi.java
  31. 65 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlInsAttributionTemplate.java
  32. 1 1
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlProduct.java
  33. 10 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementQueryVo.java
  34. 7 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementSaveVo.java
  35. 27 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlCrawlerApiSaveVo.java
  36. 20 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlInsAttributionTemplateQueryVo.java
  37. 26 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlInsAttributionTemplateSaveVo.java
  38. 3 3
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlProductVo.java
  39. 24 0
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementAttributionService.java
  40. 37 0
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementDeptService.java
  41. 3 3
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementProductCostsService.java
  42. 14 8
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java
  43. 5 4
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementUnderwritingRulesService.java
  44. 13 0
      src/main/java/com/ydtech/modules/protocol/service/PtlCrawlerApiService.java
  45. 64 0
      src/main/java/com/ydtech/modules/protocol/service/PtlInsAttributionTemplateService.java
  46. 4 3
      src/main/java/com/ydtech/modules/protocol/service/PtlProductService.java
  47. 34 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementAttributionServiceImpl.java
  48. 49 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementDeptServiceImpl.java
  49. 3 3
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementProductCostsServiceImpl.java
  50. 47 21
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  51. 4 4
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementUnderwritingRulesServiceImpl.java
  52. 22 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlCrawlerApiServiceImpl.java
  53. 114 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlInsAttributionTemplateServiceImpl.java
  54. 8 11
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlProductServiceImpl.java
  55. 3 6
      src/main/java/com/ydtech/modules/protocol/utils/AssertionUtils.java

+ 53 - 0
src/main/java/com/ydtech/modules/order/controller/InsuranceCrawlerOrderController.java

@@ -0,0 +1,53 @@
+package com.ydtech.modules.order.controller;
+
+
+import com.ydtech.aop.request.RequestSingleParam;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags = "爬虫对接")
+@RequestMapping("/insurance/crawler")
+@RestController
+public class InsuranceCrawlerOrderController {
+
+
+
+    @PostMapping("/quote")
+    @ApiOperation("报价")
+    public HttpResult quote(@RequestBody BaseQuoteVo<AccidentalDrivingVo> zmQuoteVo) {
+        return new HttpResult();
+    }
+
+    @PostMapping(value = "/submitImage")
+    @ApiOperation(value = "提交影像信息")
+    public HttpResult submitImage(@RequestSingleParam(value = "subOrderNo") String subOrderNo) {
+        return new HttpResult();
+    }
+
+    @PostMapping("/audit")
+    @ApiOperation("核保")
+    public HttpResult audit(@RequestSingleParam(value = "subOrderNo") String subOrderNo) {
+        return new HttpResult();
+    }
+
+    @PostMapping(value = "/verifyPayment")
+    @ApiOperation(value = "缴费状态查询")
+    public HttpResult verifyPayment(@RequestSingleParam(value = "subOrderNo") String subOrderNo) {
+        return new HttpResult();
+    }
+
+    @PostMapping("/getPolicyPrint")
+    @ApiOperation(value = "电子保单")
+    public HttpResult getPolicyPrint(@RequestSingleParam(value = "subOrderNo") String subOrderNo) {
+        return new HttpResult();
+    }
+
+
+}

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

@@ -0,0 +1,31 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class CrawlerLoginRequest<T extends Serializable> implements Serializable {
+
+    private static final long serialVersionUID = -4537293917734598459L;
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "username")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @JsonProperty(value = "pwd")
+    private String password;
+
+    /**
+     * 归属信息
+     */
+    @JsonProperty(value = "other")
+    private T other;
+
+}

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

@@ -0,0 +1,18 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
+
+    private static final long serialVersionUID = -5475454567145093972L;
+
+    /**
+     * 保险公司平台账号
+     */
+    private String username;
+
+}

+ 82 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java

@@ -0,0 +1,82 @@
+package com.ydtech.modules.order.entity.crawler.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Map;
+
+@Data
+public class CrawlerQuoteResponse implements Serializable {
+
+    private static final long serialVersionUID = -6081722883663574740L;
+
+    /**
+     * 附加险价格
+     */
+    @JsonProperty(value = "INSURANCE_TYPE")
+    private Map<String, Double> insuranceType;
+    /**
+     * 车船税价格
+     */
+    @JsonProperty(value = "carInsureShiptax")
+    private String carInsureShipTax;
+    /**
+     * 商业险合计价格
+     */
+    @JsonProperty(value = "busiTotalPremium")
+    private String businessTotalPremium;
+    /**
+     * 交强险价格
+     */
+    @JsonProperty(value = "forceCarInsureRisk")
+    private String forceCarInsureRisk;
+    /**
+     * 总价
+     */
+    @JsonProperty(value = "carInsureMain")
+    private String carInsureMain;
+    /**
+     * 订单号
+     */
+    @JsonProperty(value = "plyappno")
+    private String orderNo;
+    /**
+     * 滞纳金参数
+     */
+    @JsonProperty(value = "tax_arrears")
+    private TaxArrearsDto taxArrears;
+
+    @Data
+    public static class TaxArrearsDto implements Serializable {
+
+        private static final long serialVersionUID = -1251708327646266830L;
+        /**
+         * 历年滞纳金总金额
+         */
+        @JsonProperty(value = "all_late_fee")
+        private String allLateFee;
+        /**
+         * 历年欠车船税加滞纳金总价
+         */
+        @JsonProperty(value = "late_chechuan")
+        private String lateTax;
+        /**
+         * 车船税欠费起始日期
+         */
+        @JsonProperty(value = "start_day")
+        private String startDay;
+        /**
+         * 车船税欠费结束日期
+         */
+        @JsonProperty(value = "end_day")
+        private String endDay;
+        /**
+         * 历年车船税欠费金额
+         */
+        @JsonProperty(value = "late_fee")
+        private String lateFee;
+
+    }
+
+}

+ 2 - 2
src/main/java/com/ydtech/modules/order/service/BaseOrderService.java

@@ -12,7 +12,7 @@ public interface BaseOrderService<T> {
     /**
      * 报价
      *
-     * @param quoteInfoVo
+     * @param quoteInfoVo 报价实体
      * @return
      */
     HttpResult quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<T> t);
@@ -20,7 +20,7 @@ public interface BaseOrderService<T> {
     /**
      * 核保
      *
-     * @param companyId
+     * @param companyId 子订单号
      */
     HttpResult audit(String companyId);
 

+ 4 - 0
src/main/java/com/ydtech/modules/order/service/InsuranceCrawlerOrderService.java

@@ -0,0 +1,4 @@
+package com.ydtech.modules.order.service;
+
+public interface InsuranceCrawlerOrderService  extends BaseOrderService<Object> {
+}

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

@@ -11,9 +11,19 @@ import java.util.List;
 
 public interface ZhongMeiOrderApiService extends BaseOrderService<AccidentalDrivingVo> {
 
+    /**
+     * 车型查询
+     * @param modelName 车型名称
+     * @return
+     */
     HttpResult<List<CarModelDTO>> modelsQuery(String modelName);
 
-    HttpResult submitImage(String companyId);
+    /**
+     * 提交影响信息
+     * @param companyId 子订单编号
+     * @return
+     */
+    HttpResult<Object> submitImage(String companyId);
 
     /**
      * 承保回调

+ 20 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsuranceCrawlerOrderServiceImpl.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.service.impl;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.service.InsuranceCrawlerOrderService;
+
+public class InsuranceCrawlerOrderServiceImpl implements InsuranceCrawlerOrderService {
+
+
+    @Override
+    public HttpResult quote(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<Object> t) {
+        return null;
+    }
+
+    @Override
+    public HttpResult audit(String companyId) {
+        return null;
+    }
+}

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

@@ -184,7 +184,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
     }
 
     @Override
-    public HttpResult<?> submitImage(String companyId) {
+    public HttpResult<Object> submitImage(String companyId) {
         InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
         InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
         // 投保单号(总)

+ 4 - 4
src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java

@@ -45,26 +45,26 @@ public class PtlAgreementController extends BaseController {
 
     @PutMapping("/{agreementId}")
     @ApiOperation("修改协议")
-    public HttpResult<Object> revise(@PathVariable Integer agreementId, @RequestBody PtlAgreementSaveVo agreement) {
+    public HttpResult<Object> revise(@PathVariable Long agreementId, @RequestBody PtlAgreementSaveVo agreement) {
         String userName = getUserName();
         return ptlAgreementService.reviseAgreement(userName, agreementId, agreement);
     }
 
     @GetMapping("/{agreementId}")
     @ApiOperation("通过协议id查询所有信息")
-    public HttpResult<PtlAgreementQueryVo> getByAgreementId(@PathVariable Integer agreementId) {
+    public HttpResult<PtlAgreementQueryVo> getByAgreementId(@PathVariable Long agreementId) {
         return ptlAgreementService.getByAgreementId(agreementId);
     }
 
     @DeleteMapping("/{agreementId}")
     @ApiOperation("删除协议")
-    public HttpResult<Object> delete(@PathVariable Integer agreementId) {
+    public HttpResult<Object> delete(@PathVariable Long agreementId) {
         return ptlAgreementService.deleteAgreement(agreementId);
     }
 
     @PostMapping("/audit/{agreementId}")
     @ApiOperation("审核协议")
-    public HttpResult<Object> audit(@PathVariable Integer agreementId, @RequestBody PtlAgreementAuditVo ptlAgreementAuditVo) {
+    public HttpResult<Object> audit(@PathVariable Long agreementId, @RequestBody PtlAgreementAuditVo ptlAgreementAuditVo) {
         return ptlAgreementService.auditAgreement(agreementId, ptlAgreementAuditVo);
     }
 

+ 55 - 0
src/main/java/com/ydtech/modules/protocol/controller/PtlInsAttributionTemplateController.java

@@ -0,0 +1,55 @@
+package com.ydtech.modules.protocol.controller;
+
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.protocol.entity.po.PtlInsAttributionTemplate;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateQueryVo;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateSaveVo;
+import com.ydtech.modules.protocol.service.PtlInsAttributionTemplateService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+@Api(tags = "归属模版配置")
+@RequestMapping("/ptl/attributionTemplate")
+@RestController
+public class PtlInsAttributionTemplateController {
+
+    private final PtlInsAttributionTemplateService ptlInsAttributionTemplateService;
+
+    public PtlInsAttributionTemplateController(PtlInsAttributionTemplateService ptlInsAttributionTemplateService) {
+        this.ptlInsAttributionTemplateService = ptlInsAttributionTemplateService;
+    }
+
+    @PostMapping
+    @ApiOperation("提交模板信息")
+    public HttpResult<Object> submit(@RequestBody PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo) {
+        return ptlInsAttributionTemplateService.submit(ptlInsAttributionTemplateSaveVo);
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation("通过id获取模板信息")
+    public HttpResult<PtlInsAttributionTemplate> getByIdObtain(@PathVariable Long id) {
+        return ptlInsAttributionTemplateService.getByIdObtain(id);
+    }
+
+    @GetMapping
+    @ApiOperation("分页获取模板信息")
+    public HttpResult<BasePageResult<PtlInsAttributionTemplate>> getAll(PtlInsAttributionTemplateQueryVo ptlInsAttributionTemplateQueryVo) {
+        return ptlInsAttributionTemplateService.getAll(ptlInsAttributionTemplateQueryVo);
+    }
+
+    @DeleteMapping("/{id}")
+    @ApiOperation("通过id删除模板信息")
+    public HttpResult<Object> deleteById(@PathVariable String id) {
+        return ptlInsAttributionTemplateService.deleteById(id);
+    }
+
+    @PutMapping("/{id}")
+    @ApiOperation("通过id修改模板信息")
+    public HttpResult<Object> revise(@PathVariable String id, @RequestBody PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo) {
+        return ptlInsAttributionTemplateService.revise(id, ptlInsAttributionTemplateSaveVo);
+    }
+
+}

+ 21 - 21
src/main/java/com/ydtech/modules/protocol/controller/EsProductController.java → src/main/java/com/ydtech/modules/protocol/controller/PtlProductController.java

@@ -8,8 +8,8 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.modules.base.controller.BaseController;
-import com.ydtech.modules.protocol.entity.po.EsProduct;
-import com.ydtech.modules.protocol.service.EsProductService;
+import com.ydtech.modules.protocol.entity.po.PtlProduct;
+import com.ydtech.modules.protocol.service.PtlProductService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
@@ -21,12 +21,12 @@ import java.util.List;
 @Api(tags = "产品管理")
 @RestController
 @RequestMapping("/ptl/product")
-public class EsProductController extends BaseController {
+public class PtlProductController extends BaseController {
 
-    private final EsProductService esProductService;
+    private final PtlProductService PtlProductService;
 
-    public EsProductController(EsProductService esProductService) {
-        this.esProductService = esProductService;
+    public PtlProductController(PtlProductService PtlProductService) {
+        this.PtlProductService = PtlProductService;
     }
 
     /**
@@ -37,12 +37,12 @@ public class EsProductController extends BaseController {
      */
     @PostMapping(value = "/addProduct")
     @ApiOperation("新增产品信息")
-    public HttpResult save(@RequestBody EsProduct record) {
+    public HttpResult save(@RequestBody PtlProduct record) {
         record.setCreateBy(getUserName());
         record.setCreateTime(new Date());
         record.setLastUpdateBy(getUserName());
         record.setLastUpdateTime(new Date());
-        esProductService.save(record);
+        PtlProductService.save(record);
         return HttpResult.ok("产品新增成功");
     }
 
@@ -54,10 +54,10 @@ public class EsProductController extends BaseController {
      */
     @PostMapping(value = "/editProduct")
     @ApiOperation("修改产品信息")
-    public HttpResult edit(@RequestBody EsProduct record) {
+    public HttpResult edit(@RequestBody PtlProduct record) {
         record.setLastUpdateBy(getUserName());
         record.setLastUpdateTime(new Date());
-        esProductService.updateById(record);
+        PtlProductService.updateById(record);
         return HttpResult.ok("产品修改成功");
     }
 
@@ -70,8 +70,8 @@ public class EsProductController extends BaseController {
     @PostMapping(value = "/deleteProduct")
     @ApiOperation("删除产品信息")
     public HttpResult delete(@RequestParam List<String> idList) {
-        esProductService.removeBatchByIds(idList);
-        if (idList != null && idList.size() > 0) {
+        PtlProductService.removeBatchByIds(idList);
+        if (idList != null && !idList.isEmpty()) {
             return HttpResult.ok("产品删除成功");
         }
 
@@ -88,12 +88,12 @@ public class EsProductController extends BaseController {
     @GetMapping(value = "/productList")
     @ApiOperation("产品列表")
     public HttpResult query(@RequestParam String id) {
-        QueryWrapper<EsProduct> queryWrapper = new QueryWrapper<>();
+        QueryWrapper<PtlProduct> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("del_flag ", 0);
         if (id != null && id.length() > 0) {
             queryWrapper.like("id", id);
         }
-        return HttpResult.ok(esProductService.selectList(queryWrapper));
+        return HttpResult.ok(PtlProductService.selectList(queryWrapper));
     }
 
     /**
@@ -109,7 +109,7 @@ public class EsProductController extends BaseController {
         int pageNum = pageRequest.getPageNum();
         int pageSize = pageRequest.getPageSize();
 
-        LambdaQueryWrapper<EsProduct> queryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<PtlProduct> queryWrapper = new LambdaQueryWrapper<>();
         String id = pageRequest.getColumnFilterValue(pageRequest, "id");
         String name = pageRequest.getColumnFilterValue(pageRequest, "name");
         String parentId = pageRequest.getColumnFilterValue(pageRequest, "parentId");
@@ -127,28 +127,28 @@ public class EsProductController extends BaseController {
             params.add("%" + name + "%");
 
         }*/
-        queryWrapper.like(name != null, EsProduct::getName, name);
-        queryWrapper.orderByDesc(EsProduct::getLastUpdateTime);
+        queryWrapper.like(name != null, PtlProduct::getName, name);
+        queryWrapper.orderByDesc(PtlProduct::getLastUpdateTime);
 
         if (parentId != null && !parentId.equalsIgnoreCase("")) {
             whereStr.append(" and t.parent_id = ?");
             params.add(parentId);
         }
 
-        Page<EsProduct> pageInfo = new Page<>();
+        Page<PtlProduct> pageInfo = new Page<>();
         pageInfo.setSize(pageSize);
         pageInfo.setPages(pageNum);
 
         //传入查询条件
-        Page<EsProduct> page = esProductService.page(pageInfo, queryWrapper);
-        PageResult<EsProduct> pageResult = new PageResult<>(pageNum, pageSize, page.getTotal(), page.getRecords());
+        Page<PtlProduct> page = PtlProductService.page(pageInfo, queryWrapper);
+        PageResult<PtlProduct> pageResult = new PageResult<>(pageNum, pageSize, page.getTotal(), page.getRecords());
         return HttpResult.ok(pageResult);
     }
 
     @GetMapping("/getCodeAndName")
     @ApiOperation("获取编号和名称")
     public HttpResult getCodeAndName() {
-        return esProductService.getCodeAndName();
+        return PtlProductService.getCodeAndName();
     }
 
 }

+ 0 - 9
src/main/java/com/ydtech/modules/protocol/dao/EsProductMapper.java

@@ -1,9 +0,0 @@
-package com.ydtech.modules.protocol.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ydtech.modules.protocol.entity.po.EsProduct;
-
-
-public interface EsProductMapper extends BaseMapper<EsProduct> {
-
-}

+ 18 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementAttributionMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_agreement_attribution(协议归属信息)】的数据库操作Mapper
+* @createDate 2023-07-03 09:31:16
+* @Entity generator.domain.PtlAgreementAttribution
+*/
+public interface PtlAgreementAttributionMapper extends BaseMapper<PtlAgreementAttribution> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementDeptMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_agreement_dept(协议授权部门表)】的数据库操作Mapper
+* @createDate 2023-07-03 09:31:16
+* @Entity generator.domain.PtlAgreementDept
+*/
+public interface PtlAgreementDeptMapper extends BaseMapper<PtlAgreementDept> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlCrawlerApiMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlCrawlerApi;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_crawler_api(python对接接口)】的数据库操作Mapper
+* @createDate 2023-07-03 18:10:03
+* @Entity generator.domain.PtlCrawlerApi
+*/
+public interface PtlCrawlerApiMapper extends BaseMapper<PtlCrawlerApi> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlInsAttributionTemplateMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlInsAttributionTemplate;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_ins_attribution_template(保险公司归属信息模板配置)】的数据库操作Mapper
+* @createDate 2023-07-03 09:31:16
+* @Entity generator.domain.PtlInsAttributionTemplate
+*/
+public interface PtlInsAttributionTemplateMapper extends BaseMapper<PtlInsAttributionTemplate> {
+
+}
+
+
+
+

+ 9 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlProductMapper.java

@@ -0,0 +1,9 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlProduct;
+
+
+public interface PtlProductMapper extends BaseMapper<PtlProduct> {
+
+}

+ 17 - 0
src/main/java/com/ydtech/modules/protocol/entity/constants/PtlApiType.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.protocol.entity.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum PtlApiType {
+
+    PTL_API_1(1, "api对接"),
+    PTL_API_2(2, "python对接");
+
+    private final int code;
+
+    private final String desc;
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/protocol/entity/constants/PtlCrawlerApiType.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.protocol.entity.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum PtlCrawlerApiType {
+
+    API_1(1, "归属配置"),
+    API_2(2, "报价"),
+    API_3(3, "影像上传"),
+    API_4(4, "核保"),
+    API_5(5, "缴费查询"),
+    API_6(6, "保单下载"),
+    API_7(7, "非车险查询");
+
+    private final int code;
+
+    private final String desc;
+
+}

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

@@ -0,0 +1,51 @@
+package com.ydtech.modules.protocol.entity.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+
+@Data
+@ToString
+@EqualsAndHashCode
+@ApiModel("协议归属")
+public class PtlAgreementAttributionDto implements Serializable {
+
+    private static final long serialVersionUID = 5438498729372152816L;
+
+    /**
+     * 协议id
+     */
+    @ApiModelProperty("协议id")
+    private Integer agreementId;
+
+    /**
+     * api类型(1、api对接,2、python对接)
+     */
+    @ApiModelProperty("api类型(1、api对接,2、python对接)")
+    private Integer apiType;
+
+    /**
+     * 字段集
+     */
+    @ApiModelProperty("字段集")
+    private PtlAttributionTemplateDto fields;
+
+    /**
+     * 保险公司账号
+     */
+    @ApiModelProperty("保险公司账号")
+    private String username;
+
+    /**
+     * 保险公司密码
+     */
+    @ApiModelProperty("保险公司密码")
+    private String password;
+
+
+}

+ 1 - 1
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementProductCostsSaveDto.java

@@ -20,7 +20,7 @@ public class PtlAgreementProductCostsSaveDto extends PtlAgreementProductCostsBas
     @ApiModelProperty("费用")
     private List<PtlAgreementCostsFactorSaveDto> factor;
 
-    public static List<PtlAgreementProductCosts> toPtlAgreementProductCosts(Integer agreementId, List<PltAgreementSchemeSaveDto> scheme) {
+    public static List<PtlAgreementProductCosts> toPtlAgreementProductCosts(Long agreementId, List<PltAgreementSchemeSaveDto> scheme) {
         return scheme.stream().map(x -> PtlAgreementProductCosts.toPtlAgreementProductCostsList(agreementId, x.getProductId(), x.getName(), x.getProductCosts()))
                 .flatMap(Collection::stream)
                 .collect(Collectors.toList());

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

@@ -20,11 +20,11 @@ public class PtlAgreementUnderwritingRulesSaveDto {
     @ApiModelProperty("规则因子")
     private List<PtlAgreementCostsFactorSaveDto> rulesFactor;
 
-    public static List<PtlAgreementUnderwritingRules> toPtlAgreementUnderwritingRulesList(Integer agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules) {
+    public static List<PtlAgreementUnderwritingRules> toPtlAgreementUnderwritingRulesList(Long agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules) {
         return underwritingRules.stream().map(x -> PtlAgreementUnderwritingRulesSaveDto.toPtlAgreementUnderwritingRules(agreementId, x)).collect(Collectors.toList());
     }
 
-    public static PtlAgreementUnderwritingRules toPtlAgreementUnderwritingRules(Integer agreementId, PtlAgreementUnderwritingRulesSaveDto ptlAgreementUnderwritingRulesSaveDto) {
+    public static PtlAgreementUnderwritingRules toPtlAgreementUnderwritingRules(Long agreementId, PtlAgreementUnderwritingRulesSaveDto ptlAgreementUnderwritingRulesSaveDto) {
         PtlAgreementUnderwritingRules ptlAgreementUnderwritingRules = new PtlAgreementUnderwritingRules();
         ptlAgreementUnderwritingRules.setRulesType(ptlAgreementUnderwritingRulesSaveDto.getRulesType());
         ptlAgreementUnderwritingRules.setAgreementId(agreementId);

+ 26 - 0
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAttributionTemplateDto.java

@@ -0,0 +1,26 @@
+package com.ydtech.modules.protocol.entity.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("归属配置模版")
+public class PtlAttributionTemplateDto {
+
+    @ApiModelProperty(value = "字段")
+    private String field;
+
+    @ApiModelProperty(value = "标签")
+    private String label;
+
+    @ApiModelProperty(value = "类型(text 文本框,select 选择框)")
+    private String type;
+
+    @ApiModelProperty(value = "是否允许修改(0 可修改,1 不可修改)")
+    private Integer isEdit;
+
+    @ApiModelProperty(value = "值")
+    private String value;
+
+}

+ 2 - 1
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java

@@ -21,7 +21,7 @@ public class PtlAgreement implements Serializable {
      * 主键/自增
      */
     @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
+    private Long id;
 
     /**
      * 协议类型
@@ -157,4 +157,5 @@ public class PtlAgreement implements Serializable {
 
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
+
 }

+ 83 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementAttribution.java

@@ -0,0 +1,83 @@
+package com.ydtech.modules.protocol.entity.po;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 协议归属信息
+ *
+ * @TableName ptl_agreement_attribution
+ */
+@TableName(value = "ptl_agreement_attribution", autoResultMap = true)
+@Data
+@ToString
+@EqualsAndHashCode
+@AllArgsConstructor
+@NoArgsConstructor
+public class PtlAgreementAttribution implements Serializable {
+    /**
+     * 协议id
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 保险公司ID
+     */
+    @TableField(value = "ins_company_id")
+    private String insCompanyId;
+
+    /**
+     * 保险公司名称
+     */
+    @TableField(value = "ins_company_name")
+    private String insCompanyName;
+
+    /**
+     * api类型(1、api对接,2、python对接)
+     */
+    @TableField(value = "api_type")
+    private Integer apiType;
+
+    /**
+     * 字段集
+     */
+    @TableField(value = "fields", typeHandler = FastjsonTypeHandler.class)
+    private JSONArray fields;
+
+    /**
+     * 保险公司账号
+     */
+    @TableField(value = "username")
+    private String username;
+
+    /**
+     * 保险公司密码
+     */
+    @TableField(value = "password")
+    private String password;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+
+    public PtlAgreementAttribution(Long agreementId, String insCompanyId, String insCompanyName, PtlAgreementAttributionDto ptlAgreementAttributionDto) {
+        this.id = agreementId;
+        this.insCompanyId = insCompanyId;
+        this.insCompanyName = insCompanyName;
+        this.apiType = ptlAgreementAttributionDto.getApiType();
+        this.fields = JSON.parseArray(JSON.toJSONString(ptlAgreementAttributionDto.getFields()));
+        this.username = ptlAgreementAttributionDto.getUsername();
+        this.password = ptlAgreementAttributionDto.getPassword();
+    }
+
+
+}

+ 49 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementDept.java

@@ -0,0 +1,49 @@
+package com.ydtech.modules.protocol.entity.po;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 协议授权部门表
+ *
+ * @TableName ptl_agreement_dept
+ */
+@TableName(value = "ptl_agreement_dept")
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+public class PtlAgreementDept implements Serializable {
+    /**
+     * 协议id
+     */
+    @TableField(value = "agreement_id")
+    private Long agreementId;
+
+    /**
+     * 部门ID
+     */
+    @TableField(value = "dept_id")
+    private String deptId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    public static List<PtlAgreementDept> toPtlAgreementDeptList(Long agreementId, List<String> deptIdList) {
+        return deptIdList.stream().map(d -> new PtlAgreementDept(agreementId, d)).collect(Collectors.toList());
+    }
+
+    public PtlAgreementDept(Long agreementId, String deptId) {
+        this.agreementId = agreementId;
+        this.deptId = deptId;
+    }
+
+}

+ 4 - 4
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementProductCosts.java

@@ -29,13 +29,13 @@ public class PtlAgreementProductCosts implements Serializable {
      * 主键/自增
      */
     @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
+    private Long id;
 
     /**
      * 协议id
      */
     @TableField(value = "agreement_id")
-    private Integer agreementId;
+    private Long agreementId;
 
     /**
      * 产品id
@@ -107,14 +107,14 @@ public class PtlAgreementProductCosts implements Serializable {
      * @param ptlAgreementProductCostsSaveDtoList 协议费用 Dto list
      * @return List<PtlAgreementProductCosts>
      */
-    public static List<PtlAgreementProductCosts> toPtlAgreementProductCostsList(Integer AgreementId, String productId, String productName, List<PtlAgreementProductCostsSaveDto> ptlAgreementProductCostsSaveDtoList) {
+    public static List<PtlAgreementProductCosts> toPtlAgreementProductCostsList(Long AgreementId, String productId, String productName, List<PtlAgreementProductCostsSaveDto> ptlAgreementProductCostsSaveDtoList) {
         return ptlAgreementProductCostsSaveDtoList.stream().map(
                 ptlAgreementProductCostsSaveDto ->
                         new PtlAgreementProductCosts(AgreementId, productId, productName, ptlAgreementProductCostsSaveDto)
         ).collect(Collectors.toList());
     }
 
-    public PtlAgreementProductCosts(Integer agreementId, String productId, String productName, PtlAgreementProductCostsSaveDto ptlAgreementProductCostsSaveDto) {
+    public PtlAgreementProductCosts(Long agreementId, String productId, String productName, PtlAgreementProductCostsSaveDto ptlAgreementProductCostsSaveDto) {
         this.agreementId = agreementId;
         this.productId = productId;
         this.productName = productName;

+ 2 - 2
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementUnderwritingRules.java

@@ -25,13 +25,13 @@ public class PtlAgreementUnderwritingRules implements Serializable {
      * 主键/自增
      */
     @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
+    private Long id;
 
     /**
      * 协议id
      */
     @TableField(value = "agreement_id")
-    private Integer agreementId;
+    private Long agreementId;
 
     /**
      * 规则类型(0满足拒保 1满足承包)

+ 51 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlCrawlerApi.java

@@ -0,0 +1,51 @@
+package com.ydtech.modules.protocol.entity.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * python对接接口
+ * @TableName ptl_crawler_api
+ */
+@TableName(value ="ptl_crawler_api")
+@Data
+public class PtlCrawlerApi implements Serializable {
+    /**
+     * 
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 模板id
+     */
+    @TableField(value = "template_id")
+    private Long templateId;
+
+    /**
+     * 1、归属配置;2、报价;3、影像上传;4、核保;5、缴费查询;6、保单下载;7、非车险查询
+     */
+    @TableField(value = "api_type")
+    private Integer apiType;
+
+    /**
+     * api名称
+     */
+    @TableField(value = "api_name")
+    private String apiName;
+
+    /**
+     * 请求路劲
+     */
+    @TableField(value = "url")
+    private String url;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+}

+ 65 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlInsAttributionTemplate.java

@@ -0,0 +1,65 @@
+package com.ydtech.modules.protocol.entity.po;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateSaveVo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * 保险公司归属信息模板配置
+ *
+ * @TableName ptl_ins_attribution_template
+ */
+@TableName(value = "ptl_ins_attribution_template", autoResultMap = true)
+@Data
+@ToString
+@EqualsAndHashCode
+public class PtlInsAttributionTemplate implements Serializable {
+    /**
+     *
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * api类型(1、api对接,2、python对接)
+     */
+    @TableField(value = "api_type")
+    private Integer apiType;
+
+    /**
+     * 保险公司ID
+     */
+    @TableField(value = "ins_company_id")
+    private String insCompanyId;
+
+    /**
+     * 保险公司名称
+     */
+    @TableField(value = "ins_company_name")
+    private String insCompanyName;
+
+    /**
+     * 字段集
+     */
+    @TableField(value = "fields", typeHandler = FastjsonTypeHandler.class)
+    private JSONArray fields;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    public PtlInsAttributionTemplate(PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo, String insCompanyName) {
+        this.apiType = ptlInsAttributionTemplateSaveVo.getApiType();
+        this.insCompanyId = ptlInsAttributionTemplateSaveVo.getInsCompanyId();
+        this.insCompanyName = insCompanyName;
+        this.fields = JSON.parseArray(JSON.toJSONString(ptlInsAttributionTemplateSaveVo.getFields()));
+    }
+}

+ 1 - 1
src/main/java/com/ydtech/modules/protocol/entity/po/EsProduct.java → src/main/java/com/ydtech/modules/protocol/entity/po/PtlProduct.java

@@ -9,7 +9,7 @@ import java.util.Date;
 
 @Data
 @TableName(value = "esm_product")
-public class EsProduct implements Serializable {
+public class PtlProduct implements Serializable {
 
     private static final long serialVersionUID = 4994740158025000549L;
 

+ 10 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementQueryVo.java

@@ -2,6 +2,8 @@ package com.ydtech.modules.protocol.entity.vo;
 
 import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeQueryDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementUnderwritingRules;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -17,9 +19,17 @@ public class PtlAgreementQueryVo {
 
     @ApiModelProperty("协议信息")
     private PtlAgreement agreement;
+
     @ApiModelProperty("产品方案")
     private List<PltAgreementSchemeQueryDto> scheme;
+
     @ApiModelProperty("承包规则")
     private List<PtlAgreementUnderwritingRules> underwritingRules;
 
+    @ApiModelProperty("账号信息")
+    private PtlAgreementAttribution ptlAgreementAttribution;
+
+    @ApiModelProperty("部门授权信息")
+    private List<PtlAgreementDept> dept;
+
 }

+ 7 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementSaveVo.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.protocol.entity.vo;
 
 
 import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeSaveDto;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementSaveDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementUnderwritingRulesSaveDto;
 import io.swagger.annotations.ApiModel;
@@ -23,4 +24,10 @@ public class PtlAgreementSaveVo {
     @ApiModelProperty("承包规则")
     private List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules;
 
+    @ApiModelProperty("授权部门id")
+    private List<String> dept;
+
+    @ApiModelProperty
+    private PtlAgreementAttributionDto attribution;
+
 }

+ 27 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlCrawlerApiSaveVo.java

@@ -0,0 +1,27 @@
+package com.ydtech.modules.protocol.entity.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel("python对接接口保存信息")
+public class PtlCrawlerApiSaveVo implements Serializable {
+
+    private static final long serialVersionUID = -8746020505828059226L;
+
+    @ApiModelProperty("模板id")
+    private Long templateId;
+
+    @ApiModelProperty("1、归属配置;2、报价;3、影像上传;4、核保;5、缴费查询;6、保单下载;7、非车险查询")
+    private Integer apiType;
+
+    @ApiModelProperty("api名称")
+    private String apiName;
+
+    @ApiModelProperty("url")
+    private String url;
+
+}

+ 20 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlInsAttributionTemplateQueryVo.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.protocol.entity.vo;
+
+import com.ydtech.core.page.BasePageVO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel("保险公司归属信息模板查询")
+public class PtlInsAttributionTemplateQueryVo extends BasePageVO  {
+
+
+    private static final long serialVersionUID = -2974470494991688201L;
+
+    @ApiModelProperty("保险公司ID")
+    private String insCompanyId;
+
+}

+ 26 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlInsAttributionTemplateSaveVo.java

@@ -0,0 +1,26 @@
+package com.ydtech.modules.protocol.entity.vo;
+
+import com.ydtech.modules.protocol.entity.dto.PtlAttributionTemplateDto;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel("保险公司归属信息模板提交模版")
+public class PtlInsAttributionTemplateSaveVo {
+
+    @ApiModelProperty("api类型")
+    private Integer apiType;
+
+    @ApiModelProperty("保险公司ID")
+    private String insCompanyId;
+
+    @ApiModelProperty("字段集")
+    private List<PtlAttributionTemplateDto> fields;
+
+    @ApiModelProperty("api类型为2(python)必传")
+    private List<PtlCrawlerApiSaveVo> api;
+
+}

+ 3 - 3
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlProductVo.java

@@ -1,6 +1,6 @@
 package com.ydtech.modules.protocol.entity.vo;
 
-import com.ydtech.modules.protocol.entity.po.EsProduct;
+import com.ydtech.modules.protocol.entity.po.PtlProduct;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -20,11 +20,11 @@ public class PtlProductVo {
     @ApiModelProperty("名称")
     private String name;
 
-    public static List<PtlProductVo> toPtlProductVoList(List<EsProduct> esProducts) {
+    public static List<PtlProductVo> toPtlProductVoList(List<PtlProduct> esProducts) {
        return esProducts.stream().map(PtlProductVo::toPtlProductVo).collect(Collectors.toList());
     }
 
-    public static PtlProductVo toPtlProductVo(EsProduct esProducts) {
+    public static PtlProductVo toPtlProductVo(PtlProduct esProducts) {
         return new PtlProductVo(esProducts.getId(), esProducts.getName());
     }
 

+ 24 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementAttributionService.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.protocol.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+
+
+/**
+ * @author Administrator
+ * @description 针对表【ptl_agreement_attribution(协议归属信息)】的数据库操作Service
+ * @createDate 2023-07-03 09:31:16
+ */
+public interface PtlAgreementAttributionService extends IService<PtlAgreementAttribution> {
+
+    /**
+     * 添加协议归属信息
+     *
+     * @param agreementId 协议id
+     * @param attribution 协议归属信息
+     */
+    void saveAttribution(Long agreementId, String insuranceCompany, PtlAgreementAttributionDto attribution);
+
+
+}

+ 37 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementDeptService.java

@@ -0,0 +1,37 @@
+package com.ydtech.modules.protocol.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
+
+import java.util.List;
+
+/**
+ * @author Administrator
+ * @description 针对表【ptl_agreement_dept(协议授权部门表)】的数据库操作Service
+ * @createDate 2023-07-03 09:31:16
+ */
+public interface PtlAgreementDeptService extends IService<PtlAgreementDept> {
+
+
+    /**
+     * 通过 协议id 批量添加 协议授权部门
+     *
+     * @param agreementId  协议id
+     */
+    void saveBatchDept(Long agreementId, List<String> dept);
+
+
+    /**
+     * 通过 协议id 获取 协议授权部门
+     *
+     * @param agreementId  协议id
+     */
+    List<PtlAgreementDept> getByAgreementId(Long agreementId);
+
+    /**
+     * 通过 协议id 删除 协议授权部门
+     *
+     * @param agreementId  协议id
+     */
+    void deleteByAgreementId(Long agreementId);
+}

+ 3 - 3
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementProductCostsService.java

@@ -19,14 +19,14 @@ public interface PtlAgreementProductCostsService extends IService<PtlAgreementPr
      *
      * @param agreementId 协议id
      */
-    void deleteByAgreementId(Integer agreementId);
+    void deleteByAgreementId(Long agreementId);
 
     /**
      * 根据 协议id 查询协议产品费用
      *
      * @param agreementId 协议id
      */
-    List<PltAgreementSchemeQueryDto> getByAgreementId(Integer agreementId);
+    List<PltAgreementSchemeQueryDto> getByAgreementId(Long agreementId);
 
     /**
      * 批量提添加产品费用
@@ -34,5 +34,5 @@ public interface PtlAgreementProductCostsService extends IService<PtlAgreementPr
      * @param agreementId 协议id
      * @param scheme      产品
      */
-    void saveBatchProductCosts(Integer agreementId, List<PltAgreementSchemeSaveDto> scheme);
+    void saveBatchProductCosts(Long agreementId, List<PltAgreementSchemeSaveDto> scheme);
 }

+ 14 - 8
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java

@@ -22,7 +22,7 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      *
      * @param agreementId 协议id
      */
-    PtlAgreement ifExistsById(Integer agreementId);
+    PtlAgreement ifExistsById(Long agreementId);
 
 
     /**
@@ -48,7 +48,7 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @param agreementId 协议id
      * @return HttpResult
      */
-    HttpResult<PtlAgreementQueryVo> getByAgreementId(Integer agreementId);
+    HttpResult<PtlAgreementQueryVo> getByAgreementId(Long agreementId);
 
     /**
      * 删除协议
@@ -56,7 +56,7 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @param agreementId 协议id
      * @return HttpResult
      */
-    HttpResult<Object> deleteAgreement(Integer agreementId);
+    HttpResult<Object> deleteAgreement(Long agreementId);
 
 
     /**
@@ -66,14 +66,20 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @param agreement 上传的协议信息
      * @return HttpResult
      */
-    HttpResult<Object> reviseAgreement(String userName, Integer agreementId, PtlAgreementSaveVo agreement);
+    HttpResult<Object> reviseAgreement(String userName, Long agreementId, PtlAgreementSaveVo agreement);
 
     /**
-     * 提交 产品费用 承保规则
-     * @param id 协议id
+     * 提交 产品费用 承保规则 账号信息 授权部门
+     * @param agreementId 协议id
      * @param agreement 提交内容
      */
-    void saveProductCostsAndUnderwritingRules(Integer id, PtlAgreementSaveVo agreement);
+    void saveAssociationInformation(Long agreementId, String insuranceCompany, PtlAgreementSaveVo agreement);
+
+    /**
+     * 删除关联信息  产品费用 承保规则 账号信息 授权部门
+     * @param agreementId 协议id
+     */
+    void deleteAssociationInformation(Long agreementId);
 
     /**
      * 审核协议
@@ -81,5 +87,5 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      * @param ptlAgreementAuditVo 审核内容
      * @return
      */
-    HttpResult<Object> auditAgreement(Integer agreementId, PtlAgreementAuditVo ptlAgreementAuditVo);
+    HttpResult<Object> auditAgreement(Long agreementId, PtlAgreementAuditVo ptlAgreementAuditVo);
 }

+ 5 - 4
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementUnderwritingRulesService.java

@@ -21,7 +21,7 @@ public interface PtlAgreementUnderwritingRulesService extends IService<PtlAgreem
      *
      * @param agreementId 协议id
      */
-    void deleteByAgreementId(Integer agreementId);
+    void deleteByAgreementId(Long agreementId);
 
     /**
      * 根据 协议id 承保规则查询承保规则
@@ -29,7 +29,7 @@ public interface PtlAgreementUnderwritingRulesService extends IService<PtlAgreem
      * @param agreementId 协议id
      * @return List<PtlAgreementUnderwritingRulesQueryDto>
      */
-    List<PtlAgreementUnderwritingRules> getByAgreementId(Integer agreementId);
+    List<PtlAgreementUnderwritingRules> getByAgreementId(Long agreementId);
 
     /**
      * 根据协议id批量添加承保规则
@@ -37,7 +37,7 @@ public interface PtlAgreementUnderwritingRulesService extends IService<PtlAgreem
      * @param agreementId       协议id
      * @param underwritingRules 承保规则
      */
-    void saveBatchUnderwritingRules(Integer agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules);
+    void saveBatchUnderwritingRules(Long agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules);
 
     /**
      * 通过协议id 和 规则类型 获取 配置规则
@@ -46,7 +46,8 @@ public interface PtlAgreementUnderwritingRulesService extends IService<PtlAgreem
      * @param rulesType   规则类型
      * @return Map<String, PtlFactorDto>
      */
-    Map<String, PtlFactorDto> getMapPtlFactorDto(Integer agreementId, Integer rulesType);
+    Map<String, PtlFactorDto> getMapPtlFactorDto(Long agreementId, Integer rulesType);
+
 }
 
 

+ 13 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlCrawlerApiService.java

@@ -0,0 +1,13 @@
+package com.ydtech.modules.protocol.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.protocol.entity.po.PtlCrawlerApi;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_crawler_api(python对接接口)】的数据库操作Service
+* @createDate 2023-07-03 18:10:03
+*/
+public interface PtlCrawlerApiService extends IService<PtlCrawlerApi> {
+
+}

+ 64 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlInsAttributionTemplateService.java

@@ -0,0 +1,64 @@
+package com.ydtech.modules.protocol.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.protocol.entity.po.PtlInsAttributionTemplate;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateQueryVo;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateSaveVo;
+
+/**
+ * @author Administrator
+ * @description 针对表【ptl_ins_attribution_template(保险公司归属信息模板配置)】的数据库操作Service
+ * @createDate 2023-07-03 09:31:16
+ */
+public interface PtlInsAttributionTemplateService extends IService<PtlInsAttributionTemplate> {
+
+    /**
+     * 一种api方式只能配置一个保险公司
+     *
+     * @param ptlInsAttributionTemplateSaveVo 保险公司归属信息
+     * @return PtlInsAttributionTemplate
+     */
+    PtlInsAttributionTemplate getByApiTypeAndInsCompanyId(PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo);
+
+    /**
+     * 保存 保险公司归属信息模板配置
+     *
+     * @param ptlInsAttributionTemplateSaveVo 保险公司归属信息
+     * @return HttpResult
+     */
+    HttpResult<Object> submit(PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo);
+
+    /**
+     * 通过 保险公司归属信息模板id 查询模板
+     *
+     * @param id 保险公司归属信息模板id
+     * @return PtlInsAttributionTemplate
+     */
+    HttpResult<PtlInsAttributionTemplate> getByIdObtain(Long id);
+
+    /**
+     * 分页查询
+     *
+     * @param basePageVO 保险公司归属信息模板查询
+     * @return BasePageResult<PtlInsAttributionTemplate>
+     */
+    HttpResult<BasePageResult<PtlInsAttributionTemplate>> getAll(PtlInsAttributionTemplateQueryVo basePageVO);
+
+    /**
+     * 通过 保险公司归属信息模板id 删除模板
+     *
+     * @param id 保险公司归属信息模板id
+     * @return HttpResult
+     */
+    HttpResult<Object> deleteById(String id);
+
+    /**
+     * 通过 保险公司归属信息模板id 修改模板
+     *
+     * @param id 保险公司归属信息模板id
+     * @return PtlInsAttributionTemplate
+     */
+    HttpResult<Object> revise(String id, PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo);
+}

+ 4 - 3
src/main/java/com/ydtech/modules/protocol/service/EsProductService.java → src/main/java/com/ydtech/modules/protocol/service/PtlProductService.java

@@ -4,15 +4,16 @@ package com.ydtech.modules.protocol.service;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.protocol.entity.po.EsProduct;
+import com.ydtech.modules.protocol.entity.po.PtlProduct;
 
 import java.util.List;
 
-public interface EsProductService extends IService<EsProduct> {
+public interface PtlProductService extends IService<PtlProduct> {
 
-    List<EsProduct> selectList(QueryWrapper queryWrapper);
+    List<PtlProduct> selectList(QueryWrapper queryWrapper);
 
     HttpResult getCodeAndName();
+
 }
 
 

+ 34 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementAttributionServiceImpl.java

@@ -0,0 +1,34 @@
+package com.ydtech.modules.protocol.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.esm.model.EsmInsCompany;
+import com.ydtech.modules.esm.service.EsmInsCompanyService;
+import com.ydtech.modules.protocol.dao.PtlAgreementAttributionMapper;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author wenks
+* @description 针对表【ptl_agreement_attribution(协议归属信息)】的数据库操作Service实现
+* @createDate 2023-07-03 09:31:16
+*/
+@Service
+public class PtlAgreementAttributionServiceImpl extends ServiceImpl<PtlAgreementAttributionMapper, PtlAgreementAttribution>
+    implements PtlAgreementAttributionService {
+
+    private final EsmInsCompanyService esmInsCompanyService;
+
+    public PtlAgreementAttributionServiceImpl(EsmInsCompanyService esmInsCompanyService) {
+        this.esmInsCompanyService = esmInsCompanyService;
+    }
+
+    @Override
+    public void saveAttribution(Long agreementId, String insuranceCompany, PtlAgreementAttributionDto attribution) {
+        EsmInsCompany esmInsCompany = esmInsCompanyService.getById(insuranceCompany);
+        PtlAgreementAttribution ptlAgreementAttribution = new PtlAgreementAttribution(agreementId, esmInsCompany.getId(), esmInsCompany.getNamesimple(), attribution);
+        save(ptlAgreementAttribution);
+    }
+
+}

+ 49 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementDeptServiceImpl.java

@@ -0,0 +1,49 @@
+package com.ydtech.modules.protocol.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.protocol.dao.PtlAgreementDeptMapper;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
+import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+* @author wenks
+* @description 针对表【ptl_agreement_dept(协议授权部门表)】的数据库操作Service实现
+* @createDate 2023-07-03 09:31:16
+*/
+@Service
+public class PtlAgreementDeptServiceImpl extends ServiceImpl<PtlAgreementDeptMapper, PtlAgreementDept>
+    implements PtlAgreementDeptService {
+
+    @Override
+    @Transactional
+    public void saveBatchDept(Long agreementId, List<String> dept) {
+        List<PtlAgreementDept> ptlAgreementDeptList = PtlAgreementDept.toPtlAgreementDeptList(agreementId, dept);
+        saveBatch(ptlAgreementDeptList);
+    }
+
+    @Override
+    public List<PtlAgreementDept> getByAgreementId(Long agreementId) {
+        return list(byAgreementId(agreementId));
+    }
+
+    @Override
+    public void deleteByAgreementId(Long agreementId) {
+        remove(byAgreementId(agreementId));
+    }
+
+    private LambdaQueryWrapper<PtlAgreementDept> byAgreementId(Long agreementId){
+        LambdaQueryWrapper<PtlAgreementDept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(PtlAgreementDept::getAgreementId, agreementId);
+        return lambdaQueryWrapper;
+    }
+
+}
+
+
+
+

+ 3 - 3
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementProductCostsServiceImpl.java

@@ -26,14 +26,14 @@ public class PtlAgreementProductCostsServiceImpl extends ServiceImpl<PtlAgreemen
         implements PtlAgreementProductCostsService {
 
     @Override
-    public void deleteByAgreementId(Integer agreementId) {
+    public void deleteByAgreementId(Long agreementId) {
         LambdaQueryWrapper<PtlAgreementProductCosts> costsLambdaQueryWrapper = new LambdaQueryWrapper<>();
         costsLambdaQueryWrapper.eq(PtlAgreementProductCosts::getAgreementId, agreementId);
         baseMapper.delete(costsLambdaQueryWrapper);
     }
 
     @Override
-    public List<PltAgreementSchemeQueryDto> getByAgreementId(Integer agreementId) {
+    public List<PltAgreementSchemeQueryDto> getByAgreementId(Long agreementId) {
         LambdaQueryWrapper<PtlAgreementProductCosts> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PtlAgreementProductCosts::getAgreementId, agreementId);
         List<PtlAgreementProductCosts> ptlAgreementProductCosts = baseMapper.selectList(wrapper);
@@ -53,7 +53,7 @@ public class PtlAgreementProductCostsServiceImpl extends ServiceImpl<PtlAgreemen
 
     @Override
     @Transactional
-    public void saveBatchProductCosts(Integer agreementId, List<PltAgreementSchemeSaveDto> scheme) {
+    public void saveBatchProductCosts(Long agreementId, List<PltAgreementSchemeSaveDto> scheme) {
         List<PtlAgreementProductCosts> ptlAgreementProductCostsList = PtlAgreementProductCostsSaveDto.toPtlAgreementProductCosts(agreementId, scheme);
         boolean b = saveBatch(ptlAgreementProductCostsList);
         AssertionUtils.isSucceed(b, "批量添加产品费用失败");

+ 47 - 21
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -10,14 +10,14 @@ import com.ydtech.modules.protocol.dao.PtlAgreementMapper;
 import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeQueryDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementSaveDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementUnderwritingRules;
 import com.ydtech.modules.protocol.entity.vo.PtlAgreementAuditVo;
 import com.ydtech.modules.protocol.entity.vo.PtlAgreementPageVo;
 import com.ydtech.modules.protocol.entity.vo.PtlAgreementQueryVo;
 import com.ydtech.modules.protocol.entity.vo.PtlAgreementSaveVo;
-import com.ydtech.modules.protocol.service.PtlAgreementProductCostsService;
-import com.ydtech.modules.protocol.service.PtlAgreementService;
-import com.ydtech.modules.protocol.service.PtlAgreementUnderwritingRulesService;
+import com.ydtech.modules.protocol.service.*;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
@@ -41,11 +41,17 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
 
     private final PtlAgreementUnderwritingRulesService ptlAgreementUnderwritingRulesService;
 
+    private final PtlAgreementAttributionService ptlAgreementAttributionService;
+
+    private final PtlAgreementDeptService ptlAgreementDeptService;
+
     private PtlAgreementService proxyObject;
 
-    public PtlAgreementServiceImpl(PtlAgreementProductCostsService ptlAgreementProductCostsService, PtlAgreementUnderwritingRulesService ptlAgreementUnderwritingRulesService) {
+    public PtlAgreementServiceImpl(PtlAgreementProductCostsService ptlAgreementProductCostsService, PtlAgreementUnderwritingRulesService ptlAgreementUnderwritingRulesService, PtlAgreementAttributionService ptlAgreementAttributionService, PtlAgreementDeptService ptlAgreementDeptService) {
         this.ptlAgreementProductCostsService = ptlAgreementProductCostsService;
         this.ptlAgreementUnderwritingRulesService = ptlAgreementUnderwritingRulesService;
+        this.ptlAgreementAttributionService = ptlAgreementAttributionService;
+        this.ptlAgreementDeptService = ptlAgreementDeptService;
     }
 
     @Autowired
@@ -54,7 +60,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     }
 
     @Override
-    public PtlAgreement ifExistsById(Integer agreementId) {
+    public PtlAgreement ifExistsById(Long agreementId) {
         PtlAgreement ptlAgreement = getById(agreementId);
         if (ObjectUtils.isEmpty(ptlAgreement)) {
             throw new SystemException("协议id 不存在");
@@ -72,7 +78,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         ptlAgreement.setCreateTime(LocalDateTime.now());
         save(ptlAgreement);
         // 产品费用
-        proxyObject.saveProductCostsAndUnderwritingRules(ptlAgreement.getId(), agreement);
+        String insuranceCompany = ptlAgreement.getInsuranceCompany();
+        proxyObject.saveAssociationInformation(ptlAgreement.getId(), insuranceCompany, agreement);
         return HttpResult.ok("添加成功");
     }
 
@@ -94,32 +101,34 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     }
 
     @Override
-    public HttpResult<PtlAgreementQueryVo> getByAgreementId(Integer agreementId) {
+    public HttpResult<PtlAgreementQueryVo> getByAgreementId(Long agreementId) {
         PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         // 获取产品费用
         List<PltAgreementSchemeQueryDto> schemeQueryDto = ptlAgreementProductCostsService.getByAgreementId(agreementId);
         // 获取承保规则
         List<PtlAgreementUnderwritingRules> underwritingRules = ptlAgreementUnderwritingRulesService.getByAgreementId(agreementId);
-        PtlAgreementQueryVo ptlAgreementQueryVo = new PtlAgreementQueryVo(ptlAgreement, schemeQueryDto, underwritingRules);
+        //  账号信息查询
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
+        // 授权查询
+        List<PtlAgreementDept> deptList = ptlAgreementDeptService.getByAgreementId(agreementId);
+        PtlAgreementQueryVo ptlAgreementQueryVo = new PtlAgreementQueryVo(ptlAgreement, schemeQueryDto, underwritingRules, ptlAgreementAttribution, deptList);
         return HttpResult.ok(ptlAgreementQueryVo);
     }
 
     @Override
     @Transactional
-    public HttpResult<Object> deleteAgreement(Integer agreementId) {
+    public HttpResult<Object> deleteAgreement(Long agreementId) {
         proxyObject.ifExistsById(agreementId);
         boolean b = removeById(agreementId);
         AssertionUtils.isSucceed(b, "协议信息删除失败");
-        // 删除产品费用
-        ptlAgreementProductCostsService.deleteByAgreementId(agreementId);
-        // 删除承保规则
-        ptlAgreementUnderwritingRulesService.deleteByAgreementId(agreementId);
+        // 关联表删除
+        proxyObject.deleteAssociationInformation(agreementId);
         return HttpResult.ok("删除成功");
     }
 
     @Override
     @Transactional
-    public HttpResult<Object> reviseAgreement(String userName, Integer agreementId, PtlAgreementSaveVo agreement) {
+    public HttpResult<Object> reviseAgreement(String userName, Long agreementId, PtlAgreementSaveVo agreement) {
         PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
         PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         BeanUtils.copyProperties(agreementSaveDto, ptlAgreement);
@@ -128,11 +137,11 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         // 修改协议
         boolean b = updateById(ptlAgreement);
         AssertionUtils.isSucceed(b, "协议信息修改失败");
-        // 删除产品费用
-        ptlAgreementProductCostsService.deleteByAgreementId(agreementId);
-        // 删除承保规则
-        ptlAgreementUnderwritingRulesService.deleteByAgreementId(agreementId);
-        proxyObject.saveProductCostsAndUnderwritingRules(agreementId, agreement);
+        // 关联表都是先删除后添加
+        proxyObject.deleteAssociationInformation(agreementId);
+
+        String insuranceCompany = ptlAgreement.getInsuranceCompany();
+        proxyObject.saveAssociationInformation(agreementId, insuranceCompany, agreement);
         return HttpResult.ok("修改成功");
     }
 
@@ -143,15 +152,32 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
      * @param agreement   协议信息全部实体
      */
     @Override
-    public void saveProductCostsAndUnderwritingRules(Integer agreementId, PtlAgreementSaveVo agreement) {
+    public void saveAssociationInformation(Long agreementId, String insuranceCompany, PtlAgreementSaveVo agreement) {
         // 产品费用
         ptlAgreementProductCostsService.saveBatchProductCosts(agreementId, agreement.getScheme());
         // 承包规则
         ptlAgreementUnderwritingRulesService.saveBatchUnderwritingRules(agreementId, agreement.getUnderwritingRules());
+        // 部门授权
+        ptlAgreementAttributionService.saveAttribution(agreementId, insuranceCompany, agreement.getAttribution());
+        // 账号添加
+        ptlAgreementDeptService.saveBatchDept(agreementId, agreement.getDept());
+    }
+
+
+    @Override
+    public void deleteAssociationInformation(Long agreementId) {
+        // 删除产品费用
+        ptlAgreementProductCostsService.deleteByAgreementId(agreementId);
+        // 删除承保规则
+        ptlAgreementUnderwritingRulesService.deleteByAgreementId(agreementId);
+        // 删除账号信息
+        ptlAgreementAttributionService.removeById(agreementId);
+        // 删除授权部门
+        ptlAgreementDeptService.deleteByAgreementId(agreementId);
     }
 
     @Override
-    public HttpResult<Object> auditAgreement(Integer agreementId, PtlAgreementAuditVo ptlAgreementAuditVo) {
+    public HttpResult<Object> auditAgreement(Long agreementId, PtlAgreementAuditVo ptlAgreementAuditVo) {
         PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         ptlAgreement.setAuditStatus(ptlAgreementAuditVo.getAuditStatus());
         ptlAgreement.setAuditContent(ptlAgreementAuditVo.getAuditContent());

+ 4 - 4
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementUnderwritingRulesServiceImpl.java

@@ -26,14 +26,14 @@ public class PtlAgreementUnderwritingRulesServiceImpl extends ServiceImpl<PtlAgr
 
 
     @Override
-    public void deleteByAgreementId(Integer agreementId) {
+    public void deleteByAgreementId(Long agreementId) {
         LambdaQueryWrapper<PtlAgreementUnderwritingRules> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PtlAgreementUnderwritingRules::getAgreementId, agreementId);
         baseMapper.delete(wrapper);
     }
 
     @Override
-    public List<PtlAgreementUnderwritingRules> getByAgreementId(Integer agreementId) {
+    public List<PtlAgreementUnderwritingRules> getByAgreementId(Long agreementId) {
         LambdaQueryWrapper<PtlAgreementUnderwritingRules> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PtlAgreementUnderwritingRules::getAgreementId, agreementId);
         return baseMapper.selectList(wrapper);
@@ -41,14 +41,14 @@ public class PtlAgreementUnderwritingRulesServiceImpl extends ServiceImpl<PtlAgr
 
     @Override
     @Transactional
-    public void saveBatchUnderwritingRules(Integer agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules) {
+    public void saveBatchUnderwritingRules(Long agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules) {
         List<PtlAgreementUnderwritingRules> ptlAgreementUnderwritingRulesList = PtlAgreementUnderwritingRulesSaveDto.toPtlAgreementUnderwritingRulesList(agreementId, underwritingRules);
         boolean b = saveBatch(ptlAgreementUnderwritingRulesList);
         AssertionUtils.isSucceed(b, "批量添加协议承保规则失败");
     }
 
     @Override
-    public Map<String, PtlFactorDto> getMapPtlFactorDto(Integer agreementId, Integer rulesType) {
+    public Map<String, PtlFactorDto> getMapPtlFactorDto(Long agreementId, Integer rulesType) {
         LambdaQueryWrapper<PtlAgreementUnderwritingRules> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(PtlAgreementUnderwritingRules::getAgreementId, agreementId)
                 .eq(PtlAgreementUnderwritingRules::getRulesType, rulesType);

+ 22 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlCrawlerApiServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.protocol.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.protocol.dao.PtlCrawlerApiMapper;
+import com.ydtech.modules.protocol.entity.po.PtlCrawlerApi;
+import com.ydtech.modules.protocol.service.PtlCrawlerApiService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【ptl_crawler_api(python对接接口)】的数据库操作Service实现
+* @createDate 2023-07-03 18:10:03
+*/
+@Service
+public class PtlCrawlerApiServiceImpl extends ServiceImpl<PtlCrawlerApiMapper, PtlCrawlerApi>
+    implements PtlCrawlerApiService {
+
+}
+
+
+
+

+ 114 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlInsAttributionTemplateServiceImpl.java

@@ -0,0 +1,114 @@
+package com.ydtech.modules.protocol.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.esm.model.EsmInsCompany;
+import com.ydtech.modules.esm.service.EsmInsCompanyService;
+import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.protocol.dao.PtlInsAttributionTemplateMapper;
+import com.ydtech.modules.protocol.entity.constants.PtlApiType;
+import com.ydtech.modules.protocol.entity.po.PtlInsAttributionTemplate;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateQueryVo;
+import com.ydtech.modules.protocol.entity.vo.PtlInsAttributionTemplateSaveVo;
+import com.ydtech.modules.protocol.service.PtlInsAttributionTemplateService;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author wenks
+ * @description 针对表【ptl_ins_attribution_template(保险公司归属信息模板配置)】的数据库操作Service实现
+ * @createDate 2023-07-03 09:31:16
+ */
+@Service
+public class PtlInsAttributionTemplateServiceImpl extends ServiceImpl<PtlInsAttributionTemplateMapper, PtlInsAttributionTemplate>
+        implements PtlInsAttributionTemplateService {
+
+    private final EsmInsCompanyService esmInsCompanyService;
+
+    public PtlInsAttributionTemplateServiceImpl(EsmInsCompanyService esmInsCompanyService) {
+        this.esmInsCompanyService = esmInsCompanyService;
+    }
+
+    private PtlInsAttributionTemplateService proxyService;
+
+    @Autowired
+    public void setPtlInsAttributionTemplateService(PtlInsAttributionTemplateService ptlInsAttributionTemplateService) {
+        this.proxyService = ptlInsAttributionTemplateService;
+    }
+
+    @Override
+    public PtlInsAttributionTemplate getByApiTypeAndInsCompanyId(PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo) {
+        // 判断保险公司是否存在
+        EsmInsCompany esmInsCompany = esmInsCompanyService.isExists(ptlInsAttributionTemplateSaveVo.getInsCompanyId());
+
+        // 查询一个保险公司,一种api方式是否只有一种配置
+        LambdaQueryWrapper<PtlInsAttributionTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(PtlInsAttributionTemplate::getApiType, ptlInsAttributionTemplateSaveVo.getApiType())
+                .eq(PtlInsAttributionTemplate::getInsCompanyId, ptlInsAttributionTemplateSaveVo.getInsCompanyId());
+        List<PtlInsAttributionTemplate> list = list(lambdaQueryWrapper);
+        if (list.size() > 0) {
+            throw new SystemException("一个保险公司,一种api方式只能配置一种");
+        }
+
+        return new PtlInsAttributionTemplate(ptlInsAttributionTemplateSaveVo, esmInsCompany.getNamesimple());
+    }
+
+    @Override
+
+    public HttpResult<Object> submit(PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo) {
+        // 一个保险公司,一种api方式只能配置一种
+        PtlInsAttributionTemplate ptlInsAttributionTemplate = proxyService.getByApiTypeAndInsCompanyId(ptlInsAttributionTemplateSaveVo);
+        boolean save = save(ptlInsAttributionTemplate);
+
+        // 保存请求链接
+        if (PtlApiType.PTL_API_1.getCode() == ptlInsAttributionTemplateSaveVo.getApiType()) {
+            //TODO
+        }
+
+        AssertionUtils.isSucceed(save, "保险公司归属信息模板添加失败");
+        return HttpResult.ok("添加成功");
+    }
+
+    @Override
+    public HttpResult<PtlInsAttributionTemplate> getByIdObtain(Long id) {
+        return HttpResult.ok(getById(id));
+    }
+
+    @Override
+    public HttpResult<BasePageResult<PtlInsAttributionTemplate>> getAll(PtlInsAttributionTemplateQueryVo queryVo) {
+        Page<PtlInsAttributionTemplate> pageQuery = new Page<>(queryVo.getPageNum(), queryVo.getPageSize());
+        LambdaQueryWrapper<PtlInsAttributionTemplate> queryWrapper = new LambdaQueryWrapper<PtlInsAttributionTemplate>()
+                .eq(StringUtils.isNullOrEmpty(queryVo.getInsCompanyId()), PtlInsAttributionTemplate::getInsCompanyId, queryVo.getInsCompanyId());
+        Page<PtlInsAttributionTemplate> page = page(pageQuery, queryWrapper);
+        BasePageResult<PtlInsAttributionTemplate> pageResult = new BasePageResult<>(queryVo.getPageNum(), page.getSize(), page.getTotal(), page.getPages(), page.getRecords());
+        return HttpResult.ok("succeed", pageResult);
+    }
+
+    @Override
+    public HttpResult<Object> deleteById(String id) {
+        boolean b = removeById(id);
+        AssertionUtils.isSucceed(b, "保险公司归属信息模板删除失败");
+        return HttpResult.ok("删除成功");
+    }
+
+    @Override
+    public HttpResult<Object> revise(String id, PtlInsAttributionTemplateSaveVo ptlInsAttributionTemplateSaveVo) {
+        // 一个保险公司,一种api方式只能配置一种
+        PtlInsAttributionTemplate ptlInsAttributionTemplate = proxyService.getByApiTypeAndInsCompanyId(ptlInsAttributionTemplateSaveVo);
+        boolean b = updateById(ptlInsAttributionTemplate);
+        AssertionUtils.isSucceed(b, "保险公司归属信息模板修改失败");
+        return HttpResult.ok("修改成功");
+    }
+
+}
+
+
+
+

+ 8 - 11
src/main/java/com/ydtech/modules/protocol/service/impl/EsProductServiceImpl.java → src/main/java/com/ydtech/modules/protocol/service/impl/PtlProductServiceImpl.java

@@ -4,33 +4,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.protocol.dao.EsProductMapper;
-import com.ydtech.modules.protocol.entity.po.EsProduct;
+import com.ydtech.modules.protocol.dao.PtlProductMapper;
+import com.ydtech.modules.protocol.entity.po.PtlProduct;
 import com.ydtech.modules.protocol.entity.vo.PtlProductVo;
-import com.ydtech.modules.protocol.service.EsProductService;
+import com.ydtech.modules.protocol.service.PtlProductService;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 
 @Service
-public class EsProductServiceImpl extends ServiceImpl<EsProductMapper, EsProduct> implements EsProductService {
+public class PtlProductServiceImpl extends ServiceImpl<PtlProductMapper, PtlProduct> implements PtlProductService {
 
-    @Resource
-    EsProductMapper productMapper;
 
     @Override
     public List selectList(QueryWrapper queryWrapper) {
-        return productMapper.selectList(queryWrapper);
+        return baseMapper.selectList(queryWrapper);
     }
 
     @Override
     public HttpResult getCodeAndName() {
-        LambdaQueryWrapper<EsProduct> wrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<PtlProduct> wrapper = new LambdaQueryWrapper<>();
         // 查询id 和 用户名
-        wrapper.select(EsProduct::getId, EsProduct::getName);
-        List<EsProduct> esProducts = productMapper.selectList(wrapper);
+        wrapper.select(PtlProduct::getId, PtlProduct::getName);
+        List<PtlProduct> esProducts = baseMapper.selectList(wrapper);
         // 转换vo
         List<PtlProductVo> productVos = PtlProductVo.toPtlProductVoList(esProducts);
         return HttpResult.ok(productVos);

+ 3 - 6
src/main/java/com/ydtech/modules/protocol/utils/AssertionUtils.java

@@ -2,7 +2,6 @@ package com.ydtech.modules.protocol.utils;
 
 import com.ydtech.exception.SystemException;
 import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
 
 /**
  * 断言工具类
@@ -16,10 +15,8 @@ public class AssertionUtils {
     }
 
 
-    private static void assertion(boolean b, String message){
-        if (b) {
-            throw new SystemException(message);
-        }
+    private static void assertion(boolean b, String message) {
+        if (b) throw new SystemException(message);
     }
 
 
@@ -31,7 +28,7 @@ public class AssertionUtils {
         assertion(!b, message);
     }
 
-    public static void isEmpty(Object o, String message){
+    public static void isEmpty(Object o, String message) {
         assertion(ObjectUtils.isEmpty(o), message);
     }