Przeglądaj źródła

归属信息模板id修改 审核协议

wks 3 lat temu
rodzic
commit
bdb51b42a3
28 zmienionych plików z 165 dodań i 69 usunięć
  1. 3 3
      src/main/java/com/ydtech/modules/esm/controller/EsmInsAttributionTemplateController.java
  2. 1 1
      src/main/java/com/ydtech/modules/esm/model/EsmInsAttributionTemplate.java
  3. 3 3
      src/main/java/com/ydtech/modules/esm/service/EsmInsAttributionTemplateService.java
  4. 3 3
      src/main/java/com/ydtech/modules/esm/service/impl/EsmInsAttributionTemplateServiceImpl.java
  5. 9 10
      src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java
  6. 3 2
      src/main/java/com/ydtech/modules/order/service/InsOrdersService.java
  7. 2 2
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  8. 1 4
      src/main/java/com/ydtech/modules/protocol/controller/EsProductController.java
  9. 7 0
      src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java
  10. 1 0
      src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementProductCostsMapper.java
  11. 2 1
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementCostsFactorSaveDto.java
  12. 2 0
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementSaveDto.java
  13. 1 2
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementUnderwritingRulesSaveDto.java
  14. 6 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java
  15. 21 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementAuditVo.java
  16. 2 0
      src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementPageVo.java
  17. 13 5
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementProductCostsService.java
  18. 14 1
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java
  19. 9 0
      src/main/java/com/ydtech/modules/protocol/service/PtlAgreementUnderwritingRulesService.java
  20. 13 2
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementProductCostsServiceImpl.java
  21. 18 13
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  22. 9 0
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementUnderwritingRulesServiceImpl.java
  23. 7 1
      src/main/java/com/ydtech/modules/protocol/utils/AssertionUtils.java
  24. 0 3
      src/main/resources/application-prod.yml
  25. 0 3
      src/main/resources/application-test.yml
  26. 1 0
      src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml
  27. 13 10
      src/main/resources/mapper/modules/protocol/PtlAgreementProductCostsMapper.xml
  28. 1 0
      src/main/resources/mapper/modules/protocol/PtlAgreementUnderwritingRulesMapper.xml

+ 3 - 3
src/main/java/com/ydtech/modules/esm/controller/EsmInsAttributionTemplateController.java

@@ -33,7 +33,7 @@ public class EsmInsAttributionTemplateController {
 
     @GetMapping("/{id}")
     @ApiOperation("通过id获取模板信息")
-    public HttpResult getByIdObtain(@PathVariable Long id) {
+    public HttpResult getByIdObtain(@PathVariable String id) {
         return esmInsAttributionTemplateService.getByIdObtain(id);
     }
 
@@ -45,13 +45,13 @@ public class EsmInsAttributionTemplateController {
 
     @DeleteMapping("/{id}")
     @ApiOperation("通过id删除模板信息")
-    public HttpResult deleteById(@PathVariable Long id) {
+    public HttpResult deleteById(@PathVariable String id) {
         return esmInsAttributionTemplateService.deleteById(id);
     }
 
     @PutMapping("/{id}")
     @ApiOperation("通过id修改模板信息")
-    public HttpResult revise(@PathVariable Long id, @RequestBody EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo) {
+    public HttpResult revise(@PathVariable String id, @RequestBody EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo) {
         return esmInsAttributionTemplateService.revise(id, esmInsAttributionTemplateSaveVo);
     }
 

+ 1 - 1
src/main/java/com/ydtech/modules/esm/model/EsmInsAttributionTemplate.java

@@ -30,7 +30,7 @@ public class EsmInsAttributionTemplate implements Serializable {
      *
      */
     @TableId(value = "id", type = IdType.ASSIGN_ID)
-    private Long id;
+    private String id;
 
     /**
      * 保险公司ID

+ 3 - 3
src/main/java/com/ydtech/modules/esm/service/EsmInsAttributionTemplateService.java

@@ -26,7 +26,7 @@ public interface EsmInsAttributionTemplateService extends IService<EsmInsAttribu
      * @param id 归属信息模板id
      * @return HttpResult
      */
-    HttpResult getByIdObtain(Long id);
+    HttpResult getByIdObtain(String id);
 
     /**
      * 分页获取模板信息
@@ -42,7 +42,7 @@ public interface EsmInsAttributionTemplateService extends IService<EsmInsAttribu
      * @param id 归属信息模板id
      * @return HttpResult
      */
-    HttpResult deleteById(Long id);
+    HttpResult deleteById(String id);
 
     /**
      * 通过id修改模板信息
@@ -50,5 +50,5 @@ public interface EsmInsAttributionTemplateService extends IService<EsmInsAttribu
      * @param esmInsAttributionTemplateSaveVo 归属信息模板
      * @return HttpResult
      */
-    HttpResult revise(Long id, EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo);
+    HttpResult revise(String id, EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo);
 }

+ 3 - 3
src/main/java/com/ydtech/modules/esm/service/impl/EsmInsAttributionTemplateServiceImpl.java

@@ -40,7 +40,7 @@ public class EsmInsAttributionTemplateServiceImpl extends ServiceImpl<EsmInsAttr
     }
 
     @Override
-    public HttpResult getByIdObtain(Long id) {
+    public HttpResult getByIdObtain(String id) {
         EsmInsAttributionTemplate esmInsAttributionTemplate = baseMapper.selectById(id);
         return HttpResult.ok(esmInsAttributionTemplate);
     }
@@ -53,13 +53,13 @@ public class EsmInsAttributionTemplateServiceImpl extends ServiceImpl<EsmInsAttr
     }
 
     @Override
-    public HttpResult deleteById(Long id) {
+    public HttpResult deleteById(String id) {
         baseMapper.deleteById(id);
         return HttpResult.ok("删除成功");
     }
 
     @Override
-    public HttpResult revise(Long id, EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo) {
+    public HttpResult revise(String id, EsmInsAttributionTemplateSaveVo esmInsAttributionTemplateSaveVo) {
         esmInsCompanyService.isExists(esmInsAttributionTemplateSaveVo.getInsCompanyId());
         EsmInsAttributionTemplate esmInsAttributionTemplate = new EsmInsAttributionTemplate(esmInsAttributionTemplateSaveVo);
         esmInsAttributionTemplate.setId(id);

+ 9 - 10
src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java

@@ -44,42 +44,42 @@ public class InsOrdersController {
 
     @PostMapping("/generateOrder")
     @ApiOperation(value = "生成订单")
-    public HttpResult generateOrder(@Validated @RequestBody BaseQuoteInfoVo quoteInfoVo) {
+    public HttpResult<InsOrders> generateOrder(@Validated @RequestBody BaseQuoteInfoVo quoteInfoVo) {
         InsOrders insOrders = this.insOrdersService.generateOrder(quoteInfoVo);
         return HttpResult.ok("success", insOrders);
     }
 
     @PostMapping("/getByOrderNo")
     @ApiOperation(value = "通过订单ID查询订单信息")
-    public HttpResult getByOrderNo(@RequestSingleParam(value = "orderNo") String orderNo) {
+    public HttpResult<BaseQuoteInfoVo> getByOrderNo(@RequestSingleParam(value = "orderNo") String orderNo) {
         BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderNo);
         return HttpResult.ok("success", quoteInfo);
     }
 
     @PostMapping("/revise")
     @ApiOperation(value = "编辑/修改")
-    public HttpResult revise(@RequestSingleParam(value = "orderNo") String orderNo) {
+    public HttpResult<InsOrders> revise(@RequestSingleParam(value = "orderNo") String orderNo) {
         InsOrders insOrders = this.insOrdersService.revise(orderNo);
         return HttpResult.ok("success", insOrders);
     }
 
     @PostMapping("/queryOrdersAndAreaCompany")
     @ApiOperation(value = "查询订单接口")
-    public HttpResult queryOrdersAndAreaCompany(@RequestBody @Valid OrderQueryVo orderQueryVo) {
+    public HttpResult<BasePageResult<InsOrders>> queryOrdersAndAreaCompany(@RequestBody @Valid OrderQueryVo orderQueryVo) {
         BasePageResult<InsOrders> quoteResult = this.insOrdersService.queryOrdersAndAreaCompany(orderQueryVo);
         return HttpResult.ok("success", quoteResult);
     }
 
     @PostMapping("/queryOrders")
     @ApiOperation(value = "查询订单和子订单")
-    public HttpResult queryOrders(@RequestBody @Valid OrderQueryVo orderQueryVo) {
+    public HttpResult<BasePageResult<InsOrders>> queryOrders(@RequestBody @Valid OrderQueryVo orderQueryVo) {
         BasePageResult<InsOrders> quoteResult = this.insOrdersService.queryOrders(orderQueryVo);
         return HttpResult.ok("success", quoteResult);
     }
 
     @PostMapping("/queryInsAreaCompany")
     @ApiOperation(value = "通过主订单ID查询子订单")
-    public HttpResult queryInsAreaCompany(@RequestSingleParam(value = "orderNo") String orderNo) {
+    public HttpResult<List<InsAreaCompany>> queryInsAreaCompany(@RequestSingleParam(value = "orderNo") String orderNo) {
         this.insOrdersService.existOrder(orderNo);
         List<InsAreaCompany> insAreaCompanies = this.insAreaCompanyService.query().eq("orderno", orderNo).list();
         return HttpResult.ok("success", insAreaCompanies);
@@ -87,18 +87,17 @@ public class InsOrdersController {
 
     @PostMapping("/queryQuoteHistory")
     @ApiOperation(value = "查询报价历史")
-    public HttpResult queryQuoteHistory(@RequestBody QuoteHistoryVo quoteHistoryVo) {
+    public HttpResult<List<InsAreaCompany>> queryQuoteHistory(@RequestBody QuoteHistoryVo quoteHistoryVo) {
         this.insOrdersService.existOrder(quoteHistoryVo.getOrderNo());
         LambdaQueryWrapper<InsAreaCompany> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderNo()), InsAreaCompany::getOrderno, quoteHistoryVo.getOrderNo()).eq(!ObjectUtils.isEmpty(quoteHistoryVo.getOrderStatus()), InsAreaCompany::getOrderstatus, quoteHistoryVo.getOrderStatus()).orderByAsc(InsAreaCompany::getCreatetime);
         List<InsAreaCompany> insAreaCompanies = this.insAreaCompanyService.getBaseMapper().selectList(wrapper);
-
         return HttpResult.ok("success", insAreaCompanies);
     }
 
     @PostMapping("/getByCompanyId")
     @ApiOperation(value = "通过子订单查询订单信息")
-    public HttpResult getByCompanyId(@RequestSingleParam(value = "companyId") String companyId) {
+    public HttpResult<OrderVo> getByCompanyId(@RequestSingleParam(value = "companyId") String companyId) {
         return this.insOrdersService.getByCompanyId(companyId);
     }
 
@@ -117,7 +116,7 @@ public class InsOrdersController {
 
     @PostMapping("/verifyOrders")
     @ApiOperation(value = "验证近期是否出过单")
-    public HttpResult verifyOrders(@RequestBody VerifyOrdersVo verifyOrdersVo) {
+    public HttpResult<InsOrders> verifyOrders(@RequestBody VerifyOrdersVo verifyOrdersVo) {
         return insOrdersService.verifyOrders(verifyOrdersVo);
     }
 

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

@@ -7,6 +7,7 @@ import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.OrderQueryVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.OrderVo;
 import com.ydtech.modules.order.entity.vo.VerifyOrdersVo;
 
 import java.util.List;
@@ -69,7 +70,7 @@ public interface InsOrdersService extends IService<InsOrders> {
      * @param companyId
      * @return
      */
-    HttpResult getByCompanyId(String companyId);
+    HttpResult<OrderVo> getByCompanyId(String companyId);
 
     InsOrders revise(String orderNo);
 
@@ -79,5 +80,5 @@ public interface InsOrdersService extends IService<InsOrders> {
      * @param verifyOrdersVo
      * @return
      */
-    HttpResult verifyOrders(VerifyOrdersVo verifyOrdersVo);
+    HttpResult<InsOrders> verifyOrders(VerifyOrdersVo verifyOrdersVo);
 }

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

@@ -252,7 +252,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     }
 
     @Override
-    public HttpResult getByCompanyId(String companyId) {
+    public HttpResult<OrderVo> getByCompanyId(String companyId) {
         OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
         if ("永安财险".equals(orderAndAreaCompany.getInscompany())) {
             JSONObject reptxt = orderAndAreaCompany.getReptxt();
@@ -281,7 +281,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     }
 
     @Override
-    public HttpResult verifyOrders(VerifyOrdersVo verifyOrdersVo) {
+    public HttpResult<InsOrders> verifyOrders(VerifyOrdersVo verifyOrdersVo) {
         InsOrders byUseridAndLicenseNo = baseMapper.getByUseridAndLicenseNo(verifyOrdersVo);
         if (ObjectUtils.isEmpty(byUseridAndLicenseNo)) {
             throw new SystemException("没有此订单");

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

@@ -39,7 +39,6 @@ public class EsProductController extends BaseController {
     @PostMapping(value = "/addProduct")
     @ApiOperation("新增产品信息")
     public HttpResult save(@RequestBody EsProduct record) {
-
         record.setCreateBy(getUserName());
         record.setCreateTime(new Date());
         record.setLastUpdateBy(getUserName());
@@ -72,14 +71,12 @@ 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) {
             return HttpResult.ok("产品删除成功");
-
         }
-        return HttpResult.error("产品删除失败");
 
+        return HttpResult.error("产品删除失败");
 
     }
 

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

@@ -5,6 +5,7 @@ import com.ydtech.core.page.BaseController;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+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;
@@ -62,4 +63,10 @@ public class PtlAgreementController extends BaseController {
         return ptlAgreementService.deleteAgreement(agreementId);
     }
 
+    @PostMapping("/audit/{agreementId}")
+    @ApiOperation("审核协议")
+    public HttpResult<?> audit(@PathVariable Integer agreementId, @RequestBody PtlAgreementAuditVo ptlAgreementAuditVo){
+        return ptlAgreementService.auditAgreement(agreementId, ptlAgreementAuditVo);
+    }
+
 }

+ 1 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementProductCostsMapper.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.protocol.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 
+
 /**
 * @author Administrator
 * @description 针对表【ptl_agreement_product_costs(协议产品费用)】的数据库操作Mapper

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

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
+import java.util.Map;
 
 @Data
 @ApiModel("费用因子")
@@ -14,6 +15,6 @@ public class PtlAgreementCostsFactorSaveDto {
     private String factorType;
 
     @ApiModelProperty("费用因子")
-    private List<PtlFactorDto> factor;
+    private List<Map<String, PtlFactorDto>> factor;
 
 }

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

@@ -12,6 +12,8 @@ import java.time.LocalDate;
 @ApiModel("协议添加实体")
 public class PtlAgreementSaveDto implements Serializable {
 
+    private static final long serialVersionUID = 815254316326000952L;
+
     @ApiModelProperty("协议类型")
     private String agreementType;
 

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

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @Data
@@ -32,6 +33,4 @@ public class PtlAgreementUnderwritingRulesSaveDto {
         return ptlAgreementUnderwritingRules;
     }
 
-
-
 }

+ 6 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java

@@ -119,6 +119,12 @@ public class PtlAgreement implements Serializable {
     @TableField(value = "file_id")
     private String fileId;
 
+    /**
+     * 审核内容
+     */
+    @TableField(value = "audit_content")
+    private String auditContent;
+
     /**
      * 审核状态 0 申请审核 1 审核通过 2 审核不通过
      */

+ 21 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementAuditVo.java

@@ -0,0 +1,21 @@
+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("协议审核")
+public class PtlAgreementAuditVo implements Serializable {
+
+    private static final long serialVersionUID = -7649042208612658581L;
+
+    @ApiModelProperty("审核内容")
+    public String auditContent;
+
+    @ApiModelProperty("审核状态 0 申请审核 1 审核通过 2 审核不通过")
+    public Integer auditStatus;
+}

+ 2 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementPageVo.java

@@ -14,6 +14,8 @@ import java.time.LocalDate;
 @ApiModel("分页查询协议")
 public class PtlAgreementPageVo extends BasePageVO {
 
+    private static final long serialVersionUID = 2575020753576017621L;
+
     @ApiModelProperty("录入时间 开始")
     private LocalDate startDate;
 

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

@@ -2,17 +2,19 @@ package com.ydtech.modules.protocol.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeQueryDto;
+import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeSaveDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementProductCostsQueryDto;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementProductCostsSaveDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
 /**
-* @author Administrator
-* @description 针对表【ptl_agreement_product_costs(协议产品费用)】的数据库操作Service
-* @createDate 2023-06-05 17:59:52
-*/
+ * @author Administrator
+ * @description 针对表【ptl_agreement_product_costs(协议产品费用)】的数据库操作Service
+ * @createDate 2023-06-05 17:59:52
+ */
 public interface PtlAgreementProductCostsService extends IService<PtlAgreementProductCosts> {
 
     /**
@@ -22,7 +24,6 @@ public interface PtlAgreementProductCostsService extends IService<PtlAgreementPr
      */
     void deleteByAgreementId(Integer agreementId);
 
-
     /**
      * 根据 协议id 查询协议产品费用
      *
@@ -30,4 +31,11 @@ public interface PtlAgreementProductCostsService extends IService<PtlAgreementPr
      */
     List<PltAgreementSchemeQueryDto> getByAgreementId(Integer agreementId);
 
+    /**
+     * 批量提添加产品费用
+     *
+     * @param agreementId 协议id
+     * @param scheme      产品
+     */
+    void saveBatchProductCosts(Integer agreementId, List<PltAgreementSchemeSaveDto> scheme);
 }

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+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;
@@ -67,6 +68,18 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      */
     HttpResult<?> reviseAgreement(String userName, Integer agreementId, PtlAgreementSaveVo agreement);
 
-
+    /**
+     * 提交 产品费用 承保规则
+     * @param id 协议id
+     * @param agreement 提交内容
+     */
     void saveProductCostsAndUnderwritingRules(Integer id, PtlAgreementSaveVo agreement);
+
+    /**
+     * 审核协议
+     * @param agreementId 协议id
+     * @param ptlAgreementAuditVo 审核内容
+     * @return
+     */
+    HttpResult<?> auditAgreement(Integer agreementId, PtlAgreementAuditVo ptlAgreementAuditVo);
 }

+ 9 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementUnderwritingRulesService.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.protocol.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementUnderwritingRulesSaveDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementUnderwritingRules;
 
 import java.util.List;
@@ -27,4 +28,12 @@ public interface PtlAgreementUnderwritingRulesService extends IService<PtlAgreem
      * @return List<PtlAgreementUnderwritingRulesQueryDto>
      */
     List<PtlAgreementUnderwritingRules> getByAgreementId(Integer agreementId);
+
+    /**
+     * 根据协议id批量添加承保规则
+     *
+     * @param agreementId       协议id
+     * @param underwritingRules 承保规则
+     */
+    void saveBatchUnderwritingRules(Integer agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules);
 }

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

@@ -2,14 +2,15 @@ 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.entity.dto.PtlAgreementProductCostsQueryDto;
-import com.ydtech.modules.protocol.entity.dto.PtlAgreementProductCostsSaveDto;
 import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeQueryDto;
+import com.ydtech.modules.protocol.entity.dto.PltAgreementSchemeSaveDto;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementProductCostsSaveDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 import com.ydtech.modules.protocol.service.PtlAgreementProductCostsService;
 import com.ydtech.modules.protocol.dao.PtlAgreementProductCostsMapper;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -49,6 +50,16 @@ public class PtlAgreementProductCostsServiceImpl extends ServiceImpl<PtlAgreemen
         );
         return productCostsSave;
     }
+
+
+    @Override
+    @Transactional
+    public void saveBatchProductCosts(Integer agreementId, List<PltAgreementSchemeSaveDto> scheme) {
+        List<PtlAgreementProductCosts> ptlAgreementProductCostsList = PtlAgreementProductCostsSaveDto.toPtlAgreementProductCosts(agreementId, scheme);
+        boolean b = saveBatch(ptlAgreementProductCostsList);
+        AssertionUtils.isSucceed(b, "批量添加产品费用失败");
+    }
+
 }
 
 

+ 18 - 13
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -8,8 +8,8 @@ import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.protocol.entity.dto.*;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
-import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 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;
@@ -18,7 +18,6 @@ import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.dao.PtlAgreementMapper;
 import com.ydtech.modules.protocol.service.PtlAgreementUnderwritingRulesService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
-import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,8 +34,7 @@ import java.util.List;
  * @createDate 2023-06-05 17:59:52
  */
 @Service
-public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, PtlAgreement>
-        implements PtlAgreementService {
+public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, PtlAgreement> implements PtlAgreementService {
 
     private final PtlAgreementProductCostsService ptlAgreementProductCostsService;
 
@@ -110,7 +108,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     public HttpResult<?> deleteAgreement(Integer agreementId) {
         proxyObject.ifExistsById(agreementId);
         boolean b = removeById(agreementId);
-        AssertionUtils.isSucceed(BooleanUtils.toInteger(b), "协议信息删除失败");
+        AssertionUtils.isSucceed(b, "协议信息删除失败");
         // 删除产品费用
         ptlAgreementProductCostsService.deleteByAgreementId(agreementId);
         // 删除承保规则
@@ -119,6 +117,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     }
 
     @Override
+    @Transactional
     public HttpResult<?> reviseAgreement(String userName, Integer agreementId, PtlAgreementSaveVo agreement) {
         PtlAgreementSaveDto agreementSaveDto = agreement.getAgreement();
         PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
@@ -126,7 +125,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         ptlAgreement.setModifiedBy(userName);
         ptlAgreement.setUpdateTime(LocalDateTime.now());
         // 修改协议
-        updateById(ptlAgreement);
+        boolean b = updateById(ptlAgreement);
+        AssertionUtils.isSucceed(b, "协议信息修改失败");
         // 删除产品费用
         ptlAgreementProductCostsService.deleteByAgreementId(agreementId);
         // 删除承保规则
@@ -144,16 +144,21 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     @Override
     public void saveProductCostsAndUnderwritingRules(Integer agreementId, PtlAgreementSaveVo agreement) {
         // 产品费用
-        List<PltAgreementSchemeSaveDto> scheme = agreement.getScheme();
-        List<PtlAgreementProductCosts> ptlAgreementProductCostsList = PtlAgreementProductCostsSaveDto.toPtlAgreementProductCosts(agreementId, scheme);
-        ptlAgreementProductCostsService.saveBatch(ptlAgreementProductCostsList);
-
+        ptlAgreementProductCostsService.saveBatchProductCosts(agreementId, agreement.getScheme());
         // 承包规则
-        List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules = agreement.getUnderwritingRules();
-        List<PtlAgreementUnderwritingRules> ptlAgreementUnderwritingRulesList = PtlAgreementUnderwritingRulesSaveDto.toPtlAgreementUnderwritingRulesList(agreementId, underwritingRules);
-        ptlAgreementUnderwritingRulesService.saveBatch(ptlAgreementUnderwritingRulesList);
+        ptlAgreementUnderwritingRulesService.saveBatchUnderwritingRules(agreementId, agreement.getUnderwritingRules());
     }
 
+    @Override
+    public HttpResult<?> auditAgreement(Integer agreementId, PtlAgreementAuditVo ptlAgreementAuditVo) {
+        PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
+        ptlAgreement.setAuditStatus(ptlAgreementAuditVo.getAuditStatus());
+        ptlAgreement.setAuditContent(ptlAgreementAuditVo.getAuditContent());
+        // 修改协议
+        boolean b = updateById(ptlAgreement);
+        AssertionUtils.isSucceed(b, "协议信息修改失败");
+        return HttpResult.ok("修改成功");
+    }
 
 }
 

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

@@ -2,11 +2,13 @@ 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.entity.dto.PtlAgreementUnderwritingRulesSaveDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementUnderwritingRules;
 import com.ydtech.modules.protocol.service.PtlAgreementUnderwritingRulesService;
 import com.ydtech.modules.protocol.dao.PtlAgreementUnderwritingRulesMapper;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -35,6 +37,13 @@ public class PtlAgreementUnderwritingRulesServiceImpl extends ServiceImpl<PtlAgr
         return baseMapper.selectList(wrapper);
     }
 
+    @Override
+    @Transactional
+    public void saveBatchUnderwritingRules(Integer agreementId, List<PtlAgreementUnderwritingRulesSaveDto> underwritingRules) {
+        List<PtlAgreementUnderwritingRules> ptlAgreementUnderwritingRulesList = PtlAgreementUnderwritingRulesSaveDto.toPtlAgreementUnderwritingRulesList(agreementId, underwritingRules);
+        boolean b = saveBatch(ptlAgreementUnderwritingRulesList);
+        AssertionUtils.isSucceed(b, "批量添加协议承保规则失败");
+    }
 
 }
 

+ 7 - 1
src/main/java/com/ydtech/modules/protocol/utils/AssertionUtils.java

@@ -4,8 +4,8 @@ import com.ydtech.exception.SystemException;
 
 /**
  * 断言工具类
- * @author wenks
  *
+ * @author wenks
  */
 public class AssertionUtils {
 
@@ -15,4 +15,10 @@ public class AssertionUtils {
         }
     }
 
+    public static void isSucceed(boolean b, String message) {
+        if (!b) {
+            throw new SystemException(message);
+        }
+    }
+
 }

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

@@ -119,9 +119,6 @@ server:
       charset: UTF-8
       force: true
 spring:
-  jackson:
-    generator:
-      write_numbers_as_strings: true
   datasource:
     driver-class-name: com.p6spy.engine.spy.P6SpyDriver
     druid:

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

@@ -149,9 +149,6 @@ server:
 
 
 spring:
-  jackson:
-    generator:
-      write_numbers_as_strings: true
   datasource:
     driver-class-name: com.p6spy.engine.spy.P6SpyDriver
     druid:

+ 1 - 0
src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

@@ -22,6 +22,7 @@
             <result property="cooperationChannels" column="cooperation_channels" jdbcType="VARCHAR"/>
             <result property="validStatus" column="valid_status" jdbcType="VARCHAR"/>
             <result property="fileId" column="file_id" jdbcType="VARCHAR"/>
+            <result property="auditContent" column="audit_content" jdbcType="VARCHAR"/>
             <result property="auditStatus" column="audit_status" jdbcType="TINYINT"/>
             <result property="creator" column="creator" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>

+ 13 - 10
src/main/resources/mapper/modules/protocol/PtlAgreementProductCostsMapper.xml

@@ -5,16 +5,19 @@
 <mapper namespace="com.ydtech.modules.protocol.dao.PtlAgreementProductCostsMapper">
 
     <resultMap id="BaseResultMap" type="com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts">
-            <id property="id" column="id" jdbcType="INTEGER"/>
-            <result property="agreementId" column="agreement_id" jdbcType="INTEGER"/>
-            <result property="productId" column="product_id" jdbcType="INTEGER"/>
-            <result property="costsDescription" column="costs_description" jdbcType="VARCHAR"/>
-            <result property="costsProportion" column="costs_proportion" jdbcType="VARCHAR"/>
-            <result property="costsLevel" column="costs_level" jdbcType="VARCHAR"/>
-            <result property="costsStartDate" column="costs_start_date" jdbcType="DATE"/>
-            <result property="costsEndDate" column="costs_end_date" jdbcType="DATE"/>
-            <result property="costspilloverPremiums" column="costSpillover_premiums" jdbcType="VARCHAR"/>
-            <result property="costspilloverProportion" column="costSpillover_proportion" jdbcType="VARCHAR"/>
+        <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="agreementId" column="agreement_id" jdbcType="INTEGER"/>
+        <result property="productId" column="product_id" jdbcType="INTEGER"/>
+        <result property="productName" column="product_name" jdbcType="INTEGER"/>
+        <result property="costsFactor" column="costs_description" javaType="com.alibaba.fastjson.JSONArray"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="costsDescription" column="costs_description" jdbcType="VARCHAR"/>
+        <result property="costsProportion" column="costs_proportion" jdbcType="VARCHAR"/>
+        <result property="costsLevel" column="costs_level" jdbcType="VARCHAR"/>
+        <result property="costsStartDate" column="costs_start_date" jdbcType="DATE"/>
+        <result property="costsEndDate" column="costs_end_date" jdbcType="DATE"/>
+        <result property="spilloverPremiums" column="spillover_premiums" jdbcType="VARCHAR"/>
+        <result property="spilloverProportion" column="spillover_proportion" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Base_Column_List">

+ 1 - 0
src/main/resources/mapper/modules/protocol/PtlAgreementUnderwritingRulesMapper.xml

@@ -16,4 +16,5 @@
         id,agreement_id,rules_type,
         rules_factor
     </sql>
+
 </mapper>