|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.common.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.LocDirectionService; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.Cools; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.SpringUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.security.SecureRandom; | 
|---|
|  |  |  | import java.text.DecimalFormat; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by vincent on 2020/8/27 | 
|---|
|  |  |  | 
|---|
|  |  |  | return sb.toString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取库位组 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static List<String> getGroupLoc(String locNo, Long hostId) { | 
|---|
|  |  |  | int row = getRow(locNo); | 
|---|
|  |  |  | List<String> result = new ArrayList<>(); | 
|---|
|  |  |  | LocDirectionService locDirectionService = SpringUtils.getBean(LocDirectionService.class); | 
|---|
|  |  |  | List<ArrayList<Integer>> naturalList = locDirectionService.getNaturalList(hostId); | 
|---|
|  |  |  | for (ArrayList<Integer> list : naturalList) { | 
|---|
|  |  |  | if (list.contains(row)) { | 
|---|
|  |  |  | for (Integer row0 : list) { | 
|---|
|  |  |  | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取外侧方向的库位组 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static List<String> getGroupOuterLoc(String locNo, Long hostId) { | 
|---|
|  |  |  | int row = getRow(locNo); | 
|---|
|  |  |  | List<String> result = new ArrayList<>(); | 
|---|
|  |  |  | LocDirectionService locDirectionService = SpringUtils.getBean(LocDirectionService.class); | 
|---|
|  |  |  | List<ArrayList<Integer>> outerList = locDirectionService.getOuterList(hostId); | 
|---|
|  |  |  | for (ArrayList<Integer> list : outerList) { | 
|---|
|  |  |  | if (list.contains(row)) { | 
|---|
|  |  |  | for (Integer row0 : list) { | 
|---|
|  |  |  | if (row0 == row) { | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取内侧方向的库位组 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static List<String> getGroupInnerLoc(String locNo, Long hostId) { | 
|---|
|  |  |  | int row = getRow(locNo); | 
|---|
|  |  |  | List<String> result = new ArrayList<>(); | 
|---|
|  |  |  | LocDirectionService locDirectionService = SpringUtils.getBean(LocDirectionService.class); | 
|---|
|  |  |  | List<ArrayList<Integer>> innerList = locDirectionService.getInnerList(hostId); | 
|---|
|  |  |  | for (ArrayList<Integer> list : innerList) { | 
|---|
|  |  |  | if (list.contains(row)) { | 
|---|
|  |  |  | for (Integer row0 : list) { | 
|---|
|  |  |  | if (row0 == row) { | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|