提交 58f58668 作者: 洪东保

每天晚上删除两天之前的数据

父级 96ae6315
......@@ -159,7 +159,7 @@ public class EmailSender {
FileAttachment attachments = new FileAttachment();
attachments.name = attachment.getName() + ".docx";
attachments.oDataType = "#microsoft.graph.fileAttachment";
attachments.contentType = "application/msword";
attachments.contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
attachments.contentBytes = attachment.getBytes();
attachmentsList.add(attachments);
}
......
......@@ -366,11 +366,11 @@ public class CmeetingJob {
/**
* 每天0点30分执行一次
*/
@Scheduled(cron = "0 30 0 * * ? ")
@Scheduled(cron = "00 59 23 * * ?")
public void deleteDataAfterThan3Months() {
String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
log.info("删除3个月前的数据开始,开始时间: {}", date);
int count = meetingInfoService.deleteDataAfterThan3Months(date);
int count = meetingInfoService.deleteDataAfterThan2Days(date);
log.info("删除3个月前的数据结束,删除数量: {}", count);
}
......
......@@ -30,7 +30,7 @@ public interface MeetingInfoMapper extends BaseMapper<MeetingInfo> {
@Param("endTime") String endTime,
@Param("dateList") List<String> dateList);
int deleteDataAfterThan3Months(@Param("date") String date);
int deleteDataAfterThan2Days(@Param("date") String date);
// List<MeetingInfo> selectList(MeetingInfoVO vo);
......
......@@ -46,5 +46,5 @@ public interface MeetingInfoService extends IService<MeetingInfo> {
*/
void exportRecordTemplateUsingInfo(String searchValue, Date createTimeStart, Date createTimeEnd, HttpServletResponse response);
int deleteDataAfterThan3Months(String date);
int deleteDataAfterThan2Days(String date);
}
......@@ -420,8 +420,8 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
}
@Override
public int deleteDataAfterThan3Months(String date) {
return baseMapper.deleteDataAfterThan3Months(date);
public int deleteDataAfterThan2Days(String date) {
return baseMapper.deleteDataAfterThan2Days(date);
}
/**
......
......@@ -60,8 +60,8 @@
GROUP BY t.host_uid, userid.wid
</select>
<delete id="deleteDataAfterThan3Months">
delete from cmt_meeting_info where start_time &lt; DATE_SUB(#{date}, INTERVAL 3 MONTH);
<delete id="deleteDataAfterThan2Days">
delete from cmt_meeting_info where start_time &lt; DATE_SUB(#{date}, INTERVAL 2 DAY);
</delete>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论