| | |
| | | |
| | | @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("yyyyMMdd"); |
| | | String yearMonthDay = sdf.format(DateUtil.rollHour(new Date(), 24)); |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | String yearMonthDay = sdf.format(DateUtil.rollHour(new Date(), 24)); |
| | | historyService.createHistoryTable(yearMonthDay); |
| | | }catch (Exception e){ |
| | | } 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 + "创建成功"); |
| | | } |
| | | |
| | | } |