| 
															
																@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
															 | 
															
															 | 
															
																 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.client.UserCenterClient; 
															 | 
															
															 | 
															
																 import com.huaxu.client.UserCenterClient; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.common.FileUploadUtil; 
															 | 
															
															 | 
															
																 import com.huaxu.common.FileUploadUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import com.huaxu.entity.Message; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.model.AjaxMessage; 
															 | 
															
															 | 
															
																 import com.huaxu.model.AjaxMessage; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.model.LoginUser; 
															 | 
															
															 | 
															
																 import com.huaxu.model.LoginUser; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.model.Pagination; 
															 | 
															
															 | 
															
																 import com.huaxu.model.Pagination; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.model.ResultStatus; 
															 | 
															
															 | 
															
																 import com.huaxu.model.ResultStatus; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import com.huaxu.order.dto.WorkOrderManageByAlarmDto; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.order.dto.WorkOrderManageDto; 
															 | 
															
															 | 
															
																 import com.huaxu.order.dto.WorkOrderManageDto; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.order.entity.WorkFlowDetail; 
															 | 
															
															 | 
															
																 import com.huaxu.order.entity.WorkFlowDetail; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.order.entity.WorkFlowLog; 
															 | 
															
															 | 
															
																 import com.huaxu.order.entity.WorkFlowLog; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -21,10 +23,9 @@ import com.huaxu.process.entity.ProcessDefinition; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.process.service.WorkFlowService; 
															 | 
															
															 | 
															
																 import com.huaxu.process.service.WorkFlowService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.process.utils.Action; 
															 | 
															
															 | 
															
																 import com.huaxu.process.utils.Action; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.task.entity.PlanManage; 
															 | 
															
															 | 
															
																 import com.huaxu.task.entity.PlanManage; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-import com.huaxu.task.entity.TaskManage; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-import com.huaxu.task.entity.UserEntity; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.task.service.PlanManageService; 
															 | 
															
															 | 
															
																 import com.huaxu.task.service.PlanManageService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.util.DatesUtil; 
															 | 
															
															 | 
															
																 import com.huaxu.util.DatesUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import com.huaxu.util.MessageSendUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import com.huaxu.util.UserUtil; 
															 | 
															
															 | 
															
																 import com.huaxu.util.UserUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import io.swagger.annotations.Api; 
															 | 
															
															 | 
															
																 import io.swagger.annotations.Api; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import io.swagger.annotations.ApiOperation; 
															 | 
															
															 | 
															
																 import io.swagger.annotations.ApiOperation; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -62,6 +63,9 @@ public class WorkOrderManageController { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     @Autowired 
															 | 
															
															 | 
															
																     @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     UserCenterClient userCenterClient; 
															 | 
															
															 | 
															
																     UserCenterClient userCenterClient; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    private MessageSendUtil messageSendUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     @Value("${UMIS.sys_config_path}") 
															 | 
															
															 | 
															
																     @Value("${UMIS.sys_config_path}") 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     private String baseDir; 
															 | 
															
															 | 
															
																     private String baseDir; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -85,6 +89,25 @@ public class WorkOrderManageController { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         workOrderManage.setTaskNo(DatesUtil.formatDate(new Date(),"yyyyMMddHHmmss")+String.valueOf((int) (Math.random()*(9999-1000)+1000))); 
															 | 
															
															 | 
															
																         workOrderManage.setTaskNo(DatesUtil.formatDate(new Date(),"yyyyMMddHHmmss")+String.valueOf((int) (Math.random()*(9999-1000)+1000))); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         workOrderManageService.insertSelective(workOrderManage); 
															 | 
															
															 | 
															
																         workOrderManageService.insertSelective(workOrderManage); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         int result =workOrderManage.getId();//返回新增数据的id 
															 | 
															
															 | 
															
																         int result =workOrderManage.getId();//返回新增数据的id 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        //发消息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        Message message=new Message(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setStatus(1); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setCreateBy(currentUser.getUsername()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setTenantId(currentUser.getTenantId()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setMessageContent(workOrderManage.getTaskDesc()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setMessageId(UUID.randomUUID().toString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setMessageType(3); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setMessageTemplateId(3); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setChannel(0); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        message.setUrl(String.valueOf(result)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        //获取需要发消息的用户 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        List<Long> users=userCenterClient.findUserIdsForOrg(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        for(Long user : users){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            message.setUserId(user.intValue()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            messageSendUtil.send(message); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         return new AjaxMessage<>(ResultStatus.OK, result); 
															 | 
															
															 | 
															
																         return new AjaxMessage<>(ResultStatus.OK, result); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     /** 
															 | 
															
															 | 
															
																     /** 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -378,7 +401,7 @@ public class WorkOrderManageController { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             new AjaxMessage(ResultStatus.ERROR,"没有创建流程,不能提交!"); 
															 | 
															
															 | 
															
																             new AjaxMessage(ResultStatus.ERROR,"没有创建流程,不能提交!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         Map<String,Object> vars = new HashMap<>(); 
															 | 
															
															 | 
															
																         Map<String,Object> vars = new HashMap<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-        vars.put("assineeFormUserId",loginUser.getId()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        vars.put("assineeFormUserId",loginUser.getId().toString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         //巡检发送系统消息所需参数 
															 | 
															
															 | 
															
																         //巡检发送系统消息所需参数 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         vars.put("任务类型",orderType); 
															 | 
															
															 | 
															
																         vars.put("任务类型",orderType); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         vars.put("任务编号",workOrderManage.getId()); 
															 | 
															
															 | 
															
																         vars.put("任务编号",workOrderManage.getId()); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -419,4 +442,15 @@ public class WorkOrderManageController { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     public AjaxMessage<Integer> batchDelete( @ApiParam(value = "工单Ids") @RequestParam List<Integer> ids){ 
															 | 
															
															 | 
															
																     public AjaxMessage<Integer> batchDelete( @ApiParam(value = "工单Ids") @RequestParam List<Integer> ids){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         return new AjaxMessage<>(ResultStatus.OK, workOrderManageService.batchDelete(ids)); 
															 | 
															
															 | 
															
																         return new AjaxMessage<>(ResultStatus.OK, workOrderManageService.batchDelete(ids)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     * 批量插入工单信息(报警生成的) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    @RequestMapping(value = "saveByAlarms", method = RequestMethod.POST) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    @ApiOperation(value = "批量插入工单信息(报警生成的)") 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    public Integer saveByAlarms( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            @ApiParam(value = "工单信息", required = true) @RequestBody List<WorkOrderManageByAlarmDto> workOrderManages){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        return workOrderManageService.batchInsertByAlarms(workOrderManages); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 } 
															 | 
															
															 | 
															
																 } 
															 |