| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.common.model.TaskDto; |
| | |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | orderDetl.getBrand(),orderPakOut.getDocType()==11?null:orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | taskDtos.add(taskDto); |
| | | } |
| | | } |
| | | OrderPakout orderPakout = orderPakOutService.selectByNo(locDtos.get(0).getOrderNo()); |
| | | |
| | | //配盘出库单用, i=5时或者出库到最后时下发空板出库任务 |
| | | int i = 0; |
| | | //需要出库的托盘数量 |
| | | int size = taskDtos.size(); |
| | | //优先级 |
| | | int ioPri = 50; |
| | | //已下空板出库任务数量 |
| | | int j=1; |
| | | // ----------------------------------------------------------------------------------------------- |
| | | for (TaskDto taskDto : taskDtos) { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); |
| | | workService.stockOut(staNo, taskDto, getUserId()); |
| | | workService.stockOut(staNo, taskDto, getUserId(),ioPri); |
| | | ioPri--; |
| | | i++; |
| | | //配盘出库单使用,下发需要出的空板任务 |
| | | if (orderPakout.getDocType() == 11) { |
| | | if (size<5&&i==size){ |
| | | for (;j<=orderPakout.getPayType();j++){ |
| | | String bar=""; |
| | | if(!Cools.isEmpty(orderPakout.getShipCode())&&orderPakout.getShipCode().equals("A01")){ |
| | | bar = "A01"; |
| | | } |
| | | LocMast locMast = new LocMast(); |
| | | if(Cools.isEmpty(bar)){ |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D")); |
| | | }else { |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").like("barcode", bar)); |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)) { |
| | | return R.error("库存没有空板"); |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam(); |
| | | emptyPlateOutParam.setOutSite(303); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>(){{add(locNo);}}); |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam,ioPri); |
| | | ioPri--; |
| | | |
| | | } |
| | | }else if(i == 5){ |
| | | String bar=""; |
| | | if(!Cools.isEmpty(orderPakout.getShipCode())&&orderPakout.getShipCode().equals("A01")){ |
| | | bar = "A01"; |
| | | } |
| | | LocMast locMast = null; |
| | | if(Cools.isEmpty(bar)){ |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D")); |
| | | }else { |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").like("barcode", bar)); |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)) { |
| | | return R.error("库存没有空板"); |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam(); |
| | | emptyPlateOutParam.setOutSite(303); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>(){{add(locNo);}}); |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam,ioPri); |
| | | ioPri--; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |