| | |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | if (null == locMast) { |
| | | int t = 0; |
| | | boolean execute = true; |
| | | int crnNo1; |
| | | while (execute && t < 4) { |
| | | t++; |
| | | switch (curRow) { |
| | | case 3: |
| | | curRow = 11; |
| | | crnNo1 = 2; |
| | | break; |
| | | case 11: |
| | | curRow = 4; |
| | | crnNo1 = 1; |
| | | break; |
| | | case 4: |
| | | curRow = 12; |
| | | crnNo1 = 2; |
| | | break; |
| | | default: |
| | | curRow = 3; |
| | | crnNo1 = 1; |
| | | break; |
| | | Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | | Integer crnNo1 = shelves.get(curRow); |
| | | if (basCrnpService.checkSiteError(crnNo1, true)) { |
| | | crnNo = crnNo1; |
| | | execute = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (times < rowCount) { |
| | | times = times + 1; |
| | | return getLocNo(whsType, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times); |
| | | } else { |
| | | times = 0; |
| | | } |
| | | // // 货物检索低库位仓失败,兼容高库位仓后继续执行 |
| | | // if (locTypeDto.getLocType1() == 1) { |
| | | // locTypeDto.setLocType1((short) 2); |
| | | // return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | // } |
| | | // 货物检索低库位仓失败,兼容高库位仓后继续执行 |
| | | if (locTypeDto.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 2); |
| | | return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | } |