Explorar el Código

pms 瑞恒日报审批发送消息 消息标题

zhangcl hace 3 días
padre
commit
fa82248b17

+ 13 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -142,12 +142,15 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
         Map<String, IotDeviceDO> carIdDevicePair = new HashMap<>();
         // 中航北斗车辆id集合
         Set<String> zhbdCarIds = new HashSet<>();
+        // 井号
+        String wellName = StrUtil.EMPTY;
         if (CollUtil.isNotEmpty(tasks)) {
             IotProjectTaskDO task = tasks.get(0);
             // 暂时只考虑1个施工队伍只属于1个任务
             iotRhDailyReport.setProjectId(task.getProjectId());
             iotRhDailyReport.setTaskId(task.getId());
             taskId = task.getId();
+            wellName = task.getWellName();
             // 根据日报状态 查询 日报所属任务的状态
             if (ObjUtil.isNotEmpty(createReqVO.getConstructionStatus())) {
                 task.setStatus(createReqVO.getConstructionStatus());
@@ -354,15 +357,20 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
                                 // 给多个用户发送 相同 的 提醒消息
                                 if (CollUtil.isNotEmpty(users)) {
                                     // 生成消息提醒标题 部门名称-井号
+                                    String msgTitle = dept.getName();
+                                    if (StrUtil.isNotBlank(wellName)) {
+                                        msgTitle = StrUtil.join("-", msgTitle, wellName);
+                                    }
                                     CountDownLatch latch = new CountDownLatch(users.size());
+                                    String finalMsgTitle = msgTitle;
                                     users.forEach((userId, user) -> {
                                         pmsThreadPoolTaskExecutor.execute(() -> {
                                             try {
-                                                /* String mobile = user.getMobile();
-                                                if (StrUtil.isNotBlank(mobile) && StrUtil.isNotBlank(tobeSendMsgReport.getReportName())) {
-                                                    pmsMessage.sendMessage(tobeSendMsgReport.getId(), tobeSendMsgReport.getReportName(), PmsConstants.DAILY_REPORT_APPROVAL,
-                                                            userId, mobile);
-                                                } */
+                                                String mobile = user.getMobile();
+                                                if (StrUtil.isNotBlank(mobile) && StrUtil.isNotBlank(finalMsgTitle)) {
+                                                    /* pmsMessage.sendMessage(iotRhDailyReport.getId(), finalMsgTitle, PmsConstants.RH_DAILY_REPORT_APPROVAL,
+                                                            userId, mobile); */
+                                                }
                                             } finally {
                                                 latch.countDown();
                                             }