| | |
| | | @Value("${wcs.status-sync.enabled:true}") |
| | | private Boolean enabled; |
| | | |
| | | // @Scheduled( |
| | | // initialDelayString = "${wcs.status-sync.initial-delay:10000}", |
| | | // fixedDelayString = "${wcs.status-sync.fixed-delay:5000}" |
| | | // ) |
| | | @Value("${wcs.status-sync.log-on-failure:true}") |
| | | private Boolean logOnFailure; |
| | | |
| | | @Scheduled( |
| | | initialDelayString = "${wcs.status-sync.initial-delay:10000}", |
| | | fixedDelayString = "${wcs.status-sync.fixed-delay:5000}" |
| | | ) |
| | | private void execute() { |
| | | if (!Boolean.TRUE.equals(enabled)) { |
| | | return; |
| | | } |
| | | R result = wcsApiService.syncDeviceStatusFromWcs(); |
| | | if (!Objects.equals(result.get("code"), 200)) { |
| | | R result = wcsApiService.syncDeviceStatusFromWcs(Boolean.TRUE.equals(logOnFailure)); |
| | | if (Boolean.TRUE.equals(logOnFailure) && !Objects.equals(result.get("code"), 200)) { |
| | | log.warn("轮询同步WCS设备状态失败, result={}", result); |
| | | } |
| | | } |