From 083c414ff683ab12e65069c6c0ba6871ed1ed09f Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 12 七月 2025 10:19:09 +0800
Subject: [PATCH] 保洁巡检本周代码

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java |   66 +++++++++------------------------
 1 files changed, 18 insertions(+), 48 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java
index 7b7444e..94d13b9 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TInspectorController.java
@@ -127,9 +127,11 @@
                 query.setLocationIds(collect);
                 return R.ok(new PageInfo<>());
             }else{
-                collect = collect.stream().filter(query.getLocationIds()::contains).collect(Collectors.toList());
-                if (collect.isEmpty()){
-                    return R.ok(new PageInfo<>());
+                if (query.getLocationIds()!=null){
+                    collect = collect.stream().filter(query.getLocationIds()::contains).collect(Collectors.toList());
+                    if (collect.isEmpty()){
+                        return R.ok(new PageInfo<>());
+                    }
                 }
                 query.setLocationIds(collect);
             }
@@ -137,7 +139,7 @@
         return R.ok(inspectorService.pageList(query));
     }
 
-    @Log(title = "督察记录导出", businessType = BusinessType.EXPORT)
+    @Log(title = "督察记录导出", businessType = BusinessType.OTHER)
     @ApiOperation(value = "督察记录导出")
     @PostMapping(value = "/exportExcel")
     public void exportExcel(@RequestBody InsepectorListQuery query) {
@@ -258,7 +260,6 @@
     public R<Boolean> audit(@RequestBody TInspectorAuditDTO dto) {
         TTaskAuditDTO tTaskAuditDTO = new TTaskAuditDTO();
         BeanUtils.copyProperties(dto, tTaskAuditDTO);
-        dto.setAuditTime(LocalDateTime.now());
         TTask task = taskCleanerService.getById(dto.getTaskId());
         TLocation location = locationService.getById(task.getLocationId());
         TNotice tNotice = new TNotice();
@@ -268,57 +269,26 @@
         tNotice.setStatus(1);
         tNotice.setDataId(task.getId());
         tNotice.setNoticeSetType(noticeSet.getNoticeType());
-        if (dto.getAuditStatus()==2){
-            tTaskAuditDTO.setHandleType(3);
-            // 将任务修改为待整改
-            task.setStatus(4);
-            taskCleanerService.updateById(task);
-            // 增加消息
-            tNotice.setNoticeType(1);
-            tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!");
-
-        }else{
-            tTaskAuditDTO.setHandleType(2);
-            // 如果是初次审核就通过 将状态设置为已完成
-            List<TTaskDetail> list = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId()).list();
-            if (list.isEmpty()){
-                if (dto.getClearStatus()==1){
-                    task.setStatus(6);
-                    dto.setStatus(4);
-                    taskCleanerService.updateById(task);
-                }else{
-                    dto.setStatus(2);
-                    task.setStatus(4);
-                    taskCleanerService.updateById(task);
-// 增加消息
-                    tNotice.setNoticeType(1);
-                    tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!");
-                }
-
+        if (dto.getAuditStatus()==1){
+            if (dto.getClearStatus()==2){
+                tTaskAuditDTO.setHandleType(3);
+                dto.setStatus(2);
+                // 增加消息
+                tNotice.setNoticeType(1);
+                tNotice.setNoticeContent("【"+location.getLocationName()+"】督察任务不合格,请重新上传!");
+                noticeService.save(tNotice);
             }else{
-                if (dto.getClearStatus()==1){
+                if (dto.getAuditTime()!=null){
                     dto.setStatus(3);
-                    task.setStatus(5);
-                    taskCleanerService.updateById(task);
-                    // 增加消息
-                    tNotice.setNoticeType(2);
-                    tNotice.setNoticeContent("【"+location.getLocationName()+"】任务已通过");
                 }else{
-                    dto.setStatus(2);
-                    task.setStatus(4);
-                    taskCleanerService.updateById(task);
-                    // 增加消息
-                    tNotice.setNoticeType(1);
-                    tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!");
+                    dto.setStatus(4);
                 }
-
             }
-
         }
-        noticeService.save(tNotice);
+        dto.setAuditTime(LocalDateTime.now());
+
         dto.setAuditPerson(tokenService.getLoginUser().getUserId()+"");
         inspectorService.updateById(dto);
-        tTaskDetailService.save(tTaskAuditDTO);
         return R.ok();
     }
 }

--
Gitblit v1.7.1