| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | |
| | | return result; |
| | | } |
| | | |
| | | //检测提交的出库库位是否合法(浅库位有非空库位) |
| | | public static void checkStockOutLocNo(List<String> locNos) { |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | //检测是否为浅库位 |
| | | boolean sign = false; |
| | | String th = ""; |
| | | for (String locNo : locNos) { |
| | | if (sign) { |
| | | break; |
| | | } |
| | | List<String> groupInsideLoc = Utils.getGroupLoc(locNo); |
| | | if (!Cools.isEmpty(groupInsideLoc)) { |
| | | for (String insideLoc : groupInsideLoc) { |
| | | if (locNos.contains(insideLoc)) { |
| | | break; |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<String> groupLoc = Utils.getGroupLoc("1300801"); |
| | | System.out.println(groupLoc); |