提交 f2b10133 作者: 洪东保

每天清空三个月前的会议记录

父级 f2209357
......@@ -20,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
......@@ -364,5 +363,13 @@ public class CmeetingJob {
log.info("同步用户结束,耗时: {}ms", System.currentTimeMillis() - l);
}
/**
* 每天0点30分执行一次
*/
@Scheduled(cron = "0 30 0 * * ? ")
public void deleteDataAfterThan3Months() {
meetingInfoService.deleteDataAfterThan3Months(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
}
}
......@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -29,6 +30,8 @@ public interface MeetingInfoMapper extends BaseMapper<MeetingInfo> {
@Param("endTime") String endTime,
@Param("dateList") List<String> dateList);
int deleteDataAfterThan3Months(@Param("date") String date);
// List<MeetingInfo> selectList(MeetingInfoVO vo);
......
......@@ -45,4 +45,6 @@ public interface MeetingInfoService extends IService<MeetingInfo> {
* @param response
*/
void exportRecordTemplateUsingInfo(String searchValue, Date createTimeStart, Date createTimeEnd, HttpServletResponse response);
boolean deleteDataAfterThan3Months(String date);
}
......@@ -421,6 +421,11 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
}
@Override
public boolean deleteDataAfterThan3Months(String date) {
return baseMapper.deleteDataAfterThan3Months(date) != 0;
}
/**
* 保存会议纪要相关的文件
* @param content 大模型返回的不规则xml
......
......@@ -60,5 +60,8 @@
GROUP BY t.host_uid, userid.wid
</select>
<delete id="deleteDataAfterThan3Months">
delete from cmt_meeting_info where start_time < DATE_SUB(#{date}, INTERVAL 3 MONTH);
</delete>
</mapper>
\ No newline at end of file
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论