|
@@ -326,29 +326,23 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
log.info("记录为空,则不生成附件,也不生成提醒信息");
|
|
|
return R.ok();
|
|
|
}
|
|
|
- //2.生成excel 文件,返回文件信息
|
|
|
- SysFileItemDo fileItem = equMaintenanceOrderService.generateDeviceRepeatedlyFailsExcel(list);
|
|
|
+ //消息提醒id
|
|
|
+ String noticeId = SecurityUtil.getUUID();
|
|
|
+ //生成附件返回对象
|
|
|
+ String fileNameAndId = equMaintenanceOrderService.generateDeviceRepeatedlyFailsExcel(list, noticeId);
|
|
|
|
|
|
//3.消息提醒
|
|
|
- // 3.1发送人 取车间维修主管、设备部部长、设备部维修主管 角色中所有人员
|
|
|
+ // 3.1发送人 取车间维修主管、设备部部长、设备部维修主管 角色中所有人员
|
|
|
List<String> userId = equMaintenanceOrderService.selectRoleList();
|
|
|
if (userId.isEmpty()) {
|
|
|
log.info("车间维修主管、设备部部长、设备部维修主管角色无提醒人");
|
|
|
return R.ok();
|
|
|
}
|
|
|
- //3.2发送消息
|
|
|
- String id = SecurityUtil.getUUID();
|
|
|
- //附件关联业务字段存入消息主键
|
|
|
- fileItem.setRelationid(id);
|
|
|
- fileItem.setFilename(DEVICE_REPEATEDLY_FAILS_FILE_NAME);
|
|
|
-
|
|
|
- //消息提醒的remark 存放附件的名称+id
|
|
|
- String remark = fileItem.getFilename()+"-;-"+fileItem.getId();
|
|
|
- CXCommonUtils.sendNotify(id,DEVICE_REPEATEDLY_FAILS_TITLE, DEVICE_REPEATEDLY_FAILS_CONTEXT, remark, userId.stream().distinct().collect(Collectors.toList()),
|
|
|
+
|
|
|
+ CXCommonUtils.sendNotify(noticeId, DEVICE_REPEATEDLY_FAILS_TITLE, DEVICE_REPEATEDLY_FAILS_CONTEXT, fileNameAndId, userId.stream().distinct().collect(Collectors.toList()),
|
|
|
null, DEVICE_REPEATEDLY_FAILS_NOTICETYPE, true);
|
|
|
|
|
|
- //4.修改附件
|
|
|
- sysFileItemService.updateById(fileItem);
|
|
|
+
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -419,16 +413,20 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
|
|
|
|
MultipartFile multipartFile = new MockMultipartFile("file", newDate+"-保养/润滑跨月未完成.xlsx" , "application/vnd.ms-excel", byteArray);
|
|
|
- R upload = CXCommonUtils.upload(multipartFile);
|
|
|
+
|
|
|
+ //消息提醒id
|
|
|
+ String noticeId = SecurityUtil.getUUID();
|
|
|
+
|
|
|
+ R upload = CXCommonUtils.upload(multipartFile,noticeId);
|
|
|
String fileItemId = "";
|
|
|
if ("200".equals(upload.getCode())){
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(upload.getData());
|
|
|
// Map<String,String> map = (Map<String, String>) JSON.parse(upload.getData().toString());
|
|
|
- fileItemId =jsonObject.get("id").toString();
|
|
|
+ fileItemId =jsonObject.get("filename").toString() + "-;-" + jsonObject.get("id").toString();;
|
|
|
}
|
|
|
|
|
|
|
|
|
- CXCommonUtils.sendNotify(PREVIOUS_UNFINISHED_TASK_TITLE, context,plantId , userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
+ CXCommonUtils.sendNotify(noticeId,PREVIOUS_UNFINISHED_TASK_TITLE, context,plantId , userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
fileItemId, PREVIOUS_UNFINISHED_TASK, true);
|
|
|
}
|
|
|
|
|
@@ -494,13 +492,17 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
|
|
|
|
MultipartFile multipartFile = new MockMultipartFile("file", newDate+"-保养/润滑月末未完成.xlsx" , "application/vnd.ms-excel", byteArray);
|
|
|
- R upload = CXCommonUtils.upload(multipartFile);
|
|
|
+
|
|
|
+ //消息提醒id
|
|
|
+ String noticeId = SecurityUtil.getUUID();
|
|
|
+
|
|
|
+ R upload = CXCommonUtils.upload(multipartFile,noticeId);
|
|
|
String fileItemId = "";
|
|
|
if ("200".equals(upload.getCode())){
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(upload.getData());
|
|
|
- fileItemId =jsonObject.get("id").toString();
|
|
|
+ fileItemId =jsonObject.get("filename").toString() + "-;-" + jsonObject.get("id").toString();;
|
|
|
}
|
|
|
- CXCommonUtils.sendNotify(END_UNFINISHED_TASK_TITLE, context, plantId, userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
+ CXCommonUtils.sendNotify(noticeId,END_UNFINISHED_TASK_TITLE, context, plantId, userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
fileItemId, END_UNFINISHED_TASK, true);
|
|
|
}
|
|
|
|