|
@@ -89,26 +89,28 @@ public class WorkOrderManageController {
|
|
|
workOrderManage.setTaskNo(DatesUtil.formatDate(new Date(),"yyyyMMddHHmmss")+String.valueOf((int) (Math.random()*(9999-1000)+1000)));
|
|
|
workOrderManageService.insertSelective(workOrderManage);
|
|
|
int result =workOrderManage.getId();//返回新增数据的id
|
|
|
- //发消息
|
|
|
- try {
|
|
|
- Message message=new Message();
|
|
|
- message.setStatus(1);
|
|
|
- message.setCreateBy(currentUser.getId().toString());
|
|
|
- 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);
|
|
|
+ if(workOrderManage.getEventType()==1) {
|
|
|
+ //发消息
|
|
|
+ try {
|
|
|
+ Message message=new Message();
|
|
|
+ message.setStatus(1);
|
|
|
+ message.setCreateBy(currentUser.getId().toString());
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }catch(Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- }catch(Exception e){
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|