| | |
| | | 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);//判断是否为左深库位 |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row);//判断是否为左深库位 |
| | | int shallowRow = deepLocLeft? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | |
| | | 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 deepLocLeft = isDeepLoc(slaveProperties, row);//判断是否为深库位 |
| | | if (!deepLocLeft) { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | |
| | | |
| | | return necessaryParameters; |
| | | } |
| | | |
| | | //四向库(牛眼\光泰) |
| | | public static int[] LocNecessaryParametersDoubleExtension6(RowLastno rowLastno, Integer curRow, Integer crnNumber) { |
| | | int[] necessaryParameters = new int[]{0, 0, 0, 0}; |
| | |
| | | //尝试找1号弯轨堆垛机库位 |
| | | crnNo = 1; |
| | | if (basCrnpService.checkSiteError(crnNo, true)) { |
| | | List<Integer> nearRowList = new ArrayList<Integer>(){{add(4);add(6);add(3);add(1);}}; |
| | | List<Integer> nearRowList = new ArrayList<Integer>() {{ |
| | | add(4); |
| | | add(6); |
| | | add(3); |
| | | add(1); |
| | | }}; |
| | | for (Integer near : nearRowList) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("row1", near) |
| | |
| | | //尝试找1号弯轨堆垛机库位 |
| | | crnNo = 1; |
| | | if (basCrnpService.checkSiteError(crnNo, true)) { |
| | | List<Integer> nearRowList = new ArrayList<Integer>(){{add(4);add(6);add(3);add(1);}}; |
| | | List<Integer> nearRowList = new ArrayList<Integer>() {{ |
| | | add(4); |
| | | add(6); |
| | | add(3); |
| | | add(1); |
| | | }}; |
| | | for (Integer near : nearRowList) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("row1", near) |
| | |
| | | if (crnNo == 1) { |
| | | configService.updateValue("123CrnSearchList", String.valueOf(0)); |
| | | } |
| | | |
| | | //针对1号堆垛机打的补丁,防止找到库位时,找到最浅库位 |
| | | String deepLoc2 = Utils.getDeepLoc2(slaveProperties, locMast.getLocNo()); |
| | | if (!Cools.isEmpty(deepLoc2)) { |
| | | LocMast locMastNew = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", deepLoc2).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())); |
| | | if (!Cools.isEmpty(locMastNew)) { |
| | | locMast = locMastNew; |
| | | } |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | // 返回dto |
| | |
| | | # 左深库位排号 |
| | | doubleLocsLeft: 4,7,11,15,19,23 |
| | | # 右深库位排号 |
| | | doubleLocsRight: 3,7,10,14,18,22,26 |
| | | doubleLocsRight: 3,10,14,18,22,26 |
| | | # wms参数配置 |
| | | wms-parameter: |
| | | # 自动补空板功能开关 |