| | |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.RowLastno; |
| | | import com.zy.asrs.service.RowLastnoService; |
| | | import com.zy.common.CodeBuilder; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.system.service.UserService; |
| | | |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | boolean deepLocLeft = isDeepLoc(slaveProperties, row);//判断是否为左深库位 |
| | | int shallowRow = deepLocLeft? (row + 1) : (row - 1); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row);//判断是否为左深库位 |
| | | int shallowRow = deepLocLeft ? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row-1);//判断是否为左浅库位 |
| | | int shallowRow = deepLocLeft? (row - 1) : (row + 1); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row - 1);//判断是否为左浅库位 |
| | | int shallowRow = deepLocLeft ? (row - 1) : (row + 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号,如果没有深库位,则返回为空 |
| | | */ |
| | | public static String getDeepLoc2(SlaveProperties slaveProperties, String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | boolean deepLoc = isDeepLoc(slaveProperties, row);//判断是否为深库位 |
| | | if (deepLoc) { |
| | | return null; |
| | | } |
| | | if (row == 1 || row == 6) { |
| | | return null; |
| | | } |
| | | //4,7,11,15,19,23 |
| | | if (row == 4 || row == 7 || row == 11 || row == 15 || row == 19 || row == 23) { |
| | | return zerofill(String.valueOf(row + 1), 2) + shallowLoc.substring(2); |
| | | } else { |
| | | return zerofill(String.valueOf(row - 1), 2) + shallowLoc.substring(2); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | |
| | | * 获取 浅库位排对应的深库位排 |
| | | */ |
| | | public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) { |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, shallowRow-1);//判断是否为左浅库位 |
| | | return deepLocLeft? (shallowRow - 1) : (shallowRow + 1); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, shallowRow - 1);//判断是否为左浅库位 |
| | | return deepLocLeft ? (shallowRow - 1) : (shallowRow + 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | return necessaryParameters; |
| | | } |
| | | |
| | | //四向库(牛眼\光泰) |
| | | public static int[] LocNecessaryParametersDoubleExtension6(RowLastno rowLastno, Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | |
| | | necessaryParameters[0] = crnNumber; // 轮询次数 |
| | | curRow = curRow - offset; |
| | | //满板正常入库 |
| | | switch (curRow){ |
| | | switch (curRow) { |
| | | case 1: |
| | | necessaryParameters[1] = 4; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | |
| | | Integer sCrnNo = rowLastno.getsCrnNo();//起始堆垛机号 |
| | | necessaryParameters[0] = crnNumber; // 轮询次数 |
| | | //满板正常入库 |
| | | if (curRow.equals(rowLastno.geteRow())){ |
| | | if (curRow.equals(rowLastno.geteRow())) { |
| | | necessaryParameters[1] = sRow; //curRow 最深库位排 |
| | | necessaryParameters[2] = sCrnNo; //crnNo 堆垛机号 |
| | | necessaryParameters[3] = sRow; //nearRow 最浅库位排 |
| | |
| | | // 外侧方向的货位 优先入库方向 ===>> 反之 |
| | | public static List<String> getGroupOutLocCrn(Integer curRow, Integer nearRow, String locNo, boolean pakin) { |
| | | List<String> result = new ArrayList<>(); |
| | | if (pakin){ |
| | | for (int row = curRow;row>=nearRow;row--){ |
| | | if (pakin) { |
| | | for (int row = curRow; row >= nearRow; row--) { |
| | | result.add(zerofill(String.valueOf(row), 2) + locNo.substring(2)); |
| | | } |
| | | }else { |
| | | for (int row = curRow;row<=nearRow;row++){ |
| | | } else { |
| | | for (int row = curRow; row <= nearRow; row++) { |
| | | result.add(zerofill(String.valueOf(row), 2) + locNo.substring(2)); |
| | | } |
| | | } |