From 5e2d78f61bf7d1513d5d5c8cd55442133a6e898e Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 14 七月 2025 18:23:36 +0800
Subject: [PATCH] 保洁巡检本周代码

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java
index 87fa67d..2168cd3 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java
@@ -30,6 +30,7 @@
 import com.ruoyi.system.model.*;
 import com.ruoyi.system.query.TaskListQuery;
 import com.ruoyi.system.service.*;
+import com.ruoyi.system.utils.TemplateMessageSendUtil;
 import com.ruoyi.system.vo.system.*;
 import com.ruoyi.web.controller.tool.EmailUtils;
 import com.ruoyi.web.controller.tool.MsgUtils;
@@ -199,12 +200,15 @@
     private TNoticeSetService noticeSetService;
     @Resource
     private TDictDataService dictDataService;
+    @Resource
+    private TemplateMessageSendUtil templateMessageSendUtil;
     @Log(title = "审核任务", businessType = BusinessType.UPDATE)
     @ApiOperation(value = "审核任务")
     @PostMapping(value = "/audit")
     public R<Boolean> audit(@RequestBody TTaskAuditDTO dto) throws Exception {
         dto.setAuditTime(LocalDateTime.now());
         TTask task = taskCleanerService.getById(dto.getTaskId());
+        SysUser auditPerson = sysUserService.selectUserById(tokenService.getLoginUser().getUserId());
         SysUser sysUser = sysUserService.selectUserById(Long.valueOf(task.getPatrolInspector()));
 
         TTaskDetail one = taskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId())
@@ -258,7 +262,10 @@
             // 增加消息
             tNotice.setNoticeType(1);
             tNotice.setNoticeContent("【" + location.getLocationName() + "】任务不合格,请重新上传!");
+
             if (sysUser!=null){
+
+
                 switch (noticeSet.getNoticeType()) {
                     case 1:
                         msgUtils.sendMsg1(sysUser.getPhonenumber(),location.getLocationName(),"驳回");
@@ -269,6 +276,10 @@
                         }
                         break;
                     case 3:
+                        if (StringUtils.hasLength(sysUser.getOpenId())){
+                            templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(),
+                                    location.getLocationName(),"驳回",auditPerson.getNickName());
+                        }
                         break;
 
                 }
@@ -333,6 +344,10 @@
                         }
                         break;
                     case 3:
+                        if (StringUtils.hasLength(sysUser.getOpenId())){
+                            templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(),
+                                    location.getLocationName(),"驳回",auditPerson.getNickName());
+                        }
                         break;
                 }
             }
@@ -357,6 +372,8 @@
         List<TTaskDetail> tTaskDetails = new ArrayList<>();
         List<TLocation> locations = locationService.list();
         List<SysUser> sysUsers = sysUserService.selectAllList();
+        SysUser auditPerson = sysUserService.selectUserById(tokenService.getLoginUser().getUserId());
+
         List<TTaskDetail> taskDetails = taskDetailService.list(Wrappers.lambdaQuery(TTaskDetail.class)
                 .in(TTaskDetail::getTaskId, Arrays.asList(dto.getTaskIds().split(",")))
                 .eq(TTaskDetail::getHandleType,1)
@@ -527,6 +544,10 @@
                             }
                             break;
                         case 3:
+                            if (StringUtils.hasLength(sysUser.getOpenId())){
+                                templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(),
+                                        location.getLocationName(),"驳回",auditPerson.getNickName());
+                            }
                             break;
                     }
                 }

--
Gitblit v1.7.1