| | |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | one.setMemo(paramLocDetl.getMemo()); |
| | | one.setColor(paramLocDetl.getColor()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | } |
| | | } |
| | |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | param.getCstmrName(), // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | |
| | | 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); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setMemo(locDetl.getMemo()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | 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 (!locDetlDtos.isEmpty()) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | |
| | | if (locMast.getLocSts().equals("F")){ |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | |
| | | 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()); |