From 00ef2e4c4c6a85af857be272cf74a7e43e6517f0 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期日, 16 三月 2025 03:42:16 +0800
Subject: [PATCH] 修改诉求流程和新增评价功能

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java
index 4f7db17..486c621 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java
@@ -9,10 +9,7 @@
 import com.panzhihua.common.utlis.DateUtils;
 import com.panzhihua.sangeshenbian.dao.ComplaintAuditRecordMapper;
 import com.panzhihua.sangeshenbian.model.dto.ComplaintTimeout;
-import com.panzhihua.sangeshenbian.model.entity.Complaint;
-import com.panzhihua.sangeshenbian.model.entity.MessageNotification;
-import com.panzhihua.sangeshenbian.model.entity.SystemUser;
-import com.panzhihua.sangeshenbian.model.entity.WorkOrderItemConfig;
+import com.panzhihua.sangeshenbian.model.entity.*;
 import com.panzhihua.sangeshenbian.service.*;
 import com.panzhihua.sangeshenbian.utils.AliSmsUtil;
 import lombok.RequiredArgsConstructor;
@@ -34,6 +31,7 @@
     private final ISystemUserService systemUserService;;
     private final UserService userService;
     private final IMessageNotificationService messageNotificationService;
+    private final IComplaintCommentService complaintCommentService;
 
     /**
      * 诉求超时处理(每天凌晨两点执行)
@@ -80,6 +78,25 @@
         complaintService.updateBatchById(complaintList);
         messageNotificationService.saveBatch(messageNotificationList);
     }
+    
+    
+    /**
+     * 自动完成诉求评价
+     */
+    @Scheduled(cron = "0 1 0 * * ?")
+    public void automaticEvaluation() {
+        // 诉求超时提醒
+        List<Complaint> complaintList = complaintService.getTimeoutAndNotComment();
+        for (Complaint complaint : complaintList) {
+            ComplaintComment complaintComment = new ComplaintComment();
+            complaintComment.setComplaintId(complaint.getId());
+            complaintComment.setRate(2);
+            complaintComment.setContent("满意");
+            complaintComment.setDelFlag(0);
+            complaintCommentService.save(complaintComment);
+        }
+    }
+    
 
     // 诉求超时处理
     private void timeOutHandle(WorkOrderItemConfig config,Integer demandProcessingTime) {

--
Gitblit v1.7.1