| | |
| | | private ManLocDetlService manLocDetlService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Resource |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | |
| | | if(param.getCombMats().size()>1){ |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | | // if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | // eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { |
| | | // throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | // } |
| | | param.getCombMats().forEach(elem -> { |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N") |
| | | .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | }); |
| | | |
| | | if(param.getBarcode().length()!=9){ |
| | | throw new CoolException("条码长度不是9位===>>" + param.getBarcode()); |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N") |
| | | .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setManu(detlDto.getMark()); |
| | | waitPakin.setManu(detlDto.getMark()); //标记 |
| | | waitPakin.setOrigin(order.getItemName());//仓库 |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void pdaAdjust(pdaAdjustParam param, Long userId) { |
| | | if (Cools.isEmpty(param)){ |
| | | throw new CoolException("盘点列表参数为空"); |
| | | } |
| | | for (InventoryCheckOrderDetl orderDetl: param.getParam()){ |
| | | InventoryCheckOrderDetl inventoryCheckOrderDetl = inventoryCheckOrderDetlService.selectOne(new EntityWrapper<InventoryCheckOrderDetl>() |
| | | .eq("order_no", orderDetl.getOrderNo()) |
| | | .eq("matnr", orderDetl.getMatnr()) |
| | | .eq("batch", orderDetl.getBatch())); |
| | | if (Cools.isEmpty(inventoryCheckOrderDetl)){ |
| | | throw new CoolException("未查询到盘点信息"); |
| | | } |
| | | if (!inventoryCheckOrderDetl.getStatus().equals("1")){ |
| | | throw new CoolException("该任务已盘点"); |
| | | } |
| | | inventoryCheckOrderDetl.setCheckAnfme(orderDetl.getCheckAnfme()); |
| | | inventoryCheckOrderDetl.setStatus("2"); |
| | | if (!inventoryCheckOrderDetlService.updateById(inventoryCheckOrderDetl)){ |
| | | throw new CoolException("保存盘点信息失败!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, |
| | | Double curOutQty, Integer ioType, Long userId, Date now) { |