|
@@ -1,9 +1,13 @@
|
|
|
package com.free.schedule;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
+import com.free.mq.MqListeners;
|
|
|
+import com.free.mq.MqService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -26,11 +30,13 @@ public class ClearTransferApply {
|
|
|
private TransferApplyService transferApplyService;
|
|
|
@Autowired
|
|
|
private ChatRecordService chatRecordService;
|
|
|
+ @Autowired
|
|
|
+ private MqService mqService;
|
|
|
/** 自动关闭时间: 10分钟 */
|
|
|
private Long limit = 10L;
|
|
|
|
|
|
// 每2分钟整执行一次
|
|
|
- @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
+ @Scheduled(cron = "0 0/2 * * * ? ")
|
|
|
public void schedule() {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime nowTime = LocalDateTime.now();
|
|
@@ -69,6 +75,11 @@ public class ClearTransferApply {
|
|
|
closeData.setId(i.getId());
|
|
|
closeData.setIs_close(TransferApplyController.TransferApplyClose);
|
|
|
transferApplyService.updateById(closeData);
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("type","close");
|
|
|
+ try {
|
|
|
+ mqService.sendMsg(MqListeners.exName,MqListeners.queueName+"."+i.getId(),map);
|
|
|
+ }catch (Exception e){}
|
|
|
}
|
|
|
}
|
|
|
}
|