| | |
| | | // private boolean isERP; |
| | | // |
| | | //@Scheduled(cron = "0/10 * * * * ? ") |
| | | @Scheduled(fixedDelay = 10000) |
| | | @Scheduled(fixedDelay = 600000) |
| | | private void execute(){ |
| | | List<Order> orders = orderService.selectToBeHistoryOrder(); |
| | | if (orders.isEmpty()) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "* * 1 * * ? ") |
| | | private void executeOrderLog() { |
| | | ReturnT<String> returnT = overYearLogHandler.start2(); |
| | | if (!returnT.isSuccess()) { |
| | | log.error(returnT.getMsg()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start2() { |
| | | try { |
| | | // 删除半年以上的历史档 |
| | | jdbcTemplate.update("delete from man_order_log where dateadd(day,366,create_time) <= getdate();"); |
| | | jdbcTemplate.update("delete from man_order_detl_log where dateadd(day,366,create_time) <= getdate();"); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | } |