Browse Source

Merge remote-tracking branch 'origin/master'

yuejiaying 4 năm trước cách đây
mục cha
commit
c8c33719f5

+ 14 - 7
operation_manager/src/main/java/com/huaxu/task/controller/PlanManageController.java

@@ -209,14 +209,9 @@ public class PlanManageController {
         String startProcess = workFlowService.startProcess(processDefinition,vars);
         Task task = workFlowService.getProcessRuntimeTask(startProcess).get(0);
         Set<String> taskParticipator = workFlowService.getTaskParticipator(task.getId(),false,null);
-        String currentUsers = null;
+        String currentUsers = "";
         for (String str : taskParticipator) {
-            if(currentUsers == null){
-                currentUsers = str;
-            }
-            else {
-                currentUsers +=String.format(",%s",str);
-            }
+            currentUsers += String.format("%s,",str);
         }
         //更新计划表的流程相关字段值。
         planManage.setPlanStatus(1);//已执行
@@ -268,6 +263,18 @@ public class PlanManageController {
         return new AjaxMessage<>(ResultStatus.OK, planManageService.batchDelete(ids));
     }
 
+    @GetMapping("/plan/getTaskName")
+    @ApiOperation(value = "查询节点名称")
+    public AjaxMessage<Object> selectTaskName(
+            @ApiParam(value = "任务类型(巡检:7,侧漏:8,养护:9)", required = false) @RequestParam(required = false) Integer taskType){
+        LoginUser loginUser = UserUtil.getCurrentUser();
+        loginUser.setId(235);
+        Map<String,Object> map = new HashMap<>();
+        map.put("currentUsers",loginUser.getId());
+        map.put("taskType",taskType);
+        List<Map<String,Object>> result = planManageService.selectTaskName(map);
+        return new AjaxMessage(ResultStatus.OK,result);
+    }
 
     /**
      * 获取并设置用户名称

+ 2 - 0
operation_manager/src/main/java/com/huaxu/task/dao/PlanManageMapper.java

@@ -32,4 +32,6 @@ public interface PlanManageMapper {
     PlanManageDto selectPlanDetail(Integer id);
 
     int selectPendingPower(Map<String,Object> map);
+
+    List<Map<String,Object>> selectTaskName(Map<String,Object> map);
 }

+ 5 - 0
operation_manager/src/main/java/com/huaxu/task/service/PlanManageService.java

@@ -57,4 +57,9 @@ public interface PlanManageService {
      * 待处理权限
      */
     int selectPendingPower(Map<String,Object> map);
+
+    /**
+     * 流程节点名称
+     */
+    List<Map<String,Object>> selectTaskName(Map<String,Object> map);
 }

+ 5 - 0
operation_manager/src/main/java/com/huaxu/task/service/impl/PlanManageServiceImpl.java

@@ -62,4 +62,9 @@ public class PlanManageServiceImpl implements PlanManageService {
     public int selectPendingPower(Map<String, Object> map) {
         return planManageMapper.selectPendingPower(map);
     }
+
+    @Override
+    public List<Map<String,Object>> selectTaskName(Map<String, Object> map) {
+        return planManageMapper.selectTaskName(map);
+    }
 }

+ 12 - 3
operation_manager/src/main/resources/mapper/task/PlanManageMapper.xml

@@ -57,6 +57,7 @@
       <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" />
@@ -447,13 +448,21 @@
     order by t1.date_create
   </select>
 
-
   <!--待处理权限-->
   <select id="selectPendingPower" resultType="java.lang.Integer" parameterType="map">
     select count(1) from sc_plan_manage
-    where id = #{id,jdbcType=INTEGER} and INSTR(t1.current_users,#{currentUsers,jdbcType=VARCHAR})
+    where id = #{id,jdbcType=INTEGER} and INSTR(current_users,#{currentUsers,jdbcType=VARCHAR})
   </select>
 
+  <!--查询流程节点-->
+  <select id="selectTaskName" resultType="map" parameterType="map">
+    select distinct current_task_name 任务节点,task_type 任务类型 from sc_plan_manage
+    where INSTR(current_users,#{currentUsers,jdbcType=VARCHAR})
+    <if test="taskType != null">
+      and task_type = #{taskType,jdbcType=INTEGER}
+    </if>
+    order by task_type
+  </select>
 
   <!--删除-->
   <delete id="batchDelete">
@@ -468,7 +477,7 @@
   <select id="selectPlanDetail" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select t1.*,t2.flow_detail
     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_detail t2 on t1.INTEGERid=t2.flow_id and t2.flow_type=1
     where t1.id = #{id,jdbcType=INTEGER}
   </select>