浏览代码

巡检查询

wangbo 4 年之前
父节点
当前提交
6e78444938

+ 0 - 19
operation_manager/src/main/java/com/huaxu/task/controller/PlanManageController.java

@@ -218,23 +218,4 @@ public class PlanManageController {
     public AjaxMessage<Integer> batchDelete( @ApiParam(value = "巡检计划ids") @RequestParam List<Integer> ids){
         return new AjaxMessage<>(ResultStatus.OK, planManageService.batchDelete(ids));
     }
-
-    @GetMapping("/task/handle")
-    @ApiOperation(value = "流程处理")
-    public AjaxMessage approvePlan(@ApiParam(value = "任务ID", required = true) @RequestParam(required = true) String taskId,
-                                   @ApiParam(value = "流程状态(审批:1,接单:2,拒单:3)", required = true) @RequestParam(required = true) Integer actionId,
-                                   @ApiParam(value = "流程备注", required = false) @RequestParam(required = false) String comment){
-        Action action = null;
-        if(actionId==1){
-            action=Action.ACTION_AUDIT;
-        }else if(actionId==2){
-            action=Action.ACTION_RECEIVE;
-        }
-        else if(actionId==3){
-            action=Action.ACTION_REJECT;
-        }
-        Map<String,Object>args=new HashMap<>();
-        List<TaskPorcessResult> results = workFlowService.handleTask(Action.ACTION_AUDIT, taskId, args, comment);
-        return new AjaxMessage(ResultStatus.OK,results);
-    }
 }

+ 4 - 3
operation_manager/src/main/java/com/huaxu/task/entity/TaskManage.java

@@ -8,14 +8,15 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 @Data
 @ApiModel
 public class TaskManage extends PlanManageDto implements Serializable {
 
-    @ApiModelProperty(value = "工作流日志")
-    WorkFlowLog workFlowLog;
-
     @ApiModelProperty(value = "工作流详情")
     WorkFlowDetail workFlowDetail;
+
+    @ApiModelProperty(value = "工作流日志集合")
+    List<WorkFlowDetail> workFlowLogList;
 }

+ 1 - 1
operation_manager/src/main/resources/generator/generatorConfig.xml

@@ -59,7 +59,7 @@
         <!-- 列出要生成代码的所有表,这里配置的是不生成Example文件 -->
         <!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample
                    是否生成 example类   -->
-        <table tableName="sc_plan_manage" domainObjectName="PlanManage"
+        <table tableName="sc_work_flow_log" domainObjectName="WorkFlowLog222"
                enableCountByExample="false"
                enableUpdateByExample="false"
                enableDeleteByExample="false"

+ 35 - 17
operation_manager/src/main/resources/mapper/task/PlanManageMapper.xml

@@ -31,8 +31,33 @@
     <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
   </resultMap>
 
+  <resultMap id="workFlowLogResultMap" type="com.huaxu.order.entity.WorkFlowLog">
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="flow_id" property="flowId" jdbcType="INTEGER" />
+    <result column="log_process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
+    <result column="task_id" property="taskId" jdbcType="VARCHAR" />
+    <result column="handle_user_id" property="handleUserId" jdbcType="VARCHAR" />
+    <result column="handle_user_name" property="handleUserName" jdbcType="VARCHAR" />
+    <result column="flow_type" property="flowType" jdbcType="INTEGER" />
+    <result column="flow_result" property="flowResult" jdbcType="VARCHAR" />
+    <result column="log_create_by" property="createBy" jdbcType="VARCHAR" />
+    <result column="log_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
+    <result column="log_update_by" property="updateBy" jdbcType="VARCHAR" />
+    <result column="log_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
+  </resultMap>
+
   <resultMap id="TaskResultMap" type="com.huaxu.task.entity.TaskManage" extends="BaseResultMap">
-    <association property="workFlowLog" javaType="com.huaxu.order.entity.WorkFlowLog">
+    <association property="workFlowDetail" javaType="com.huaxu.order.entity.WorkFlowDetail">
+      <id column="id" property="id" jdbcType="INTEGER" />
+      <result column="flow_id" property="flowId" jdbcType="INTEGER" />
+      <result column="flow_type" property="flowType" jdbcType="INTEGER" />
+      <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
+      <result column="detail_create_by" property="createBy" jdbcType="VARCHAR" />
+      <result column="detail_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
+      <result column="detail_update_by" property="updateBy" jdbcType="VARCHAR" />
+      <result column="detail_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
+    </association>
+    <collection property="workFlowLogList" ofType="com.huaxu.order.entity.WorkFlowLog" javaType="java.util.List" select="getWorkFlowLog" column="{flowId=id}">
       <id column="id" property="id" jdbcType="INTEGER" />
       <result column="flow_id" property="flowId" jdbcType="INTEGER" />
       <result column="log_process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
@@ -45,17 +70,7 @@
       <result column="log_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
       <result column="log_update_by" property="updateBy" jdbcType="VARCHAR" />
       <result column="log_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
-    </association>
-    <association property="workFlowDetail" javaType="com.huaxu.order.entity.WorkFlowDetail">
-      <id column="id" property="id" jdbcType="INTEGER" />
-      <result column="flow_id" property="flowId" jdbcType="INTEGER" />
-      <result column="flow_type" property="flowType" jdbcType="INTEGER" />
-      <result column="flow_detail" property="flowDetail" jdbcType="VARCHAR" />
-      <result column="detail_create_by" property="createBy" jdbcType="VARCHAR" />
-      <result column="detail_date_create" property="dateCreate" jdbcType="TIMESTAMP" />
-      <result column="detail_update_by" property="updateBy" jdbcType="VARCHAR" />
-      <result column="detail_date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
-    </association>
+    </collection>
   </resultMap>
 
   <sql id="Base_Column_List" >
@@ -66,6 +81,13 @@
     task_checked
   </sql>
 
+  <select id="getWorkFlowLog" resultMap="workFlowLogResultMap" parameterType="map">
+        select t3.process_instance_id log_process_instance_id,t3.task_id,t3.handle_user_id,t3.handle_user_name,t3.flow_result,t3.create_by log_create_by,
+        t3.date_create log_date_create,t3.update_by log_update_by,t3.date_update log_date_update
+        from sc_work_flow_log t3
+        where t3.flow_id= #{flowId,jdbcType=INTEGER} and t3.flow_type=1
+    </select>
+
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
@@ -367,13 +389,9 @@
     task_content, task_area_shape, task_area_name, task_type, plan_status, tenant_id,
     t1.process_instance_id, process_def_id, current_task_id, current_users, current_task_name,
     t1.create_by, t1.date_create, t1.update_by, t1.date_update, company_org_id, department_org_id,task_checked,
-    t2.flow_detail,t2.create_by detail_create_by,t2.date_create detail_date_create,t2.update_by detail_update_by,t2.date_update detail_date_update,
-    t3.process_instance_id log_process_instance_id,t3.task_id,t3.handle_user_id,t3.handle_user_name,t3.flow_result,t3.create_by log_create_by,
-    t3.date_create log_date_create,t3.update_by log_update_by,t3.date_update log_date_update
+    t2.flow_detail,t2.create_by detail_create_by,t2.date_create detail_date_create,t2.update_by detail_update_by,t2.date_update detail_date_update
     from sc_plan_manage t1 left  join sc_work_flow_detail t2
     on t1.id = t2.flow_id and t2.flow_type=1
-    left join sc_work_flow_log t3
-    on t3.flow_id = t1.id and t3.flow_type=1
     <where>
       <if test="plan.tenantId != null and plan.tenantId != ''">
         and t1.tenant_id = #{plan.tenantId}