| | |
| | | @Transactional |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) { |
| | | whsType = Utils.GetWhsType(sourceStaNo); |
| | | return getLocNo(whsType, staDescId, sourceStaNo, matnr, batch, grade, 0, locTypeDto, 0); |
| | | return getLocNoToOne(whsType, staDescId, sourceStaNo, matnr, batch, grade, 0, locTypeDto, 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | StartupDto startupDto = new StartupDto(); |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | int sRow = rowLastno.getsRow(); |
| | | int eRow = rowLastno.geteRow(); |
| | | int crnNumber = rowLastno.getCrnQty(); |
| | | int sRow = rowLastno.getsRow(); //起始排号 |
| | | int eRow = rowLastno.geteRow(); //终止排号 |
| | | int crnNumber = rowLastno.getCrnQty(); //堆垛机数量 |
| | | |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | // ===============>>>> 开始执行 |
| | | curRow = rowLastno.getCurrentRow(); |
| | | curRow = rowLastno.getCurrentRow(); //当前排号 |
| | | |
| | | if (!Cools.isEmpty(moveCrnNo) && moveCrnNo != 0) { |
| | | crnNumber = moveCrnNo; |
| | |
| | | startupDto.setLocNo(locNo); |
| | | return startupDto; |
| | | } |
| | | |
| | | /*镇江恒立单伸立库逻辑*/ |
| | | @Transactional |
| | | public StartupDto getLocNoToOne(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { |
| | | //目标库位 |
| | | LocMast locMast = null; |
| | | //1号巷道 3种托盘类型 |
| | | if (locTypeDto.getLocType2()==4||locTypeDto.getLocType2()==5||locTypeDto.getLocType2()==6){ |
| | | locMast=locMastService.queryLocToOne(locTypeDto.getLocType2()); |
| | | }else if (locTypeDto.getLocType2()==7||locTypeDto.getLocType2()==8){ |
| | | //2号巷道 2种类型托盘 |
| | | locMast=locMastService.queryLocToTwo(locTypeDto.getLocType2()); |
| | | }else { |
| | | throw new CoolException("不存在该库位类型:"+locTypeDto.getLocType2()); |
| | | } |
| | | if (locMast == null){ |
| | | throw new CoolException("入库没有空库位"); |
| | | } |
| | | |
| | | //堆垛机号 |
| | | Integer crnNo = locMast.getCrnNo(); |
| | | |
| | | //获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", crnNo); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)){ |
| | | log.error("入库路径不存在,staDesc={},sourceStaNo={},crnNo={}",1,staDescId,crnNo); |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | |
| | | //检测目标站 |
| | | BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | if (!staNo.getAutoing().equals("Y")){ |
| | | throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | } |
| | | |
| | | //生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | |
| | | //返回dto |
| | | StartupDto startupDto =new StartupDto(); |
| | | startupDto.setWorkNo(workNo); |
| | | startupDto.setLocNo(locMast.getLocNo()); |
| | | startupDto.setStaNo(staNo.getDevNo()); |
| | | startupDto.setCrnNo(crnNo); |
| | | startupDto.setSourceStaNo(sourceStaNo); |
| | | return startupDto; |
| | | } |
| | | |
| | | } |