xuqiang 1 год назад
Родитель
Сommit
4876e84e14
17 измененных файлов с 198 добавлено и 77 удалено
  1. 1 0
      commons/src/main/java/com/jzg/commons/aop/OperatorTrajectory.java
  2. 121 48
      commons/src/main/java/com/jzg/commons/aop/aspect/OperatorTrajectoryAspect.java
  3. 2 0
      commons/src/main/java/com/jzg/commons/entity/dto/AgreementContactAddParam.java
  4. 2 0
      commons/src/main/java/com/jzg/commons/entity/dto/AgreementContactEditParam.java
  5. 5 0
      commons/src/main/java/com/jzg/commons/entity/dto/CostExternalAdd.java
  6. 5 0
      commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostExternalEnd.java
  7. 5 0
      commons/src/main/java/com/jzg/commons/entity/vo/CostExternalListVo.java
  8. 6 0
      tenant/insurance/quotation-summary/pom.xml
  9. 3 3
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/InsOrdersController.java
  10. 15 2
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/factory/CompanyFactory.java
  11. 6 2
      tenant/organization/src/main/java/com/jzg/organization/controller/AgreementController.java
  12. 1 1
      tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostController.java
  13. 8 4
      tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostExternalController.java
  14. 1 2
      tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementCostExternalMapper.java
  15. 2 1
      tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementCostExternalService.java
  16. 2 4
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostExternalServiceImpl.java
  17. 13 10
      tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml

+ 1 - 0
commons/src/main/java/com/jzg/commons/aop/OperatorTrajectory.java

@@ -36,6 +36,7 @@ public @interface OperatorTrajectory {
 
     OperationTypeEnum OperationDict() default OperationTypeEnum.SAVE;
 
+    String  enableDisableDict() default "";
 }
 
 

+ 121 - 48
commons/src/main/java/com/jzg/commons/aop/aspect/OperatorTrajectoryAspect.java

@@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.aop.OperatorTrajectory;
 import com.jzg.commons.async.AsyncFactory;
 import com.jzg.commons.async.AsyncManager;
+import com.jzg.commons.constants.OperationTypeEnum;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.enums.YesNoEnum;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.service.OperatorTrajectoryService;
 import com.jzg.commons.util.GetSelectIdDataUtils;
@@ -22,8 +24,14 @@ import org.aspectj.lang.annotation.AfterThrowing;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.reflect.MethodSignature;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
+import org.springframework.context.expression.MethodBasedEvaluationContext;
+import org.springframework.core.DefaultParameterNameDiscoverer;
+import org.springframework.core.ParameterNameDiscoverer;
+import org.springframework.expression.EvaluationContext;
+import org.springframework.expression.Expression;
+import org.springframework.expression.ExpressionParser;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
 import org.springframework.stereotype.Component;
 
 import java.lang.reflect.Method;
@@ -38,77 +46,108 @@ import java.util.Objects;
 @RequiredArgsConstructor
 public class OperatorTrajectoryAspect {
 
-
-    @Autowired
     @Lazy
-    OperatorTrajectoryService operatorTrajectoryService;
+    private final OperatorTrajectoryService operatorTrajectoryService;
+
+    private final BaseController baseController;
+
+    private final ThreadLocal<MethodContext> methodContext = new ThreadLocal<>();
+    private final ExpressionParser parser = new SpelExpressionParser();
+    private final ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
 
-    @Autowired
-    private BaseController baseController;
 
-    private ThreadLocal<MethodContext> methodContext = new ThreadLocal<>();
 
     @AfterReturning(pointcut = "@annotation(com.jzg.commons.aop.OperatorTrajectory)",returning = "result")
     public void doAfter(JoinPoint joinPoint, HttpResult result) {
-        MethodContext context = methodContext.get();
-        Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
-        Object arg = joinPoint.getArgs()[0];
+        try {
+            MethodContext context = methodContext.get();
+            if (context == null) {
+                log.warn("Method context is null for pointcut: {}", joinPoint.getSignature());
+                return;
+            }
+            Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
+            OperatorTrajectory annotation = method.getAnnotation(OperatorTrajectory.class);
+            if (!joinPoint.getSignature().getName().equals(context.getMethodName())) {
+                log.warn("Mismatched method name in context: {}", context.getMethodName());
+                return;
+            }
+            String id = context.getId();
+            if (StringUtils.isBlank(id)) {
+                throw new SystemException("线程上下文异常,请重试");
+            }
 
-        OperatorTrajectory annotation = method.getAnnotation(OperatorTrajectory.class);
-        if (context != null) {
-            // 验证结果
-            String methodName = context.getMethodName();
-            if(joinPoint.getSignature().getName().equals(methodName)){
-                if(Objects.isNull(context.getId())){
-                    throw new SystemException("线程上下文异常,请重试");
-                }
-                com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(context.getId());
-                if(result.getCode() == 200){
-                    if(byId.getOperatorType().equals("C")){
-                        JSONObject agr = JSON.parseObject(JSONObject.toJSONString(arg));
-                        byId.setPrimaryValue(agr.getString(annotation.primary()));
-                    }
-                    byId.setExecuteStatus(1);
-                }else{
-                    byId.setExecuteStatus(2);
-                    byId.setErrorMsg(result.getMsg());
+            com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(id);
+            if (byId == null) {
+                log.error("Operator trajectory record not found for ID: {}", id);
+                return;
+            }
+            if (result.getCode() == 200) {
+                if ("C".equals(byId.getOperatorType())) {
+                    byId.setPrimaryValue(getId(joinPoint, annotation.primary()));
                 }
-                operatorTrajectoryService.updateById(byId);
+                byId.setExecuteStatus(1); // 成功状态
+            } else {
+                byId.setExecuteStatus(2); // 失败状态
+                byId.setErrorMsg(result.getMsg());
             }
+            operatorTrajectoryService.updateById(byId);
+        } catch (Exception e) {
+            log.error("Error occurred in doAfter", e);
+        } finally {
+            methodContext.remove();
         }
-        // 清除上下文
-        methodContext.remove();
     }
 
 
     //拦截异常消息
     @AfterThrowing(pointcut = "@annotation(com.jzg.commons.aop.OperatorTrajectory)", throwing = "ex")
     public void doAfterThrowing(JoinPoint joinPoint, Throwable ex) {
-        MethodContext context = methodContext.get();
-        if (context != null) {
+        try {
+            MethodContext context = methodContext.get();
+            if (context == null) {
+                log.warn("获取上下文异常: {}", joinPoint.getSignature());
+                return;
+            }
             String methodName = context.getMethodName();
-            if(joinPoint.getSignature().getName().equals(methodName)){
-                com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(context.getId());
-                byId.setExecuteStatus(2);
-                byId.setErrorMsg(ex.getMessage());
-                operatorTrajectoryService.updateById(byId);
+            if (!joinPoint.getSignature().getName().equals(methodName)) {
+                log.warn("方法名称不一致: {}", methodName);
+                return;
             }
+            String id = context.getId();
+            com.jzg.commons.entity.po.OperatorTrajectory byId = operatorTrajectoryService.getById(id);
+            if (byId == null) {
+                log.error("获取上下文ID异常: {}", id);
+                return;
+            }
+
+            byId.setExecuteStatus(2); // 失败状态
+            byId.setErrorMsg(ex.getMessage());
+            operatorTrajectoryService.updateById(byId);
+        } catch (Exception e) {
+            log.error("Error occurred in doAfterThrowing", e);
+        } finally {
+            methodContext.remove();
+        }
+    }
+
+    public String getId(JoinPoint joinPoint, String key) {
+        Object arg = joinPoint.getArgs()[0];
+        if (arg instanceof Collection) {
+            return StringUtils.join(arg);
+        } else if (arg instanceof String) {
+            return String.valueOf(arg);
+        } else if (arg != null) {
+            JSONObject jsonObject = (JSONObject) JSON.toJSON(arg);
+            return jsonObject.getString(key);
         }
-        // 清除上下文
-        methodContext.remove();
+        return null;
     }
 
+
     @Before("@annotation(operatorTrajectory)")
     public void doBefore(JoinPoint point,  OperatorTrajectory operatorTrajectory){
         Object obj = point.getArgs()[0];
-        String id;
-        if (obj instanceof String){
-            id = obj.toString();
-        }else if (obj instanceof Collection){
-            id = StringUtils.join(obj);
-        }else {
-            id = JSON.parseObject(JSONObject.toJSONString(obj)).getString(operatorTrajectory.primary());
-        }
+        String id = getId(point,operatorTrajectory.primary());
         if (isRecorded(operatorTrajectory.isRecorded(),obj)){
             return;
         }
@@ -129,6 +168,13 @@ public class OperatorTrajectoryAspect {
         }
         Object beforeData;
         String operatorName = operatorTrajectory.OperationDict().getName();
+        if (StringUtils.isNotEmpty(operatorTrajectory.enableDisableDict())){
+            if (getEnableDisable(point, operatorTrajectory)){
+                operatorName = OperationTypeEnum.ENABLED.getName();
+            }else {
+                operatorName = OperationTypeEnum.DISABLED.getName();
+            }
+        }
         switch(operatorTrajectory.type()){
             //创建
             case "C":
@@ -153,6 +199,8 @@ public class OperatorTrajectoryAspect {
                 trajectory.setOperationContent(DescriptionUtils.generateDescription(beforeData,operatorName));
                 operatorTrajectoryService.save(trajectory);
                 break;
+                default:
+                    log.warn("Unsupported operator type: {}", operatorTrajectory.type());
 
         }
         // 用于验证上下文
@@ -160,6 +208,31 @@ public class OperatorTrajectoryAspect {
     }
 
 
+    public boolean getEnableDisable(JoinPoint point,  OperatorTrajectory operatorTrajectory){
+        Method method = ((MethodSignature) point.getSignature()).getMethod();
+        EvaluationContext context = new MethodBasedEvaluationContext(
+                null, method, point.getArgs(), parameterNameDiscoverer);
+        Expression expression = parser.parseExpression(operatorTrajectory.enableDisableDict());
+        Object value = expression.getValue(context);
+        if (value instanceof Boolean){
+            return (Boolean) value;
+        }else if (value instanceof String){
+            return Boolean.parseBoolean(String.valueOf(value));
+        }else if (value instanceof Integer){
+            return Integer.parseInt(String.valueOf(value)) == 1;
+        }else if (value instanceof Enum){
+            Class<?> enumClass = value.getClass();
+            Enum<?> enumObj = (Enum<?>) enumClass.cast(value);
+            if (YesNoEnum.YES.equals(enumObj)){
+                return false;
+            }
+            return true;
+        }else {
+            return true;
+        }
+    }
+
+
     public boolean isRecorded(String isRecorded,Object obj) {
         if(StringUtils.isNotBlank(isRecorded)){
             Map<String,Object> map = JSONObject.parseObject(JSONObject.toJSONString(obj), Map.class);

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/dto/AgreementContactAddParam.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.dto;
 
+import com.jzg.commons.aop.LogDescriptionField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Size;
@@ -14,6 +15,7 @@ public class AgreementContactAddParam {
     @Schema(description = "协议名称")
     @Size(min=1,max=50,message = "协议名称长度不能大于50")
     @NotNull(message = "协议名称不能为空")
+    @LogDescriptionField("协议名称")
     private String agreementTitle;
 
     @Schema(description = "协议简称")

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/dto/AgreementContactEditParam.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.dto;
 
+import com.jzg.commons.aop.LogDescriptionField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Size;
@@ -18,6 +19,7 @@ public class AgreementContactEditParam {
     @Schema(description = "协议名称")
     @Size(min=1,max=50,message = "协议名称长度不能大于50")
     @NotNull(message = "协议名称不能为空")
+    @LogDescriptionField("协议名称")
     private String agreementTitle;
 
     @Schema(description = "协议简称")

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/dto/CostExternalAdd.java

@@ -1,6 +1,7 @@
 package com.jzg.commons.entity.dto;
 
 
+import com.jzg.commons.aop.LogDescriptionField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.Valid;
 import jakarta.validation.constraints.NotBlank;
@@ -17,6 +18,10 @@ public class CostExternalAdd {
     @NotBlank(message = "协议ID不能为空")
     private String ptlAgreementId;
 
+    @Schema(description = "协议名称")
+    @LogDescriptionField("协议名称-中增加了一条新的费用")
+    private String agreementTitle;
+
     @Schema(description = "对接人姓名")
     @NotBlank(message = "对接人姓名不能为空")
     private String contactPerson;

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostExternalEnd.java

@@ -1,6 +1,7 @@
 package com.jzg.commons.entity.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jzg.commons.aop.LogDescriptionField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.Valid;
 import jakarta.validation.constraints.NotBlank;
@@ -27,6 +28,10 @@ public class PtlAgreementCostExternalEnd {
     @Schema(description = "险种ID")
     private String productId;
 
+    @Schema(description = "协议名称")
+    @LogDescriptionField("协议名称")
+    private String agreementTitle;
+
     @Schema(description = "生效时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @NotBlank(message = "生效时间不能为空")

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/vo/CostExternalListVo.java

@@ -2,6 +2,7 @@ package com.jzg.commons.entity.vo;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jzg.commons.aop.LogDescriptionField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -20,6 +21,10 @@ public class CostExternalListVo {
     @Schema(description = "协议简称")
     private String agreementAbbreviation;
 
+    @Schema(description = "协议名称")
+    @LogDescriptionField("协议名称-中的的费用")
+    private String agreementTitle;
+
     @Schema(description = "险种")
     private String productName;
 

+ 6 - 0
tenant/insurance/quotation-summary/pom.xml

@@ -73,6 +73,12 @@
             <version>1.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.jzg</groupId>
+            <artifactId>quotation-huatai</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

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

@@ -31,21 +31,21 @@ public class InsOrdersController {
     @Resource
     private InsTaskImagesService insTaskImagesService;
 
-    @OperatorTrajectory(moduleName = "车险订单(补录)",mapperClass = InsOrdersMapper.class,entityClass = InsOrdersAdd.class,isRecorded = "insOrders.isTemporarily")
+    @OperatorTrajectory(moduleName = "车险订单/补录订单)",mapperClass = InsOrdersMapper.class,entityClass = InsOrdersAdd.class,isRecorded = "insOrders.isTemporarily")
     @Operation(summary = "录入订单新增")
     @PostMapping("saveOrders")
     public HttpResult saveOrUpdate(@RequestBody InsOrdersAdd ordersAdd) {
         return insOrdersService.saveOrders(ordersAdd);
     }
 
-
+    @OperatorTrajectory(moduleName = "车险订单/补录订单修改)",mapperClass = InsOrdersMapper.class,entityClass = InsOrdersAdd.class,isRecorded = "insOrders.isTemporarily")
     @Operation(summary = "录入订单修改")
     @PostMapping("updateOrders")
     public HttpResult updateOrders(@RequestBody InsOrdersEnd ordersEnd) {
         return insOrdersService.updateOrders(ordersEnd);
     }
 
-
+    @OperatorTrajectory(moduleName = "车险订单/补录订单删除)",mapperClass = InsOrdersMapper.class,entityClass = InsOrdersAdd.class,type = "D")
     @GetMapping("deleteById")
     @Operation(summary = "删除订单")
     public HttpResult deleteById(@RequestParam("id") Long id) {

+ 15 - 2
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/factory/CompanyFactory.java

@@ -6,7 +6,10 @@ import com.jzg.commons.constants.CompanyConstants;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
-import com.jzg.commons.entity.orders.po.*;
+import com.jzg.commons.entity.orders.po.InsOrders;
+import com.jzg.commons.entity.orders.po.InsOrdersCarInfo;
+import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
+import com.jzg.commons.entity.orders.po.InsOrdersRisk;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.spring.SpringUtils;
@@ -25,9 +28,15 @@ import com.jzg.quotation.summary.factory.decorator.quote.QuoteDispatchDecorator;
 import com.jzg.quotation.summary.factory.decorator.quote.QuoteProxyFactory;
 import com.jzg.quotation.summary.factory.decorator.quote.QuoteRestrictDecorator;
 import com.jzg.quotation.summary.service.*;
-import com.jzg.quotation.yongcheng.api.service.impl.YongChengApiRequestImpl;
 import com.jzg.quotation.yangguang.api.service.impl.YangGuangApiRequestImpl;
+import com.jzg.quotation.yongcheng.api.service.impl.YongChengApiRequestImpl;
+import com.jzg.commons.entity.orders.po.InsOrders;
+import com.jzg.commons.entity.orders.po.InsOrdersCarInfo;
+import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
+import com.jzg.commons.entity.orders.po.InsOrdersRisk;
 import com.jzg.quotation.guoren.api.service.Impl.GuoRenApiRequestImpl;
+import com.jzg.quotation.yongcheng.api.service.impl.YongChengApiRequestImpl;
+import com.jzg.quote.huatai.api.service.Impl.HuaTaiApiRequestImpl;
 import io.minio.MinioClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -98,6 +107,10 @@ public class CompanyFactory {
         if (CompanyConstants.XDCX.getCompanyCode().equals(companyCode)) {
             quoteService = SpringUtils.getBean(GuoRenApiRequestImpl.class);
         }
+        // 华泰
+        if (CompanyConstants.HTIC.getCompanyCode().equals(companyCode)){
+            quoteService = SpringUtils.getBean(HuaTaiApiRequestImpl.class);
+        }
         return quoteService;
     }
 

+ 6 - 2
tenant/organization/src/main/java/com/jzg/organization/controller/AgreementController.java

@@ -2,6 +2,7 @@ package com.jzg.organization.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.aop.OperatorTrajectory;
+import com.jzg.commons.constants.OperationTypeEnum;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.*;
@@ -87,7 +88,7 @@ public class AgreementController extends BaseController {
      * @param param
      * @return
      */
-    @OperatorTrajectory(moduleName = "报价配置/协议管理/添加协议",type = "U", mapperClass = PtlAgreementMapper.class,entityClass = AgreementAddParam.class)
+    @OperatorTrajectory(moduleName = "报价配置/协议管理/添加协议",type = "U",OperationDict = OperationTypeEnum.UPDATE, mapperClass = PtlAgreementMapper.class,entityClass = AgreementAddParam.class)
     @Operation(summary = "协议修改")
     @PostMapping("/agreementEdit")
     public HttpResult agreementEdit(@Validated @RequestBody AgreementEditParam param) {
@@ -156,6 +157,7 @@ public class AgreementController extends BaseController {
      *
      * @param ids 主键串
      */
+    @OperatorTrajectory(moduleName = "报价配置/协议管理/(启用、禁用)协议",primary = "ids",OperationDict = OperationTypeEnum.DELETE, type = "D", mapperClass = PtlAgreementMapper.class,entityClass = AgreementAddParam.class)
     @Operation(summary = "批量删除协议")
     @DeleteMapping("/agreementDelete")
     public HttpResult agreementDelete(String[] ids) {
@@ -167,7 +169,7 @@ public class AgreementController extends BaseController {
      * @param upAndDownVo
      * @return
      */
-    @OperatorTrajectory(moduleName = "报价配置/协议管理/(启用、禁用)协议",primary = "ids", type = "U", mapperClass = PtlAgreementMapper.class,entityClass = AgreementAddParam.class)
+    @OperatorTrajectory(moduleName = "报价配置/协议管理/(启用、禁用)协议",enableDisableDict = "#upAndDownVo.opType", primary = "ids", type = "U", mapperClass = PtlAgreementMapper.class,entityClass = AgreementAddParam.class)
     @PostMapping("/sysUpAndDown")
     @Operation(summary = "启用/禁用协议")
     public HttpResult upAndDown(@RequestBody UpAndDownVo upAndDownVo) {
@@ -192,6 +194,7 @@ public class AgreementController extends BaseController {
      * @param param
      * @return
      */
+    @OperatorTrajectory(moduleName = "报价配置/外部协议/添加协议", mapperClass = PtlAgreementMapper.class,entityClass = AgreementContactAddParam.class)
     @Operation(summary = "外部协议添加")
     @PostMapping("/contactAdd")
     public HttpResult contactAdd(@Validated @RequestBody AgreementContactAddParam param) {
@@ -212,6 +215,7 @@ public class AgreementController extends BaseController {
      * @param param
      * @return
      */
+    @OperatorTrajectory(moduleName = "报价配置/外部协议/修改协议",type = "U",OperationDict = OperationTypeEnum.UPDATE, mapperClass = PtlAgreementMapper.class,entityClass = AgreementContactAddParam.class)
     @Operation(summary = "外部协议修改")
     @PostMapping("/contactEdit")
     public HttpResult contactEdit(@Validated @RequestBody AgreementContactEditParam param) {

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

@@ -55,7 +55,7 @@ public class PtlAgreementCostController {
         return ptlAgreementCostService.queryById(id);
     }
 
-    @OperatorTrajectory(moduleName = "报价配置/费用管理/(启用、禁用)费用",OperationDict = OperationTypeEnum.ENABLED, type = "U", mapperClass = PtlAgreementCostMapper.class,entityClass = PtlAgreementCostVo.class)
+    @OperatorTrajectory(moduleName = "报价配置/费用管理/(启用、禁用)费用",enableDisableDict="#isEnabled", type = "U", mapperClass = PtlAgreementCostMapper.class,entityClass = PtlAgreementCostVo.class)
     @Operation(summary = "协议费用管理批量禁用/启用")
     @PostMapping("enableDisableByIds")
     public HttpResult enableDisableByIds(@RequestBody @NotEmpty(message = "id不能为空") List<String> ids, @NotNull(message = "状态不能为空") Boolean isEnabled){

+ 8 - 4
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostExternalController.java

@@ -1,9 +1,12 @@
 package com.jzg.organization.controller;
 
 
+import com.jzg.commons.aop.OperatorTrajectory;
+import com.jzg.commons.constants.OperationTypeEnum;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.vo.CostExternalListVo;
+import com.jzg.organization.mapper.PtlAgreementCostExternalMapper;
 import com.jzg.organization.service.PtlAgreementCostExternalService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -26,6 +29,7 @@ public class PtlAgreementCostExternalController {
     @Resource
     private PtlAgreementCostExternalService ptlAgreementCostExternalService;
 
+    @OperatorTrajectory(entityClass = CostExternalAdd.class,mapperClass = PtlAgreementCostExternalMapper.class, moduleName ="报价配置/外部协议/费用管理")
     @PostMapping("save")
     @Operation(summary= "补录协议费用新增")
     public HttpResult save(@Valid @RequestBody CostExternalAdd costExternalAdd){
@@ -39,7 +43,7 @@ public class PtlAgreementCostExternalController {
         return ptlAgreementCostExternalService.selectByAgreementIdAll(costExternalParam);
     }
 
-
+    @OperatorTrajectory(entityClass = CostExternalListVo.class,type = "D",mapperClass = PtlAgreementCostExternalMapper.class, moduleName ="报价配置/外部协议/费用修改", OperationDict = OperationTypeEnum.UPDATE)
     @PostMapping("updateList")
     @Operation(summary= "批量编辑")
     public HttpResult updateList(@Valid @RequestBody CostExternalEnd costExternalEnd){
@@ -53,7 +57,7 @@ public class PtlAgreementCostExternalController {
         return ptlAgreementCostExternalService.getById(id);
     }
 
-
+    @OperatorTrajectory(entityClass = CostExternalListVo.class,type = "U",mapperClass = PtlAgreementCostExternalMapper.class, moduleName ="报价配置/外部协议/费用修改", OperationDict = OperationTypeEnum.UPDATE)
     @PostMapping("updateById")
     @Operation(summary= "补录协议费用修改")
     public HttpResult updateById(@RequestBody PtlAgreementCostExternalEnd costExternalEnd){
@@ -67,14 +71,14 @@ public class PtlAgreementCostExternalController {
         return ptlAgreementCostExternalService.costExternalList(costExternalParam);
     }
 
-
+    @OperatorTrajectory(entityClass = CostExternalListVo.class,type = "D", mapperClass = PtlAgreementCostExternalMapper.class, moduleName ="报价配置/外部协议/费用删除", OperationDict = OperationTypeEnum.DELETE)
     @PostMapping("deleteById")
     @Operation(summary = "批量删除")
     public HttpResult deleteById(@RequestBody List<Long> ids){
         return ptlAgreementCostExternalService.removeBatchByIds(ids) ? HttpResult.ok("删除成功") : HttpResult.error("删除失败");
     }
 
-
+    @OperatorTrajectory(entityClass = CostExternalListVo.class,type = "D", mapperClass = PtlAgreementCostExternalMapper.class, moduleName ="报价配置/外部协议/费用删除", OperationDict = OperationTypeEnum.DELETE)
     @PostMapping("deleteByPtlAgreementIdAndMobile")
     @Operation(summary = "通过协议ID 与 对接人手机号删除")
     public HttpResult deleteByPtlAgreementIdAndMobile(@Valid @RequestBody CostExternalDeleteParam costExternalDeleteParam){

+ 1 - 2
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAgreementCostExternalMapper.java

@@ -20,8 +20,7 @@ public interface  PtlAgreementCostExternalMapper extends BaseMapper<PtlAgreement
 
     List<CostExternalVo> costExternalList(CostExternalParam costExternalParam);
 
-
-    CostExternalListVo getById(Long id);
+    CostExternalListVo selectById(Long id);
 
     Page<CostExternalListVo> pageList(Page page, @Param("costParam") CostExternalPageParam costParam);
 

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.po.PtlAgreementCostExternal;
+import com.jzg.commons.entity.vo.CostExternalListVo;
 
 import java.util.List;
 
@@ -11,7 +12,7 @@ public interface PtlAgreementCostExternalService extends IService<PtlAgreementCo
 
     HttpResult save(CostExternalAdd costExternalAdd);
 
-    HttpResult getById(Long id);
+    HttpResult<CostExternalListVo> getById(Long id);
 
     HttpResult updateById(PtlAgreementCostExternalEnd costExternalEnd);
 

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

@@ -84,11 +84,9 @@ public class PtlAgreementCostExternalServiceImpl extends ServiceImpl<PtlAgreemen
 
 
 
-
-
     @Override
-    public HttpResult getById(Long id) {
-        return HttpResult.ok(baseMapper.getById(id));
+    public HttpResult<CostExternalListVo> getById(Long id) {
+        return HttpResult.ok(baseMapper.selectById(id));
     }
 
     @Override

+ 13 - 10
tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml

@@ -24,6 +24,7 @@
         <result column="audit_person" property="auditPerson" />
         <result column="audit_time" property="auditTime" />
         <result column="review_description" property="reviewDescription" />
+        <result column="agreement_title" property="agreementTitle" />
         <collection property="costExternalTypeAdds" column="id" ofType="com.jzg.commons.entity.vo.CostExternalTypeVo" select="selectCostExternalTypeVo" />
     </resultMap>
 
@@ -52,9 +53,12 @@
 
     <sql id="Base_Column">
         SELECT
-            id,ptl_agreement_id,product_name,product_id,effective_time,failure_time,audit_method,audit_status,is_enabled,review_description,audit_person,audit_time,is_inquiry,cost_describe,contact_person,contact_mobile,is_delete
+            ce.id,ce.ptl_agreement_id,ce.product_name,ce.product_id,ce.effective_time,ce.failure_time,ce.audit_method,ce.audit_status,ce.is_enabled,
+            ce.review_description,ce.audit_person,ce.audit_time,ce.is_inquiry,ce.cost_describe,ce.contact_person,ce.contact_mobile,ce.is_delete,
+            pa.agreement_title
         FROM
-            ptl_agreement_cost_external
+            ptl_agreement_cost_external ce
+            LEFT JOIN ptl_agreement pa ON pa.id = ce.ptl_agreement_id
     </sql>
 
     <sql id="Base_Column_type">
@@ -69,11 +73,10 @@
     </delete>
 
 
-    <select id="getById" resultMap="CostExternalListVoMap">
-        <include refid="Base_Column" /> WHERE id = #{id}
+    <select id="selectById" resultMap="CostExternalListVoMap">
+        <include refid="Base_Column" /> WHERE ce.id = #{id}
     </select>
 
-
     <select id="costExternalList" resultMap="CostExternalVoMap">
         SELECT
             contact_person,
@@ -91,7 +94,7 @@
     </select>
 
     <select id="selectByIds" resultMap="CostExternalListVoMap">
-        <include refid="Base_Column" /> WHERE id in (${ids})
+        <include refid="Base_Column" /> WHERE ce.id in (${ids})
     </select>
 
     <select id="selectCostExternalTypeVo" resultType="com.jzg.commons.entity.vo.CostExternalTypeVo">
@@ -168,15 +171,15 @@
     <select id="selectByAgreementIdAll" resultMap="CostExternalListVoMap">
         <include refid="Base_Column" />
         <where>
-            is_delete = 0
+            ce.is_delete = 0
             <if test="ptlAgreementId != null and ptlAgreementId != ''">
-                AND ptl_agreement_id = #{ptlAgreementId}
+                AND ce.ptl_agreement_id = #{ptlAgreementId}
             </if>
             <if test="contactPerson != null and contactPerson != ''">
-                AND contact_person = #{contactPerson}
+                AND ce.contact_person = #{contactPerson}
             </if>
             <if test="contactMobile != null and contactMobile != ''">
-                AND contact_mobile = #{contactMobile}
+                AND ce.contact_mobile = #{contactMobile}
             </if>
         </where>
     </select>