|
@@ -1,6 +1,8 @@
|
|
|
package com.dayou.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
import com.dayou.dto.OrderReportDTO;
|
|
@@ -19,36 +21,24 @@ import com.dayou.message.handler.BusinessMessageHandler;
|
|
|
import com.dayou.message.handler.SystemMessageHandler;
|
|
|
import com.dayou.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dayou.service.workflow.IWorkTaskRecordService;
|
|
|
import com.dayou.utils.LoginContext;
|
|
|
import com.dayou.vo.CommissionDeclareVO;
|
|
|
import com.dayou.vo.ItemVO;
|
|
|
import com.dayou.vo.MajorProductionVO;
|
|
|
+import com.dayou.vo.TaskReminderVO;
|
|
|
import com.dayou.websocket.WebSocketServer;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
-import com.dayou.utils.ExcelUtil;
|
|
|
-import org.apache.poi.ss.usermodel.Cell;
|
|
|
-import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
-import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import com.dayou.enums.BatchTaskTypeEnum;
|
|
|
-
|
|
|
import static com.dayou.enums.BusinessReplyEnum.MARKET_LOG_REPLY;
|
|
|
import static com.dayou.enums.BusinessReplyEnum.MARKET_VISIT_REPLY;
|
|
|
import static com.dayou.message.MessageTitle.*;
|
|
@@ -91,8 +81,12 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
private IMajorProductionAllotService majorProductionAllotService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private IWorkTaskRecordService workTaskRecordService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private WebSocketServer webSocketServer;
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean packagingBusinessMessage(BusinessReply originalBO) {
|
|
|
BusinessMessageBO messageBO = new BusinessMessageBO();
|
|
@@ -280,6 +274,37 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
|
|
|
@Override
|
|
|
public void packagingNodeTodoReminder(WorkNodeCommit commit) {
|
|
|
+ Long instanceNodeId = commit.getInstanceNodeId();
|
|
|
+ //
|
|
|
+ TaskReminderVO taskReminderVO = workTaskRecordService.getTaskReminderInfo(instanceNodeId);
|
|
|
+ //根据处理人查询
|
|
|
+ Long handlerId = workTaskRecordService.getHandlerIdByLastNode(taskReminderVO.getBusiness(), taskReminderVO.getBusinessId(), taskReminderVO.getBusinessSubId(), taskReminderVO.getBusinessMinId());
|
|
|
+ if (handlerId != null){
|
|
|
+ Message message = new Message();
|
|
|
+ message.setTitle(NODE_TODO_REMINDER.getName());
|
|
|
+ message.setReceiver(handlerId);
|
|
|
+ message.setParams(JSON.toJSONString(taskReminderVO));
|
|
|
+ message.setSender(1L);
|
|
|
+ message.setType(NODE_TODO_REMINDER.name());
|
|
|
+ message.setMessage(new StringBuilder(taskReminderVO.getUser()).append("提交").append(taskReminderVO.getBusinessType())
|
|
|
+ .append(StrUtil.isNotBlank(taskReminderVO.getNo())?taskReminderVO.getNo():"").append("的新的流程待办,请及时处理。").toString());
|
|
|
+ this.save(message);
|
|
|
+ taskReminderVO.setCreated(message.getCreated());
|
|
|
+ taskReminderVO.setHandlerId(handlerId);
|
|
|
+ //发送websocket
|
|
|
+ webSocketServer.sendNodeReminder(taskReminderVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void sendWebSocket() {
|
|
|
+ TaskReminderVO taskReminderVO = new TaskReminderVO();
|
|
|
+ taskReminderVO.setId(RandomUtil.randomLong());
|
|
|
+ taskReminderVO.setCreated(new Date());
|
|
|
+ taskReminderVO.setHandlerId(1L);
|
|
|
+ taskReminderVO.setUser("管理员");
|
|
|
+ taskReminderVO.setNo("2025010001");
|
|
|
+ taskReminderVO.setBusinessType("大中型业务");
|
|
|
+ webSocketServer.sendNodeReminder(taskReminderVO);
|
|
|
}
|
|
|
}
|