|
@@ -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 任务名称
|
|
@@ -70,7 +74,7 @@ public class PlanManageController {
|
|
|
record.setPlanName(planName);
|
|
|
record.setTaskType(taskType);
|
|
|
record.setTaskChecked(taskChecked);
|
|
|
- record.setPlanDate(new Date());
|
|
|
+ //record.setPlanDate(new Date());
|
|
|
record.setPlanStartDate(DatesUtil.parseDate(planStartDate,"yyyy-MM-dd"));
|
|
|
record.setPlanEndDate(DatesUtil.parseDate(planEndDate,"yyyy-MM-dd"));
|
|
|
record.setPlanStatus(0);
|
|
@@ -218,7 +222,8 @@ public class PlanManageController {
|
|
|
if(planManage.getId() != null) {
|
|
|
planManage.setUpdateBy(String.valueOf(loginUser.getId()));
|
|
|
}
|
|
|
- planManage.setDateUpdate(new Date());
|
|
|
+ planManage.setPlanDate(new Date());// 提交时间
|
|
|
+ planManage.setDateUpdate(new Date());// 更新时间
|
|
|
planManage.setProcessInstanceId(task.getProcessInstanceId());
|
|
|
planManage.setProcessDefId(task.getProcessDefinitionId());
|
|
|
planManage.setCurrentTaskId(task.getId());
|
|
@@ -263,17 +268,33 @@ 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);
|
|
|
+ @GetMapping("/plan/delProcInst")
|
|
|
+ @ApiOperation(value = "终止流程")
|
|
|
+ public AjaxMessage deleteProcessInstance(
|
|
|
+ @ApiParam(value = "任务ID", required = true) @RequestBody Integer id,
|
|
|
+ @ApiParam(value = "流程ID", required = true) @RequestBody String processInstanceId,
|
|
|
+ @ApiParam(value = "流程备注", required = true) @RequestBody String remark) {
|
|
|
+ Boolean delFlow = workFlowService.deleteProcessInstance(processInstanceId,remark);
|
|
|
+ if(delFlow ==true) {
|
|
|
+ PlanManage planManage = new PlanManage();
|
|
|
+ planManage.setId(id);
|
|
|
+ planManage.setPlanStatus(2);//结束状态
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
/**
|