twzydn20000928 2 rokov pred
rodič
commit
e3cd6b42cc

+ 9 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/TBuildFlowController.java

@@ -101,4 +101,13 @@ public class TBuildFlowController extends BaseController
     {
         return toAjax(tBuildFlowService.deleteTBuildFlowByIds(ids));
     }
+
+    /**
+     * 查看构建结果
+     */
+    @GetMapping("/getFlow/{subTaskId}")
+    public AjaxResult getFlow(@PathVariable("subTaskId") Long subtaskId)
+    {
+        return success(tBuildFlowService.getFlow(subtaskId));
+    }
 }

+ 10 - 51
kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/TBuildFlow.java

@@ -1,5 +1,6 @@
 package com.kgraph.graph.suport.domain;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.kgraph.common.annotation.Excel;
@@ -11,6 +12,7 @@ import com.kgraph.common.core.domain.BaseEntity;;
  * @author kgraph
  * @date 2023-05-28
  */
+@Data
 public class TBuildFlow extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -18,6 +20,14 @@ public class TBuildFlow extends BaseEntity
     /** 序号 */
     private Long id;
 
+    /** 子任务id */
+    @Excel(name = "子任务id")
+    private String subTaskId;
+
+    /** 故障编码 */
+    @Excel(name = "故障名称")
+    private String errorAppearance;
+
     /** 故障编码 */
     @Excel(name = "故障编码")
     private String errorCode;
@@ -29,55 +39,4 @@ public class TBuildFlow extends BaseEntity
     /** 流程树json */
     @Excel(name = "流程树json")
     private String flowTreeJson;
-
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
-        return id;
-    }
-    public void setErrorCode(String errorCode) 
-    {
-        this.errorCode = errorCode;
-    }
-
-    public String getErrorCode() 
-    {
-        return errorCode;
-    }
-    public void setFlowEncode(String flowEncode) 
-    {
-        this.flowEncode = flowEncode;
-    }
-
-    public String getFlowEncode() 
-    {
-        return flowEncode;
-    }
-    public void setFlowTreeJson(String flowTreeJson) 
-    {
-        this.flowTreeJson = flowTreeJson;
-    }
-
-    public String getFlowTreeJson() 
-    {
-        return flowTreeJson;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("errorCode", getErrorCode())
-            .append("flowEncode", getFlowEncode())
-            .append("flowTreeJson", getFlowTreeJson())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .toString();
-    }
 }

+ 4 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/TBuildFlowMapper.java

@@ -1,6 +1,8 @@
 package com.kgraph.graph.suport.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.kgraph.graph.suport.domain.TBuildFlow;
 
 /**
@@ -58,4 +60,6 @@ public interface TBuildFlowMapper
      * @return 结果
      */
     public int deleteTBuildFlowByIds(Long[] ids);
+
+    public Map getFlow(Long subtaskId);
 }

+ 4 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/ITBuildFlowService.java

@@ -1,6 +1,8 @@
 package com.kgraph.graph.suport.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.kgraph.graph.suport.domain.TBuildFlow;
 
 /**
@@ -58,4 +60,6 @@ public interface ITBuildFlowService
      * @return 结果
      */
     public int deleteTBuildFlowById(Long id);
+
+    Map getFlow(Long subtaskId);
 }

+ 8 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/TBuildFlowServiceImpl.java

@@ -1,7 +1,9 @@
 package com.kgraph.graph.suport.service.impl;
 
 import java.util.List;
-import com.kgraph.common.utils.DateUtils;;
+import java.util.Map;
+
+import com.kgraph.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.kgraph.graph.suport.mapper.TBuildFlowMapper;
@@ -93,4 +95,9 @@ public class TBuildFlowServiceImpl implements ITBuildFlowService
     {
         return tBuildFlowMapper.deleteTBuildFlowById(id);
     }
+
+    @Override
+    public Map getFlow(Long subtaskId) {
+        return tBuildFlowMapper.getFlow(subtaskId);
+    }
 }

+ 22 - 2
kgraph-graph/src/main/resources/mapper/suport/TBuildFlowMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="TBuildFlow" id="TBuildFlowResult">
         <result property="id"    column="id"    />
+        <result property="subTaskId"    column="sub_task_id"    />
+        <result property="errorAppearance"    column="error_appearance"    />
         <result property="errorCode"    column="error_code"    />
         <result property="flowEncode"    column="flow_encode"    />
         <result property="flowTreeJson"    column="flow_tree_json"    />
@@ -16,13 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTBuildFlowVo">
-        select id, error_code, flow_encode, flow_tree_json, create_by, create_time, update_by, update_time from t_build_flow
+        select id, sub_task_id, error_appearance, error_code, flow_encode, flow_tree_json, create_by, create_time, update_by, update_time from t_build_flow
     </sql>
 
     <select id="selectTBuildFlowList" parameterType="TBuildFlow" resultMap="TBuildFlowResult">
         <include refid="selectTBuildFlowVo"/>
         <where>  
-            <if test="errorCode != null  and errorCode != ''"> and error_code = #{errorCode}</if>
+            <if test="errorAppearance != null  and errorAppearance != ''"> and error_appearance = #{errorAppearance}</if>
             <if test="flowEncode != null  and flowEncode != ''"> and flow_encode = #{flowEncode}</if>
             <if test="flowTreeJson != null  and flowTreeJson != ''"> and flow_tree_json = #{flowTreeJson}</if>
         </where>
@@ -36,6 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertTBuildFlow" parameterType="TBuildFlow" useGeneratedKeys="true" keyProperty="id">
         insert into t_build_flow
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="subTaskId != null">sub_task_id,</if>
+            <if test="errorAppearance != null">error_appearance,</if>
             <if test="errorCode != null">error_code,</if>
             <if test="flowEncode != null">flow_encode,</if>
             <if test="flowTreeJson != null">flow_tree_json,</if>
@@ -45,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="subTaskId != null">#{subTaskId},</if>
+            <if test="errorAppearance != null">#{errorAppearance},</if>
             <if test="errorCode != null">#{errorCode},</if>
             <if test="flowEncode != null">#{flowEncode},</if>
             <if test="flowTreeJson != null">#{flowTreeJson},</if>
@@ -58,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateTBuildFlow" parameterType="TBuildFlow">
         update t_build_flow
         <trim prefix="SET" suffixOverrides=",">
+            <if test="subTaskId != null">#{subTaskId},</if>
+            <if test="errorAppearance != null">#{errorAppearance},</if>
             <if test="errorCode != null">error_code = #{errorCode},</if>
             <if test="flowEncode != null">flow_encode = #{flowEncode},</if>
             <if test="flowTreeJson != null">flow_tree_json = #{flowTreeJson},</if>
@@ -79,4 +87,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <select id="getFlow" resultType="Map">
+        select
+            id,
+            sub_task_id subTaskId,
+            error_appearance errorAppearance,
+            error_code errorCode,
+            flow_encode flowEncode,
+            flow_tree_json flowTreeJson
+        from
+            t_build_flow tbf where tbf.sub_task_id = #{subTaskId}
+    </select>
 </mapper>