wangbo 4 years ago
parent
commit
9b696d97df

+ 20 - 24
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderManageController.java

@@ -390,8 +390,8 @@ public class WorkOrderManageController {
         //流程查询, 测试参数:(test1 1 1)
         ProcessDefinition processDefinition = workFlowService.findProcessDefinition(
                 "test1",
-                1,
-                1);
+                8,
+                8);
         if(processDefinition == null){
             new AjaxMessage(ResultStatus.ERROR,"没有创建流程,不能派单!");
         }
@@ -471,27 +471,24 @@ public class WorkOrderManageController {
             @ApiParam(value = "任务ID", required = true) @RequestParam(required = true) Integer id,
             @ApiParam(value = "流程ID", required = true) @RequestParam(required = true) String processInstanceId,
             @ApiParam(value = "流程备注", required = false) @RequestParam(required = false) String remark) {
-        Boolean delFlow = workFlowService.deleteProcessInstance(processInstanceId,remark);
-        if(delFlow ==true) {
-            WorkOrderManage workOrderManage = new WorkOrderManage();
-            workOrderManage.setId(id);
-            workOrderManage.setOrderStatus(3);//工单终止状态
-            workOrderManage.setCurrentUsers("");
-            workOrderManageService.updateByPrimaryKeySelective(workOrderManage);
-            LoginUser currentUser = UserUtil.getCurrentUser();
-            WorkFlowLog workFlowLog=new WorkFlowLog();
-            workFlowLog.setFlowId(id);
-            workFlowLog.setFlowType(1);
-            workFlowLog.setFlowResult(remark);
-            workFlowLog.setCreateBy(currentUser.getId()!=null?currentUser.getId().toString():null);
-            workFlowLog.setDateCreate(new Date());
-            workFlowLog.setHandleUserId(currentUser.getId()!=null?currentUser.getId().toString():null);
-            workFlowLog.setHandleUserName(currentUser.getUsername());
-            //记录日志
-            workFlowLogService.insert(workFlowLog);
-            return new AjaxMessage<>(ResultStatus.OK);
-        }
-        return new AjaxMessage<>(ResultStatus.ERROR);
+        workFlowService.stopProcessInstance(processInstanceId);
+        WorkOrderManage workOrderManage = new WorkOrderManage();
+        workOrderManage.setId(id);
+        workOrderManage.setOrderStatus(3);//工单终止状态
+        workOrderManage.setCurrentUsers("");
+        workOrderManageService.updateByPrimaryKeySelective(workOrderManage);
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        WorkFlowLog workFlowLog=new WorkFlowLog();
+        workFlowLog.setFlowId(id);
+        workFlowLog.setFlowType(1);
+        workFlowLog.setFlowResult(remark);
+        workFlowLog.setCreateBy(currentUser.getId()!=null?currentUser.getId().toString():null);
+        workFlowLog.setDateCreate(new Date());
+        workFlowLog.setHandleUserId(currentUser.getId()!=null?currentUser.getId().toString():null);
+        workFlowLog.setHandleUserName(currentUser.getUsername());
+        //记录日志
+        workFlowLogService.insert(workFlowLog);
+        return new AjaxMessage<>(ResultStatus.OK);
     }
 
     @RequestMapping(value="batchDelete" , method = RequestMethod.DELETE)
@@ -507,7 +504,6 @@ public class WorkOrderManageController {
     @ApiOperation(value = "批量插入工单信息(报警生成的)")
     public Integer saveByAlarms(
             @ApiParam(value = "工单信息", required = true) @RequestBody List<WorkOrderManageByAlarmDto> workOrderManages){
-
         return workOrderManageService.batchInsertByAlarms(workOrderManages);
     }
 

+ 18 - 21
operation_manager/src/main/java/com/huaxu/task/controller/PlanManageController.java

@@ -285,27 +285,24 @@ public class PlanManageController {
             @ApiParam(value = "任务ID", required = true) @RequestParam(required = true) Integer id,
             @ApiParam(value = "流程ID", required = true) @RequestParam(required = true) String processInstanceId,
             @ApiParam(value = "流程备注", required = false) @RequestParam(required = false) String remark) {
-        Boolean delFlow = workFlowService.deleteProcessInstance(processInstanceId,remark);
-        if(delFlow ==true) {
-            PlanManage planManage = new PlanManage();
-            planManage.setId(id);
-            planManage.setPlanStatus(3);//任务终止状态
-            planManage.setCurrentUsers("");
-            planManageService.updateByPrimaryKeySelective(planManage);
-            LoginUser currentUser = UserUtil.getCurrentUser();
-            WorkFlowLog workFlowLog=new WorkFlowLog();
-            workFlowLog.setFlowId(id);
-            workFlowLog.setFlowType(1);
-            workFlowLog.setFlowResult(remark);
-            workFlowLog.setCreateBy(currentUser.getId()!=null?currentUser.getId().toString():null);
-            workFlowLog.setDateCreate(new Date());
-            workFlowLog.setHandleUserId(currentUser.getId()!=null?currentUser.getId().toString():null);
-            workFlowLog.setHandleUserName(currentUser.getUsername());
-            //记录日志
-           workFlowLogService.insert(workFlowLog);
-           return new AjaxMessage<>(ResultStatus.OK);
-        }
-        return new AjaxMessage<>(ResultStatus.ERROR);
+        workFlowService.stopProcessInstance(processInstanceId);
+        PlanManage planManage = new PlanManage();
+        planManage.setId(id);
+        planManage.setPlanStatus(3);//任务终止状态
+        planManage.setCurrentUsers("");
+        planManageService.updateByPrimaryKeySelective(planManage);
+        LoginUser currentUser = UserUtil.getCurrentUser();
+        WorkFlowLog workFlowLog=new WorkFlowLog();
+        workFlowLog.setFlowId(id);
+        workFlowLog.setFlowType(1);
+        workFlowLog.setFlowResult(remark);
+        workFlowLog.setCreateBy(currentUser.getId()!=null?currentUser.getId().toString():null);
+        workFlowLog.setDateCreate(new Date());
+        workFlowLog.setHandleUserId(currentUser.getId()!=null?currentUser.getId().toString():null);
+        workFlowLog.setHandleUserName(currentUser.getUsername());
+        //记录日志
+       workFlowLogService.insert(workFlowLog);
+       return new AjaxMessage<>(ResultStatus.OK);
     }
 
     /**