| | |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | @Autowired |
| | | private StationOperateProcessUtils stationOperateProcessUtils; |
| | | |
| | | public synchronized void crnIoExecute() { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .eq("crn_no", basCrnp.getCrnNo()) |
| | | .in("wrk_sts", WrkStsType.INBOUND_RUN.sts, WrkStsType.OUTBOUND_RUN.sts) |
| | | .orderBy("batch_seq", false) |
| | | ); |
| | | if(!wrkMasts.isEmpty()){ |
| | | continue; |
| | |
| | | return false; |
| | | } |
| | | |
| | | int stationMaxTaskCount = 30; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | try { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | stationMaxTaskCount = Integer.parseInt(systemConfigMap.getOrDefault("stationMaxTaskCountLimit", "30")); |
| | | } catch (Exception ignore) {} |
| | | } |
| | | |
| | | int currentStationTaskCount = stationOperateProcessUtils.getCurrentStationTaskCount(); |
| | | if (stationMaxTaskCount > 0 && currentStationTaskCount >= stationMaxTaskCount) { |
| | | News.warn("输送站点任务数量达到上限,已停止任务下发。当前任务数={},上限={}", currentStationTaskCount, stationMaxTaskCount); |
| | | return false; |
| | | } |
| | | |
| | | Integer crnNo = basCrnp.getCrnNo(); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .eq("crn_no", crnNo) |
| | | .eq("wrk_sts", WrkStsType.NEW_OUTBOUND.sts) |
| | | .orderBy("batch_seq", false) |
| | | ); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | CrnCommand resetCommand = crnThread.getResetCommand(crnProtocol.getCrnNo()); |
| | | CrnCommand resetCommand = crnThread.getResetCommand(crnProtocol.getTaskNo(), crnProtocol.getCrnNo()); |
| | | MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, resetCommand)); |
| | | News.info("堆垛机任务状态更新成功,堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | } |
| | |
| | | String shallowLocNo = Utils.getLocNo(shallowRow, Utils.getBay(locNo), Utils.getLev(locNo)); |
| | | LocMast shallowLocMast = locMastService.queryByLoc(shallowLocNo); |
| | | if (shallowLocMast == null) { |
| | | News.taskInfo(taskNo, "浅库位:{} 数据不存在", shallowLocNo); |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | if (shallowLocMast.getLocSts().equals("O")) { |