wangbo 4 år sedan
förälder
incheckning
5366765adc

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

@@ -7,6 +7,8 @@ import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.LoginUser;
 import com.huaxu.model.Pagination;
 import com.huaxu.model.ResultStatus;
+import com.huaxu.order.entity.WorkFlowLog;
+import com.huaxu.order.service.WorkFlowLogService;
 import com.huaxu.process.entity.ProcessDefinition;
 import com.huaxu.process.service.WorkFlowService;
 import com.huaxu.task.dto.PlanManageDto;
@@ -35,10 +37,12 @@ public class PlanManageController {
 
     @Autowired
     WorkFlowService workFlowService;
-    @Autowired
-    private UserCenterClient userCenterClient;
 
+    @Autowired
+    WorkFlowLogService workFlowLogService;
 
+    @Autowired
+    private UserCenterClient userCenterClient;
     /**
      * 新增巡检计划
      * @param planName 任务名称
@@ -276,10 +280,19 @@ public class PlanManageController {
             planManage.setId(id);
             planManage.setPlanStatus(2);//结束状态
             planManage.setCurrentUsers("");
-            int rows = planManageService.updateByPrimaryKeySelective(planManage);
-            if (rows > 0) {
-                return new AjaxMessage<>(ResultStatus.OK);
-            }
+            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);
     }