每日凌晨清空除捐赠和审核中以外的数据
()
| 46 | * 每日凌晨清空除捐赠和审核中以外的数据 |
| 47 | */ |
| 48 | @Scheduled(cron="0 0 0 * * ?") |
| 49 | public void cronJob(){ |
| 50 | |
| 51 | List<Pay> list=payDao.getByStateIs(2); |
| 52 | list.addAll(payDao.getByStateIs(3)); |
| 53 | for(Pay p:list){ |
| 54 | try { |
| 55 | payService.delPay(p.getId()); |
| 56 | }catch (Exception e){ |
| 57 | log.error("定时删除数据"+p.getId()+"失败"); |
| 58 | e.printStackTrace(); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | log.info("定时执行清空驳回和通过不展示的数据完毕"); |
| 63 | |
| 64 | //设置未审核或已扫码数据为支付失败 |
| 65 | List<Pay> list1=payDao.getByStateIs(0); |
| 66 | list1.addAll(payDao.getByStateIs(4)); |
| 67 | for(Pay p:list1){ |
| 68 | p.setState(2); |
| 69 | p.setUpdateTime(new Date()); |
| 70 | try { |
| 71 | payService.updatePay(p); |
| 72 | }catch (Exception e){ |
| 73 | log.error("设置未审核数据"+p.getId()+"为支付失败出错"); |
| 74 | e.printStackTrace(); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | log.info("定时执行设置未审核数据为支付失败完毕"); |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * 每日10am统一发送支付失败邮件 |
nothing calls this directly
no test coverage detected