| | |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private BasDualCrnpService basDualCrnpService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | |
| | | public synchronized void stationOutExecute() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", wrkMast.getCrnNo())); |
| | | if (basCrnp == null) { |
| | | continue; |
| | | } |
| | | List<StationObjModel> outStationList = new ArrayList<>(); |
| | | |
| | | List<StationObjModel> outStationList = basCrnp.getOutStationList$(); |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", wrkMast.getCrnNo())); |
| | | if (basCrnp != null) { |
| | | outStationList = basCrnp.getOutStationList$(); |
| | | if(outStationList.isEmpty()){ |
| | | News.info("堆垛机:{} 出库站点未设置", basCrnp.getCrnNo()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", wrkMast.getDualCrnNo())); |
| | | if (basDualCrnp != null) { |
| | | outStationList = basDualCrnp.getOutStationList$(); |
| | | if(outStationList.isEmpty()){ |
| | | News.info("双工位堆垛机:{} 出库站点未设置", basDualCrnp.getCrnNo()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | for (StationObjModel stationObjModel : outStationList) { |
| | |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | News.info("输送站点出库命令下发成功,站点号={},工作号={},命令数据={}", stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command)); |
| | | redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_LIMIT.key + stationProtocol.getStationId(), "lock", 5); |
| | | redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_COMPLETE_LIMIT.key + wrkMast.getWrkNo(), "lock", 60 * 5); |
| | | } |
| | | } |
| | | } |
| | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer wrkNo = wrkMast.getWrkNo(); |
| | | |
| | | Object lock = redisUtil.get(RedisKeyType.STATION_OUT_EXECUTE_COMPLETE_LIMIT.key + wrkNo); |
| | | if (lock != null) { |
| | | continue; |
| | | } |
| | | |
| | | boolean complete = true; |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |