| | |
| | | @TableField("station_alias") |
| | | private String stationAlias; |
| | | |
| | | /** |
| | | * 出库任务上限 |
| | | */ |
| | | @ApiModelProperty(value= "出库任务上限") |
| | | @TableField("out_task_limit") |
| | | private Integer outTaskLimit; |
| | | |
| | | public BasStation() {} |
| | | |
| | | public BasStation(Integer status,Integer wrkNo,String inEnable,String outEnable,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer stationLev) { |
| | |
| | | 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) { |
| | |
| | | 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() { |
| | |
| | | |
| | | 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) { |
| | |
| | | return countCurrentStationTask(); |
| | | } |
| | | |
| | | public synchronized int getCurrentOutboundTaskCountByTargetStation(Integer stationId) { |
| | | if (stationId == null) { |
| | | return 0; |
| | | } |
| | | return (int) wrkMastService.count(new QueryWrapper<WrkMast>() |
| | | .eq("io_type", WrkIoType.OUT.id) |
| | | .eq("sta_no", stationId) |
| | | .in("wrk_sts", |
| | | WrkStsType.OUTBOUND_RUN.sts, |
| | | WrkStsType.OUTBOUND_RUN_COMPLETE.sts, |
| | | WrkStsType.STATION_RUN.sts)); |
| | | } |
| | | |
| | | // 检测出库排序 |
| | | public synchronized void checkStationOutOrder() { |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | |
| | | <result column="station_lev" property="stationLev" /> |
| | | <result column="device_no" property="deviceNo" /> |
| | | <result column="station_alias" property="stationAlias" /> |
| | | <result column="out_task_limit" property="outTaskLimit" /> |
| | | |
| | | </resultMap> |
| | | |
| New file |
| | |
| | | -- asr_bas_station 增加出库任务上限配置 |
| | | -- 用途:按最终出库站限制堆垛机可同时放行的在途出库任务数 |
| | | -- 适用数据库:MySQL |
| | | |
| | | SET @current_db := DATABASE(); |
| | | |
| | | SET @out_task_limit_exists := ( |
| | | SELECT COUNT(1) |
| | | FROM information_schema.COLUMNS |
| | | WHERE TABLE_SCHEMA = @current_db |
| | | AND TABLE_NAME = 'asr_bas_station' |
| | | AND COLUMN_NAME = 'out_task_limit' |
| | | ); |
| | | |
| | | SET @add_out_task_limit_sql := IF( |
| | | @out_task_limit_exists = 0, |
| | | 'ALTER TABLE asr_bas_station ADD COLUMN out_task_limit INT NULL COMMENT ''出库任务上限,<0或NULL表示不限制,0表示禁止新出库'' AFTER station_alias', |
| | | 'SELECT ''column out_task_limit already exists'' ' |
| | | ); |
| | | PREPARE stmt_out_task_limit FROM @add_out_task_limit_sql; |
| | | EXECUTE stmt_out_task_limit; |
| | | DEALLOCATE PREPARE stmt_out_task_limit; |
| | | |
| | | SHOW COLUMNS FROM asr_bas_station LIKE 'out_task_limit'; |
| | |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'outTaskLimit', |
| | | columnName: 'out_task_limit', |
| | | label: '出库任务上限', |
| | | tableProp: 'outTaskLimit', |
| | | exportField: 'outTaskLimit', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 130, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'stationId', |
| | | columnName: 'station_id', |
| | | label: '编 号', |
| | |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'outTaskLimit', |
| | | columnName: 'out_task_limit', |
| | | label: '出库任务上限', |
| | | tableProp: 'outTaskLimit', |
| | | exportField: 'outTaskLimit', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 130, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | } |
| | | |
| | | ]); |