| | |
| | | list.add(dto); |
| | | } |
| | | } |
| | | |
| | | //下发的订单明细,查看库存是否有足够的库存,排除机台的库位 |
| | | for (DetlDto detail : list) { |
| | | for (DetlDto detail : list) { |
| | | List<LocDetl> matnr = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("matnr", detail.getMatnr())); |
| | | Double count=0.0; |
| | | for (LocDetl detl : matnr) { |
| | |
| | | if (count<detail.getAnfme()) { |
| | | return R.error("物料="+detail.getMatnr()+"库存不足无法生成订单"); |
| | | } |
| | | //机台有冻结时禁止呼叫物料 |
| | | BasDevice basDevice = basDeviceService.selectOne(new EntityWrapper<BasDevice>() |
| | | .eq("status", 1) |
| | | .eq("dev_no", detail.getStandby1())); |
| | | if (Objects.isNull(basDevice)) { |
| | | return R.error(detail.getStandby1()+"机台信息不存在或已禁用!!"); |
| | | } |
| | | List<LocAroundBind> binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>() |
| | | .eq("dev_no", basDevice.getType()) |
| | | .eq("freeze", 1)); |
| | | if (!Cools.isEmpty(binds)) { |
| | | return R.error(detail.getStandby1()+"机台被冻结无法呼叫物料"); |
| | | } |
| | | } |
| | | // 单据主档 |
| | | order = new OrderPakout( |