| | |
| | | && stationProtocol.isLoading() |
| | | && stationProtocol.isInEnable() |
| | | && stationProtocol.getTaskNo() > 0)) { |
| | | logTraceLimited("generate_wait_condition_" + stationId, 5, |
| | | "[WCS Trace][条码站入库] 条码站暂未满足生成条件。stationId={},autoing={},loading={},inEnable={},enableIn={},taskNo={},targetStaNo={},barcode={},error={},warning={}", |
| | | stationId, stationProtocol.isAutoing(), stationProtocol.isLoading(), |
| | | stationProtocol.isInEnable(), stationProtocol.isEnableIn(), stationProtocol.getTaskNo(), |
| | | stationProtocol.getTargetStaNo(), stationProtocol.getBarcode(), |
| | | stationProtocol.getError(), stationProtocol.getSystemWarning()); |
| | | return; |
| | | } |
| | | if (Cools.isEmpty(stationProtocol.getBarcode())) { |
| | | logTraceLimited("generate_wait_barcode_" + stationId, 5, |
| | | "[WCS Trace][条码站入库] 条码站已到位但还没有条码。stationId={},taskNo={},targetStaNo={},palletHeight={},weight={},error={},warning={}", |
| | | stationId, stationProtocol.getTaskNo(), stationProtocol.getTargetStaNo(), |
| | | stationProtocol.getPalletHeight(), stationProtocol.getWeight(), |
| | | stationProtocol.getError(), stationProtocol.getSystemWarning()); |
| | | return; |
| | | } |
| | | |
| | |
| | | wrkMasts.size(), firstWrkMast.getWrkNo(), firstWrkMast.getWrkSts(), |
| | | firstWrkMast.getLocNo()); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (wrkMast.getIoType().equals(WrkIoType.OUT.id) && wrkMast.getWrkSts().equals(WrkStsType.STATION_RUN.sts)) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_OUTBOUND.sts); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | if (wrkMast.getIoType().equals(WrkIoType.OUT.id)) { |
| | | if (wrkMast.getWrkSts().equals(WrkStsType.STATION_RUN.sts) || wrkMast.getWrkSts().equals(WrkStsType.STATION_RUN_COMPLETE.sts)) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_OUTBOUND.sts); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | } |
| | | return; |
| | |
| | | |
| | | Object generateLock = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId); |
| | | if (generateLock != null) { |
| | | logTraceLimited("generate_wait_lock_" + stationId, 3, |
| | | "[WCS Trace][条码站入库] 条码站生成任务命中限流锁。stationId={},taskNo={},barcode={},warning={}", |
| | | stationId, stationProtocol.getTaskNo(), stationProtocol.getBarcode(), stationProtocol.getSystemWarning()); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void logTraceLimited(String lockKey, int seconds, String format, Object... arguments) { |
| | | String redisKey = RedisKeyType.LOG_LIMIT.key + "wcs_trace_" + lockKey; |
| | | try { |
| | | Object lock = redisUtil.get(redisKey); |
| | | if (lock != null) { |
| | | return; |
| | | } |
| | | redisUtil.set(redisKey, "lock", seconds); |
| | | } catch (Exception e) { |
| | | // 诊断日志不能影响主流程。 |
| | | } |
| | | News.info(format, arguments); |
| | | } |
| | | |
| | | //检测入库站是否有任务生成,并启动入库 |
| | | private synchronized void checkInStationHasTask() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |