|
|
@ -76,10 +76,16 @@ public class TaskGenerateAspect { |
|
|
|
PlanEntity plan = (PlanEntity) args[0]; |
|
|
|
PlanEntity plan = (PlanEntity) args[0]; |
|
|
|
List<TaskEntity> list = taskService.list( |
|
|
|
List<TaskEntity> list = taskService.list( |
|
|
|
Wrappers.<TaskEntity>lambdaQuery().eq(TaskEntity::getPlanId,plan.getId()) |
|
|
|
Wrappers.<TaskEntity>lambdaQuery().eq(TaskEntity::getPlanId,plan.getId()) |
|
|
|
|
|
|
|
.isNull(TaskEntity::getPushStatus) |
|
|
|
); |
|
|
|
); |
|
|
|
if(CollectionUtil.isNotEmpty(list)) { |
|
|
|
if(CollectionUtil.isNotEmpty(list)) { |
|
|
|
list.forEach(this::pushMessageByTask); |
|
|
|
list.forEach(task -> { |
|
|
|
|
|
|
|
this.pushMessageByTask(task); |
|
|
|
|
|
|
|
task.setPushStatus(true); |
|
|
|
|
|
|
|
taskService.updateById(task); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TaskEntity task = JSONObject.parseObject(JSON.toJSONString(args[0]),TaskEntity.class); |
|
|
|
TaskEntity task = JSONObject.parseObject(JSON.toJSONString(args[0]),TaskEntity.class); |
|
|
|
this.pushMessageByTask(task); |
|
|
|
this.pushMessageByTask(task); |
|
|
|
} |
|
|
|
} |
|
|
@ -91,6 +97,7 @@ public class TaskGenerateAspect { |
|
|
|
* @param taskEntity 巡检任务 |
|
|
|
* @param taskEntity 巡检任务 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void pushMessageByTask(TaskEntity taskEntity) { |
|
|
|
private void pushMessageByTask(TaskEntity taskEntity) { |
|
|
|
|
|
|
|
log.info("======================进入消息推送======================"); |
|
|
|
PlanMsgRecordDto recordDto = new PlanMsgRecordDto(); |
|
|
|
PlanMsgRecordDto recordDto = new PlanMsgRecordDto(); |
|
|
|
recordDto.setDeptId(taskEntity.getCreateDept()); |
|
|
|
recordDto.setDeptId(taskEntity.getCreateDept()); |
|
|
|
recordDto.setTemplateId(taskEntity.getMessageTemplateId()); |
|
|
|
recordDto.setTemplateId(taskEntity.getMessageTemplateId()); |
|
|
@ -114,12 +121,13 @@ public class TaskGenerateAspect { |
|
|
|
recordDto.setPlanTime(taskEntity.getPlanStartTime()); |
|
|
|
recordDto.setPlanTime(taskEntity.getPlanStartTime()); |
|
|
|
recordDto.setSmsParam(JSON.toJSONString(smsMap)); |
|
|
|
recordDto.setSmsParam(JSON.toJSONString(smsMap)); |
|
|
|
recordDto.setContent("任务“"+ taskEntity.getPlanName() + "”的计划执行时间是:" + df.format(taskEntity.getPlanStartTime())+ " —— " + df.format(taskEntity.getPlanEndTime())); |
|
|
|
recordDto.setContent("任务“"+ taskEntity.getPlanName() + "”的计划执行时间是:" + df.format(taskEntity.getPlanStartTime())+ " —— " + df.format(taskEntity.getPlanEndTime())); |
|
|
|
|
|
|
|
log.info("巡检任务开始,推送对象:{}",JSON.toJSONString(recordDto)); |
|
|
|
messageClient.planSendMessage(recordDto); |
|
|
|
messageClient.planSendMessage(recordDto); |
|
|
|
// 消息结束前提醒
|
|
|
|
// 消息结束前提醒
|
|
|
|
/* smsMap.put("two",df.format(taskEntity.getPlanEndTime())); |
|
|
|
smsMap.put("two",df.format(taskEntity.getPlanEndTime())); |
|
|
|
recordDto.setPlanTime(taskEntity.getPlanEndTime()); |
|
|
|
recordDto.setPlanTime(taskEntity.getPlanEndTime()); |
|
|
|
recordDto.setSmsParam(JSON.toJSONString(smsMap)); |
|
|
|
recordDto.setSmsParam(JSON.toJSONString(smsMap)); |
|
|
|
messageClient.planSendMessage(recordDto);*/ |
|
|
|
messageClient.planSendMessage(recordDto); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|