|
|
@@ -3,6 +3,9 @@ package com.fs.his.task;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.service.impl.SmsServiceImpl;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
@@ -40,10 +43,7 @@ import com.fs.fastgptApi.vo.AudioVO;
|
|
|
import com.fs.gtPush.mapper.PushLogMapper;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
|
import com.fs.his.config.StoreConfig;
|
|
|
-import com.fs.his.domain.FsInquiryOrder;
|
|
|
-import com.fs.his.domain.FsStoreAfterSales;
|
|
|
-import com.fs.his.domain.FsStoreOrder;
|
|
|
-import com.fs.his.domain.FsUser;
|
|
|
+import com.fs.his.domain.*;
|
|
|
import com.fs.his.dto.FsInquiryOrderPatientDTO;
|
|
|
import com.fs.his.enums.FsStoreOrderLogEnum;
|
|
|
import com.fs.his.enums.FsStoreOrderStatusEnum;
|
|
|
@@ -72,6 +72,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
@@ -192,6 +193,8 @@ public class Task {
|
|
|
|
|
|
@Autowired
|
|
|
private QwRestrictionPushRecordMapper qwRestrictionPushRecordMapper;
|
|
|
+ @Autowired
|
|
|
+ private FsUserOperationLogMapper fsUserOperationLogMapper;
|
|
|
|
|
|
public static final String SOP_TEMP_VOICE_KEY = "sop:tempVoice";
|
|
|
|
|
|
@@ -1518,5 +1521,15 @@ public class Task {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //定时删除行为轨迹记录 (数据量太大 默认保留一天的)
|
|
|
+ @Scheduled(cron = "0 0 1 * * ?")
|
|
|
+ //@Scheduled(cron = "0 * * * * ?") //测试每分钟执行一次
|
|
|
+ public void deleteUserOperationLog(){
|
|
|
+ LambdaQueryWrapper<FsUserOperationLog> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.lt(FsUserOperationLog::getCreateTime, DateUtils.addDays(new Date(), -1));
|
|
|
+ int deleteCount = fsUserOperationLogMapper.delete(wrapper);
|
|
|
+ log.info("定时删除行为轨迹记录 {} 条", deleteCount);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|