kaiyu
2020-11-19 f2cfc6973ec1b43391654b4bd722c2c316d06fc7
src/main/java/com/moral/task/HistoryTableCreatAndDeleteTask.java
@@ -22,20 +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) {
        try {
            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天表失败");
            return new ReturnT(500, "history_" + yearMonthDay + "创建失败");
        }
        return new ReturnT(200,"history天表创建成功");
        return new ReturnT(200, "history_" + yearMonthDay + "创建成功");
    }
}