| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.RowLastno; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.RowLastnoService; |
| | | import com.zy.common.CodeBuilder; |
| | | import com.zy.common.model.LocDetlDto; |
| | |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | // 奇数排(1, 3...)对应的浅库位是 row + 1 |
| | | // 偶数排(2, 4...)对应的浅库位是 row - 1 |
| | | int shallowRow = (remainder % 2 != 0) ? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位对应的浅库位号 |
| | | */ |
| | | public static String getShallowLoc(String deepLoc, List<Integer> doubleLocs) { |
| | | LocMastService locService = SpringUtils.getBean(LocMastService.class); |
| | | LocMast depLoc = locService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", deepLoc)); |
| | | int row; |
| | | if (depLoc.getRow1() != 1) { |
| | | row = depLoc.getRow1() - 1; |
| | | } else { |
| | | row = depLoc.getRow1(); |
| | | } |
| | | boolean contains = doubleLocs.contains(row); |
| | | LocMast shallowLoc = null; |
| | | if (!contains) { |
| | | shallowLoc = locService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", row) |
| | | .eq("bay1", depLoc.getBay1()) |
| | | .eq("lev1", depLoc.getLev1()) |
| | | ); |
| | | } else { |
| | | shallowLoc = locService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", depLoc.getRow1() + 1) |
| | | .eq("bay1", depLoc.getBay1()) |
| | | .eq("lev1", depLoc.getLev1()) |
| | | ); |
| | | } |
| | | return shallowLoc.getLocNo(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static Integer getShallowRow(SlaveProperties slaveProperties, Integer deepRow) { |
| | | int remainder = (int) Arith.remainder(deepRow, slaveProperties.getGroupCount()); |
| | | return remainder == 1 ? (deepRow + 1) : (deepRow - 1); |
| | | return (remainder % 2 != 0) ? (deepRow + 1) : (deepRow - 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | case 2://经典单伸库位(2排货架) |
| | | return LocNecessaryParametersDoubleExtension2(rowLastno, curRow, crnNumber); //已完善 |
| | | case 3://经典单双伸库位 左单右双(小单大双) |
| | | return LocNecessaryParametersDoubleExtension3(rowLastno, curRow, crnNumber); //未完善 |
| | | return LocNecessaryParametersDoubleExtension(rowLastno, curRow, crnNumber); //已完善 |
| | | // return LocNecessaryParametersDoubleExtension3(rowLastno, curRow, crnNumber); //未完善 |
| | | case 4://经典单双伸库位 左双右单(小双大单) |
| | | return LocNecessaryParametersDoubleExtension4(rowLastno, curRow, crnNumber); //未完善 |
| | | case 5://双工位单伸库位(4排货架) |