kaiyu
2020-11-20 1c8d100cbf2916b797de1a0fde5c29d132ead593
src/main/java/com/moral/task/HistoryTableCreatAndDeleteTask.java
@@ -22,15 +22,28 @@
    @XxlJob("deleteHitoryTable")
    public ReturnT deleteHistoryTable(String param) {
       return new ReturnT(200,"删除成功");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String yearMonthDay = sdf.format(DateUtil.rollHour(new Date(), -8*24));
        try {
            historyService.dropHistoryTable(yearMonthDay);
        } catch (Exception e) {
            logger.error(e.getMessage());
            return new ReturnT(500, "history_" + yearMonthDay + "删除失败");
        }
        return new ReturnT(200, "history_" + yearMonthDay + "删除成功");
    }
    @XxlJob("createHistoryTable")
    public ReturnT createHistoryTable(String param) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String yearMonthDay = sdf.format(DateUtil.rollHour(new Date(),24));
        historyService.createHistoryTable(yearMonthDay);
        return new ReturnT(200,"创建成功");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String yearMonthDay = sdf.format(DateUtil.rollHour(new Date(), 24));
        try {
            historyService.createHistoryTable(yearMonthDay);
        } catch (Exception e) {
            logger.error(e.getMessage());
            return new ReturnT(500, "history_" + yearMonthDay + "创建失败");
        }
        return new ReturnT(200, "history_" + yearMonthDay + "创建成功");
    }
}