| | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStoreOrder(StockOutParam param, Long userId) { |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getOrderNo()) || Cools.isEmpty(param.getLocDetls())){ |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getLocDetls())){ |
| | | throw new CoolException("参数为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())){ |
| | | throw new CoolException("订单号参数为空"); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd("手动出库单", Boolean.FALSE); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | |
| | | orderDetl.setSpecs(locDetl.getSpecs());//规格 |
| | | orderDetl.setBrand(locDetl.getBrand());//木箱类型 |
| | | orderDetl.setBarcode(locDetl.getZpallet());//木箱类型 |
| | | orderDetl.setWeight(locDetl.getWeight()); |
| | | // orderDetl.setWorkQty(locDetl.getAnfme()); |
| | | orderDetl.setWorkQty(0.0); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setOrigin(locDetl.getOrigin()); |
| | | orderDetl.setCreateBy(userId); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(userId); |
| | |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setSheetNo("0"); |
| | | if (staDesc.getStnNo()<118 || staDesc.getStnNo()>121){ |
| | | wrkMast.setSheetNo("3"); |
| | | } |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()!=202) { |
| | | wrkMast.setWrkSts(14L); |
| | | }else if (wrkMast.getIoType()==202){ |
| | | wrkMast.setWrkSts(57L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setSheetNo("2"); |
| | | wrkMast.setSheetNo("3"); |
| | | // 完成操作人员记录 |
| | | wrkMast.setManuType("手动完成"); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14 && wrkMast.getIoType()!=202) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else if (wrkMast.getIoType()==202 || wrkMast.getIoType()==212){ |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | |
| | | } |
| | | // 删除工作档明细 |
| | | boolean wrkDetlRes = wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | } |
| | | if (wrkMast.getIoType()==202 || wrkMast.getIoType()==212){ |
| | | return; |
| | | } |
| | | |
| | | // 修改库位状态 |
| | |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("matnr", param.getLocDetls().get(0).getMatnr())); |
| | | if (Cools.isEmpty(locDetls) || locDetls.size()<1){ |
| | | throw new CoolException("待修改商品无库存,无需修改! 品号:"+param.getLocDetls().get(0).getMatnr()); |
| | | throw new CoolException("待修改商品无库存,无需修改! 规格:"+param.getLocDetls().get(0).getMatnr()); |
| | | } |
| | | try { |
| | | locDetlService.updateMatTurn(param.getLocDetls().get(0).getMatnr(),mat.getMatnr()); |