1
0

26 Коммиты decefb5057 ... 47a8b49cdf

Автор SHA1 Сообщение Дата
  xuqiang 47a8b49cdf Merge remote-tracking branch 'origin/master' 10 месяцев назад
  xuqiang 28de7194c3 app版本管理 10 месяцев назад
  dongxin a69614c058 Merge remote-tracking branch 'origin/master' 10 месяцев назад
  dongxin 32167ef8ef 协议bug的修改 10 месяцев назад
  Qchen 0050a85855 费用回显留点比例 10 месяцев назад
  785834757 baeca1a611 车型查询接口过滤中文 10 месяцев назад
  785834757 c929c8e159 平台角色添加bug 10 месяцев назад
  785834757 2e5d0a5fd9 银行卡校验已存在的bug修改 10 месяцев назад
  Qchen a265eaebb6 Merge remote-tracking branch 'origin/master' 11 месяцев назад
  Qchen b0d461abb3 修改 11 месяцев назад
  785834757 c18f0f662d 调整网关路由格式 11 месяцев назад
  785834757 e6359f6b5c 查询订单信息 过滤业务员空数据 11 месяцев назад
  Qchen 9450af97d0 Merge remote-tracking branch 'origin/master' 11 месяцев назад
  Qchen 7877e0c0c7 修改 11 месяцев назад
  785834757 b426a681f5 地址配置搜索 名称使用通配 11 месяцев назад
  785834757 e5adebc009 Merge remote-tracking branch 'origin/master' 11 месяцев назад
  785834757 fa63894039 出单账号支持 保司搜索 11 месяцев назад
  Qchen a8186ca0f5 bug修改 11 месяцев назад
  Qchen 81192f8c06 阳光添加向阳花标识 红黄蓝车系 11 месяцев назад
  785834757 90f60c03b7 修改 租户管理员不显示在成员列表的bug 11 месяцев назад
  785834757 a9450cee9a 添加调度 11 месяцев назад
  wks a82926f3c8 update 11 месяцев назад
  dongxin 3f3ba61edb Merge remote-tracking branch 'origin/master' 11 месяцев назад
  dongxin 7488c4208c 订单批改的提交 11 месяцев назад
  wks bbaef411c6 update 11 месяцев назад
  Qchen ae1f5d55dc 批改后的应收数据修改 11 месяцев назад
97 измененных файлов с 2556 добавлено и 187 удалено
  1. 22 0
      commons/src/main/java/com/jzg/commons/entity/action/base/ActionHandler.java
  2. 34 0
      commons/src/main/java/com/jzg/commons/entity/action/enums/ActionEnum.java
  3. 40 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatch.java
  4. 35 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAction.java
  5. 37 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAfterAction.java
  6. 57 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchRulesAttrLink.java
  7. 20 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchQuery.java
  8. 87 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchVo.java
  9. 106 0
      commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/ValidateDispatchRuleVo.java
  10. 3 0
      commons/src/main/java/com/jzg/commons/entity/dto/OrderAdjustParam.java
  11. 3 0
      commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostEnd.java
  12. 6 0
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrders.java
  13. 6 0
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrdersOther.java
  14. 25 0
      commons/src/main/java/com/jzg/commons/entity/po/SysAppManage.java
  15. 4 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfo.java
  16. 8 0
      commons/src/main/java/com/jzg/commons/entity/po/SysVersion.java
  17. 11 1
      commons/src/main/java/com/jzg/commons/entity/quote/vo/QuoteVo.java
  18. 20 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteResultsVo.java
  19. 10 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/base/OrderBase.java
  20. 6 0
      commons/src/main/java/com/jzg/commons/entity/scheme/po/PtlSchemeRulesAttrLink.java
  21. 6 0
      commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlAgreementInsCompanyVo.java
  22. 11 8
      commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java
  23. 8 0
      commons/src/main/java/com/jzg/commons/entity/vo/AgreementVo.java
  24. 9 0
      commons/src/main/java/com/jzg/commons/entity/vo/SysAppManageVo.java
  25. 10 0
      gateway/src/main/java/com/jzg/GateWayApplication.java
  26. 37 0
      gateway/src/main/java/com/jzg/factory/MultiPathRoutePredicateFactory.java
  27. 77 8
      gateway/src/main/resources/application-dev.yml
  28. 80 12
      gateway/src/main/resources/application-test.yml
  29. 11 0
      platform/src/main/java/com/jzg/mapper/SysUserJzgInfoSalesmanMapper.java
  30. 13 1
      platform/src/main/java/com/jzg/service/impl/SysSystemServiceImpl.java
  31. 17 14
      platform/src/main/java/com/jzg/service/impl/UserRoleServiceImpl.java
  32. 1 0
      platform/src/main/resources/mapper/PtlAgreementAttributionMapper.xml
  33. 1 1
      platform/src/main/resources/mapper/PtlAgreementUrlMapper.xml
  34. 46 1
      tenant/costsorrule/src/main/java/com/jzg/costsorrule/controller/RuleController.java
  35. 9 0
      tenant/costsorrule/src/main/java/com/jzg/costsorrule/service/RuleService.java
  36. 35 9
      tenant/costsorrule/src/main/java/com/jzg/costsorrule/service/impl/RuleServiceImpl.java
  37. 29 1
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java
  38. 50 3
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java
  39. 5 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/CarModelController.java
  40. 7 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java
  41. 3 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java
  42. 9 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsOrdersService.java
  43. 8 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrderAdjustInfoServiceImpl.java
  44. 2 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrderAdjustServiceImpl.java
  45. 21 14
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  46. 4 0
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrderAdjustMapper.xml
  47. 26 2
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml
  48. 31 2
      tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/build/YangGuangApiQuoteResultsVoBuild.java
  49. 18 16
      tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/entity/request/YangGuangGetNonVehicleProductsRequest.java
  50. 12 0
      tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/entity/response/YangGuangAccuracyCalculateResponse.java
  51. 10 2
      tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/service/impl/YangGuangApiRequestImpl.java
  52. 4 0
      tenant/organization/pom.xml
  53. 53 0
      tenant/organization/src/main/java/com/jzg/organization/action/ActionExecutor.java
  54. 29 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/CancelQuoteHandler.java
  55. 28 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/ChangeBsAccountHandler.java
  56. 34 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/ChangePocHandler.java
  57. 62 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/SendNotifyMsgHandler.java
  58. 27 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/SpecifyAgreementHandler.java
  59. 23 0
      tenant/organization/src/main/java/com/jzg/organization/action/service/SupplementaryOrderHandler.java
  60. 11 0
      tenant/organization/src/main/java/com/jzg/organization/client/CostsRuleClient.java
  61. 10 1
      tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java
  62. 18 0
      tenant/organization/src/main/java/com/jzg/organization/client/OrgClient.java
  63. 16 1
      tenant/organization/src/main/java/com/jzg/organization/client/QuoteClient.java
  64. 6 0
      tenant/organization/src/main/java/com/jzg/organization/config/WeComConfig.java
  65. 90 0
      tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementDispatchController.java
  66. 7 0
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  67. 58 0
      tenant/organization/src/main/java/com/jzg/organization/controller/SysAppManageController.java
  68. 1 1
      tenant/organization/src/main/java/com/jzg/organization/controller/WechatCustomerServiceManageController.java
  69. 42 0
      tenant/organization/src/main/java/com/jzg/organization/entity/vo/WechatCustomerCallbackVo.java
  70. 24 0
      tenant/organization/src/main/java/com/jzg/organization/entity/vo/WechatEncryptVo.java
  71. 15 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchActionMapper.java
  72. 15 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchAfterActionMapper.java
  73. 11 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchMapper.java
  74. 12 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchRulesAttrLinkMapper.java
  75. 9 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysAppManageMapper.java
  76. 75 0
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementDispatchService.java
  77. 2 0
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesAttrService.java
  78. 3 1
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesDictLabalService.java
  79. 2 1
      tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java
  80. 15 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysAppManageService.java
  81. 6 3
      tenant/organization/src/main/java/com/jzg/organization/service/WechatCustomerServiceManageService.java
  82. 278 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java
  83. 7 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesAttrServiceImpl.java
  84. 8 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesDictLabalServiceImpl.java
  85. 77 8
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java
  86. 130 5
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  87. 41 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAppManageServiceImpl.java
  88. 4 4
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserServiceImpl.java
  89. 83 57
      tenant/organization/src/main/java/com/jzg/organization/service/impl/WechatCustomerServiceManageServiceImpl.java
  90. 2 0
      tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml
  91. 25 0
      tenant/organization/src/main/resources/mapper/PtlAgreementDispatchActionMapper.xml
  92. 22 0
      tenant/organization/src/main/resources/mapper/PtlAgreementDispatchAfterActionMapper.xml
  93. 6 2
      tenant/organization/src/main/resources/mapper/PtlAgreementMapper.xml
  94. 7 0
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml
  95. 9 3
      tenant/organization/src/main/resources/mapper/SysOrganizationMapper.xml
  96. 2 2
      tenant/organization/src/main/resources/mapper/SysUserJzgInfoBankCardMapper.xml
  97. 1 1
      tenant/organization/src/main/resources/mapper/SysUserJzgInfoMapper.xml

+ 22 - 0
commons/src/main/java/com/jzg/commons/entity/action/base/ActionHandler.java

@@ -0,0 +1,22 @@
+package com.jzg.commons.entity.action.base;
+
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import org.springframework.stereotype.Component;
+
+// 动作处理
+
+@Component
+public interface ActionHandler {
+
+    /**
+    获取动作枚举
+     */
+    ActionEnum getActionEnum();
+
+    /**
+     * 执行动作逻辑
+     * @param params
+     */
+    QuoteVo execute(String orderNo, QuoteVo quoteVo, Object params);
+}

+ 34 - 0
commons/src/main/java/com/jzg/commons/entity/action/enums/ActionEnum.java

@@ -0,0 +1,34 @@
+package com.jzg.commons.entity.action.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum ActionEnum {
+    SPECIFY_AGREEMENT("specify_agreement","指定协议"),
+    CANCEL_QUOTE("cancel_quote","终止报价"),
+    SEND_NOTIFY_MSG("send_notify_msg","发送通知消息"),
+    SUPPLEMENTARY_ORDER ("supplementary_order","补录订单"),
+    CHANGE_POC("change_poc","更换对接人"),
+    CHANGE_BS_ACCOUNT("change_bs_account","更换保司账号")
+    ;
+
+    private final String code;
+
+    private final String desc;
+
+    /**
+     * 根据code 获取动作枚举
+     * @param code
+     * @return
+     */
+    public static ActionEnum getByCode(String code){
+        for (ActionEnum action : ActionEnum.values()) {
+            if (action.getCode().equals(code)) {
+                return action;
+            }
+        }
+        return null;
+    }
+}

+ 40 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatch.java

@@ -0,0 +1,40 @@
+package com.jzg.commons.entity.agreement.dispatch.dto;
+
+import com.jzg.commons.core.base.BaseModel;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.util.idgen.IdGenerate;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Schema(description = "协议调度实体")
+public class PtlAgreementDispatch extends BaseModel {
+
+    @Schema(description = "id")
+    private String id;
+
+    @Schema(description = "保司id")
+    private String companyId;
+
+    @Schema(description = "调度名称")
+    private String dispatchName;
+
+    public PtlAgreementDispatch(PtlAgreementDispatchVo.DispatchVo vo){
+        if (vo.getDispatchId() == null || vo.getDispatchId().isEmpty()) {
+            this.id = IdGenerate.nextId();
+        }
+        this.companyId = vo.getCompanyId();
+        if(vo.getDispatchName() == null || vo.getDispatchName().isEmpty()) {
+            this.dispatchName = "";
+        }else {
+            this.dispatchName = vo.getDispatchName();
+        }
+    }
+
+}

+ 35 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAction.java

@@ -0,0 +1,35 @@
+package com.jzg.commons.entity.agreement.dispatch.dto;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Map;
+
+@Data
+@Schema(description = "协议调度动作实体")
+public class PtlAgreementDispatchAction implements Serializable {
+
+    private static final long serialVersionUID = 1000183859846970741L;
+
+    @Schema(description = "id")
+    private String id;
+
+    @Schema(description = "调度id")
+    private String dispatchId;
+
+    @Schema(description = "动作code")
+    private String actionCode;
+
+    @Schema(description = "动作json")
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private JSONObject actionJson;
+
+    @Schema(description = "动作名称")
+    @TableField(exist = false)
+    private String actionName;
+
+}

+ 37 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchAfterAction.java

@@ -0,0 +1,37 @@
+package com.jzg.commons.entity.agreement.dispatch.dto;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@Schema(description = "协议调度之后动作实体")
+public class PtlAgreementDispatchAfterAction implements Serializable {
+
+    private static final long serialVersionUID = 1000183859846970741L;
+
+    @Schema(description = "id")
+    private String id;
+
+    @Schema(description = "保司id")
+    private String companyId;
+
+    @Schema(description = "动作code")
+    private String actionCode;
+
+    @Schema(description = "动作json")
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private JSONObject actionJson;
+
+    @Schema(description = "系统code")
+    private String systemCode;
+
+    @Schema(description = "动作名称")
+    @TableField(exist = false)
+    private String actionName;
+
+}

+ 57 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatchRulesAttrLink.java

@@ -0,0 +1,57 @@
+package com.jzg.commons.entity.agreement.dispatch.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+@Schema(description = "协议调度规则属性关联实体")
+public class PtlAgreementDispatchRulesAttrLink implements Serializable {
+
+    private static final long serialVersionUID = 1000183859846970741L;
+
+    @Schema(description = "id")
+    private String id;
+
+    @Schema(description = "调度id")
+    private String dispatchId;
+
+    @Schema(description = "规则属性id")
+    private String attrId;
+
+    @Schema(description = "规则code")
+    private String attrCode;
+
+    @Schema(description = "左操作符")
+    private String min;
+
+    @Schema(description = "操作符")
+    private String operator;
+
+    @Schema(description = "右操作符")
+    private String max;
+
+    @TableField(exist = false)
+    private List<String> minArray = new ArrayList<>();
+
+    @Schema(description = "分组")
+    private String section;
+
+    @Schema(description = "操作符描述")
+    @TableField(exist = false)
+    private String operatorDesc;
+
+    @Schema(description = "规则描述")
+    @TableField(exist = false)
+    private List<String> attrDesc;
+
+    @Schema(description = "规则code名称")
+    @TableField(exist = false)
+    private String attrCodeName;
+
+
+}

+ 20 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchQuery.java

@@ -0,0 +1,20 @@
+package com.jzg.commons.entity.agreement.dispatch.vo;
+
+import lombok.Data;
+
+/**
+ * 协议调度查询实体
+ */
+@Data
+public class PtlAgreementDispatchQuery {
+
+    /**
+     * 调度id
+     */
+    private String dispatchId;
+
+    /**
+     * 保险公司id
+     */
+    private String companyId;
+}

+ 87 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/PtlAgreementDispatchVo.java

@@ -0,0 +1,87 @@
+package com.jzg.commons.entity.agreement.dispatch.vo;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+@Data
+@Schema(description = "协议调度VO")
+public class PtlAgreementDispatchVo {
+
+    /**
+     * 调度信息
+     */
+    private List<DispatchVo> dispatchVos;
+
+    /**
+     * 报价之后的动作列表
+     */
+    private List<PtlAgreementDispatchAfterAction> afterActions;
+
+    public PtlAgreementDispatchVo(){
+        if(this.dispatchVos == null){
+            this.dispatchVos = new ArrayList<>();
+        }
+        if(this.afterActions == null){
+            this.afterActions = new ArrayList<>();
+        }
+    }
+
+    public PtlAgreementDispatchVo(PtlAgreementDispatch dispatch,List<PtlAgreementDispatchRulesAttrLink> attrLinks,List<PtlAgreementDispatchAction> actions){
+        if(this.dispatchVos == null){
+            this.dispatchVos = new ArrayList<>();
+        }
+        if(this.afterActions == null){
+            this.afterActions = new ArrayList<>();
+        }
+    }
+
+
+    @Data
+    public static class DispatchVo{
+        /**
+         * 调度id
+         */
+        private String dispatchId;
+
+        /**
+         * 保险公司id
+         */
+        private String companyId;
+
+        /**
+         * 调度名称
+         */
+        private String dispatchName;
+
+        /**
+         * 规则列表
+         */
+        private List<PtlAgreementDispatchRulesAttrLink> attrLinks;
+
+        /**
+         * 动作列表
+         */
+        private List<PtlAgreementDispatchAction> actions;
+
+        public DispatchVo(){
+
+        }
+
+        public DispatchVo(PtlAgreementDispatch dispatch,List<PtlAgreementDispatchRulesAttrLink> attrLinks,List<PtlAgreementDispatchAction> actions){
+            this.dispatchId = dispatch.getId();
+            this.companyId = dispatch.getCompanyId();
+            this.dispatchName = dispatch.getDispatchName();
+            this.attrLinks = attrLinks;
+            this.actions = actions;
+        }
+    }
+}

+ 106 - 0
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/vo/ValidateDispatchRuleVo.java

@@ -0,0 +1,106 @@
+package com.jzg.commons.entity.agreement.dispatch.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.po.SysDict;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.scheme.po.PtlSchemeRulesAttrLink;
+import com.jzg.commons.entity.scheme.vo.SchemeRuleFilterVo;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.redisson.api.RList;
+import org.redisson.api.RedissonClient;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import static com.jzg.commons.constants.RedisKeyConstants.DICT_REDIS_KEY;
+
+@AllArgsConstructor
+@Data
+public class ValidateDispatchRuleVo {
+    private QuoteVo quoteVo;
+
+    private List<DispatchAttrVo> dispatchAttrVos;
+
+    @Data
+    public static class DispatchAttrVo {
+
+        /**
+         * 调度id
+         */
+        private String dispatchId;
+
+        /**
+         * 保险公司id
+         */
+        private String companyId;
+
+        /**
+         * 调度名称
+         */
+        private String dispatchName;
+
+        /**
+         * 分组
+         */
+        private List<Section> sections;
+
+        public void setSectionGroups(Map<String, List<PtlAgreementDispatchRulesAttrLink>> grouped){
+            List<Section> nSections = new ArrayList<>();
+            grouped.forEach((key,value)->{
+                Section section = new Section();
+                section.section = key;
+                section.attrLinks = value;
+                nSections.add(section);
+            });
+            this.sections =  nSections;
+        }
+
+    }
+
+    @Data
+    public static class Section{
+        /**
+         * 分组
+         */
+        private String section;
+        /**
+         * 规则列表
+         */
+        private List<PtlAgreementDispatchRulesAttrLink> attrLinks;
+    }
+
+    public void builderQuoteVo(SchemeRuleFilterVo schemeRuleFilterVo, RedissonClient redissonClient){
+        if(Objects.isNull(quoteVo)){
+            quoteVo = new QuoteVo();
+        }
+        this.quoteVo.setCarInfoVo(schemeRuleFilterVo.getCarInfo());
+        this.quoteVo.setOwnersInfo(schemeRuleFilterVo.getOwnerInfo());
+        this.quoteVo.setPolicyHolderInfo(schemeRuleFilterVo.getApplyInfo());
+        this.quoteVo.setInsuredPersonInfo(schemeRuleFilterVo.getInsureInfo());
+
+        //转换字典value转成label
+        //车辆性质
+        RList<SysDict> carNatureCode = redissonClient.getList(DICT_REDIS_KEY + "car_nature_code");
+        this.quoteVo.getCarInfoVo().setCarNatureCode(
+                carNatureCode.stream().filter(x -> x.getValue().equals(this.quoteVo.getCarInfoVo().getCarNatureCode())).findFirst().get().getValue());
+        //能源类型
+        RList<SysDict> energyTypeCode = redissonClient.getList(DICT_REDIS_KEY + "energy_type_code");
+        this.quoteVo.getCarInfoVo().setEnergyTypeCode(
+                energyTypeCode.stream().filter(x->x.getValue().equals(this.quoteVo.getCarInfoVo().getEnergyTypeCode())).findFirst().get().getValue()
+        );
+
+        RList<SysDict> vehicleUseCode = redissonClient.getList(DICT_REDIS_KEY + "car_kind_code");
+        this.quoteVo.getCarInfoVo().setCarKindCode(
+                vehicleUseCode.stream().filter(x->x.getValue().equals(this.quoteVo.getCarInfoVo().getCarKindCode())).findFirst().get().getValue()
+        );
+    }
+
+    public ValidateDispatchRuleVo(){
+        this.dispatchAttrVos = new ArrayList<>();
+    }
+}

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/dto/OrderAdjustParam.java

@@ -36,4 +36,7 @@ public class OrderAdjustParam extends PageRequest {
     @Schema(description = "批改结束时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime endDate;
+
+    @Schema(description = "录入状态 1 车险录入 2 待客录单 3 外部订单")
+    private Integer entryStatus;
 }

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostEnd.java

@@ -119,6 +119,9 @@ public class PtlAgreementCostEnd {
         @Schema(description = "加投比例")
         private BigDecimal addThrow;
 
+        @Schema(description = "留点比例")
+        private BigDecimal keepPointRatio;
+
     }
 
 }

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrders.java

@@ -98,4 +98,10 @@ public class InsOrders extends BaseModel {
     @Schema(description = "报价失败信息")
     private String errorMessage;
 
+    @Schema(description = "对接人姓名")
+    private String dockingPerson;
+
+    @Schema(description = "对接人电话")
+    private String dockingPersonPhone;
+
 }

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrdersOther.java

@@ -66,6 +66,12 @@ public class InsOrdersOther {
     @Schema(description = "阳光交商合并经营成本率")
     private String mergeCostRate;
 
+    @Schema(description = "阳光 向阳花评分")
+    private String xyhGrade;
+
+    @Schema(description = "阳光 红黄蓝车系")
+    private String seriesTypeActualName;
+
     @Schema(description = "商业险是否有费用")
     private String ciMessage;
 

+ 25 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysAppManage.java

@@ -0,0 +1,25 @@
+package com.jzg.commons.entity.po;
+
+
+import com.jzg.commons.core.base.BaseModel;
+import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class SysAppManage extends BaseModel {
+
+    private String id;
+
+    @NotBlank(message = "应用名称不能为空")
+    private String appName;
+
+    private String appIcon;
+
+    @NotBlank(message = "应用ID不能为空")
+    private String appId;
+
+    private String description;
+
+    private String systemCode;
+
+}

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfo.java

@@ -300,6 +300,10 @@ public class SysUserJzgInfo extends BaseModel implements Serializable {
     @Schema(description = "角色名称集合")
     private List<String> roleIds;
 
+    @TableField(exist = false)
+    @Schema(description = "角色名称集合")
+    private List<String> roleNames;
+
     @TableField(exist = false)
     @Schema(description = "密码")
     private String password;

+ 8 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysVersion.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.po;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.jzg.commons.core.base.BaseModel;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 /**
@@ -22,16 +24,22 @@ public class SysVersion extends BaseModel {
 
     private String content;
 
+    @Schema(description = "0-不提示更新;1强制更新,2强提示更新,3弱提示更新")
     private String appType;
 
     private String platform;
 
     private String version;
 
+    private String path;
+
+    @TableField(exist = false)
     private String downloadUrl;
 
     private String updateFlag;
 
     private String issueFlag;
 
+    private byte  packageType;
+
 }

+ 11 - 1
commons/src/main/java/com/jzg/commons/entity/quote/vo/QuoteVo.java

@@ -3,6 +3,7 @@ package com.jzg.commons.entity.quote.vo;
 
 import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
 import com.jzg.commons.entity.po.InsCompanyClause;
+import com.jzg.commons.entity.scheme.vo.SchemeRuleFilterVo;
 import com.jzg.commons.entity.vo.CompanyClauseVo;
 import com.jzg.commons.entity.vo.InsOrdersOtherInfoVo;
 import com.jzg.commons.util.IDCardUtils;
@@ -180,5 +181,14 @@ public class QuoteVo implements Serializable {
         return List.of(this.ownersInfo, this.insuredPersonInfo, this.policyHolderInfo);
     }
 
-
+    public SchemeRuleFilterVo toSchemeRuleFilterVo(){
+        SchemeRuleFilterVo vo = new SchemeRuleFilterVo();
+        vo.setCarInfo(this.carInfoVo);
+        vo.setApplyInfo(this.policyHolderInfo);
+        vo.setInsureInfo(this.insuredPersonInfo);
+        vo.setOwnerInfo(this.ownersInfo);
+        vo.setProductId(this.order.getProductId());
+        vo.setUserId(this.order.getRealQuoteUserId());
+        return vo;
+    }
 }

+ 20 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteResultsVo.java

@@ -163,6 +163,26 @@ public class QuoteResultsVo implements Serializable {
          * 商业出险次数
          */
         private String biClaims;
+        /**
+         * 交强转续保
+         */
+        private String jqRenewal;
+        /**
+         * 商业转续保
+         */
+        private String syRenewal;
+        /**
+         * 阳光 交商合并经营成本率
+         */
+        private String mergeCostRate;
+        /**
+         * 阳光 向阳花评分
+         */
+        private String xyhGrade;
+        /**
+         * 阳光 红黄蓝车系
+         */
+        private String seriesTypeActualName;
 
     }
 

+ 10 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/base/OrderBase.java

@@ -75,6 +75,16 @@ public class OrderBase implements Serializable {
      */
     private String agreementId;
 
+    /**
+     * 判断是否是调度
+     */
+    private String isDispatch;
+
+    /**
+     * 调度id
+     */
+    private String dispatchId;
+
     /**
      * 获取保险公司编码
      */

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/po/PtlSchemeRulesAttrLink.java

@@ -33,6 +33,12 @@ public class PtlSchemeRulesAttrLink extends BaseModel {
 
     @TableField(exist = false)
     private List<String> minArray = new ArrayList<>();
+
+    /**
+     * 调度进行分组 加或的条件
+     */
+    @TableField(exist = false)
+    private String group;
 }
 
 

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlAgreementInsCompanyVo.java

@@ -24,6 +24,12 @@ public class PtlAgreementInsCompanyVo extends EsmInsCompany implements Serializa
 //    @Schema(description = "税源协议id")
 //    private String TaxSourceAgreementId;
 
+    @Schema(description = "是否调度")
+    private Integer isDispatch;
+
+    @Schema(description = "调度id")
+    private String dispatchId;
+
     @Schema(description = "协议信息")
     private List<PtlAgreement> agreement;
 

+ 11 - 8
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -134,24 +134,27 @@ public class PtlSchemeSaveVo {
             }
         });
 
-        ptlScheme.setCarnature(
-                collect.stream()
+        String carNatureCode = collect.stream()
                 .filter(x -> "CarNatureCode".equals(x.getAttrCode()))
                 .findFirst()
                 .map(x -> x.getDictLabal().stream()
-                        .filter(label -> Arrays.asList(x.getMinArray()).contains(label.getName()))
+                        .filter(label -> Arrays.asList(x.getMinArray()).contains(label.getCode()))
                         .map(label -> label.getCode())
                         .collect(Collectors.joining(",")))
-                .orElse(""));
-        ptlScheme.setVehicleType(
-                collect.stream()
+                .orElse("");
+
+        ptlScheme.setCarnature(carNatureCode);
+
+        String carKindCode = collect.stream()
                 .filter(x -> "CarKindCode".equals(x.getAttrCode()))
                 .findFirst()
                 .map(x -> x.getDictLabal().stream()
-                        .filter(label -> Arrays.asList(x.getMinArray()).contains(label.getName()))
+                        .filter(label -> Arrays.asList(x.getMinArray()).contains(label.getCode()))
                         .map(label -> label.getCode())
                         .collect(Collectors.joining(",")))
-                .orElse(""));
+                .orElse("");
+        ptlScheme.setVehicleType(carKindCode);
+
         ptlScheme.setRuleDesc(buildDesc(this.getRuleAttrs(), undwrtRulesAttrList));
 
         return ptlScheme;

+ 8 - 0
commons/src/main/java/com/jzg/commons/entity/vo/AgreementVo.java

@@ -44,6 +44,10 @@ public class AgreementVo extends BaseModel {
     @Schema(description = "关联-保险公司id")
     private String companyId;
 
+    /** 合作-保险公司id */
+    @Schema(description = "合作-保险公司id")
+    private String partnerCompanyId;
+
     /** 协议起期 */
     @Schema(description = "协议起期")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -162,6 +166,10 @@ public class AgreementVo extends BaseModel {
     @Schema(description = "关联-保险公司简称")
     private String company;
 
+    /** 关联-保险公司简称 */
+    @Schema(description = "关联-保险公司简称")
+    private String partnerCompanyName;
+
     @Schema(description = "交强入口手续费比例")
     private BigDecimal jqEntranceFeeRatio;
 

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/vo/SysAppManageVo.java

@@ -0,0 +1,9 @@
+package com.jzg.commons.entity.vo;
+
+
+import com.jzg.commons.core.base.PageRequest;
+import lombok.Data;
+
+@Data
+public class SysAppManageVo extends PageRequest {
+}

+ 10 - 0
gateway/src/main/java/com/jzg/GateWayApplication.java

@@ -1,16 +1,26 @@
 package com.jzg;
 
+import com.jzg.factory.MultiPathRoutePredicateFactory;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.context.annotation.Bean;
 
 @EnableDiscoveryClient
 @SpringBootApplication(exclude ={DataSourceAutoConfiguration.class},scanBasePackages = "com.jzg")
 public class GateWayApplication {
 
+
+
+
     public static void main(String[] args) {
         SpringApplication.run(GateWayApplication.class, args);
     }
 
+
+    @Bean
+    public MultiPathRoutePredicateFactory multiPathPredicateFactory() {
+        return new MultiPathRoutePredicateFactory();
+    }
 }

+ 37 - 0
gateway/src/main/java/com/jzg/factory/MultiPathRoutePredicateFactory.java

@@ -0,0 +1,37 @@
+package com.jzg.factory;
+import lombok.Getter;
+import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.function.Predicate;
+
+@Component
+public class MultiPathRoutePredicateFactory extends AbstractRoutePredicateFactory<MultiPathRoutePredicateFactory.Config> {
+    private final AntPathMatcher antPathMatcher = new AntPathMatcher();
+
+    public MultiPathRoutePredicateFactory() {
+        super(Config.class);
+    }
+
+    @Getter
+    public static class Config {
+        private List<String> paths;
+
+        public void setPaths(List<String> paths) {
+            this.paths = paths;
+        }
+    }
+
+    @Override
+    public Predicate<ServerWebExchange> apply(Config config) {
+        return exchange -> {
+            String path = exchange.getRequest().getURI().getPath();
+            boolean match = config.getPaths().stream()
+                    .anyMatch(pattern -> antPathMatcher.match(pattern, path));
+            return match;
+        };
+    }
+}

+ 77 - 8
gateway/src/main/resources/application-dev.yml

@@ -13,40 +13,109 @@ spring:
         import-check:
           enabled: false
         file-extension: yaml
-        namespace: 1096345e-2a2d-4307-8025-ee1b669e127b
+        namespace: ba488f58-c785-49b4-9c02-b5d9b8a965a5
         group: DEFAULT_GROUP
       discovery:
-        namespace: 1096345e-2a2d-4307-8025-ee1b669e127b
+        namespace: ba488f58-c785-49b4-9c02-b5d9b8a965a5
 
     gateway:
       routes:
         - id: auth_route
           uri: http://localhost:8081/
           predicates:
-            - Path=/auth/**,/send/sendSmsCode,/appAuth/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /auth/**
+                  - /send/sendSmsCode
+                  - /appAuth/**
 
         - id: platform_route
           uri: http://localhost:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/attribution/**,/manager/attributionTemplate/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /userRole/**
+                  - /system/**
+                  - /file/**
+                  - /user/**
+                  - /esmInsCompany/**
+                  - /jyxConfig/**
+                  - /qrBarcode/**
+                  - /sysDept/**
+                  - /manager/**
 
         - id: tenant_route
           uri: http://localhost:8084/
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/agreement/**,/pltAgreement/**,/agreementRules/**,/plt/areaLicense/**,/scheme/**,/schemeRules/**,/schemeRulesAttrLink/**,/schemeRulesAttr/**,/schemeRulesDictLable/**,/schemeRulesUndwrt/**,/schemeRulesUndwrtAttrLink/**,/schemeRulesUndwrtAttr/**,/schemeRulesUndwrtDictLable/**,/schemeRulesUndwrtRules/**,/schemeRulesUndwrtRulesAttrLink/**,/schemeRules,/ptlAgreementCost/**,/ptlAgreementCost/**,/ptlAgreementCostExternal/**,/operatorTrajectory/**,/messageTemplate/**,/message/**,/appUser/**,/userBankCard/**,/accountCard/**,/account/**,/amountAuditing/**,/userAccount/**,/receivable/**,/sysDistributionSetting/**,/organization/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /tenant/**
+                  - /dept/**
+                  - /area/**
+                  - /dict/**
+                  - /userInfo/**
+                  - /sysOrganization/**
+                  - /activity/**
+                  - /message/**
+                  - /messageNotice/**
+                  - /poster/**
+                  - /agreement/**
+                  - /pltAgreement/**
+                  - /agreementRules/**
+                  - /plt/areaLicense/**
+                  - /scheme/**
+                  - /schemeRules/**
+                  - /schemeRulesAttrLink/**
+                  - /schemeRulesAttr/**
+                  - /schemeRulesDictLable/**
+                  - /schemeRulesUndwrt/**
+                  - /schemeRulesUndwrtAttrLink/**
+                  - /schemeRulesUndwrtAttr/**
+                  - /schemeRulesUndwrtDictLable/**
+                  - /schemeRulesUndwrtRules/**
+                  - /schemeRulesUndwrtRulesAttrLink/**
+                  - /schemeRules/**
+                  - /ptlAgreementCost/**
+                  - /ptlAgreementCostExternal/**
+                  - /operatorTrajectory/**
+                  - /messageTemplate/**
+                  - /appUser/**
+                  - /userBankCard/**
+                  - /receivable/**
+                  - /ptlAgreementDispatch/**
 
         - id: summary_route
           uri: http://localhost:9898/
           predicates:
-            - Path= /order/identify/** ,/supplementOrder/**,/order/carModel/**,/unify/**,/order/taskImages/**,/order/qrCode/**,/orderTrack/**,/feeAudit/**,/adjust/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /order/identify/**
+                  - /supplementOrder/**
+                  - /order/carModel/**
+                  - /unify/**
+                  - /order/taskImages/**
+                  - /order/qrCode/**
+                  - /orderTrack/**
+                  - /feeAudit/**
+                  - /adjust/**
 
         - id: costsorrule_route
           uri: http://localhost:8085/
           predicates:
-            - Path=/validate/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /validate/**
 
         #控制台添加网关
         - id: console_route
           uri: http://localhost:8086/
           predicates:
-            - Path=/console/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /console/**

+ 80 - 12
gateway/src/main/resources/application-test.yml

@@ -1,7 +1,12 @@
 spring:
+  minio:
+    url: http://192.168.0.250:9000
+    access-key: v7Zb8XhyLcYNcSHlxvyK
+    secret-key: 58YibMwpxGKtXcekPL065OM4GonC1hf2tFMjI9EN
+    bucket-name: jzg
   cloud:
     nacos:
-      server-addr: 172.24.144.223:8848
+      server-addr: 192.168.0.250:8848
       username: nacos
       password: nacos
       config:
@@ -16,23 +21,86 @@ spring:
     gateway:
       routes:
         - id: auth_route
-          uri: http://172.24.144.223:9081/
+          uri: http://192.168.0.250:8081/
           predicates:
-            - Path=/auth/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /auth/**
+                  - /send/sendSmsCode
+                  - /appAuth/**
 
         - id: platform_route
-          uri: http://172.24.144.223:9083/
+          uri: http://192.168.0.250:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/**,
+            - name: MultiPath
+              args:
+                paths:
+                - /userRole/**
+                - /system/**
+                - /file/**
+                - /user/**
+                - /esmInsCompany/**
+                - /jyxConfig/**
+                - /qrBarcode/**
+                - /sysDept/**
+                - /manager/**
 
         - id: tenant_route
-          uri: http://172.24.144.223:9084/
+          uri: http://192.168.0.250:8084/
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,,/pltAgreement/**,/agreementRules/**,/poster/**,/agreement/**,/ptl/areaLicense/**,/ptlAgreementCost/**,/scheme/**,/ptlAgreementCostExternal/**,/plt/areaLicense/**
-        #数据报表
-        - id: console_route
-          uri: http://172.24.144.223:9085/
-          predicates:
-            - Path=/console/**
+            - name: MultiPath
+              args:
+                paths:
+                  - /tenant/**
+                  - /dept/**
+                  - /area/**
+                  - /dict/**
+                  - /userInfo/**
+                  - /sysOrganization/**
+                  - /activity/**
+                  - /message/**
+                  - /messageNotice/**
+                  - /poster/**
+                  - /agreement/**
+                  - /pltAgreement/**
+                  - /agreementRules/**
+                  - /plt/areaLicense/**
+                  - /scheme/**
+                  - /schemeRules/**
+                  - /schemeRulesAttrLink/**
+                  - /schemeRulesAttr/**
+                  - /schemeRulesDictLable/**
+                  - /schemeRulesUndwrt/**
+                  - /schemeRulesUndwrtAttrLink/**
+                  - /schemeRulesUndwrtAttr/**
+                  - /schemeRulesUndwrtDictLable/**
+                  - /schemeRulesUndwrtRules/**
+                  - /schemeRulesUndwrtRulesAttrLink/**
+                  - /schemeRules,/ptlAgreementCost/**
+                  - /ptlAgreementCost/**
+                  - /ptlAgreementCostExternal/**
+                  - /operatorTrajectory/**
+                  - /messageTemplate/**
+                  - /message/**
 
+        - id: summary_route
+          uri: http://192.168.0.250:9898/
+          predicates:
+            - name: MultiPath
+              args:
+                paths:
+                  - /order/identify/**
+                  - /supplementOrder/**
+                  - /order/carModel/**
+                  - /unify/**
+                  - /order/taskImages/**
+                  - /order/qrCode/**
 
+        - id: costsorrule_route
+          uri: http://192.168.0.250:8085/
+          predicates:
+            - name: MultiPath
+              args:
+                paths:
+                  - /validate/**

+ 11 - 0
platform/src/main/java/com/jzg/mapper/SysUserJzgInfoSalesmanMapper.java

@@ -0,0 +1,11 @@
+package com.jzg.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.po.SysUserJzgInfo;
+import com.jzg.commons.entity.po.SysUserJzgInfoSalesman;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SysUserJzgInfoSalesmanMapper extends BaseMapper<SysUserJzgInfoSalesman> {
+
+}

+ 13 - 1
platform/src/main/java/com/jzg/service/impl/SysSystemServiceImpl.java

@@ -24,6 +24,7 @@ import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.StringUtils;
+import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.mapper.*;
 import com.jzg.service.PtlAgreementService;
 import com.jzg.service.SysSystemService;
@@ -79,6 +80,9 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
     @Autowired
     private BaseController baseController;
 
+    @Autowired
+    private SysUserJzgInfoSalesmanMapper sysUserJzgInfoSalesmanMapper;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     @IgnoreTenant
@@ -239,7 +243,7 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
                 }
                 if(deptMap.containsKey(sysSystem.getSysCode())){
                     int count = deptMap.get(sysSystem.getSysCode()).size();
-                    sysSystem.setDeptCount(count);
+                    sysSystem.setDeptCount(count - 1); // 不包含租户本身
                 }else{
                     sysSystem.setDeptCount(0);
                 }
@@ -336,6 +340,14 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
         // 新增用户机构关联信息
         SysUserJzgInfo info = new SysUserJzgInfo(param.getUserName(),user, sysSystem.getSysCode(),sysDept.getId());
         sysUserJzgInfoMapper.insert(info);
+
+        // 新加用户属性表
+        SysUserJzgInfoSalesman salesman = new SysUserJzgInfoSalesman();
+        salesman.setId(IdGenerate.nextId());
+        salesman.setSysUserJzgInfoId(info.getId());
+        salesman.setTypeAttr("2");
+        sysUserJzgInfoSalesmanMapper.insert(salesman);
+
         // 查询该租户是否有管理员角色
         LambdaQueryWrapper<SysRole> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysRole::getSystemCode, sysSystem.getSysCode())

+ 17 - 14
platform/src/main/java/com/jzg/service/impl/UserRoleServiceImpl.java

@@ -115,23 +115,26 @@ public class UserRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
         });
         SysRoleDataScope sysRoleDataScope = new SysRoleDataScope();
         sysRoleDataScope.setRoleId(sysRole.getId());
-        sysRoleDataScope.setDataMark(sysRoleVo.getDataScope().getDataMark());
-        sysRoleDataScopeMapper.insert(sysRoleDataScope);
-        if (sysRoleVo.getDataScope().getDataMark().equals("2") || sysRoleVo.getDataScope().getDataMark().equals("1")) {
-            List<SysRoleDataScopeLink> sysRoleDataScopeLinks = new ArrayList<>();
-            if (!Objects.isNull(sysRoleVo.getDataScope().getDeptIds())) {
-                if (!sysRoleVo.getDataScope().getDeptIds().isEmpty()) {
-                    sysRoleVo.getDataScope().getDeptIds().forEach(item -> {
-                        SysRoleDataScopeLink sysRoleDataScopeLink = new SysRoleDataScopeLink();
-                        sysRoleDataScopeLink.setId(IdGenerate.nextId());
-                        sysRoleDataScopeLink.setRoleId(sysRole.getId());
-                        sysRoleDataScopeLink.setDeptId(item);
-                        sysRoleDataScopeLinks.add(sysRoleDataScopeLink);
-                    });
+        if(Objects.nonNull(sysRoleVo.getDataScope())) {
+            sysRoleDataScope.setDataMark(sysRoleVo.getDataScope().getDataMark());
+            sysRoleDataScopeMapper.insert(sysRoleDataScope);
+            if (sysRoleVo.getDataScope().getDataMark().equals("2") || sysRoleVo.getDataScope().getDataMark().equals("1")) {
+                List<SysRoleDataScopeLink> sysRoleDataScopeLinks = new ArrayList<>();
+                if (!Objects.isNull(sysRoleVo.getDataScope().getDeptIds())) {
+                    if (!sysRoleVo.getDataScope().getDeptIds().isEmpty()) {
+                        sysRoleVo.getDataScope().getDeptIds().forEach(item -> {
+                            SysRoleDataScopeLink sysRoleDataScopeLink = new SysRoleDataScopeLink();
+                            sysRoleDataScopeLink.setId(IdGenerate.nextId());
+                            sysRoleDataScopeLink.setRoleId(sysRole.getId());
+                            sysRoleDataScopeLink.setDeptId(item);
+                            sysRoleDataScopeLinks.add(sysRoleDataScopeLink);
+                        });
+                    }
                 }
+                sysRoleDataScopeLinkMapper.insert(sysRoleDataScopeLinks);
             }
-            sysRoleDataScopeLinkMapper.insert(sysRoleDataScopeLinks);
         }
+
         if(sysRolePermsMapper.insert(sysRolePermsList).stream().count() > 0 && baseMapper.insert(sysRole) > 0){
             return true;
         }

+ 1 - 0
platform/src/main/resources/mapper/PtlAgreementAttributionMapper.xml

@@ -34,6 +34,7 @@
         <if test="ptlAgreementAttributionQueryVo.username != null and ptlAgreementAttributionQueryVo.username != ''">
             and paa.username like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
             or paa.user_abbr like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
+            or eic.name_simple like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
         </if>
         <if test="ptlAgreementAttributionQueryVo.quoteStatus != null and ptlAgreementAttributionQueryVo.quoteStatus != ''">
             and paa.quote_status = #{ptlAgreementAttributionQueryVo.quoteStatus}

+ 1 - 1
platform/src/main/resources/mapper/PtlAgreementUrlMapper.xml

@@ -18,7 +18,7 @@
             and pau.company_id = #{ptlAgreementUrlVo.companyId}
         </if>
         <if test="ptlAgreementUrlVo.name != null and ptlAgreementUrlVo.name != ''">
-            and pau.name = #{ptlAgreementUrlVo.name}
+            and pau.name like concat('%',#{ptlAgreementUrlVo.name},'%')
         </if>
     </select>
 </mapper>

+ 46 - 1
tenant/costsorrule/src/main/java/com/jzg/costsorrule/controller/RuleController.java

@@ -1,9 +1,13 @@
 package com.jzg.costsorrule.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.scheme.po.PtlSchemeRulesAttrLink;
 import com.jzg.costsorrule.mapper.PtlAgreementUndwrtRulesAttrMapper;
@@ -39,7 +43,11 @@ public class RuleController extends BaseController {
     @Autowired
     private PtlAgreementUndwrtRulesAttrMapper ptlAgreementUndwrtRulesAttrMapper;
 
-
+    /**
+     * 校验方案规则
+     * @param validateSchemeRuleVo
+     * @return
+     */
     @PostMapping(value = "/validateSchemeRule")
     public HttpResult validateSchemeRule(@RequestBody ValidateSchemeRuleVo validateSchemeRuleVo){
         Map<String, List<PtlSchemeRulesAttrLink>> maps = validateSchemeRuleVo.getAttrLinks().stream().collect(Collectors.groupingBy(PtlSchemeRulesAttrLink::getSchemeId));
@@ -65,4 +73,41 @@ public class RuleController extends BaseController {
 
         return HttpResult.ok(schemeIds);
     }
+
+    /**
+     * 校验调度规则
+     * @param
+     * @return
+     */
+    @PostMapping(value = "/validateDispatchRule")
+    public HttpResult validateSchemeRule(@RequestBody ValidateDispatchRuleVo validateDispatchRuleVo){
+        Map<String, List<PtlAgreementDispatchRulesAttrLink>> maps = new HashMap<>();
+        for (ValidateDispatchRuleVo.DispatchAttrVo dispatchAttrVo : validateDispatchRuleVo.getDispatchAttrVos()){
+            for (ValidateDispatchRuleVo.Section section : dispatchAttrVo.getSections()) {
+                maps.put(dispatchAttrVo.getDispatchId() + "-" + section.getSection(), section.getAttrLinks());
+            }
+        }
+        HashMap<String,String> attrMap = new HashMap<>();
+
+        //将传入的对象转换成Map对象用于校验因子
+        ruleService.traverseJsonObject(JSON.parseObject(JSON.toJSONString(validateDispatchRuleVo.getQuoteVo())),attrMap);
+        List<PtlAgreementUndwrtRulesAttr> rulesAttrs = ptlAgreementUndwrtRulesAttrMapper.selectList(new LambdaQueryWrapper<>());
+
+        //转换对象 将List<PtlSchemeRulesAttrLink>转换为List<RuleAttrLinkVo>
+        Map<String, List<RuleAttrLinkVo>> converMaps = ruleService.convertDispatchRule(maps);
+
+        //规则过滤 获取满足规则的方案id
+        List<String> dispatchIds = new ArrayList<>();
+        StringBuilder logs = new StringBuilder();
+        for (Map.Entry<String, List<RuleAttrLinkVo>> entry : converMaps.entrySet()) {
+            String key = entry.getKey();
+            List<RuleAttrLinkVo> vos = entry.getValue();
+            if(ruleService.verificationRule(attrMap,vos,rulesAttrs,logs)){
+                String[] keys = key.split("-");
+                dispatchIds.add(keys[0]);
+            }
+        }
+
+        return HttpResult.ok(dispatchIds);
+    }
 }

+ 9 - 0
tenant/costsorrule/src/main/java/com/jzg/costsorrule/service/RuleService.java

@@ -1,6 +1,8 @@
 package com.jzg.costsorrule.service;
 
 import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.scheme.po.PtlSchemeRulesAttrLink;
 import com.jzg.costsorrule.model.RuleAttrLinkVo;
@@ -34,4 +36,11 @@ public interface RuleService {
      * @return
      */
     public Map<String, List<RuleAttrLinkVo>> convertSchemeRule(Map<String, List<PtlSchemeRulesAttrLink>> schemeRules);
+
+    /**
+     * 将调度规则转换成通用规则实体
+     * @param dispatchRules
+     * @return
+     */
+    public Map<String, List<RuleAttrLinkVo>> convertDispatchRule(Map<String, List<PtlAgreementDispatchRulesAttrLink>> dispatchRules);
 }

+ 35 - 9
tenant/costsorrule/src/main/java/com/jzg/costsorrule/service/impl/RuleServiceImpl.java

@@ -2,6 +2,8 @@ package com.jzg.costsorrule.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.scheme.po.PtlSchemeRulesAttrLink;
 import com.jzg.costsorrule.constants.AttrTypeConstant;
@@ -62,15 +64,17 @@ public class RuleServiceImpl implements RuleService {
 //            logs.append("费用id:" + agreementProductCosts.get(i).getId() + "\n");
 //            logs.append("费用因子描述:" + agreementProductCosts.get(i).getCostsDescription() + "\n");
 //            String attrCode = linkVos.get(i).getAttrCode();
-            String attrValue = maps.get(linkVos.get(i).getAttrCode().toLowerCase());
-            int finalI = i;
-            PtlAgreementUndwrtRulesAttr rulesAttr = rulesAttrs.stream().filter(value -> value.getAttrCode().toLowerCase().equals(linkVos.get(finalI).getAttrCode().toLowerCase())).findFirst().orElse(null);
-            if(Objects.isNull(attrValue) || Objects.isNull(rulesAttr)){
-                return false;
-            }
-            if (!judgements(attrValue, linkVos.get(i),rulesAttr, logs)) {
-                //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
-                return false;
+            if(linkVos.get(i).getAttrCode() != null) {
+                String attrValue = maps.get(linkVos.get(i).getAttrCode().toLowerCase());
+                int finalI = i;
+                PtlAgreementUndwrtRulesAttr rulesAttr = rulesAttrs.stream().filter(value -> value.getAttrCode().toLowerCase().equals(linkVos.get(finalI).getAttrCode().toLowerCase())).findFirst().orElse(null);
+                if (Objects.isNull(attrValue) || Objects.isNull(rulesAttr)) {
+                    return false;
+                }
+                if (!judgements(attrValue, linkVos.get(i), rulesAttr, logs)) {
+                    //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
+                    return false;
+                }
             }
 //            log.debug("当前费用因子匹配结束\n");
         }
@@ -372,4 +376,26 @@ public class RuleServiceImpl implements RuleService {
         }
         return convertMaps;
     }
+
+    @Override
+    public Map<String, List<RuleAttrLinkVo>> convertDispatchRule(Map<String, List<PtlAgreementDispatchRulesAttrLink>> dispatchRules) {
+        Map<String, List<RuleAttrLinkVo>> convertMaps = new HashMap<>();
+        for (Map.Entry<String, List<PtlAgreementDispatchRulesAttrLink>> entry : dispatchRules.entrySet()) {
+            String key = entry.getKey();
+            List<RuleAttrLinkVo> vos = new ArrayList<>();
+            List<PtlAgreementDispatchRulesAttrLink> values = entry.getValue();
+
+            values.forEach(value->{
+                RuleAttrLinkVo vo = new RuleAttrLinkVo();
+                vo.setMin(value.getMin());
+                vo.setMax(value.getMax());
+                vo.setAttrCode(value.getAttrCode());
+                vo.setOperator(value.getOperator());
+                vo.setMinArray(value.getMinArray().toArray(new String[0]));
+                vos.add(vo);
+            });
+            convertMaps.put(key,vos);
+        }
+        return convertMaps;
+    }
 }

+ 29 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java

@@ -1,15 +1,20 @@
 package com.jzg.quotation.commons.client;
 
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
 import com.jzg.commons.entity.dto.CostAgreementParam;
 import com.jzg.commons.entity.dto.MessageAddParam;
 import com.jzg.commons.entity.enums.MessageCodeEnum;
+import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.*;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.vo.*;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 @FeignClient(name="jzg-organization",url = "http://localhost:8084/")
 public interface OrgClient {
@@ -117,8 +122,31 @@ public interface OrgClient {
      * 获取租户用户
      */
     @GetMapping(value = "userInfo/getUserInfo")
-    public HttpResult<SysUserJzgInfo> getUserInfo(String userId);
+    public HttpResult<SysUserJzgInfo> getUserInfo(String id);
 
     @GetMapping(value = "userInfo/getUserInfoById")
     public HttpResult<SysUserJzgInfo> getUserInfoById(String id);
+
+    @PostMapping(value = "receivable/restockInsPlyIncome")
+    public void restockInsPlyIncome(@RequestBody InsOrderAdjust insOrderAdjust);
+
+    /**
+     * 获取调度动作
+     */
+    @PostMapping(value = "/ptlAgreementDispatch/getAgreementDispatchAction")
+    public HttpResult<List<PtlAgreementDispatchVo.DispatchVo>> getAgreementDispatchAction(List<String> dispatchIds);
+
+    /**
+     * 获取报价之后的调度动作
+     * @param companyId
+     * @return
+     */
+    @PostMapping(value = "/ptlAgreementDispatch/getAgreementDispatchAfterAction")
+    public HttpResult<List<PtlAgreementDispatchAfterAction>> getAgreementDispatchAfterAction(String companyId);
+
+    /**
+     * 执行调度动作
+     */
+    @PostMapping(value = "executeActions")
+    public HttpResult executeActions(@RequestParam("orderNo") String orderNo,@RequestParam("quoteVo") QuoteVo quoteVo,@RequestParam("actionMap") Map<String, Object> actionMap);
 }

+ 50 - 3
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.summary.aop.aspect;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.quote.enums.quote.CarKindCode;
@@ -7,18 +8,27 @@ import com.jzg.commons.constants.quote.enums.quote.CarNatureCode;
 import com.jzg.commons.constants.quote.enums.quote.EnergyTypeCode;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
 import com.jzg.commons.entity.dto.CostAgreementParam;
 import com.jzg.commons.entity.orders.po.*;
 import com.jzg.commons.entity.po.*;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.vo.*;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.summary.service.*;
 import lombok.RequiredArgsConstructor;
+import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.AfterReturning;
 import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
@@ -62,6 +72,10 @@ public class QuoteVerificationAspect {
 
     private final BaseController baseController;
 
+    @Autowired
+    private RedissonClient redissonClient;
+
+
     @AfterReturning(pointcut = "@annotation(com.jzg.quotation.summary.aop.QuoteVerification)", returning = "result")
     public void doAfter(HttpResult<QuoteResultsVo> result) {
         if (result.getCode() == 200) {
@@ -198,7 +212,6 @@ public class QuoteVerificationAspect {
                 log.debug("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLink.getAttrCode());
                 log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLink.getAttrCode());
 
-
                 List<PtlAgreementUndwrtRulesAttr> collect = undwrtRulesAttrList.stream()
                         .filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLink.getAttrCode()))
                         .toList();
@@ -720,8 +733,6 @@ public class QuoteVerificationAspect {
         // 7. 计算总应收、总应付、保存费用比例 入库
         saveRatio(insFeeOrders, agreementInfoVo, jqCostType, syCostType, jyCostType);
         calculateTotalPremium(insFeeOrders);
-        // 8. 计算分销费用
-        calculateDistributionFee(insOrdersCosts,insFeeOrders, insOrders);
         insFeeOrdersService.save(insFeeOrders);
     }
 
@@ -961,4 +972,40 @@ public class QuoteVerificationAspect {
             }
         }
     }
+
+    @Before("@annotation(com.jzg.quotation.summary.aop.QuoteVerification)")
+    public void doBefore(JoinPoint point) {
+        Object[] args = point.getArgs();
+        for (Object arg : args) {
+            if (arg instanceof QuoteVo) {
+                // 1.根据参数判断是否存在调度信息
+                QuoteVo quoteVo = (QuoteVo)arg;
+                // 判断是否匹配到调度
+                if(quoteVo.getOrder().getIsDispatch() != null && quoteVo.getOrder().getIsDispatch().equals("1")){
+                    // 获取调度动作
+                    String dispatchId = quoteVo.getOrder().getDispatchId();
+                    List<String> dispatchIds = new ArrayList<>();
+                    dispatchIds.add(dispatchId);
+                    HttpResult<List<PtlAgreementDispatchVo.DispatchVo>> agreementDispatchActionResult = orgClient.getAgreementDispatchAction(dispatchIds);
+                    if(agreementDispatchActionResult.getCode() == 200){
+                        Map<String, Object> actionMap = new HashMap<>();
+                        // 处理动作的参数
+                        List<PtlAgreementDispatchVo.DispatchVo> agreementDispatch = agreementDispatchActionResult.getData();
+                        List<PtlAgreementDispatchAction> actions = agreementDispatch.get(0).getActions();
+                        actions.forEach(action->{
+                            ActionEnum byCode = ActionEnum.getByCode(action.getActionCode());
+                            JSONObject actionJson = action.getActionJson();
+                            actionMap.put(byCode.getCode(),actionJson);
+                        });
+                        HttpResult httpResult = orgClient.executeActions(quoteVo.getOrder().getOrdersNo(), quoteVo, actionMap);
+                        if(httpResult.getCode() == 200){
+                            // 拷贝处理处理完动作之后的报价参数
+                            QuoteVo updateQuoteVo = (QuoteVo)httpResult.getData();
+                            BeanUtils.copyProperties(updateQuoteVo, quoteVo);
+                        }
+                    }
+                }
+            }
+        }
+    }
 }

+ 5 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/CarModelController.java

@@ -3,6 +3,7 @@ package com.jzg.quotation.summary.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.vo.CarModelDTO;
+import com.jzg.commons.exception.SystemException;
 import com.jzg.quotation.summary.entity.po.ModelsQueryQueryVo;
 import com.jzg.quotation.summary.service.CarModelService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -45,6 +46,10 @@ public class  CarModelController {
     @PostMapping(value = "/modelsQuery")
     @Operation(description = "车型查询接口")
     public HttpResult<List<CarModelDTO>> modelsQuery(@RequestBody ModelsQueryQueryVo modelsQueryQueryVo) {
+        String filtered = modelsQueryQueryVo.getModelName().replaceAll("[\\u4e00-\\u9fa5]", "");
+        if("".equals(filtered)){
+            throw new SystemException("品牌型号不能为纯中文");
+        }
         List<CarModelDTO> map = carModelService.modelsQuery(modelsQueryQueryVo.getModelName());
         List<CarModelDTO> carModelDTOS =
                 map.stream().sorted(Comparator.comparing(CarModelDTO::getReplacementValue)).collect(Collectors.toList());

+ 7 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java

@@ -121,4 +121,11 @@ public class InsOrdersController {
         return HttpResult.ok(insFeeOrdersService.calcCosts(ptlAgreementCostRatioVo));
     }
 
+    @GetMapping("/changePerson")
+    @Operation(summary = "更改对接人")
+    public HttpResult changePerson(String orderNo,String name,String phone){
+        return insOrdersService.changePerson(orderNo,name,phone) ? HttpResult.ok("更改对接人成功") : HttpResult.error("更改对接人失败");
+    }
+
+
 }

+ 3 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -209,11 +209,13 @@ public class UnifyOrderManager {
     @PostMapping("/quote")
     @QuoteVerification
     public HttpResult<QuoteResultsVo> quote(@RequestBody QuoteVo quoteVo) throws Exception {
-         HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(quoteVo.getOrder()
+        HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(quoteVo.getOrder()
                 .getInsuranceCompanyCode(), baseController.getToken());
         AssertionUtils.isFail(esmInsCompanyHttpResult.getCode() != 200, esmInsCompanyHttpResult.getMsg());
         String systemCode = getSystemCode();
         String companyName = CompanyConstants.getCompanyNameByCode(esmInsCompanyHttpResult.getData().getCompanyCode());
+
+
         //先默认第一个协议
         HttpResult<List<PtlAgreement>> byCompanyId = orgClient.getByCompanyId(esmInsCompanyHttpResult.getData()
                 .getId(), baseController.getToken(), systemCode);

+ 9 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsOrdersService.java

@@ -127,4 +127,13 @@ public interface InsOrdersService extends IService<InsOrders> {
      */
     void orderAfterUpdateOrderStatus(String orderNo, OrderStatusResultVo orderStatusResultVo);
 
+    /**
+     * 更改对接人
+     * @param orderNo
+     * @param name
+     * @param phone
+     * @return
+     */
+    boolean changePerson(String orderNo,String name,String phone);
+
 }

+ 8 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrderAdjustInfoServiceImpl.java

@@ -10,6 +10,7 @@ import com.jzg.commons.entity.vo.AdjustAllRefundVo;
 import com.jzg.commons.entity.vo.OrderAdjustInfoVo;
 import com.jzg.commons.entity.vo.OrderAdjustVo;
 import com.jzg.commons.util.AssertionUtils;
+import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.summary.mapper.InsOrderAdjustInfoMapper;
 import com.jzg.quotation.summary.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +50,10 @@ public class InsOrderAdjustInfoServiceImpl extends ServiceImpl<InsOrderAdjustInf
     @Autowired
     private InsOrdersAccidentalDrivingService ordersAccidentalDrivingService;
 
+    @Autowired
+    private OrgClient orgClient;
+
+
     @Override
     public AdjustAllRefundVo adjustAllRefundGet(String id, String orderNo) {
 
@@ -497,6 +502,9 @@ public class InsOrderAdjustInfoServiceImpl extends ServiceImpl<InsOrderAdjustInf
     public void verifyOrder(VerifyAdjustParam param) {
         InsOrderAdjust insOrderAdjust = orderAdjustService.getById(param.getId());
         AssertionUtils.isFail(insOrderAdjust.getStatus() > 1, "订单已审核,请刷新页面");
+        if(param.getStatus().equals(2)){ // 审核通过
+            orgClient.restockInsPlyIncome(insOrderAdjust);
+        }
         insOrderAdjust.setStatus(param.getStatus());
         insOrderAdjust.setRefuse(param.getRefuse());
         orderAdjustService.updateById(insOrderAdjust);

+ 2 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrderAdjustServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Objects;
 
 /**
 * @author dongxin
@@ -148,7 +149,7 @@ public class InsOrderAdjustServiceImpl extends ServiceImpl<InsOrderAdjustMapper,
             return adjustNew.getId();
         }else{
             InsOrdersCosts costs = ordersCostsService.getById(param.getOrderNo());
-            premium = costs.getSumPremium().subtract(costs.getTaxPremium());
+            premium = costs.getSumPremium().subtract(Objects.isNull(costs.getTaxPremium()) ? new BigDecimal(0) : costs.getTaxPremium());
             InsOrderAdjust adjust = new InsOrderAdjust();
             adjust.setOrderNo(param.getOrderNo());
             adjust.setType(param.getType());

+ 21 - 14
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -5,14 +5,11 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.constants.CompanyConstants;
 import com.jzg.commons.constants.InsuranceRisk;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
@@ -31,8 +28,6 @@ import com.jzg.commons.entity.quote.vo.aggregated.OrderStatusResultVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteEchoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.quote.vo.aggregated.UnderwritingResultsVo;
-import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
-import com.jzg.commons.entity.quote.vo.underwriting.SpecialAppointmentsVo;
 import com.jzg.commons.entity.vo.*;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.MinioUtils;
@@ -45,7 +40,6 @@ import com.jzg.commons.entity.quote.vo.orders.InsOrdersAdd;
 import com.jzg.commons.entity.quote.vo.orders.InsOrdersEnd;
 import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
 import com.jzg.quotation.commons.utils.SnowFlakeUtil;
-import com.jzg.quotation.summary.constants.QuoteNumberConstant;
 import com.jzg.quotation.summary.consumer.template.OrderMessageTemplate;
 import com.jzg.quotation.summary.mapper.*;
 import com.jzg.quotation.summary.service.*;
@@ -106,7 +100,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
     @Autowired
     @Lazy
-    private InsFeeAuditService insFeeAuditService; // ✅ 改为字段注入 + 延迟加载
+    private InsFeeAuditService insFeeAuditService;
 
     @Setter(onMethod_ = @Autowired)
     private OrderMessageTemplate orderMessageTemplate;
@@ -373,13 +367,15 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         // 业务员信息
         SalesmanVo salesmanInfo = orgClient.getUserByMobile(insOrdersVo.getCreateBy(),baseController.getToken(),baseController.getAppSystemCode());
-        InsOrdersVo.Salesman salesman = new InsOrdersVo.Salesman();
-        salesman.setName(salesmanInfo.getName());
-        salesman.setDeptName(salesmanInfo.getDeptName());
-        salesman.setTypeAttr(salesmanInfo.getTypeAttr());
-        salesman.setDeptId(salesmanInfo.getDeptId());
-        salesman.setMobile(salesmanInfo.getMobile());
-        insOrdersVo.setSalesmanInfo(salesman);
+        if(Objects.nonNull(salesmanInfo)) {
+            InsOrdersVo.Salesman salesman = new InsOrdersVo.Salesman();
+            salesman.setName(salesmanInfo.getName());
+            salesman.setDeptName(salesmanInfo.getDeptName());
+            salesman.setTypeAttr(salesmanInfo.getTypeAttr());
+            salesman.setDeptId(salesmanInfo.getDeptId());
+            salesman.setMobile(salesmanInfo.getMobile());
+            insOrdersVo.setSalesmanInfo(salesman);
+        }
         // 2. 处理车辆用户信息列表
         if (CollectionUtil.isNotEmpty(insOrdersVo.getCarUserInfoList())) {
             for (InsOrdersCarUserInfo carUserInfo : insOrdersVo.getCarUserInfoList()) {
@@ -644,6 +640,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 ordersOther.setJqLossRation(new BigDecimal(quoteResponse.getScoreVo().getJqLossRation() != null ? quoteResponse.getScoreVo().getJqLossRation() : "0"));
                 ordersOther.setSyLossRation(new BigDecimal(quoteResponse.getScoreVo().getSyLossRation() != null ? quoteResponse.getScoreVo().getSyLossRation() : "0"));
                 ordersOther.setTpColorScore(quoteResponse.getScoreVo().getTpColorScore() != null ? quoteResponse.getScoreVo().getTpColorScore() : "");
+                ordersOther.setXyhGrade(quoteResponse.getScoreVo().getXyhGrade() != null ? quoteResponse.getScoreVo().getXyhGrade() : "");
+                ordersOther.setSeriesTypeActualName(quoteResponse.getScoreVo().getSeriesTypeActualName() != null ? quoteResponse.getScoreVo().getSeriesTypeActualName() : "");
             }
             insOrdersOtherService.saveOrUpdate(ordersOther);
 
@@ -1078,5 +1076,14 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         this.updateById(insOrders);
     }
 
+    @Override
+    public boolean changePerson(String orderNo, String name, String phone) {
+        InsOrders byId = baseMapper.selectById(Long.parseLong(orderNo));
+        byId.setDockingPerson(name);
+        byId.setDockingPersonPhone(phone);
+        baseMapper.updateById(byId);
+        return false;
+    }
+
 
 }

+ 4 - 0
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrderAdjustMapper.xml

@@ -32,6 +32,7 @@
         select <include refid="Base_Column_List"/>
         FROM ins_order_adjust ioa
         LEFT JOIN sys_user su on ioa.create_by = su.username
+        LEFT JOIN ins_orders io on ioa.order_no = io.id
         <where>
             ioa.is_delete = 0
             <if test="param.orderNo != null and param.orderNo != ''">
@@ -55,6 +56,9 @@
             <if test="param.startDate != null and param.endDate != null">
                 and DATE_FORMAT(ioa.create_time, '%Y-%m-%d') between #{param.startDate} AND #{param.endDate}
             </if>
+            <if test="param.entryStatus != null ">
+                and io.entry_status = #{param.entryStatus}
+            </if>
         </where>
         ORDER BY ioa.create_time DESC
     </select>

+ 26 - 2
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml

@@ -375,7 +375,10 @@
             s.tax_premium,
             o.real_quote_user_id,
             suji.name as real_quote_user_name,
-            sd.name as salesmanCompany
+            sd.name as salesmanCompany,
+            ioa.status as adjustStatus,
+            ioa.id as adjustId,
+            ioa1.after_premium as adjustPremium
         FROM
             ins_orders o
                 LEFT JOIN ins_orders_car_info c ON c.order_no = o.id
@@ -384,7 +387,24 @@
                 LEFT JOIN sys_user_jzg_info suji ON suji.user_id = su.id
                 LEFT JOIN esm_ins_company eic on o.company_id = eic.id
                 left join sys_dept sd on sd.id = suji.dept_id
-
+                left join
+                    (
+                        SELECT *
+                        FROM (
+                        SELECT t.*,
+                        ROW_NUMBER() OVER(PARTITION BY t.order_no ORDER BY t.create_time DESC) AS rn
+                        FROM ins_order_adjust t where t.is_delete = 0
+                    ) x WHERE x.rn = 1
+                    ) ioa ON o.id = ioa.order_no
+                left join
+                    (
+                        SELECT *
+                        FROM (
+                        SELECT t.*,
+                        ROW_NUMBER() OVER(PARTITION BY t.order_no ORDER BY t.create_time DESC) AS rn
+                        FROM ins_order_adjust t where t.status = 2 and t.is_delete = 0
+                    ) x WHERE x.rn = 1
+                    ) ioa1 ON o.id = ioa1.order_no
         <where>
             o.is_delete = 0
             <if test="insOrdersParam.orderNo != null and insOrdersParam.orderNo != ''">
@@ -405,6 +425,10 @@
             <if test="insOrdersParam.auditStatus != null and insOrdersParam.auditStatus != ''">
                 AND o.audit_status = #{insOrdersParam.auditStatus}
             </if>
+
+            <if test="insOrdersParam.adjustStatus!= null and insOrdersParam.adjustStatus!= ''">
+                AND ioa.status = #{insOrdersParam.adjustStatus}
+            </if>
 <!--            <if test="insOrdersParam.recordingTime != null and insOrdersParam.recordingTime.size() > 0">-->
 <!--                AND o.create_time BETWEEN #{insOrdersParam.recordingTime[0]} AND #{insOrdersParam.recordingTime[1]}-->
 <!--            </if>-->

+ 31 - 2
tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/build/YangGuangApiQuoteResultsVoBuild.java

@@ -42,7 +42,7 @@ public final class YangGuangApiQuoteResultsVoBuild {
         // 交强保费 车船税 商业保费
         buildPremium(quoteResultsVo, yangGuangAccuracyCalculateResponse);
         quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.WAIT_AUDIT);
-        quoteResultsVo.setScoreVo(buildScoreVo(yangGuangAccuracyCalculateResponse.getDiscount()));
+        quoteResultsVo.setScoreVo(buildScoreVo(yangGuangAccuracyCalculateResponse.getDiscount(), yangGuangAccuracyCalculateResponse));
         return quoteResultsVo;
     }
 
@@ -142,13 +142,42 @@ public final class YangGuangApiQuoteResultsVoBuild {
         riskInfoVo.setEndDate(quotationResponse.getBiEndDate());
         return riskInfoVo;
     }
-    private static QuoteResultsVo.ScoreVo buildScoreVo(YangGuangAccuracyCalculateResponse.discount discount) {
+    private static QuoteResultsVo.ScoreVo buildScoreVo(YangGuangAccuracyCalculateResponse.discount discount,YangGuangAccuracyCalculateResponse yangGuangAccuracyCalculateResponse) {
         QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
         scoreVo.setJqScore(discount.getMarkingnobcCI());
         scoreVo.setSyScore(discount.getMarkingnobcBI());
         scoreVo.setLossRation(discount.getFinalmarkingnobc());
         scoreVo.setJqLossRation(discount.getFinalmarkingnoCi());
         scoreVo.setSyLossRation(discount.getFinalmarkingnoBi());
+        scoreVo.setMergeCostRate(yangGuangAccuracyCalculateResponse.getVascostmarginbc());
+        scoreVo.setXyhGrade(yangGuangAccuracyCalculateResponse.getXYHGrade() != null ? "1" : "0");
+        scoreVo.setSeriesTypeActualName(yangGuangAccuracyCalculateResponse.getSeriesTypeActualName() != null ? yangGuangAccuracyCalculateResponse.getSeriesTypeActualName() : "");
+        if (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagCI() != null) {
+            switch (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagCI()) {
+                case "1":
+                case "3":
+                    scoreVo.setJqRenewal("0");
+                    break;
+                case "2":
+                case "4":
+                case "5":
+                    scoreVo.setJqRenewal("1");
+                    break;
+            }
+        }
+        if (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagBI() != null) {
+            switch (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagBI()) {
+                case "1":
+                case "3":
+                    scoreVo.setSyRenewal("0");
+                    break;
+                case "2":
+                case "4":
+                case "5":
+                    scoreVo.setSyRenewal("1");
+                    break;
+            }
+        }
         return scoreVo;
     }
 

+ 18 - 16
tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/entity/request/YangGuangGetNonVehicleProductsRequest.java

@@ -1,6 +1,10 @@
 package com.jzg.quotation.yangguang.api.entity.request;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.quotation.yangguang.api.constant.enums.YangGuangCarType;
+import com.jzg.quotation.yangguang.api.constant.enums.YgUseNatureCodeMapping;
+import com.jzg.quotation.yangguang.api.entity.YangGuangConfigureParameters;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -86,24 +90,22 @@ public class YangGuangGetNonVehicleProductsRequest extends YangGuangBaseRequest
     private String ProjectBrand;
 
 
-//    public YangGuangGetNonVehicleProductsRequest(String seatcount, InsOrders insOrders, YangGuangConfigureParameters ygConfigureParameters) {
+    public YangGuangGetNonVehicleProductsRequest(CarInfoVo carInfoVo, YangGuangConfigureParameters ygConfigureParameters) {
 //        String json = insOrders.getCarinfo().toJSONString();
 //        JSONObject jsonObject = JSONObject.parseObject(json);
 //        String useNatureCode = jsonObject.getString("vehicleUse");
-//        this.RequestNo = "getNonVehicleProducts";
-//        this.ComCode = ygConfigureParameters.getComCode();
-//        this.HandlerCode = ygConfigureParameters.getHandlerCode();
-//        this.AgentCode = ygConfigureParameters.getAgentCode();
-//        this.ServiceArea = ygConfigureParameters.getServiceArea() == null ? "" : ygConfigureParameters.getServiceArea();
-//        this.Seatcount = seatcount;
-//        if (useNatureCode != null) {
-//            this.UseNatureCode = YgUseNatureCodeMapping.getYgUseNatureCode(useNatureCode);
-//        }
+        this.RequestNo = "getNonVehicleProducts";
+        this.ComCode = ygConfigureParameters.getComCode();
+        this.HandlerCode = ygConfigureParameters.getHandlerCode();
+        this.AgentCode = ygConfigureParameters.getAgentCode();
+        this.ServiceArea = ygConfigureParameters.getServiceArea() == null ? "" : ygConfigureParameters.getServiceArea();
+        this.Seatcount = carInfoVo.getSeatCount();
+        this.UseNatureCode = YgUseNatureCodeMapping.getYgUseNatureCode(carInfoVo.getVehicleUseCode());
 //        String cartype = jsonObject.getString("cartype");
-//        //车辆种类
-//        YangGuangCarType yangGuangCarType = Enum.valueOf(YangGuangCarType.class,cartype);
-//        this.VehicleType = yangGuangCarType.getCode();
-//        this.LicenseCategory = jsonObject.getString("cartype");
-//        this.Toncount = jsonObject.getString("seatCount");
-//    }
+        //车辆种类
+        YangGuangCarType yangGuangCarType = Enum.valueOf(YangGuangCarType.class,carInfoVo.getCarTypeCode());
+        this.VehicleType = yangGuangCarType.getCode();
+        this.LicenseCategory = carInfoVo.getCarTypeCode();
+        this.Toncount = carInfoVo.getSeatCount();
+    }
 }

+ 12 - 0
tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/entity/response/YangGuangAccuracyCalculateResponse.java

@@ -125,6 +125,18 @@ public class YangGuangAccuracyCalculateResponse extends YangGuangBaseResponse{
     @JSONField(name = "vascostmarginbc")
     private String vascostmarginbc;
 
+    /**
+     *  红黄蓝车系(仅电车返回有值)
+     */
+    @JSONField(name = "SeriesTypeActualName")
+    private String SeriesTypeActualName;
+
+    /**
+     *  向阳花标识返回
+     */
+    @JSONField(name = "XYHGrade")
+    private String XYHGrade;
+
     /**
      *  商业险重复投保提示
      */

+ 10 - 2
tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/service/impl/YangGuangApiRequestImpl.java

@@ -3,7 +3,6 @@ package com.jzg.quotation.yangguang.api.service.impl;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
-import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.agreement.po.PtlAgreementUrl;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
@@ -12,7 +11,6 @@ import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.quotation.commons.annotation.QuoteApiService;
-import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.commons.client.PlatformClient;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.commons.entity.quote.vo.base.OrderBase;
@@ -77,6 +75,8 @@ public class YangGuangApiRequestImpl implements YangGuangApiRequest {
         // 过滤车型
         YangGuangQueryVehicleModelResponse.carmodellist carModel =
                 CarModelsFilterUtils.to(yangGuangQueryVehicleModelResponse.getCarmodellist(), quoteVo.getCarInfoVo());
+        // 获取非车套餐列表
+        getNonVehicleList(carInfoVo, parameters, url);
         // 报价
         YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest = new YangGuangAccuracyCalculateRequest(quoteVo, carModel, parameters);
         yangGuangAccuracyCalculateRequest.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
@@ -376,4 +376,12 @@ public class YangGuangApiRequestImpl implements YangGuangApiRequest {
         }
         return orderStatusResultVo;
     }
+
+    public YangGuangGetNonVehicleProductsResponse getNonVehicleList(CarInfoVo carInfoVo, YangGuangConfigureParameters ygConfigureParameters,String apiUrl) throws JsonProcessingException {
+        // 获取非车列表
+        YangGuangGetNonVehicleProductsRequest yangGuangGetNonVehicleProductsRequest = new YangGuangGetNonVehicleProductsRequest(carInfoVo,ygConfigureParameters);
+        return yangGuangApiRequestComponent.getNonVehicleProducts(yangGuangGetNonVehicleProductsRequest,apiUrl);
+    }
+
+
 }

+ 4 - 0
tenant/organization/pom.xml

@@ -56,6 +56,10 @@
             <groupId>com.github.binarywang</groupId>
             <artifactId>weixin-java-cp</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.dataformat</groupId>
+            <artifactId>jackson-dataformat-xml</artifactId>
+        </dependency>
 
     </dependencies>
     <build>

+ 53 - 0
tenant/organization/src/main/java/com/jzg/organization/action/ActionExecutor.java

@@ -0,0 +1,53 @@
+package com.jzg.organization.action;
+
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.exception.SystemException;
+import com.jzg.organization.action.service.CancelQuoteHandler;
+import com.jzg.organization.action.service.SendNotifyMsgHandler;
+import com.jzg.organization.action.service.SpecifyAgreementHandler;
+import com.jzg.organization.action.service.SupplementaryOrderHandler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@Component
+public class ActionExecutor {
+
+    private final Map<ActionEnum, ActionHandler> handlerMap = new EnumMap<>(ActionEnum.class);
+
+    /**
+     * 注册动作
+     * @param handlers
+     */
+    @Autowired
+    public ActionExecutor(List<ActionHandler> handlers){
+        for (ActionHandler handler : handlers) {
+            //注册动作
+            handlerMap.put(handler.getActionEnum(), handler);
+        }
+    }
+
+    /**
+     * 执行动作
+     * @param actionMap
+     */
+    public QuoteVo executeActions(String orderNo, QuoteVo quoteVo, Map<ActionEnum, Object> actionMap){
+        try {
+            for (Map.Entry<ActionEnum, Object> entry : actionMap.entrySet()) {
+                ActionHandler handler = handlerMap.get(entry.getKey());
+                if (handler != null) {
+                    quoteVo = handler.execute(orderNo, quoteVo, entry.getValue());
+                }
+            }
+            return quoteVo;
+        }catch(Exception e){
+            throw new SystemException("动作执行失败");
+        }
+    }
+}

+ 29 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/CancelQuoteHandler.java

@@ -0,0 +1,29 @@
+package com.jzg.organization.action.service;
+
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.exception.SystemException;
+import org.springframework.stereotype.Component;
+
+/**
+ * 终止报价动作
+ */
+
+@Component
+public class CancelQuoteHandler implements ActionHandler {
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.CANCEL_QUOTE;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo, QuoteVo quoteVo, Object param) {
+        // 传入的值为String
+        String message = param.toString();
+        return quoteVo;
+        // 直接抛出错误提示的异常
+//        throw new SystemException(message);
+
+    }
+}

+ 28 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/ChangeBsAccountHandler.java

@@ -0,0 +1,28 @@
+package com.jzg.organization.action.service;
+
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.exception.SystemException;
+import org.springframework.stereotype.Component;
+
+/**
+ * 更改保司账号
+ */
+
+@Component
+public class ChangeBsAccountHandler implements ActionHandler {
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.CHANGE_BS_ACCOUNT;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo, QuoteVo quoteVo, Object param) {
+        // 传入的值为String
+        String message = param.toString();
+        return quoteVo;
+        // 直接抛出错误提示的异常
+//        throw new SystemException(message);
+    }
+}

+ 34 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/ChangePocHandler.java

@@ -0,0 +1,34 @@
+package com.jzg.organization.action.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.exception.SystemException;
+import com.jzg.organization.client.QuoteClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 更改对接人
+ */
+
+@Component
+public class ChangePocHandler implements ActionHandler {
+
+    @Autowired
+    QuoteClient quoteClient;
+
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.CHANGE_POC;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo,QuoteVo quoteVo, Object param) {
+        JSONObject params = (JSONObject)param;
+        HttpResult changePersonResult = quoteClient.changePerson(orderNo,params.getString("name"), params.getString("phone"));
+        return quoteVo;
+    }
+}

+ 62 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/SendNotifyMsgHandler.java

@@ -0,0 +1,62 @@
+package com.jzg.organization.action.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.enums.MessageCodeEnum;
+import com.jzg.commons.entity.orders.po.InsOrders;
+import com.jzg.commons.entity.po.SysUserJzgInfo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.organization.client.QuoteClient;
+import com.jzg.organization.consumer.templete.UserMessageTemplate;
+import com.jzg.organization.service.SysUserJzgInfoService;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 发送通知消息动作
+ */
+
+@Component
+public class SendNotifyMsgHandler implements ActionHandler {
+
+    @Setter(onMethod_ = @Autowired)
+    private UserMessageTemplate userMessageTemplate;
+
+    @Autowired
+    private QuoteClient quoteClient;
+
+    @Autowired
+    private SysUserJzgInfoService sysUserJzgInfoService;
+
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.SEND_NOTIFY_MSG;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo, QuoteVo quoteVo, Object param) {
+        JSONObject params = (JSONObject)param;
+        String userId = "";
+        // 如果是查找管理的话
+        if(params.getString("is_manager").equals("1")){
+            //查找管理员id
+            userId = "";
+            HttpResult ordersByIdHttp = quoteClient.getOrdersById(orderNo);
+            if(ordersByIdHttp.getCode() == 200){
+                InsOrders ordersById = (InsOrders) ordersByIdHttp.getData();
+                SysUserJzgInfo userByUserId = sysUserJzgInfoService.getUserByUserId(ordersById.getRealQuoteUserId());
+                userId = userByUserId.getId();
+            }
+        }else{
+            userId = params.getString("user_id");
+        }
+        // 发送消息
+        userMessageTemplate.sendAddUser(userId,params.getString("title"),params.getString("content"), MessageCodeEnum.TEMPLATE_11,null);
+        return quoteVo;
+    }
+}

+ 27 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/SpecifyAgreementHandler.java

@@ -0,0 +1,27 @@
+package com.jzg.organization.action.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import org.springframework.stereotype.Component;
+
+/**
+ * 指定协议动作
+ */
+
+@Component
+public class SpecifyAgreementHandler implements ActionHandler {
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.SPECIFY_AGREEMENT;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo, QuoteVo quoteVo, Object param) {
+        JSONObject params = (JSONObject) param;
+        quoteVo.getOrder().setAgreementId(params.getString("agreementId"));
+        return quoteVo;
+
+    }
+}

+ 23 - 0
tenant/organization/src/main/java/com/jzg/organization/action/service/SupplementaryOrderHandler.java

@@ -0,0 +1,23 @@
+package com.jzg.organization.action.service;
+
+import com.jzg.commons.entity.action.base.ActionHandler;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import org.springframework.stereotype.Component;
+
+/**
+ * 补录订单动作
+ */
+
+@Component
+public class SupplementaryOrderHandler implements ActionHandler {
+    @Override
+    public ActionEnum getActionEnum() {
+        return ActionEnum.SUPPLEMENTARY_ORDER;
+    }
+
+    @Override
+    public QuoteVo execute(String orderNo, QuoteVo quoteVo, Object param) {
+        return quoteVo;
+    }
+}

+ 11 - 0
tenant/organization/src/main/java/com/jzg/organization/client/CostsRuleClient.java

@@ -1,11 +1,18 @@
 package com.jzg.organization.client;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.costs.vo.ValidateSchemeRuleVo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import java.util.List;
+import java.util.Map;
+
 @FeignClient(name="jzg-costsorrule",url = "http://localhost:8001/")
 public interface CostsRuleClient {
 
@@ -13,4 +20,8 @@ public interface CostsRuleClient {
     public HttpResult validateSchemeRule(@RequestBody ValidateSchemeRuleVo validateSchemeRuleVo);
 
 
+    @PostMapping("/validate/rule/validateDispatchRule")
+    public HttpResult validateDispatchRule(@RequestBody ValidateDispatchRuleVo dispatchRuleVo);
+
+
 }

+ 10 - 1
tenant/organization/src/main/java/com/jzg/organization/client/EsmInsCompanyClient.java

@@ -1,6 +1,7 @@
 package com.jzg.organization.client;
 
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.system.vo.SysSystemBusPermsVo;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -41,6 +42,14 @@ public interface EsmInsCompanyClient {
     public HttpResult<List<EsmInsCompany>> getUserCompany(@RequestParam String systemCode,
                                                           @RequestHeader("Authorization") String token);
 
-
+    /**
+     * 获取保司账号信息
+     * @param id
+     * @return
+     */
+    @GetMapping("/manager/attributionTemplate/getAgreementAttribution")
+    public HttpResult<PtlAgreementAttribution> getAgreementAttribution(            @RequestParam("agreementId") String agreementId,
+                                                                                   @RequestHeader("Authorization") String authToken,
+                                                                                   @RequestHeader("system_code") String systemCode);
 
 }

+ 18 - 0
tenant/organization/src/main/java/com/jzg/organization/client/OrgClient.java

@@ -0,0 +1,18 @@
+package com.jzg.organization.client;
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+
+@FeignClient(name="jzg-org",url = "http://192.168.0.253:8084/")
+public interface OrgClient {
+
+    @PostMapping("/ptlAgreementDispatch/getAgreementDispatch")
+    public HttpResult getAgreementDispatch(@RequestBody PtlAgreementDispatchQuery ptlAgreementDispatchQuery,
+                                           @RequestHeader("Authorization") String token);
+
+
+}

+ 16 - 1
tenant/organization/src/main/java/com/jzg/organization/client/QuoteClient.java

@@ -1,14 +1,20 @@
 package com.jzg.organization.client;
 
+import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.InsFeeOrdersParam;
+import com.jzg.commons.entity.orders.po.InsOrders;
 import com.jzg.commons.entity.po.InsFeeOrders;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-@FeignClient(name="jzg-insurance",url = "http://192.168.0.106:9898/")
+@FeignClient(name="jzg-insurance",url = "http://localhost:9898/")
 public interface QuoteClient {
+
+    @GetMapping(value = "/supplementOrder/selectById")
+    public HttpResult getOrdersById(String id);
+
     @PostMapping(value = "/insFeeOrder/getInsFeeOrdersList")
     public List<InsFeeOrders> getInsFeeOrdersList(@RequestBody InsFeeOrdersParam param);
 
@@ -24,6 +30,15 @@ public interface QuoteClient {
     @GetMapping(value = "/insFeeOrder/getInsFeeOrderByOrderNo")
     public List<InsFeeOrders> getInsFeeOrderByOrderNo(@RequestParam("orderNo") String orderNo);
 
+    /**
+     * 更改对接人
+     * @param orderNo
+     * @param name
+     * @param phone
+     * @return
+     */
+    @GetMapping(value = "/supplementOrder/changePerson")
+    public HttpResult changePerson(@RequestParam("orderNo") String orderNo, @RequestParam("name") String name,@RequestParam("phone") String phone);
 
 
 

+ 6 - 0
tenant/organization/src/main/java/com/jzg/organization/config/WeComConfig.java

@@ -1,5 +1,6 @@
 package com.jzg.organization.config;
 
+import me.chanjar.weixin.common.util.crypto.WxCryptUtil;
 import me.chanjar.weixin.cp.api.*;
 import me.chanjar.weixin.cp.api.impl.*;
 import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
@@ -22,6 +23,11 @@ public class WeComConfig {
         return wxCpService;
     }
 
+    @Bean
+    public WxCryptUtil wxCryptUtil(){
+        return new WxCryptUtil("hGskYOrv1XnVFtooYsX8Q2PxN", "cYIzKkyIJQY6wFHUTtamtKiy2uxFynTZOx6VHnvC7vI", "wwfe67d19509d43ec5");
+    }
+
     @Bean
     public WxCpKfService wxCpKfService() {
         return new WxCpKfServiceImpl(wxCpService());

+ 90 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementDispatchController.java

@@ -0,0 +1,90 @@
+package com.jzg.organization.controller;
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.entity.dto.CostExternalParam;
+import com.jzg.commons.entity.orders.po.InsOrders;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.vo.CostExternalListVo;
+import com.jzg.commons.request.RequestSingleParam;
+import com.jzg.organization.action.ActionExecutor;
+import com.jzg.organization.service.PtlAgreementDispatchService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 协议调度
+ */
+
+@Tag(name="协议调度管理")
+@Validated
+@RestController
+@RequestMapping("/ptlAgreementDispatch")
+public class PtlAgreementDispatchController {
+
+    @Autowired
+    PtlAgreementDispatchService ptlAgreementDispatchService;
+
+    @Autowired
+    ActionExecutor actionExecutor;
+
+    @PostMapping("getAgreementDispatch")
+    @Operation(summary= "获取协议调度")
+    public HttpResult<PtlAgreementDispatchVo> getAgreementDispatch(@RequestBody PtlAgreementDispatchQuery ptlAgreementDispatchQuery){
+        return HttpResult.ok(ptlAgreementDispatchService.getAgreementDispatch(ptlAgreementDispatchQuery));
+    }
+
+    @PostMapping("addAgreementDispatch")
+    @Operation(summary = "添加协议调度")
+    public HttpResult addAgreementDispatch(@RequestBody PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo){
+        String dispatchId = ptlAgreementDispatchService.addAgreementDispatch(ptlAgreementDispatchVo);
+        return HttpResult.ok("添加协议调度成功",dispatchId);
+    }
+
+    @PostMapping("addAgreementDispatchAction")
+    @Operation(summary = "添加协议调度动作")
+    public HttpResult addAgreementDispatch(@RequestBody List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchVo){
+        return ptlAgreementDispatchService.addAgreementDispatchAction(ptlAgreementDispatchVo) ? HttpResult.ok("添加调度动作成功") : HttpResult.error("添加调度动作失败");
+    }
+
+    @PostMapping("updateAgreementDispatch")
+    @Operation(summary = "修改协议调度")
+    public HttpResult updateAgreementDispatch(@RequestBody PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo){
+        return ptlAgreementDispatchService.updateAgreementDispatch(ptlAgreementDispatchVo) ? HttpResult.ok("修改协议调度成功") : HttpResult.error("修改协议调度失败");
+    }
+
+    @GetMapping("deleteAgreementDispatch")
+    @Operation(summary = "删除协议调度")
+    public HttpResult deleteAgreementDispatch(String dispatchId){
+        return ptlAgreementDispatchService.deleteAgreementDispatch(dispatchId) ? HttpResult.ok("删除协议调度成功") : HttpResult.error("删除协议调度失败");
+    }
+
+    @GetMapping("getAgreementDispatchAction")
+    @Operation(summary = "获取调度动作")
+    public  HttpResult getAgreementDispatchAction(List<String> dispatchIds){
+        return HttpResult.ok(ptlAgreementDispatchService.getAgreementDispatchAction(dispatchIds));
+    }
+
+    @PostMapping("executeActions")
+    @Operation(summary = "执行动作")
+    public HttpResult executeActions(@RequestSingleParam("orderNo") String orderNo, @RequestSingleParam("quoteVo") QuoteVo quoteVo, @RequestSingleParam("actionMap") Map<ActionEnum, Object> actionMap){
+        quoteVo = actionExecutor.executeActions(orderNo, quoteVo, actionMap);
+        return HttpResult.ok(quoteVo);
+    }
+
+    @GetMapping("updateDispatchName")
+    @Operation(summary = "修改调度名称")
+    public HttpResult updateDispatchName(String dispatchId,String name){
+        return ptlAgreementDispatchService.updateDispatchName(dispatchId, name) ? HttpResult.ok("修改调度名称成功") : HttpResult.error("修改调度名称失败");
+    }
+}

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -6,6 +6,7 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.finance.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
 import com.jzg.commons.entity.finance.vo.*;
+import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.organization.service.ReceivableService;
@@ -334,4 +335,10 @@ public class ReceivableController {
     public HttpResult getInvoiceRecordDetail(@RequestSingleParam("id") String id){
         return HttpResult.ok(receivableService.getInvoiceRecordDetail(id));
     }
+
+    @PostMapping("/restockInsPlyIncome")
+    @Operation(summary = "批改订单后应收重新添加")
+    public void restockInsPlyIncome(@RequestBody InsOrderAdjust insOrderAdjust){
+        receivableService.restockInsPlyIncome(insOrderAdjust);
+    }
 }

+ 58 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/SysAppManageController.java

@@ -0,0 +1,58 @@
+package com.jzg.organization.controller;
+
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.SysAppManage;
+import com.jzg.commons.entity.vo.SysAppManageVo;
+import com.jzg.organization.service.SysAppManageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Objects;
+
+/**
+ * 应用管理
+ * @author quchen
+ * @date 2025/6/19 9:54
+ */
+
+@RestController
+@RequestMapping("/appManage")
+public class SysAppManageController {
+
+    @Autowired
+    private SysAppManageService sysAppManageService;
+
+
+    @PostMapping("/queryAppList")
+    public HttpResult queryAppList(@RequestBody SysAppManageVo sysAppManageVo) {
+        return HttpResult.ok(sysAppManageService.queryAppList(sysAppManageVo));
+    }
+
+
+    @PostMapping("/save")
+    public HttpResult save( @RequestBody SysAppManage sysAppManage) {
+        if (Objects.isNull(sysAppManage.getAppId())){
+            return HttpResult.error("应用ID不能为空");
+        }
+        boolean save = sysAppManageService.save(sysAppManage);
+        return save ? HttpResult.ok("保存成功") : HttpResult.error("保存失败");
+    }
+
+
+    @PostMapping("/update")
+    public HttpResult update(@RequestBody SysAppManage sysAppManage) {
+        if (Objects.isNull(sysAppManage.getId())){
+            return HttpResult.error("ID不能为空");
+        }
+        boolean b = sysAppManageService.updateById(sysAppManage);
+        return b ? HttpResult.ok("更新成功") :HttpResult.error("更新失败");
+    }
+
+
+    @GetMapping("/deleteById")
+    public HttpResult deleteById(@RequestParam String id) {
+        return sysAppManageService.deleteById(id);
+    }
+
+}

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/controller/WechatCustomerServiceManageController.java

@@ -115,7 +115,7 @@ public class WechatCustomerServiceManageController {
 
     @PostMapping(path = "/callback", consumes = MediaType.TEXT_XML_VALUE, produces = MediaType.TEXT_XML_VALUE)
     @Operation(summary = "客服回调(处理事件发送欢迎语)", description = "客服回调(处理事件发送欢迎语)")
-    public HttpResult<String> customerCallback(@RequestBody WxCpXmlMessage wechatEncrypt) throws JsonProcessingException, WxErrorException {
+    public HttpResult<String> customerCallback(@RequestBody String wechatEncrypt) throws JsonProcessingException, WxErrorException {
         wechatCustomerServiceManageService.callbackSendMsgOnEvent(wechatEncrypt);
         return HttpResult.ok();
     }

+ 42 - 0
tenant/organization/src/main/java/com/jzg/organization/entity/vo/WechatCustomerCallbackVo.java

@@ -0,0 +1,42 @@
+package com.jzg.organization.entity.vo;
+
+
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 微信客服 回调实体
+ * @author: wenks
+ * @date: 2024/11/26 10:37
+ **/
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+@JacksonXmlRootElement(localName = "xml")
+public class WechatCustomerCallbackVo {
+
+    @JacksonXmlProperty(localName = "ToUserName")
+    private String toUserName;
+
+    @JacksonXmlProperty(localName = "FromUserName")
+    private String fromUserName;
+
+    @JacksonXmlProperty(localName = "CreateTime")
+    private String createTime;
+
+    @JacksonXmlProperty(localName = "MsgType")
+    private String msgType;
+
+    @JacksonXmlProperty(localName = "Event")
+    private String event;
+
+    @JacksonXmlProperty(localName = "Token")
+    private String token;
+
+    @JacksonXmlProperty(localName = "OpenKfId")
+    private String openKfId;
+
+}

+ 24 - 0
tenant/organization/src/main/java/com/jzg/organization/entity/vo/WechatEncryptVo.java

@@ -0,0 +1,24 @@
+package com.jzg.organization.entity.vo;
+
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+@JacksonXmlRootElement(localName = "xml")
+public class WechatEncryptVo {
+
+    @JacksonXmlProperty(localName = "ToUserName")
+    private String toUserName;
+
+    @JacksonXmlProperty(localName = "Encrypt")
+    private String encrypt;
+
+    @JacksonXmlProperty(localName = "AgentID")
+    private String agentID;
+
+}

+ 15 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchActionMapper.java

@@ -0,0 +1,15 @@
+package com.jzg.organization.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface PtlAgreementDispatchActionMapper extends BaseMapper<PtlAgreementDispatchAction> {
+
+    public List<PtlAgreementDispatchAction> getActions(List<String> dispatchIds);
+}

+ 15 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchAfterActionMapper.java

@@ -0,0 +1,15 @@
+package com.jzg.organization.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface PtlAgreementDispatchAfterActionMapper extends BaseMapper<PtlAgreementDispatchAfterAction> {
+
+    public List<PtlAgreementDispatchAfterAction> getAfterActions(String companyId);
+}

+ 11 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchMapper.java

@@ -0,0 +1,11 @@
+package com.jzg.organization.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PtlAgreementDispatchMapper extends BaseMapper<PtlAgreementDispatch> {
+
+}

+ 12 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementDispatchRulesAttrLinkMapper.java

@@ -0,0 +1,12 @@
+package com.jzg.organization.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PtlAgreementDispatchRulesAttrLinkMapper extends BaseMapper<PtlAgreementDispatchRulesAttrLink> {
+
+}

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/SysAppManageMapper.java

@@ -0,0 +1,9 @@
+package com.jzg.organization.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.po.SysAppManage;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SysAppManageMapper extends BaseMapper<SysAppManage> {
+}

+ 75 - 0
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementDispatchService.java

@@ -0,0 +1,75 @@
+package com.jzg.organization.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.entity.dto.*;
+import com.jzg.commons.entity.po.PtlAgreement;
+import com.jzg.commons.entity.po.PtlAgreementCost;
+import com.jzg.commons.entity.vo.AgreementInfoVo;
+import com.jzg.commons.entity.vo.AgreementUserVo;
+import com.jzg.commons.entity.vo.AgreementVo;
+import com.jzg.commons.entity.vo.UpAndDownVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+* 协议调度service层
+*/
+public interface PtlAgreementDispatchService extends IService<PtlAgreementDispatch> {
+
+    /**
+     * 添加协议调度
+     * @param ptlAgreementDispatchVo
+     * @return
+     */
+    public String addAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo);
+
+    /**
+     * 添加协议调度动作
+     * @param ptlAgreementDispatchVo
+     * @return
+     */
+    public boolean addAgreementDispatchAction(List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchVo);
+
+
+    /**
+     * 修改协议调度
+     * @param ptlAgreementDispatchVo
+     * @return
+     */
+    public boolean updateAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo);
+
+    /**
+     * 删除协议调度
+     * @param dispatchId
+     * @return
+     */
+    public boolean deleteAgreementDispatch(String dispatchId);
+
+    /**
+     * 获取协议调度信息
+     * @param ptlAgreementDispatchQuery
+     */
+    public PtlAgreementDispatchVo getAgreementDispatch(PtlAgreementDispatchQuery ptlAgreementDispatchQuery);
+
+    /**
+     * 根据调度id 获取调度动作
+     * @param dispatchIds
+     * @return
+     */
+    public List<PtlAgreementDispatchVo.DispatchVo> getAgreementDispatchAction(List<String> dispatchIds);
+
+    /**
+     * 更新调度名称
+     * @param dispatchId
+     * @param name
+     * @return
+     */
+    public boolean updateDispatchName(String dispatchId,String name);
+}

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

@@ -17,5 +17,7 @@ public interface PtlAgreementUndwrtRulesAttrService extends IService<PtlAgreemen
 
     Map<String, List<PtlAgreementUndwrtRulesAttr>> attrGroup(RulesAttParam param);
 
+    PtlAgreementUndwrtRulesAttr getUndwrtRuleAttrByAttrCode(String attrCode);
+
 
 }

+ 3 - 1
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementUndwrtRulesDictLabalService.java

@@ -3,7 +3,9 @@ package com.jzg.organization.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 
-public interface PtlAgreementUndwrtRulesDictLabalService extends IService<PtlAgreementUndwrtRulesDictLabal> {
+import java.util.List;
 
+public interface PtlAgreementUndwrtRulesDictLabalService extends IService<PtlAgreementUndwrtRulesDictLabal> {
 
+    public List<PtlAgreementUndwrtRulesDictLabal> getDictLabelsByTypeCode(Integer typeCode);
 }

+ 2 - 1
tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java

@@ -6,6 +6,7 @@ import com.jzg.commons.entity.finance.dto.*;
 import com.jzg.commons.entity.finance.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
 import com.jzg.commons.entity.finance.vo.*;
+import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.orders.po.InsOrders;
 import com.jzg.commons.entity.orders.po.InsOrdersPolicy;
 import com.jzg.commons.entity.po.EsmInsCompany;
@@ -252,6 +253,6 @@ public interface ReceivableService extends IService<InsPlyIncome> {
     /**
      * 批改订单后应收重新添加
      */
-    void restockInsPlyIncome(String orderNo,String companyId);
+    void restockInsPlyIncome(InsOrderAdjust insOrderAdjust);
 
 }

+ 15 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysAppManageService.java

@@ -0,0 +1,15 @@
+package com.jzg.organization.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.SysAppManage;
+import com.jzg.commons.entity.vo.SysAppManageVo;
+
+public interface SysAppManageService extends IService<SysAppManage> {
+
+
+    Page<SysAppManage> queryAppList(SysAppManageVo sysAppManageVo);
+
+    HttpResult deleteById(String id);
+}

+ 6 - 3
tenant/organization/src/main/java/com/jzg/organization/service/WechatCustomerServiceManageService.java

@@ -1,6 +1,7 @@
 package com.jzg.organization.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.jzg.organization.entity.vo.*;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
@@ -76,9 +77,11 @@ public interface WechatCustomerServiceManageService {
     String getWeChatCustomer() throws WxErrorException;
 
     /**
-     * 客服事件回调
+     * 微信客服回调信息
      *
-     * @param wechatEncrypt 微信加密字符串
+     * @param wechatEncrypt 加密参数
+     * @throws JsonProcessingException
+     * @throws WxErrorException
      */
-    void callbackSendMsgOnEvent(WxCpXmlMessage wechatEncrypt);
+    void callbackSendMsgOnEvent(String wechatEncrypt) throws JsonProcessingException, WxErrorException;
 }

+ 278 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -0,0 +1,278 @@
+package com.jzg.organization.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jzg.commons.core.base.BaseController;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatch;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
+import com.jzg.commons.entity.po.PtlAgreement;
+import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
+import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
+import com.jzg.commons.entity.po.SysDict;
+import com.jzg.commons.util.idgen.IdGenerate;
+import com.jzg.organization.client.EsmInsCompanyClient;
+import com.jzg.organization.mapper.PtlAgreementDispatchActionMapper;
+import com.jzg.organization.mapper.PtlAgreementDispatchAfterActionMapper;
+import com.jzg.organization.mapper.PtlAgreementDispatchMapper;
+import com.jzg.organization.mapper.PtlAgreementDispatchRulesAttrLinkMapper;
+import com.jzg.organization.service.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+* @author dongxin
+* @description 针对表【ptl_agreement_dept(协议授权部门表)】的数据库操作Service实现
+* @createDate 2025-02-18 17:58:58
+*/
+@Service
+public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDispatchMapper, PtlAgreementDispatch>
+    implements PtlAgreementDispatchService {
+
+    @Autowired
+    PtlAgreementDispatchRulesAttrLinkMapper rulesAttrLinkMapper;
+
+    @Autowired
+    PtlAgreementDispatchActionMapper actionMapper;
+
+    @Autowired
+    PtlAgreementUndwrtRulesAttrService ptlAgreementUndwrtRulesAttrService;
+
+    @Autowired
+    PtlAgreementUndwrtRulesDictLabalService ptlAgreementUndwrtRulesDictLabalService;
+
+    @Autowired
+    SysDictService sysDictService;
+
+    @Autowired
+    PtlAgreementService ptlAgreementService;
+
+    @Autowired
+    EsmInsCompanyClient esmInsCompanyClient;
+
+    @Autowired
+    PtlAgreementDispatchAfterActionMapper afterActionMapper;
+
+    @Autowired
+    BaseController baseController;
+
+    @Override
+    @Transactional
+    public String addAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo) {
+        PtlAgreementDispatch dispatch = new PtlAgreementDispatch(ptlAgreementDispatchVo);
+        baseMapper.insert(dispatch);
+
+        for (PtlAgreementDispatchRulesAttrLink link : ptlAgreementDispatchVo.getAttrLinks()){
+            link.setDispatchId(dispatch.getId());
+        }
+        rulesAttrLinkMapper.insert(ptlAgreementDispatchVo.getAttrLinks());
+
+        for (PtlAgreementDispatchAction action  : ptlAgreementDispatchVo.getActions()){
+            action.setId(IdGenerate.nextId());
+            action.setDispatchId(dispatch.getId());
+        }
+        actionMapper.insert(ptlAgreementDispatchVo.getActions());
+
+        return dispatch.getId();
+    }
+
+    @Override
+    public boolean addAgreementDispatchAction(List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchVo) {
+        for (PtlAgreementDispatchAfterAction action  : ptlAgreementDispatchVo){
+            action.setId(IdGenerate.nextId());
+        }
+        afterActionMapper.insert(ptlAgreementDispatchVo);
+        return true;
+    }
+
+    @Override
+    @Transactional
+    public boolean updateAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo) {
+        this.deleteAgreementDispatch(ptlAgreementDispatchVo.getDispatchId());
+        this.addAgreementDispatch(ptlAgreementDispatchVo);
+        return true;
+    }
+
+    @Override
+    @Transactional
+    public boolean deleteAgreementDispatch(String dispatchId) {
+        baseMapper.deleteById(dispatchId);
+        rulesAttrLinkMapper.delete(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()
+                .eq(PtlAgreementDispatchRulesAttrLink::getDispatchId,dispatchId));
+        actionMapper.delete(new LambdaQueryWrapper<PtlAgreementDispatchAction>()
+                .eq(PtlAgreementDispatchAction::getDispatchId,dispatchId));
+        return true;
+    }
+
+    @Override
+    public PtlAgreementDispatchVo getAgreementDispatch(PtlAgreementDispatchQuery ptlAgreementDispatchQuery) {
+        List<PtlAgreementDispatch> ptlAgreementDispatches = baseMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatch>()
+                .eq(PtlAgreementDispatch::getCompanyId, ptlAgreementDispatchQuery.getCompanyId()));
+        PtlAgreementDispatchVo dispatchVos = new PtlAgreementDispatchVo();
+        List<String> dispatchIds = ptlAgreementDispatches.stream().map(x -> x.getId()).collect(Collectors.toList());
+        if (dispatchIds.size() > 0) {
+            List<SysDict> dispatchBeforeActionDict = sysDictService.getByTypeCode("dispatch_before_action");
+            List<SysDict> dispatchAfterActionDict = sysDictService.getByTypeCode("dispatch_after_action");
+
+            // 查询保司所有的规则属性 然后进行分组
+            List<PtlAgreementDispatchRulesAttrLink> ptlAgreementDispatchRulesAttrLinks = rulesAttrLinkMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()
+                    .in(PtlAgreementDispatchRulesAttrLink::getDispatchId, dispatchIds));
+
+            // 获取所有保司的动作
+            List<PtlAgreementDispatchAction> ptlAgreementDispatchActions = actionMapper.getActions(dispatchIds);
+
+            // 获取保司的报价失败之后的动作
+            List<PtlAgreementDispatchAfterAction> ptlAgreementDispatchAfterActions = afterActionMapper.getAfterActions(ptlAgreementDispatchQuery.getCompanyId());
+            int index = 1;
+            for(PtlAgreementDispatch dispatch : ptlAgreementDispatches){
+                if(dispatch.getDispatchName().equals("")){
+                    dispatch.setDispatchName("规则" + index);
+                    index++;
+                }
+                List<PtlAgreementDispatchRulesAttrLink> attrLinks = ptlAgreementDispatchRulesAttrLinks.stream().filter(x -> x.getDispatchId().equals(dispatch.getId())).collect(Collectors.toList());
+                List<PtlAgreementDispatchAction> actions = ptlAgreementDispatchActions.stream().filter(x -> x.getDispatchId().equals(dispatch.getId())).collect(Collectors.toList());
+                for(PtlAgreementDispatchRulesAttrLink attrlink : attrLinks){
+                    if (attrlink.getOperator() != null) {
+                        if (attrlink.getOperator().equals("1")) {
+                            attrlink.setOperatorDesc("包含");
+                        }
+                        if (attrlink.getOperator().equals("2")) {
+                            attrlink.setOperatorDesc("小于");
+                        }
+                        if (attrlink.getOperator().equals("3")) {
+                            attrlink.setOperatorDesc("小于等于");
+                        }
+                        if (attrlink.getOperator().equals("4")) {
+                            attrlink.setOperatorDesc("大于");
+                        }
+                        if (attrlink.getOperator().equals("5")) {
+                            attrlink.setOperatorDesc("大于等于");
+                        }
+                    }else{
+                        attrlink.setOperatorDesc("未知");
+                    }
+                    PtlAgreementUndwrtRulesAttr undwrtRuleAttrByAttrCode = ptlAgreementUndwrtRulesAttrService.getUndwrtRuleAttrByAttrCode(attrlink.getAttrCode());
+                    if(undwrtRuleAttrByAttrCode != null && undwrtRuleAttrByAttrCode.getDictId() != null){
+                        attrlink.setAttrCodeName(undwrtRuleAttrByAttrCode.getAttrName());
+                        List<PtlAgreementUndwrtRulesDictLabal> dictLabelsByTypeCode = ptlAgreementUndwrtRulesDictLabalService.getDictLabelsByTypeCode(undwrtRuleAttrByAttrCode.getDictId());
+                        PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = dictLabelsByTypeCode.stream().filter(x -> x.getCode().equals(attrlink.getMin())).findFirst().orElse(null);
+                        if(ptlAgreementUndwrtRulesDictLabal != null){
+                            if(attrlink.getAttrDesc() == null){
+                                attrlink.setAttrDesc(new ArrayList<>());
+                            }
+                            attrlink.getAttrDesc().add(ptlAgreementUndwrtRulesDictLabal.getName());
+                        }
+                    }
+                }
+
+                for(PtlAgreementDispatchAction action : actions){
+                    SysDict sysDict = dispatchBeforeActionDict.stream().filter(x -> x.getValue().equals(action.getActionCode())).findFirst().orElse(null);
+                    if(sysDict == null){
+                        action.setActionName("未知动作");
+                    }else{
+                        action.setActionName(sysDict.getLabel());
+                        if("specify_agreement".equals(action.getActionCode())){
+                            if(action.getActionJson() != null) {
+                                PtlAgreement byId = ptlAgreementService.getById(action.getActionJson().get("agreementId").toString());
+                                if(byId != null) {
+                                    action.getActionJson().put("agreementName", byId.getAgreementName());
+                                }
+                            }
+                        }else if("change_bs_account".equals(action.getActionCode())){
+                            HttpResult<PtlAgreementAttribution> agreementAttribution = esmInsCompanyClient.getAgreementAttribution(action.getActionJson().get("accountId").toString(), baseController.getToken(), baseController.getUserSystemCode());
+                            if(agreementAttribution.getCode() == 200){
+                                PtlAgreementAttribution data = agreementAttribution.getData();
+                                action.getActionJson().put("userName",data.getUsername());
+                                action.getActionJson().put("companyName",data.getInsCompanyName());
+                            }
+                        }
+                    }
+                }
+
+                PtlAgreementDispatchVo.DispatchVo vo = new PtlAgreementDispatchVo.DispatchVo(dispatch,attrLinks,actions);
+                dispatchVos.getDispatchVos().add(vo);
+            }
+
+            for(PtlAgreementDispatchAfterAction afterAction : ptlAgreementDispatchAfterActions){
+                SysDict sysDict = dispatchBeforeActionDict.stream().filter(x -> x.getValue().equals(afterAction.getActionCode())).findFirst().orElse(null);
+                if(sysDict == null){
+                    afterAction.setActionName("未知动作");
+                }else{
+                    afterAction.setActionName(sysDict.getLabel());
+                    if("specify_agreement".equals(afterAction.getActionCode())){
+                        if(afterAction.getActionJson() != null) {
+                            PtlAgreement byId = ptlAgreementService.getById(afterAction.getActionJson().get("agreementId").toString());
+                            if(byId != null) {
+                                afterAction.getActionJson().put("agreementName", byId.getAgreementName());
+                            }
+                        }
+                    }else if("change_bs_account".equals(afterAction.getActionCode())){
+                        HttpResult<PtlAgreementAttribution> agreementAttribution = esmInsCompanyClient.getAgreementAttribution(afterAction.getActionJson().get("accountId").toString(), baseController.getToken(), baseController.getUserSystemCode());
+                        if(agreementAttribution.getCode() == 200){
+                            PtlAgreementAttribution data = agreementAttribution.getData();
+                            afterAction.getActionJson().put("userName",data.getUsername());
+                            afterAction.getActionJson().put("companyName",data.getInsCompanyName());
+                        }
+                    }
+                }
+            }
+            dispatchVos.setAfterActions(ptlAgreementDispatchAfterActions);
+        }
+
+
+        return dispatchVos;
+    }
+
+    @Override
+    public List<PtlAgreementDispatchVo.DispatchVo> getAgreementDispatchAction(List<String> dispatchIds) {
+        List<PtlAgreementDispatchVo.DispatchVo> dispatchVos = new ArrayList<>();
+
+        if (!dispatchIds.isEmpty()) {
+            List<PtlAgreementDispatchAction> ptlAgreementDispatchActions = actionMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatchAction>()
+                    .in(PtlAgreementDispatchAction::getDispatchId, dispatchIds));
+
+            // 进行分组
+            Map<String, List<PtlAgreementDispatchAction>> groupedByDispatchId = ptlAgreementDispatchActions.stream()
+                    .collect(Collectors.groupingBy(PtlAgreementDispatchAction::getDispatchId));
+
+            // 遍历示例
+            groupedByDispatchId.forEach((dispatchId, actions) -> {
+                PtlAgreementDispatch byId = this.getById(dispatchId);
+                PtlAgreementDispatchVo.DispatchVo vo = new PtlAgreementDispatchVo.DispatchVo();
+                vo.setDispatchId(dispatchId);
+                vo.setCompanyId(byId.getCompanyId());
+                vo.setActions(actions);
+                dispatchVos.add(vo);
+            });
+        }
+        return dispatchVos;
+    }
+
+    @Override
+    public boolean updateDispatchName(String dispatchId, String name) {
+        PtlAgreementDispatch dispatch = baseMapper.selectById(dispatchId);
+        if(dispatch != null) {
+            dispatch.setDispatchName(name);
+            baseMapper.updateById(dispatch);
+            return true;
+        }
+        return false;
+    }
+
+
+}
+
+
+
+

+ 7 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesAttrServiceImpl.java

@@ -93,5 +93,12 @@ public class PtlAgreementUndwrtRulesAttrServiceImpl extends ServiceImpl<PtlAgree
         }
     }
 
+    @Override
+    public PtlAgreementUndwrtRulesAttr getUndwrtRuleAttrByAttrCode(String attrCode) {
+        PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = baseMapper.selectOne(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttr>()
+                .eq(PtlAgreementUndwrtRulesAttr::getAttrCode, attrCode));
+        return ptlAgreementUndwrtRulesAttr;
+    }
+
 
 }

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesDictLabalServiceImpl.java

@@ -1,14 +1,22 @@
 package com.jzg.organization.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesDictLabalMapper;
 import com.jzg.organization.service.PtlAgreementUndwrtRulesDictLabalService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class PtlAgreementUndwrtRulesDictLabalServiceImpl extends ServiceImpl<PtlAgreementUndwrtRulesDictLabalMapper, PtlAgreementUndwrtRulesDictLabal>
         implements PtlAgreementUndwrtRulesDictLabalService {
 
 
+    @Override
+    public List<PtlAgreementUndwrtRulesDictLabal> getDictLabelsByTypeCode(Integer typeCode) {
+        return baseMapper.selectList(new LambdaQueryWrapper<PtlAgreementUndwrtRulesDictLabal>()
+                .eq(PtlAgreementUndwrtRulesDictLabal::getDictId,typeCode));
+    }
 }

+ 77 - 8
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -1,11 +1,21 @@
 package com.jzg.organization.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 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.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.action.enums.ActionEnum;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction;
+import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchRulesAttrLink;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchQuery;
+import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
+import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.jzg.commons.entity.scheme.po.*;
@@ -17,11 +27,9 @@ import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.entity.costs.vo.ValidateSchemeRuleVo;
 import com.jzg.organization.client.CostsRuleClient;
 import com.jzg.organization.client.EsmInsCompanyClient;
+import com.jzg.organization.client.OrgClient;
 import com.jzg.organization.mapper.*;
-import com.jzg.organization.service.PtlAgreementDeptService;
-import com.jzg.organization.service.PtlAgreementService;
-import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrService;
-import com.jzg.organization.service.PtlSchemeService;
+import com.jzg.organization.service.*;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -69,6 +77,12 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
     @Autowired
     private PtlAgreementService agreementService;
 
+    @Autowired
+    PtlAgreementDispatchService ptlAgreementDispatchService;
+
+    @Autowired
+    OrgClient orgClient;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean saveScheme(PtlSchemeSaveVo ptlSchemeSaveVo) {
@@ -363,13 +377,68 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
             vo.setCnName(vo.getCode());
             vo.setLogo(MinioUtils.getPresignedObjectUrl(bucketName,company.getLogo()));
             resVo.add(vo);
-
         });
 
-//        AgreementParam param = new AgreementParam();
-//        param.setCompanyIds(companyIds);
-//        Page<AgreementVo> agreementVoPage = agreementService.queryPage(param);
+        ValidateDispatchRuleVo dispatchRuleVos = new ValidateDispatchRuleVo();
+        dispatchRuleVos.setQuoteVo(validateSchemeRuleVo.getQuoteVo());
+        //2.协议调度规则数据拼接
+        companyList.forEach(company->{
+            PtlAgreementDispatchQuery query = new PtlAgreementDispatchQuery();
+            query.setCompanyId(company.getId());
+            HttpResult agreementDispatch = orgClient.getAgreementDispatch(query,baseController.getToken());
+            if(agreementDispatch.getCode() == 200){
+                ObjectMapper mapper = new ObjectMapper();
+                List<PtlAgreementDispatchVo.DispatchVo> vos = new ArrayList<>();
+                Map<String, Object> data = (Map<String, Object>)agreementDispatch.getData();
+
+                Object dispatchVosObj = data.get("dispatchVos");
+                if (dispatchVosObj instanceof List) {
+                    List<Map<String, Object>> dispatchVos = (List<Map<String, Object>>) dispatchVosObj;
+                    for (Map<String, Object> map : dispatchVos) {
+                        PtlAgreementDispatchVo.DispatchVo obj = mapper.convertValue(map, PtlAgreementDispatchVo.DispatchVo.class);
+                        vos.add(obj);
+                    }
+                }
 
+                // 根据section 分组 进行拆分 规则
+                for (PtlAgreementDispatchVo.DispatchVo vo : vos){
+                    List<PtlAgreementDispatchRulesAttrLink> attrLinks = vo.getAttrLinks();
+                    Map<String, List<PtlAgreementDispatchRulesAttrLink>> grouped =
+                            attrLinks.stream()
+                                    .collect(Collectors.groupingBy(
+                                                    PtlAgreementDispatchRulesAttrLink::getSection,
+                                                    LinkedHashMap::new,
+                                                    Collectors.toList()
+                                    ));
+                    ValidateDispatchRuleVo.DispatchAttrVo dispatchAttrVo = new ValidateDispatchRuleVo.DispatchAttrVo();
+                    dispatchAttrVo.setDispatchId(vo.getDispatchId());
+                    dispatchAttrVo.setDispatchName(vo.getDispatchName());
+                    dispatchAttrVo.setCompanyId(vo.getCompanyId());
+                    dispatchAttrVo.setSectionGroups(grouped);
+                    dispatchRuleVos.getDispatchAttrVos().add(dispatchAttrVo);
+                }
+            }
+        });
+//
+        // 3. 校验调度数据
+        HttpResult httpResult = costsRuleClient.validateDispatchRule(dispatchRuleVos);
+        if(httpResult.getCode() == 200){
+            // 返回了调度id  通过调度id 查询动作
+            List<PtlAgreementDispatchVo.DispatchVo> agreementDispatchAction = ptlAgreementDispatchService.getAgreementDispatchAction((List<String>) httpResult.getData());
+            // 如果动作中存在替换协议则 保司标志置为调度
+            resVo.forEach(company->{
+                company.setIsDispatch(0);
+                PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo = agreementDispatchAction.stream().filter(x -> x.getCompanyId().contains(company.getId())).findFirst().orElse(null);
+                if(ptlAgreementDispatchVo != null){
+                    PtlAgreementDispatchAction action1 = ptlAgreementDispatchVo.getActions().stream().filter(action -> action.getActionCode().equals(ActionEnum.SPECIFY_AGREEMENT.getCode())).findFirst().orElse(null);
+                    if(action1 != null){
+                        //将调度字段设为1
+                        company.setIsDispatch(1);
+                        company.setDispatchId(ptlAgreementDispatchVo.getDispatchId());
+                    }
+                }
+            });
+        }
         return resVo;
     }
 

+ 130 - 5
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -12,6 +12,7 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.finance.dto.*;
 import com.jzg.commons.entity.finance.po.*;
 import com.jzg.commons.entity.finance.vo.*;
+import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.po.PtlAgreement;
 import com.jzg.commons.entity.po.SysUploadFiles;
@@ -50,6 +51,8 @@ import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.function.BiConsumer;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 /**
  * @author tz
@@ -1218,16 +1221,138 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     }
 
     @Override
-    public void restockInsPlyIncome(String orderNo, String companyId) {
+    public void restockInsPlyIncome(InsOrderAdjust insOrderAdjust) {
+        final String AGREEMENT_TYPE_PLATFORM = "1";
+        final BigDecimal RATIO_1_06 = new BigDecimal("1.06");
         List<InsPlyIncome> insPlyIncomeList = baseMapper
-                .selectList(new LambdaQueryWrapper<InsPlyIncome>().eq(InsPlyIncome::getOrderNo, orderNo).eq(InsPlyIncome::getCompanyId, companyId));
+                .selectList(new LambdaQueryWrapper<InsPlyIncome>().eq(InsPlyIncome::getOrderNo, insOrderAdjust.getOrderNo()).eq(InsPlyIncome::getCompanyId, insOrderAdjust.getCompanyId()));
         if (insPlyIncomeList.isEmpty()) {
             throw new SystemException("未找到该应收订单");
         }
         InsPlyIncome insPlyIncome = insPlyIncomeList.get(0);
-        InsPlyIncome restockInsPlyIncome = new InsPlyIncome();
-        BeanUtils.copyProperties(insPlyIncome, restockInsPlyIncome);
-        this.save(restockInsPlyIncome);
+        InsPlyIncome restockIncome = new InsPlyIncome();
+        BeanUtils.copyProperties(insPlyIncome, restockIncome);
+        // 获取批改后的保费
+        BigDecimal adjustJqPremium = insOrderAdjust.getAfterJqPremium();
+        BigDecimal adjustSyPremium = insOrderAdjust.getAfterSyPremium();
+        BigDecimal adjustJyPremium = insOrderAdjust.getAfterJyPremium();
+        restockIncome.setJqPremium(adjustJqPremium.toPlainString());
+        restockIncome.setSyPremium(adjustSyPremium.toPlainString());
+        restockIncome.setJyPremium(adjustJyPremium.toPlainString());
+        // 计算手续费
+        calculateAndSetCosts(restockIncome, adjustJqPremium,
+                InsPlyIncome::getJqSuperviseCostsProportion,
+                InsPlyIncome::setJqSuperviseCostsPremiums);
+
+        calculateAndSetCosts(restockIncome, adjustSyPremium,
+                InsPlyIncome::getSySuperviseCostsProportion,
+                InsPlyIncome::setSySuperviseCostsPremiums);
+
+        calculateAndSetCosts(restockIncome, adjustJyPremium,
+                InsPlyIncome::getJySuperviseCostsProportion,
+                InsPlyIncome::setJySuperviseCostsPremiums);
+
+        // 计算并设置跟单费
+        calculateAndSetCosts(restockIncome, adjustJqPremium,
+                InsPlyIncome::getJqOtherCostsProportion,
+                InsPlyIncome::setJqOtherCostsPremiums);
+
+        calculateAndSetCosts(restockIncome, adjustSyPremium,
+                InsPlyIncome::getSyOtherCostsProportion,
+                InsPlyIncome::setSyOtherCostsPremiums);
+
+        calculateAndSetCosts(restockIncome, adjustJyPremium,
+                InsPlyIncome::getJyOtherCostsProportion,
+                InsPlyIncome::setJyOtherCostsPremiums);
+
+        // 计算并设置应收保费(按协议类型处理)
+        calculateAndSetReceivable(restockIncome, adjustJqPremium, adjustSyPremium, adjustJyPremium,
+                AGREEMENT_TYPE_PLATFORM, RATIO_1_06);
+        this.save(restockIncome);
+    }
+    /**
+     * 通用计算费用(手续费/跟单费)并设置到对象
+     * @param income 目标对象
+     * @param premium 保费
+     * @param proportionGetter 比例获取器
+     * @param costSetter 费用设置器
+     */
+    private void calculateAndSetCosts(InsPlyIncome income, BigDecimal premium,
+                                      Function<InsPlyIncome, String> proportionGetter,
+                                      BiConsumer<InsPlyIncome, String> costSetter) {
+        // 转换比例字符串为BigDecimal(处理可能的空值或异常)
+        BigDecimal proportion = new BigDecimal(proportionGetter.apply(income));
+        // 计算费用并设置(使用toPlainString避免科学计数法)
+        BigDecimal cost = premium.multiply(proportion);
+        costSetter.accept(income, cost.toPlainString());
+    }
+
+    /**
+     * 计算并设置应收保费
+     */
+    private void calculateAndSetReceivable(InsPlyIncome income, BigDecimal jqPremium, BigDecimal syPremium, BigDecimal jyPremium,
+                                           String platformAgreementType, BigDecimal ratio106) {
+        // 平台协议逻辑
+        if (platformAgreementType.equals(income.getAgreementType())) {
+            setReceivableForPlatform(income, jqPremium, syPremium, jyPremium);
+        } else {
+            // 私有协议逻辑
+            setReceivableForPrivate(income, jqPremium, syPremium, jyPremium, ratio106);
+        }
+    }
+
+    /**
+     * 平台协议应收保费计算
+     */
+    private void setReceivableForPlatform(InsPlyIncome income, BigDecimal jqPremium, BigDecimal syPremium, BigDecimal jyPremium) {
+        // 从已计算的手续费和跟单费中获取值(避免重复计算)
+        BigDecimal jqTotal = new BigDecimal(income.getJqSuperviseCostsPremiums())
+                .add(new BigDecimal(income.getJqOtherCostsPremiums()));
+
+        BigDecimal syTotal = new BigDecimal(income.getSySuperviseCostsPremiums())
+                .add(new BigDecimal(income.getSyOtherCostsPremiums()));
+
+        BigDecimal jyTotal = new BigDecimal(income.getJySuperviseCostsPremiums())
+                .add(new BigDecimal(income.getJyOtherCostsPremiums()));
+
+        income.setJqReceivablePremium(jqTotal.toPlainString());
+        income.setSyReceivablePremium(syTotal.toPlainString());
+        income.setJyReceivablePremium(jyTotal.toPlainString());
+    }
+
+    /**
+     * 私有协议应收保费计算
+     */
+    private void setReceivableForPrivate(InsPlyIncome income, BigDecimal jqPremium, BigDecimal syPremium, BigDecimal jyPremium,
+                                         BigDecimal ratio106) {
+        // 计算私有协议下的应收保费
+        calculatePrivateReceivable(income, jqPremium, ratio106,
+                InsPlyIncome::getJqSuperviseCostsProportion,
+                InsPlyIncome::getJqOtherCostsProportion,
+                InsPlyIncome::setJqReceivablePremium);
+
+        calculatePrivateReceivable(income, syPremium, ratio106,
+                InsPlyIncome::getSySuperviseCostsProportion,
+                InsPlyIncome::getSyOtherCostsProportion,
+                InsPlyIncome::setSyReceivablePremium);
+
+        calculatePrivateReceivable(income, jyPremium, ratio106,
+                InsPlyIncome::getJySuperviseCostsProportion,
+                InsPlyIncome::getJyOtherCostsProportion,
+                InsPlyIncome::setJyReceivablePremium);
+    }
+
+    /**
+     * 私有协议下单个类型的应收保费计算
+     */
+    private void calculatePrivateReceivable(InsPlyIncome income, BigDecimal premium, BigDecimal ratio106,
+                                            Function<InsPlyIncome, String> superviseProportionGetter,
+                                            Function<InsPlyIncome, String> otherProportionGetter,
+                                            BiConsumer<InsPlyIncome, String> receivableSetter) {
+        BigDecimal base = premium.multiply(ratio106);
+        BigDecimal superviseCost = base.multiply(new BigDecimal(superviseProportionGetter.apply(income)));
+        BigDecimal otherCost = base.multiply(new BigDecimal(otherProportionGetter.apply(income)));
+        receivableSetter.accept(income, superviseCost.add(otherCost).toPlainString());
     }
 }
 

+ 41 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAppManageServiceImpl.java

@@ -0,0 +1,41 @@
+package com.jzg.organization.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.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.SysAppManage;
+import com.jzg.commons.entity.vo.SysAppManageVo;
+import com.jzg.organization.mapper.SysAppManageMapper;
+import com.jzg.organization.service.SysAppManageService;
+import org.springframework.stereotype.Service;
+
+
+@Service
+public class SysAppManageServiceImpl extends ServiceImpl<SysAppManageMapper, SysAppManage> implements SysAppManageService {
+
+    @Override
+    public Page<SysAppManage> queryAppList(SysAppManageVo sysAppManageVo) {
+        try {
+            LambdaQueryWrapper<SysAppManage> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            return baseMapper.selectPage(sysAppManageVo.getPage(), lambdaQueryWrapper);
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new RuntimeException("查询失败");
+        }
+    }
+
+    @Override
+    public HttpResult deleteById(String id) {
+        SysAppManage sysAppManage = baseMapper.selectById(id);
+        if (sysAppManage == null) {
+            return HttpResult.error("该应用不存在");
+        }
+        try {
+            baseMapper.deleteById(id);
+            return HttpResult.ok("删除成功");
+        } catch (Exception e) {
+            return HttpResult.error("删除失败");
+        }
+    }
+}

+ 4 - 4
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserServiceImpl.java

@@ -679,7 +679,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             sysUserJzgInfoService.updateBatchById(sysUserJzgInfoList);
         } else {
             for (String id : isEnableVo.getIds()) {
-                SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getUserByUserId(id);
+                SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getById(id);
                 if (sysUserJzgInfo == null) {
                     throw new SystemException("该用户不存在");
                 }
@@ -735,7 +735,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 .getOne(new LambdaQueryWrapper<SysUserJzgInfoBankCard>().eq(SysUserJzgInfoBankCard::getBankCardNumber, sysUserJzgInfoBankCardVo.getBankCardNumber())
                         .eq(SysUserJzgInfoBankCard::getSystemCode, baseController.getUserSystemCode()));
         if (verifyBankCard != null) {
-            HttpResult.error("该租户下银行卡已存在");
+            return HttpResult.error("该租户下银行卡已存在");
         }
         SysUserJzgInfoBankCard sysUserJzgInfoBankCard = new SysUserJzgInfoBankCard();
         BeanUtils.copyProperties(sysUserJzgInfoBankCardVo, sysUserJzgInfoBankCard);
@@ -871,9 +871,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         sysUserJzgInfo.setPassword("******");
         //角色
         List<SysRole> userRole = sysUserRoleService.getUserRole(sysUser.getId());
-        List<String> roleIds = userRole.stream().map(u -> u.getId()).collect(Collectors.toList());
+        List<String> roleIds = userRole.stream().map(SysRole::getId).collect(Collectors.toList());
         sysUserJzgInfo.setRoleIds(roleIds);
-
+        sysUserJzgInfo.setRoleNames(userRole.stream().map(SysRole::getName).collect(Collectors.toList()));
 
         List<SysUserJzgInfoFile> sysUserJzgInfoFile = sysUserJzgInfoFileService.list
                 (new LambdaQueryWrapper<SysUserJzgInfoFile>().eq(SysUserJzgInfoFile::getUserId, sysUserJzgInfo.getId()));

+ 83 - 57
tenant/organization/src/main/java/com/jzg/organization/service/impl/WechatCustomerServiceManageServiceImpl.java

@@ -1,9 +1,9 @@
 package com.jzg.organization.service.impl;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.entity.po.SysUploadFiles;
-import com.jzg.commons.entity.vo.SysUserAccountVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.organization.entity.WechatCustomerService;
@@ -22,16 +22,14 @@ import me.chanjar.weixin.cp.bean.WxCpBaseResp;
 import me.chanjar.weixin.cp.bean.WxCpDepart;
 import me.chanjar.weixin.cp.bean.WxCpUser;
 import me.chanjar.weixin.cp.bean.kf.*;
-import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
-import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage;
-import me.chanjar.weixin.cp.message.WxCpMessageRouter;
+import me.chanjar.weixin.cp.bean.kf.msg.WxCpKfEventMsg;
+import me.chanjar.weixin.cp.bean.kf.msg.WxCpKfTextMsg;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
 
-import java.io.File;
 import java.io.InputStream;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -54,10 +52,6 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
 
     private final SysUserService sysUserService;
 
-    private final WxCpService wxCpService;
-
-    private final WxCpMessageRouter wxCpMessageRouter;
-
     private final WxCpMediaService wxCpMediaService;
 
     private final WxCpKfService wxCpKfService;
@@ -70,6 +64,10 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
 
     private final BaseController baseController;
 
+    private final XmlMapper xmlMapper = new XmlMapper();
+
+    private final WxCryptUtil wxCryptUtil;
+
     @Value("${minio.bucket-name}")
     private String bucketName;
 
@@ -190,16 +188,11 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
     @Override
     public List<WeComDeptVo> getDeptByDeptId() throws WxErrorException {
         List<WxCpDepart> list = wxCpDepartmentService.list(null);
-        List<WeComDeptVo> deptVos = list.stream()
-                .map(WeComDeptVo::new)
-                .toList();
-        Map<String, List<WeComDeptVo>> parentGroup = deptVos.stream()
-                .collect(Collectors.groupingBy(WeComDeptVo::getParentId));
+        List<WeComDeptVo> deptVos = list.stream().map(WeComDeptVo::new).toList();
+        Map<String, List<WeComDeptVo>> parentGroup = deptVos.stream().collect(Collectors.groupingBy(WeComDeptVo::getParentId));
         List<String> collect = deptVos.stream().map(WeComDeptVo::getDeptId).toList();
         deptVos.forEach(node -> node.setChildDept(parentGroup.getOrDefault(node.getDeptId(), Collections.emptyList())));
-        return deptVos.stream()
-                .filter(node -> node.getParentId() != null && !collect.contains(node.getParentId()))
-                .collect(Collectors.toList());
+        return deptVos.stream().filter(node -> node.getParentId() != null && !collect.contains(node.getParentId())).collect(Collectors.toList());
     }
 
     @Override
@@ -214,30 +207,24 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
     public void saveOrUpdateCustomerServiceDutyRules(WechatCustomerServiceDutyRulesVo sysWechatCustomerDutyRules) {
         // 删除之前的排班信息
         wechatCustomerServiceDutyService.clearCustomerDuty(sysWechatCustomerDutyRules.getCustomerId());
-        List<WechatCustomerServiceDuty> wechatCustomerServiceDuties = sysWechatCustomerDutyRules.getDutyList()
-                .stream()
-                .flatMap(duty -> duty.getDutyConfig().stream()
-                        .map(config -> {
-                            WechatCustomerServiceDuty dutyEntity = new WechatCustomerServiceDuty();
-                            dutyEntity.setCustomerServiceId(sysWechatCustomerDutyRules.getCustomerId());
-                            dutyEntity.setDutyCustomerServiceId(config.getDutyCustomerServiceId());
-                            dutyEntity.setDate(duty.getDutyDate());
-                            dutyEntity.setStartTime(config.getStartTime());
-                            dutyEntity.setEndTime(config.getEndTime());
-                            return dutyEntity;
-                        }))
-                .collect(Collectors.toList());
+        List<WechatCustomerServiceDuty> wechatCustomerServiceDuties = sysWechatCustomerDutyRules.getDutyList().stream().flatMap(duty -> duty.getDutyConfig().stream().map(config -> {
+            WechatCustomerServiceDuty dutyEntity = new WechatCustomerServiceDuty();
+            dutyEntity.setCustomerServiceId(sysWechatCustomerDutyRules.getCustomerId());
+            dutyEntity.setDutyCustomerServiceId(config.getDutyCustomerServiceId());
+            dutyEntity.setDate(duty.getDutyDate());
+            dutyEntity.setStartTime(config.getStartTime());
+            dutyEntity.setEndTime(config.getEndTime());
+            return dutyEntity;
+        })).collect(Collectors.toList());
         // 保存排班信息
         wechatCustomerServiceDutyService.saveBatch(wechatCustomerServiceDuties);
     }
 
     @Override
     public String getWeChatCustomer() throws WxErrorException {
-//        String userName = baseController.getUserName();
+        String userName = baseController.getUserName();
         WechatCustomerService wechatCustomerService = null;
-//        String leaderId = sysUserService.getLeaderId(userName);
-        String userName = "1930514052662677506";
-        String leaderId = "1930514052662677506";
+        String leaderId = sysUserService.getLeaderId(userName);
         if (StringUtils.hasLength(leaderId)) {
             wechatCustomerService = wechatCustomerServiceService.getByUserId(leaderId);
         }
@@ -245,23 +232,14 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
         if (ObjectUtils.isEmpty(wechatCustomerService)) {
             // 获取最近一次的客服记录
             List<WechatCustomerService> sysWechatCustomerList = wechatCustomerServiceService.list();
-            List<Long> sysWechatCustomerIdList = sysWechatCustomerList.stream()
-                    .map(WechatCustomerService::getId)
-                    .collect(Collectors.toList());
-
-            WechatCustomerServiceRecording wechatCustomerServiceRecording = wechatCustomerServiceRecordingService.lambdaQuery()
-                    .in(!sysWechatCustomerIdList.isEmpty(), WechatCustomerServiceRecording::getCustomerServiceId, sysWechatCustomerIdList)
-                    .eq(WechatCustomerServiceRecording::getUserId, userName)
-                    .orderByDesc(WechatCustomerServiceRecording::getCreateTime)
-                    .last("limit 1")
-                    .one();
+            List<Long> sysWechatCustomerIdList = sysWechatCustomerList.stream().map(WechatCustomerService::getId).collect(Collectors.toList());
+
+            WechatCustomerServiceRecording wechatCustomerServiceRecording = wechatCustomerServiceRecordingService.lambdaQuery().in(!sysWechatCustomerIdList.isEmpty(), WechatCustomerServiceRecording::getCustomerServiceId, sysWechatCustomerIdList).eq(WechatCustomerServiceRecording::getUserId, userName).orderByDesc(WechatCustomerServiceRecording::getCreateTime).last("limit 1").one();
             if (ObjectUtils.isEmpty(wechatCustomerServiceRecording)) {
                 wechatCustomerService = wechatCustomerServiceService.getCacheCustomerId(wechatCustomerService);
             } else {
                 // 使用上一次的客服
-                wechatCustomerService = wechatCustomerServiceService.lambdaQuery()
-                        .eq(WechatCustomerService::getId, wechatCustomerServiceRecording.getCustomerServiceId())
-                        .one();
+                wechatCustomerService = wechatCustomerServiceService.lambdaQuery().eq(WechatCustomerService::getId, wechatCustomerServiceRecording.getCustomerServiceId()).one();
                 if (ObjectUtils.isEmpty(wechatCustomerService)) {
                     wechatCustomerService = wechatCustomerServiceService.getCacheCustomerId(wechatCustomerService);
                 }
@@ -272,12 +250,7 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
             wechatCustomerServiceRecordingService.save(customerRecording);
         }
 
-        List<WechatCustomerServiceDuty> list = wechatCustomerServiceDutyService.lambdaQuery()
-                .eq(WechatCustomerServiceDuty::getDutyCustomerServiceId, wechatCustomerService.getId())
-                .eq(WechatCustomerServiceDuty::getDate, LocalDate.now())
-                .le(WechatCustomerServiceDuty::getStartTime, LocalTime.now())
-                .ge(WechatCustomerServiceDuty::getEndTime, LocalTime.now())
-                .list();
+        List<WechatCustomerServiceDuty> list = wechatCustomerServiceDutyService.lambdaQuery().eq(WechatCustomerServiceDuty::getDutyCustomerServiceId, wechatCustomerService.getId()).eq(WechatCustomerServiceDuty::getDate, LocalDate.now()).le(WechatCustomerServiceDuty::getStartTime, LocalTime.now()).ge(WechatCustomerServiceDuty::getEndTime, LocalTime.now()).list();
         if (list != null && !list.isEmpty()) {
             WechatCustomerServiceDuty wechatCustomerServiceDuty = list.get(0);
             wechatCustomerService = wechatCustomerServiceService.getById(wechatCustomerServiceDuty.getDutyCustomerServiceId());
@@ -295,9 +268,62 @@ public class WechatCustomerServiceManageServiceImpl implements WechatCustomerSer
         return accountLink.getUrl();
     }
 
+
     @Override
-    public void callbackSendMsgOnEvent(WxCpXmlMessage wechatEncrypt) {
-        WxCpXmlOutMessage route = wxCpMessageRouter.route(wechatEncrypt);
-        System.out.println(route.toString());
+    public void callbackSendMsgOnEvent(String wechatEncrypt) throws JsonProcessingException, WxErrorException {
+        log.info("回调参数为{}", wechatEncrypt);
+        WechatEncryptVo wechatEncryptVo = xmlMapper.readValue(wechatEncrypt, WechatEncryptVo.class);
+        log.info("解密参数为{}", wechatEncryptVo.getEncrypt());
+        String encrypt = wxCryptUtil.decrypt(wechatEncryptVo.getEncrypt());
+        log.info("解密后的参数为{}", encrypt);
+        WechatCustomerCallbackVo wechatCustomerCallbackVo = xmlMapper.readValue(encrypt, WechatCustomerCallbackVo.class);
+
+        // 获取消息
+        WxCpKfMsgListResp wxCpKfMsgListResp = wxCpKfService.syncMsg(null, wechatCustomerCallbackVo.getToken(), null, null, wechatCustomerCallbackVo.getOpenKfId());
+
+        while (wxCpKfMsgListResp.getHasMore() == 1) {
+            String nextCursor = wxCpKfMsgListResp.getNextCursor();
+            wxCpKfMsgListResp = wxCpKfService.syncMsg(nextCursor, wechatCustomerCallbackVo.getToken(), null, null, wechatCustomerCallbackVo.getOpenKfId());
+        }
+        List<WxCpKfMsgListResp.WxCpKfMsgItem> msgList = wxCpKfMsgListResp.getMsgList();
+        WxCpKfMsgListResp.WxCpKfMsgItem wxCpKfMsgItem = wxCpKfMsgListResp.getMsgList().get(msgList.size() - 1);
+
+        if (wxCpKfMsgItem.getOrigin() == 3) {
+            List<WxCpKfMsgListResp.WxCpKfMsgItem> msgListDTOList = msgList.stream().filter(x -> "event".equals(x.getMsgType())).toList();
+
+            msgListDTOList.forEach(x -> {
+                try {
+                    WxCpKfEventMsg xEvent = x.getEvent();
+                    WxCpKfServiceStateResp serviceState = wxCpKfService.getServiceState(xEvent.getOpenKfid(), xEvent.getExternalUserId());
+                    if (serviceState.getServiceState() == 0) {
+                        List<WechatCustomerService> list = wechatCustomerServiceService.lambdaQuery().eq(WechatCustomerService::getOpenKfId, xEvent.getOpenKfid()).list();
+                        wxCpKfService.transServiceState(xEvent.getOpenKfid(), xEvent.getExternalUserId(), 3, list.get(0).getReceptionistId());
+                    }
+                } catch (WxErrorException e) {
+                    throw new RuntimeException(e);
+                }
+            });
+        }
+
+        WxCpKfEventMsg event = wxCpKfMsgItem.getEvent();
+        if (ObjectUtils.isEmpty(event)) {
+            return;
+        }
+
+        String scene = event.getScene();
+        if (StringUtils.isEmpty(scene)) {
+            return;
+        }
+        if (wxCpKfMsgItem.getOrigin() == 4) {
+            String userName = new BaseController().getUserName();
+            WxCpKfMsgSendRequest wxCpKfMsgSendRequest = new WxCpKfMsgSendRequest();
+            String messages = "你好!" + userName + "(" + userName + ")" + "很高兴为你服务";
+            wxCpKfMsgSendRequest.setCode(event.getWelcomeCode());
+            WxCpKfTextMsg wxCpKfTextMsg = new WxCpKfTextMsg();
+            wxCpKfTextMsg.setContent(messages);
+            wxCpKfMsgSendRequest.setText(wxCpKfTextMsg);
+            wxCpKfService.sendMsgOnEvent(wxCpKfMsgSendRequest);
+        }
+
     }
 }

+ 2 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml

@@ -57,6 +57,7 @@
         <result column="inlet" property="inlet" jdbcType="DECIMAL"/>
         <result column="export" property="export" jdbcType="DECIMAL"/>
         <result column="add_throw" property="addThrow" jdbcType="DECIMAL"/>
+        <result column="keep_point_ratio" property="keepPointRatio" jdbcType="DECIMAL"/>
     </resultMap>
 
 
@@ -281,6 +282,7 @@
             tt.inlet,
             tt.export,
             tt.add_throw,
+            tt.keep_point_ratio,
             CASE
                 WHEN tt.cost_type = '交强险' THEN pa.jq_entrance_fee_ratio
                 WHEN tt.cost_type = '商业险' THEN pa.sy_entrance_fee_ratio

+ 25 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchActionMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.organization.mapper.PtlAgreementDispatchActionMapper">
+
+    <resultMap id="ActionMap" type="com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAction">
+        <id property="id" column="id"/>
+        <result property="dispatchId" column="dispatch_id"/>
+        <result property="actionCode" column="action_code"/>
+        <result property="actionJson" column="action_json"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+    </resultMap>
+
+    <select id="getActions" resultMap="ActionMap">
+        select *
+        from
+            ptl_agreement_dispatch_action
+        where 1=1
+          and dispatch_id in
+        <foreach collection="dispatchIds" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+</mapper>

+ 22 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementDispatchAfterActionMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.organization.mapper.PtlAgreementDispatchAfterActionMapper">
+
+    <resultMap id="ActionMap" type="com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction">
+        <id property="id" column="id"/>
+        <result property="companyId" column="companyId"/>
+        <result property="actionCode" column="action_code"/>
+        <result property="actionJson" column="action_json"
+                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+    </resultMap>
+
+    <select id="getAfterActions" resultMap="ActionMap">
+        select *
+        from
+            ptl_agreement_dispatch_after_action
+        where 1=1
+          and company_id = #{id}
+    </select>
+</mapper>

+ 6 - 2
tenant/organization/src/main/resources/mapper/PtlAgreementMapper.xml

@@ -13,6 +13,7 @@
             <result property="agreementAbbreviation" column="agreement_abbreviation" jdbcType="VARCHAR"/>
             <result property="isEnable" column="is_enable" jdbcType="TINYINT"/>
             <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
+            <result property="partnerCompanyId" column="partner_company_id" jdbcType="VARCHAR"/>
             <result property="startDate" column="start_date" jdbcType="TIMESTAMP"/>
             <result property="endDate" column="end_date" jdbcType="TIMESTAMP"/>
             <result property="moneyTime" column="money_time" jdbcType="INTEGER"/>
@@ -45,7 +46,7 @@
     <sql id="Base_Column_List">
         pa.id,pa.agreement_type,pa.agreement_code,
         pa.agreement_name,pa.agreement_title,pa.agreement_abbreviation,
-        pa.is_enable,pa.company_id,
+        pa.is_enable,pa.company_id,pa.partner_company_id,
         pa.start_date,pa.end_date,pa.money_time,
         pa.match_type,pa.docking_person,pa.docking_phone,
         pa.valid_status,pa.money_type,pa.file_id,
@@ -57,7 +58,7 @@
         pa.update_time,pa.is_delete,paa.username,paa.user_abbr as userAbbr,
         suji.name as managerName,sd.name as managerDeptName,
 --         suf.file_name as fileName,suf.file_size as fileSize,
-        eic.name_simple as company,sdd.name as deptName,
+        eic.name_simple as company,sdd.name as deptName,eica.name_simple as partnerCompanyName,
         pa.api_type,pa.jq_entrance_fee_ratio,pa.sy_entrance_fee_ratio,pa.jy_entrance_fee_ratio
     </sql>
     <select id="queryPage" resultType="com.jzg.commons.entity.vo.AgreementVo">
@@ -69,6 +70,7 @@
         LEFT JOIN sys_dept sd on suji.dept_id = sd.id
         LEFT JOIN sys_upload_files suf on pa.file_id = suf.id
         LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
         <where>
             pa.is_delete = 0
             <if test="param.searchValue != null and param.searchValue != ''">
@@ -126,6 +128,7 @@
         LEFT JOIN sys_dept sd on suji.dept_id = sd.id
         LEFT JOIN sys_upload_files suf on pa.file_id = suf.id
         LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
         <where>
             pa.is_delete = 0
             <if test="param.searchValue != null and param.searchValue != ''">
@@ -180,6 +183,7 @@
         LEFT JOIN sys_dept sd on suji.dept_id = sd.id
 --         LEFT JOIN sys_upload_files suf on suf.id = pa.file_id
         LEFT JOIN esm_ins_company eic on pa.company_id = eic.id
+        LEFT JOIN esm_ins_company eica on pa.partner_company_id = eica.id
         <where>
             <if test="id != null and id != ''">
                 and pa.id = #{id}

+ 7 - 0
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -983,6 +983,13 @@
             </where>
             GROUP BY ipiil.income_id
             ) invoice_summary ON invoice_summary.income_id = ipi.id
+        LEFT JOIN (
+                     SELECT
+                     ifo.order_no,
+                     SUM(DISTINCT (ifo.jq_commission_premium + ifo.sy_commission_premium + ifo.jy_commission_premium)) as total_commission
+                     FROM ins_fee_orders ifo
+                     GROUP BY ifo.order_no
+                     ) fee_summary ON ipi.order_no = fee_summary.order_no
         WHERE
         eic.parent_id = 0
             <if test="settlementReportQueryVo.companyId != null and settlementReportQueryVo.companyId != ''">

+ 9 - 3
tenant/organization/src/main/resources/mapper/SysOrganizationMapper.xml

@@ -34,10 +34,16 @@
 
     <select id="getTeamUserPage" resultType="com.jzg.commons.entity.vo.SysOrganizationUserLinkVo">
         SELECT
-        su.*,
-        suji.*,
+        su.id as userId,
+        suji.id as id,
+        suji.name as name,
+        su.mobile as mobile,
+        suji.type_attr as typeAttr,
+        suji.status as status,
+        suji.is_enable as isEnable,
+        suji.dept_id as deptId,
         sd.NAME AS dept_name,
-        so.attribute,
+        so.attribute as attribute ,
         ref_suji.name as referrer_name,
         ref_su.mobile as referrer_id,
         led_suji.name as leader_name,

+ 2 - 2
tenant/organization/src/main/resources/mapper/SysUserJzgInfoBankCardMapper.xml

@@ -9,7 +9,7 @@
         <result column="bankAddress" jdbcType="VARCHAR" property="bankAddress"/>
         <result column="bankCardNumber" jdbcType="VARCHAR" property="bankCardNumber"/>
         <result column="auditStatus" jdbcType="VARCHAR" property="auditStatus"/>
-        <result column="cardFile" jdbcType="VARCHAR" property="cardFile"/>
+        <result column="cardFileUrl" jdbcType="VARCHAR" property="cardFileUrl"/>
         <result column="systemCode" jdbcType="VARCHAR" property="systemCode"/>
     </resultMap>
 
@@ -22,7 +22,7 @@
             sujibc.bank_address as bankAddress,
             sujibc.bank_card_number as bankCardNumber,
             sujibc.audit_status as auditStatus,
-            sujif.file_url as cardFile
+            sujif.file_url as cardFileUrl
         from
             sys_user_jzg_info_bank_card sujibc
         left join sys_user su on su.id = sujibc.user_id

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

@@ -56,7 +56,7 @@
         su.username as leader_name,
         suji.referrer_id,
         su.username as referrer_name,
-        GROUP_CONCAT(sr.name) as role_name,
+        GROUP_CONCAT(DISTINCT sr.name) as role_name,
         soul.organization_id as organization_id,
         so.name as organization_name,
         suji.create_time as createTime,