| | |
| | | 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.BasCrnp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | |
| | | ); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (isOutboundTargetStationTaskLimitReached(wrkMast)) { |
| | | continue; |
| | | } |
| | | if (!allowBatchOutboundExecute(wrkMast)) { |
| | | continue; |
| | | } |
| | |
| | | |
| | | Integer crnNo = basCrnp.getCrnNo(); |
| | | |
| | | if (isOutboundTargetStationTaskLimitReached(wrkMast)) { |
| | | return false; |
| | | } |
| | | |
| | | if (!allowBatchOutboundExecute(wrkMast)) { |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | 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 int getSystemConfigInt(String code, int defaultValue) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj == null) { |