From b2e3d6532dbbb3929e01a598dcef7eb07f39b826 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 11 七月 2025 09:30:27 +0800
Subject: [PATCH] 保洁巡检本周代码

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
index b4a6ab0..4fe08ac 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TAppealController.java
@@ -14,6 +14,7 @@
 import com.ruoyi.system.service.*;
 import com.ruoyi.system.vo.system.AppealDetailVO;
 import com.ruoyi.system.vo.system.AppealListVO;
+import com.tencentcloudapi.es.v20180416.models.TaskDetail;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.util.CollectionUtils;
@@ -185,24 +186,49 @@
         TTask task = taskCleanService.getById(appeal.getTaskId());
         TLocation location = locationService.getById(task.getLocationId());
         TNotice tNotice = new TNotice();
-        tNotice.setUserId(dto.getAppealPerson());
+        tNotice.setUserId(appeal.getAppealPerson());
         tNotice.setStatus(1);
         tNotice.setDataId(dto.getId());
         dto.setAuditTime(LocalDateTime.now());
+        TTaskDetail taskDetail = new TTaskDetail();
+        taskDetail.setTaskId(appeal.getTaskId());
+        Long count = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, appeal.getTaskId())
+                .eq(TTaskDetail::getHandleType, 1).count();
         if (dto.getStatus()==2){
+            taskDetail.setClearStatus(1);
+            taskDetail.setAuditTime(LocalDateTime.now());
+            taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
+            taskDetail.setAuditStatus(1);
+            taskDetail.setAuditRemark(dto.getAuditRemark());
+            taskDetail.setHandleType(5);
+            taskDetail.setAppealId(dto.getId());
             // 通过
             TTask byId = taskCleanService.getById(dto.getTaskId());
-            byId.setStatus(6);
+            if (count>1){
+                byId.setStatus(5);
+            }else{
+                byId.setStatus(6);
+
+            }
+
             taskCleanService.updateById(byId);
             tNotice.setNoticeType(5);
             tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉通过");
         }else{
+            taskDetail.setClearStatus(2);
+            taskDetail.setAuditTime(LocalDateTime.now());
+            taskDetail.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
+            taskDetail.setAuditStatus(2);
+            taskDetail.setAuditRemark(dto.getAuditRemark());
+            taskDetail.setHandleType(6);
+            taskDetail.setAppealId(dto.getId());
             tNotice.setNoticeType(4);
             tNotice.setNoticeContent("【"+location.getLocationName()+"】任务申诉驳回");
         }
         noticeService.save(tNotice);
         dto.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
         appealService.updateById(dto);
+        tTaskDetailService.save(taskDetail);
         return R.ok();
     }
 }

--
Gitblit v1.7.1