Преглед на файлове

报价配置-协议调度-新增报错

新增的时候,不填写执行动作时报错的问题
lipf преди 4 месеца
родител
ревизия
43981a866d

+ 3 - 1
commons/src/main/java/com/jzg/commons/entity/agreement/dispatch/dto/PtlAgreementDispatch.java

@@ -8,7 +8,7 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.io.Serializable;
+import java.io.Serial;
 
 @Data
 @NoArgsConstructor
@@ -16,6 +16,8 @@ import java.io.Serializable;
 @Schema(description = "协议调度实体")
 public class PtlAgreementDispatch extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = 1408696065054280481L;
     @Schema(description = "id")
     private String id;
 

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
@@ -12,6 +13,7 @@ import java.util.List;
 @Schema(description = "协议调度规则属性关联实体")
 public class PtlAgreementDispatchRulesAttrLink implements Serializable {
 
+    @Serial
     private static final long serialVersionUID = 1000183859846970741L;
 
     @Schema(description = "id")

+ 10 - 11
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementDispatchServiceImpl.java

@@ -1,9 +1,9 @@
 package com.jzg.organization.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 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;
@@ -69,14 +69,12 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
 
     @Autowired
     PtlAgreementDispatchAfterActionMapper afterActionMapper;
-
-    @Autowired
-    BaseController baseController;
-
     @Override
     @Transactional
     public String addAgreementDispatch(PtlAgreementDispatchVo.DispatchVo ptlAgreementDispatchVo) {
+        log.info("添加协议调度信息: ptlAgreementDispatchVo=[{}]", JSONUtil.toJsonStr(ptlAgreementDispatchVo));
         PtlAgreementDispatch dispatch = new PtlAgreementDispatch(ptlAgreementDispatchVo);
+        // ptl_agreement_dispatch 表中插入数据
         baseMapper.insert(dispatch);
 
         for (PtlAgreementDispatchRulesAttrLink link : ptlAgreementDispatchVo.getAttrLinks()){
@@ -84,12 +82,13 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
         }
         rulesAttrLinkMapper.insert(ptlAgreementDispatchVo.getAttrLinks());
 
-        for (PtlAgreementDispatchAction action  : ptlAgreementDispatchVo.getActions()){
-            action.setId(IdGenerate.nextId());
-            action.setDispatchId(dispatch.getId());
+        if(CollUtil.isNotEmpty(ptlAgreementDispatchVo.getActions())){
+            for (PtlAgreementDispatchAction action : ptlAgreementDispatchVo.getActions()){
+                action.setId(IdGenerate.nextId());
+                action.setDispatchId(dispatch.getId());
+            }
+            actionMapper.insert(ptlAgreementDispatchVo.getActions());
         }
-        actionMapper.insert(ptlAgreementDispatchVo.getActions());
-
         return dispatch.getId();
     }
 
@@ -130,7 +129,7 @@ public class PtlAgreementDispatchServiceImpl extends ServiceImpl<PtlAgreementDis
         List<String> dispatchIds = ptlAgreementDispatches.stream().map(PtlAgreementDispatch::getId).collect(Collectors.toList());
         if (!dispatchIds.isEmpty()) {
             List<SysDict> dispatchBeforeActionDict = sysDictService.getByTypeCode("dispatch_before_action");
-            List<SysDict> dispatchAfterActionDict = sysDictService.getByTypeCode("dispatch_after_action");
+            //List<SysDict> dispatchAfterActionDict = sysDictService.getByTypeCode("dispatch_after_action");
 
             // 查询保司所有的规则属性 然后进行分组
             List<PtlAgreementDispatchRulesAttrLink> ptlAgreementDispatchRulesAttrLinks = rulesAttrLinkMapper.selectList(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()