Pu Zhibing
2025-03-16 00ef2e4c4c6a85af857be272cf74a7e43e6517f0
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) {