| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | ArrayList<String> locNos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl locDetl:param.getLocDetls()){ |
| | | if (!locNos.contains(locDetl.getLocNo())){ |
| | | locNos.add(locDetl.getLocNo()); |
| | | } |
| | | } |
| | | //检测是否为浅库位 |
| | | boolean sign=false; |
| | | String th = ""; |
| | | for (String locNo:locNos){ |
| | | if (sign){ |
| | | break; |
| | | } |
| | | List<String> groupInsideLoc = Utils.getGroupInsideLoc(locNo); |
| | | if (!Cools.isEmpty(groupInsideLoc)) { |
| | | for (String insideLoc : groupInsideLoc) { |
| | | if (locNos.contains(insideLoc)){ |
| | | continue; |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", insideLoc)); |
| | | if (locMast != null) { |
| | | if (!locMast.getLocSts().equals("O") && !locMast.getLocSts().equals("R")){ |
| | | sign=true; |
| | | th="库位号:"+locNo+" 浅库位有非空库位!"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (sign){ |
| | | throw new CoolException("出库失败;"+th); |
| | | } |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | |
| | | } else { |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | } |
| | | /** |
| | | * 通过库位号获取 排 |
| | | */ |
| | | public static int getRow(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(0, 2)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | /** |
| | | * 通过库位号获取 列 |
| | | */ |
| | | public static int getBay(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(2, 5)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | /** |
| | | * 通过库位号获取 层 |
| | | */ |
| | | public static int getLev(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(5, 7)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | @Transactional |
| | | public void emptyPlateOut(EmptyPlateOutParam param, Long userId) { |
| | | List<String> locNos = param.getLocNos(); |
| | | //检测是否为浅库位 |
| | | boolean sign=false; |
| | | String th = ""; |
| | | for (String locNo:locNos){ |
| | | if (sign){ |
| | | break; |
| | | } |
| | | List<String> groupInsideLoc = Utils.getGroupInsideLoc(locNo); |
| | | if (!Cools.isEmpty(groupInsideLoc)) { |
| | | for (String insideLoc : groupInsideLoc) { |
| | | if (locNos.contains(insideLoc)){ |
| | | continue; |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", insideLoc)); |
| | | if (locMast != null) { |
| | | if (!locMast.getLocSts().equals("O") && !locMast.getLocSts().equals("R")){ |
| | | sign=true; |
| | | th="库位号:"+locNo+" 浅库位有非空库位!"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (sign){ |
| | | throw new CoolException("出库失败;"+th); |
| | | } |
| | | if (Cools.isEmpty(param.getOutSite())) { |
| | | throw new CoolException("站点不存在"); |
| | | } |