| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.CreateLocMoveTaskParam; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasDualCrnpService; |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private WmsOperateUtils wmsOperateUtils; |
| | |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | @Autowired |
| | | private StationOperateProcessUtils stationOperateProcessUtils; |
| | | |
| | | //入出库 ===>> 双工位堆垛机入出库作业下发 |
| | | public synchronized void dualCrnIoExecute() { |
| | |
| | | WrkMast stationOneWrkMast = null; |
| | | WrkMast stationTwoWrkMast = null; |
| | | |
| | | List<Integer> disableList = basDualCrnp.getDisableStationOneBays$(); |
| | | List<Integer> disableOneList = basDualCrnp.getDisableStationOneBays$(); |
| | | List<Integer> disableTwoList = basDualCrnp.getDisableStationTwoBays$(); |
| | | |
| | | for (WrkMast wrkMast : outTaskList) { |
| | | if (stationOneWrkMast == null) { |
| | | if (!disableList.contains(Utils.getBay(wrkMast.getSourceLocNo()))) { |
| | | if (!disableOneList.contains(Utils.getBay(wrkMast.getSourceLocNo()))) { |
| | | stationOneWrkMast = wrkMast; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if (stationTwoWrkMast == null) { |
| | | if (!disableList.contains(Utils.getBay(wrkMast.getSourceLocNo()))) { |
| | | if (!disableTwoList.contains(Utils.getBay(wrkMast.getSourceLocNo()))) { |
| | | stationTwoWrkMast = wrkMast; |
| | | continue; |
| | | } |
| | |
| | | |
| | | Integer crnNo = basDualCrnp.getCrnNo(); |
| | | |
| | | if (isOutboundTargetStationTaskLimitReached(wrkMast)) { |
| | | return null; |
| | | } |
| | | |
| | | for (StationObjModel stationObjModel : outStationList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo()); |
| | | if (stationThread == null) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | private boolean isOutboundTargetStationTaskLimitReached(WrkMast wrkMast) { |
| | | if (wrkMast == null || wrkMast.getStaNo() == null) { |
| | | return false; |
| | | } |
| | | BasStation basStation = basStationService.getById(wrkMast.getStaNo()); |
| | | if (basStation == null || basStation.getOutTaskLimit() == null || basStation.getOutTaskLimit() < 0) { |
| | | return false; |
| | | } |
| | | int currentStationTaskCount = stationOperateProcessUtils.getCurrentOutboundTaskCountByTargetStation(wrkMast.getStaNo()); |
| | | if (currentStationTaskCount >= basStation.getOutTaskLimit()) { |
| | | News.taskInfo(wrkMast.getWrkNo(), |
| | | "目标出库站:{} 已达出库任务上限,当前={},上限={}", |
| | | wrkMast.getStaNo(), |
| | | currentStationTaskCount, |
| | | basStation.getOutTaskLimit()); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private synchronized SendDualCrnCommandParam crnExecuteLocMove(BasDualCrnp basDualCrnp, DualCrnThread dualCrnThread, WrkMast wrkMast, int station) { |
| | | DualCrnProtocol dualCrnProtocol = dualCrnThread.getStatus(); |
| | | if (dualCrnProtocol == null) { |