| | |
| | | @Autowired |
| | | private DataSyncConfig dataSyncConfig; |
| | | |
| | | /** |
| | | * 每分钟拉取一次今日的访客预约数据 |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron= "0 0 23 * * ?") |
| | | public void syncVehicleUpdateData() throws Exception { |
| | | hkSyncVehicleFromHKService.syncVehicleUpdateData(new Date(System.currentTimeMillis()-24*60*60*1000)); |
| | | } |
| | | /** |
| | | * 每分钟拉取一次今日的访客预约数据 |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedRate= 3*60*1000) |
| | | public void syncVistAppointData() throws Exception { |
| | | if(Constants.DEALING_FROM_HK_VISIT){ |
| | | return ; |
| | | } |
| | | try { |
| | | Constants.DEALING_FROM_HK_VISIT =true; |
| | | hkSyncVisitFromHKService.syncVistAppointData(new Date()); |
| | | Constants.DEALING_FROM_HK_VISIT =false; |
| | | }catch (Exception e){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~"); |
| | | }finally { |
| | | Constants.DEALING_FROM_HK_VISIT =false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每10分钟拉取一次最新访客登记状态(预约成功和已登记) |
| | | * @throws Exception |
| | |
| | | * 下载海康系统图片数据 |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(fixedRate= 60*1000) |
| | | // @Scheduled(fixedRate= 60*1000) |
| | | public void downloadHkImg() throws Exception { |
| | | if(dataSyncConfig.getNeedDealImg()!=null && dataSyncConfig.getNeedDealImg()){ |
| | | hkSyncImgService.downHKImgs(0); |
| | |
| | | hkSyncVisitService.syncVisitData(); |
| | | } |
| | | |
| | | /** |
| | | * 每分钟拉取一次今日的访客预约数据 |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron= "0 0 23 * * ?") |
| | | public void syncVehicleUpdateData() throws Exception { |
| | | hkSyncVehicleFromHKService.syncVehicleUpdateData(new Date(System.currentTimeMillis()-24*60*60*1000)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时冻结内部人员 |
| | | */ |
| | | /** |
| | | * 定时冻结内部人员 |
| | | */ |
| | | // @Scheduled(fixedRate= 60*1000) |
| | | public void memberFreeze() { |
| | | memberService.memberFreeze(); |
| | | } |
| | | /** |
| | | * 每天清理超过一周的接口日志数据(清除和安防平台对接的接口数据) |
| | | * @throws Exception |
| | | */ |
| | | // @Scheduled(cron= "0 0 23 * * ?") |
| | | public void clearThreeMonthLog() throws Exception { |
| | | interfaceLogService.clearThreeMonthLog(); |
| | | } |
| | | public void memberFreeze() { |
| | | memberService.memberFreeze(); |
| | | } |
| | | /** |
| | | * 每天清理超过一周的接口日志数据(清除和安防平台对接的接口数据) |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron= "0 0 23 * * ?") |
| | | public void remainLastLogs() throws Exception { |
| | | interfaceLogService.remainLastLogs(); |
| | | } |
| | | |
| | | |
| | | } |