| | |
| | | private static final int DEFAULT_ROW_NO_TYPE = 1; |
| | | |
| | | // 堆垛机映射一楼的入库出库站点 |
| | | private static final Map<Integer,List<Integer>> crnMapNo; |
| | | private static final Map<Integer, List<Integer>> crnMapNo; |
| | | |
| | | static { |
| | | crnMapNo = new HashMap<>(); |
| | | crnMapNo.put(1,new ArrayList<Integer>(){{add(3001);add(3002);}}); |
| | | crnMapNo.put(2,new ArrayList<Integer>(){{add(3004);add(3003);}}); |
| | | crnMapNo.put(3,new ArrayList<Integer>(){{add(3005);add(3006);}}); |
| | | crnMapNo.put(4,new ArrayList<Integer>(){{add(3007);add(3008);}}); |
| | | crnMapNo.put(5,new ArrayList<Integer>(){{add(3010);add(3009);}}); |
| | | crnMapNo.put(6,new ArrayList<Integer>(){{add(3011);add(3012);}}); |
| | | crnMapNo.put(1, new ArrayList<Integer>() {{ |
| | | add(3001); |
| | | add(3002); |
| | | }}); |
| | | crnMapNo.put(2, new ArrayList<Integer>() {{ |
| | | add(3004); |
| | | add(3003); |
| | | }}); |
| | | crnMapNo.put(3, new ArrayList<Integer>() {{ |
| | | add(3005); |
| | | add(3006); |
| | | }}); |
| | | crnMapNo.put(4, new ArrayList<Integer>() {{ |
| | | add(3007); |
| | | add(3008); |
| | | }}); |
| | | crnMapNo.put(5, new ArrayList<Integer>() {{ |
| | | add(3010); |
| | | add(3009); |
| | | }}); |
| | | crnMapNo.put(6, new ArrayList<Integer>() {{ |
| | | add(3011); |
| | | add(3012); |
| | | }}); |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | // 检索库位 |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | // List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), param.getList().get(0).getMatnr(),null,null, locTypeDto); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), param.getList().get(0).getMatnr(), null, null, locTypeDto); |
| | | // 生成工作号 |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiUser(userId); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)){ |
| | | if (!basDevpService.updateById(sourceStaNo)) { |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)){ |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo()+"目标库位已被占用"); |
| | | throw new CoolException(dto.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | return dto.getLocNo(); |
| | | } |
| | |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | LocDetl one = new LocDetl(); |
| | | // if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo()) |
| | | .eq("brand",paramLocDetl.getBrand()).eq("model",paramLocDetl.getModel())); |
| | | one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", paramLocDetl.getLocNo()) |
| | | .eq("brand", paramLocDetl.getBrand()).eq("model", paramLocDetl.getModel())); |
| | | // selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | if(paramLocDetl.getMatnr().equals("空箱")){ |
| | | one= locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo())); |
| | | if (paramLocDetl.getMatnr().equals("空箱")) { |
| | | one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", paramLocDetl.getLocNo())); |
| | | } |
| | | if (null != one && !paramLocDetl.getMatnr().equals("空箱")) { |
| | | if(!"合格".equals(one.getThreeCode())) { |
| | | throw new CoolException(one.getModel() + "卷不合格:" + one.getThreeCode() ); |
| | | } |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | }else{ |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | if (null != one && !paramLocDetl.getMatnr().equals("空箱")) { |
| | | if (!"合格".equals(one.getThreeCode())) { |
| | | throw new CoolException(one.getModel() + "卷不合格:" + one.getThreeCode()); |
| | | } |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | } else { |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | } |
| | | // } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") ){ |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | }else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStoreOrder(StockOutParam param, Long userId) { |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getLocDetls())){ |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getLocDetls())) { |
| | | throw new CoolException("参数为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())){ |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | throw new CoolException("订单号参数为空"); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd("手动出库单", Boolean.FALSE); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (Cools.isEmpty(order)){ |
| | | if (Cools.isEmpty(order)) { |
| | | Date now = new Date(); |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<StockOutParam.LocDetl> locDetls = param.getLocDetls(); |
| | | int i=0; |
| | | int i = 0; |
| | | for (StockOutParam.LocDetl locDetl : locDetls) { |
| | | i++; |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | |
| | | // } |
| | | |
| | | } else { |
| | | throw new CoolException("订单号重复,订单"+param.getOrderNo()+"已存在!!!"); |
| | | throw new CoolException("订单号重复,订单" + param.getOrderNo() + "已存在!!!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId) { |
| | |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setSheetNo("0"); |
| | | // wrkMast.setMemo(groupOrderNumber); |
| | | if (staDesc.getStnNo()<118 || staDesc.getStnNo()>121){ |
| | | if (staDesc.getStnNo() < 118 || staDesc.getStnNo() > 121) { |
| | | wrkMast.setSheetNo("3"); |
| | | } |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) { |
| | | continue; |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | List<OrderDetl> orderDetl = orderDetlService.selectByBrand(detlDto.getLocDetl().getBrand()); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | for (OrderDetl orderDetlDto : orderDetl) { |
| | | if(orderDetlDto.getSupp() != null){ |
| | | if (orderDetlDto.getSupp() != null) { |
| | | wrkDetl.setSupp(orderDetlDto.getSupp()); |
| | | } |
| | | if(orderDetlDto.getMemo() != null){ |
| | | if (orderDetlDto.getMemo() != null) { |
| | | wrkDetl.setMemo(orderDetlDto.getMemo()); |
| | | } |
| | | } |
| | | wrkDetl.setOrderNo(detlDto.getOrderNo()); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | |
| | | // 修改订单明细 |
| | | orderDetlMapper.updateOrderDetlByGroupNo(detlDto.getOrderNo(), detlDto.getLocDetl().getBrand(), 1); |
| | | // 修改订单状态 |
| | | orderMapper.updateSettleByOrderNo(detlDto.getOrderNo(),2L, userId); |
| | | orderMapper.updateSettleByOrderNo(detlDto.getOrderNo(), 2L, userId); |
| | | } |
| | | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setLocSts(ioType == 101 ? "R" : "P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | throw new CoolException("预约库位状态失败,库位号:" + dto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId,String groupOrderNumber) { |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId, String groupOrderNumber) { |
| | | Date now = new Date(); |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { |
| | | ioType = 107; |
| | | } else if (ioWorkType.equals(IoWorkType.ALL_OUT)) { |
| | | ioType = 101; |
| | | } |
| | | assert ioType != null; |
| | | // 获取库位 |
| | |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setSheetNo("0"); |
| | | wrkMast.setMemo(groupOrderNumber); |
| | | if (staDesc.getStnNo()<118 || staDesc.getStnNo()>121){ |
| | | if (staDesc.getStnNo() < 118 || staDesc.getStnNo() > 121) { |
| | | wrkMast.setSheetNo("3"); |
| | | } |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+dto.getLocNo()); |
| | | throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) { |
| | | continue; |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | List<OrderDetl> orderDetl = orderDetlService.selectByBrand(detlDto.getLocDetl().getBrand()); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | for (OrderDetl orderDetlDto : orderDetl) { |
| | | if(orderDetlDto.getSupp() != null){ |
| | | if (orderDetlDto.getSupp() != null) { |
| | | wrkDetl.setSupp(orderDetlDto.getSupp()); |
| | | } |
| | | if(orderDetlDto.getMemo() != null){ |
| | | if (orderDetlDto.getMemo() != null) { |
| | | wrkDetl.setMemo(orderDetlDto.getMemo()); |
| | | } |
| | | } |
| | | wrkDetl.setOrderNo(detlDto.getOrderNo()); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | |
| | | // 修改订单明细 |
| | | orderDetlMapper.updateOrderDetlByGroupNo(detlDto.getOrderNo(), detlDto.getLocDetl().getBrand(), 1); |
| | | // 修改订单状态 |
| | | orderMapper.updateSettleByOrderNo(detlDto.getOrderNo(),2L, userId); |
| | | orderMapper.updateSettleByOrderNo(detlDto.getOrderNo(), 2L, userId); |
| | | } |
| | | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setLocSts(ioType == 101 ? "R" : "P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | throw new CoolException("预约库位状态失败,库位号:" + dto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | |
| | | int souresStaNo = 0; |
| | | if (taskDto.getStaNo() < 3000) { // 二楼 |
| | | switch (row) { |
| | | case 1: case 2: case 3: |
| | | case 4: souresStaNo = 2062; break; |
| | | case 5: case 6: case 7: |
| | | case 8: souresStaNo = 2065; break; |
| | | case 9: case 10: case 11: |
| | | case 12: souresStaNo = 2068; break; |
| | | case 13: case 14: case 15: |
| | | case 16: souresStaNo = 2070; break; |
| | | case 17: case 18: case 19: |
| | | case 20: souresStaNo = 2073; break; |
| | | case 21: case 22: case 23: |
| | | case 24: souresStaNo = 2076; break; |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | souresStaNo = 2062; |
| | | break; |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | case 8: |
| | | souresStaNo = 2065; |
| | | break; |
| | | case 9: |
| | | case 10: |
| | | case 11: |
| | | case 12: |
| | | souresStaNo = 2068; |
| | | break; |
| | | case 13: |
| | | case 14: |
| | | case 15: |
| | | case 16: |
| | | souresStaNo = 2070; |
| | | break; |
| | | case 17: |
| | | case 18: |
| | | case 19: |
| | | case 20: |
| | | souresStaNo = 2073; |
| | | break; |
| | | case 21: |
| | | case 22: |
| | | case 23: |
| | | case 24: |
| | | souresStaNo = 2076; |
| | | break; |
| | | default: |
| | | } |
| | | } else { // 一楼 |
| | | switch (row) { |
| | | case 1: case 2: case 3: |
| | | case 4: souresStaNo = 3002; break; |
| | | case 5: case 6: case 7: |
| | | case 8: souresStaNo = 3003; break; |
| | | case 9: case 10: case 11: |
| | | case 12: souresStaNo = 3006; break; |
| | | case 13: case 14: case 15: |
| | | case 16: souresStaNo = 3008; break; |
| | | case 17: case 18: case 19: |
| | | case 20: souresStaNo = 3009; break; |
| | | case 21: case 22: case 23: |
| | | case 24: souresStaNo = 3012; break; |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | souresStaNo = 3002; |
| | | break; |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | case 8: |
| | | souresStaNo = 3003; |
| | | break; |
| | | case 9: |
| | | case 10: |
| | | case 11: |
| | | case 12: |
| | | souresStaNo = 3006; |
| | | break; |
| | | case 13: |
| | | case 14: |
| | | case 15: |
| | | case 16: |
| | | souresStaNo = 3008; |
| | | break; |
| | | case 17: |
| | | case 18: |
| | | case 19: |
| | | case 20: |
| | | souresStaNo = 3009; |
| | | break; |
| | | case 21: |
| | | case 22: |
| | | case 23: |
| | | case 24: |
| | | souresStaNo = 3012; |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:"+taskDto.getLocNo()); |
| | | throw new CoolException("保存工作档失败,出库库位号:" + taskDto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | if (locDto.getAnfme() == null || locDto.getAnfme() <= 0.0D) { |
| | | continue; |
| | | } |
| | | OrderDetl orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | if (orderDetl == null) { |
| | | orderDetl = orderDetlService.selectItem(locDto.getOrderNo(), locDto.getMatnr(), null); |
| | |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(taskDto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts(ioType==101?"R":"P"); |
| | | locMast.setLocSts(ioType == 101 ? "R" : "P"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+taskDto.getLocNo()); |
| | | throw new CoolException("预约库位状态失败,库位号:" + taskDto.getLocNo()); |
| | | } |
| | | } else { |
| | | throw new CoolException(taskDto.getLocNo() + "库位不是在库状态"); |
| | |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null,null,null, locTypeDto); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null, null, null, locTypeDto); |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | | // 生成工作档 |
| | |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiUser(userId); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)){ |
| | | if (!basDevpService.updateById(sourceStaNo)) { |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)){ |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo()+"目标库位已被占用"); |
| | | throw new CoolException(dto.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | return dto.getLocNo(); |
| | | } |
| | |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException(locNo+"库位不存在"); |
| | | throw new CoolException(locNo + "库位不存在"); |
| | | } |
| | | if (!locMast.getLocSts().equals("D")){ |
| | | throw new CoolException("所选库位存在状态不为D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | if (!locMast.getLocSts().equals("D")) { |
| | | throw new CoolException("所选库位存在状态不为D的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | // 获取源站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 更新库位状态 D.空板 -> R.出库预约 |
| | | if (locMast.getLocSts().equals("D")){ |
| | | if (locMast.getLocSts().equals("D")) { |
| | | locMast.setLocSts("R"); |
| | | locMast.setModiUser(userId); |
| | | locMast.setModiTime(now); |
| | |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException(locNo+"库位不存在"); |
| | | throw new CoolException(locNo + "库位不存在"); |
| | | } |
| | | // 获取源站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 更新库位状态 D.空板 -> R.出库预约 |
| | | if (locMast.getLocSts().equals("D")){ |
| | | if (locMast.getLocSts().equals("D")) { |
| | | locMast.setLocSts("R"); |
| | | locMast.setModiUser(1L); |
| | | locMast.setModiTime(now); |
| | |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo()) |
| | | .eq("brand",paramLocDetl.getBrand()).eq("model",paramLocDetl.getModel())); |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", paramLocDetl.getLocNo()) |
| | | .eq("brand", paramLocDetl.getBrand()).eq("model", paramLocDetl.getModel())); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | if (locMast.getLocSts().equals("F")) { |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | | }else { |
| | | throw new CoolException("所选库位存在状态不为F的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | throw new CoolException("库位物料不存在"); |
| | |
| | | public void locMove(String sourceLocNo, String locNo, Long userId) { |
| | | LocMast sourceLoc = locMastService.selectById(sourceLocNo); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); |
| | | if (Cools.isEmpty(sourceLoc)){ |
| | | if (Cools.isEmpty(sourceLoc)) { |
| | | throw new CoolException("未找到库位"); |
| | | } |
| | | LocMast loc = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(loc)){ |
| | | if (Cools.isEmpty(loc)) { |
| | | throw new CoolException("未找到库位"); |
| | | } |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("D"))){ |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("D"))) { |
| | | throw new CoolException("库位状态已改变"); |
| | | } |
| | | if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { |
| | |
| | | wrkMast.setCrnNo(sourceLoc.getCrnNo()); |
| | | wrkMast.setSourceLocNo(sourceLocNo); // 源库位 |
| | | wrkMast.setLocNo(locNo); // 目标库位 |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls)?"N":"Y"); // 满板:Y |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls) ? "N" : "Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); |
| | |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiUser(userId); |
| | | sourceLoc.setModiTime(now); |
| | | if (!locMastService.updateById(sourceLoc)){ |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败,状态:"+sourceLoc.getLocSts$()); |
| | | throw new CoolException("源库位出库失败,状态:" + sourceLoc.getLocSts$()); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败,目标库位状态:"+loc.getLocSts$()); |
| | | throw new CoolException("移转失败,目标库位状态:" + loc.getLocSts$()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void autoLocMove(String orderNo,String sourceLocNo, String locNo, Long userId) { |
| | | public void autoLocMove(String orderNo, String sourceLocNo, String locNo, Long userId) { |
| | | LocMast sourceLoc = locMastService.selectById(sourceLocNo); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); |
| | | if (Cools.isEmpty(sourceLoc)){ |
| | | if (Cools.isEmpty(sourceLoc)) { |
| | | throw new CoolException("未找到库位"); |
| | | } |
| | | LocMast loc = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(loc)){ |
| | | if (Cools.isEmpty(loc)) { |
| | | throw new CoolException("未找到库位"); |
| | | } |
| | | |
| | |
| | | wrkMast.setLocNo(locNo); // 目标库位 |
| | | wrkMast.setSourceStaNo(crnMapNo.get(sourceLoc.getCrnNo()).get(1)); // 出库源站点 |
| | | wrkMast.setStaNo(crnMapNo.get(loc.getCrnNo()).get(0)); // 入库目标站点 |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls)?"N":"Y"); // 满板:Y |
| | | wrkMast.setFullPlt(Cools.isEmpty(locDetls) ? "N" : "Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D")?"Y":"N"); // 空板 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); |
| | |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiUser(userId); |
| | | sourceLoc.setModiTime(now); |
| | | if (!locMastService.updateById(sourceLoc)){ |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败,状态:"+sourceLoc.getLocSts$()); |
| | | throw new CoolException("源库位出库失败,状态:" + sourceLoc.getLocSts$()); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败,目标库位状态:"+loc.getLocSts$()); |
| | | throw new CoolException("移转失败,目标库位状态:" + loc.getLocSts$()); |
| | | } |
| | | } |
| | | |
| | |
| | | @Transactional |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | throw new CoolException(workNo+"工作档不存在"); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 5 || wrkMast.getWrkSts() == 14 || wrkMast.getWrkSts() == 15) { |
| | | throw new CoolException("当前工作档已完成"); |
| | |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getIoType() < 60) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | // 出库 |
| | | } else if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 103 && wrkMast.getIoType() != 107 && wrkMast.getIoType() != 109) { |
| | | wrkMast.setWrkSts(14L); |
| | | }else{ |
| | | } else { |
| | | throw new CoolException("当前工作类型或状态无法完成"); |
| | | } |
| | | Date now = new Date(); |
| | |
| | | Iterator<LocDetlAdjustParam.LocDetlAdjust> iterator1 = list.iterator(); |
| | | while (iterator1.hasNext()) { |
| | | LocDetlAdjustParam.LocDetlAdjust adjust = iterator1.next(); |
| | | if (adjust.getCount() == 0) { continue; } |
| | | if (adjust.getCount() == 0) { |
| | | continue; |
| | | } |
| | | if (locDetl.getMatnr().equals(adjust.getMatnr()) && Cools.eq(locDetl.getBatch(), adjust.getBatch())) { |
| | | if (!locDetl.getAnfme().equals(adjust.getCount())) { |
| | | // todo 盘点记录 |
| | |
| | | |
| | | // 添加库存 |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : list) { |
| | | if (adjust.getCount() == 0.0D) { continue; } |
| | | if (adjust.getCount() == 0.0D) { |
| | | continue; |
| | | } |
| | | Mat mat = matService.selectByMatnr(adjust.getMatnr()); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(mat); |
| | |
| | | public void cancelWrkMast(String workNo, Long userId) { |
| | | Date now = new Date(); |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | throw new CoolException(workNo+"工作档不存在"); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | String locNo = ""; // 待修改目标库位 |
| | | String locSts = ""; // 待修改目标库位状态 |
| | |
| | | // 库位转移:源库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,源库位不存在:"+ wrkMast.getSourceLocNo()); |
| | | throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F"); |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() == 11) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | | locSts = "F"; |
| | | // 空板出库 ===>> D.空桶/空栈板 |
| | | // 空板出库 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 110) { |
| | | locSts = "D"; |
| | | // 库位转移 ===>> D.空桶/空栈板 |
| | | // 库位转移 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 11 || wrkMast.getIoType() == 12) { |
| | | locSts = wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F"; |
| | | locSts = wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"; |
| | | // 库位转移:目标库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,目标库位不存在:"+ wrkMast.getSourceLocNo()); |
| | | throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | }else { |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | | |
| | | //取消入库工作档时,查询组托表,如果有将状态改为待处理 |
| | | if(wrkMast.getIoType() == 1) { |
| | | List<WaitPakin> waitPakins=waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | for (WaitPakin waitPakin:waitPakins){ |
| | | if (wrkMast.getIoType() == 1) { |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | if (!Cools.isEmpty(waitPakin)) { |
| | | waitPakin.setIoStatus("N"); |
| | | waitPakin.setLocNo(""); |
| | | waitPakinService.update(waitPakin, new EntityWrapper<WaitPakin>() |
| | | // .eq("order_no", waitPakin.getOrderNo()) |
| | | .eq("zpallet",waitPakin.getZpallet()) |
| | | .eq("zpallet", waitPakin.getZpallet()) |
| | | .eq("matnr", waitPakin.getMatnr()) |
| | | .eq("batch", waitPakin.getBatch())); |
| | | } |
| | |
| | | Order order = orderList.get(0); |
| | | // 回滚单据明细的移库状态 |
| | | List<OrderDetl> orderDetlList1 = orderDetlMapper.selectList(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo()).eq("specs", wrkMast.getSourceLocNo())); |
| | | for (OrderDetl orderDetl:orderDetlList1) { |
| | | for (OrderDetl orderDetl : orderDetlList1) { |
| | | if (orderDetl.getBeBatch() != null) { |
| | | orderDetl.setModel(""); |
| | | } |
| | |
| | | orderMapper.updateById(order); |
| | | } |
| | | } else { |
| | | log.error("回滚移库单据异常,无源库位数据:{}",wrkMast.getSourceLocNo()); |
| | | log.error("回滚移库单据异常,无源库位数据:{}", wrkMast.getSourceLocNo()); |
| | | } |
| | | } |
| | | |
| | |
| | | // } |
| | | |
| | | //取消出库工作档时,查询单据管理表,回滚作业中数量 |
| | | if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107) { |
| | | if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | orderDetlMapper.updateOrderDetlByGroupNo(wrkDetl.getOrderNo(),wrkDetl.getBrand(),0); |
| | | orderDetlMapper.updateOrderDetlByGroupNo(wrkDetl.getOrderNo(), wrkDetl.getBrand(), 0); |
| | | |
| | | //修改订单主表状态,没有作业数量时才可以修改 |
| | | boolean flag = true; |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no",wrkDetl.getOrderNo())); |
| | | for(OrderDetl orderDetl : orderDetls){ |
| | | if(orderDetl.getWorkQty() > 0){ |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", wrkDetl.getOrderNo())); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (orderDetl.getWorkQty() > 0) { |
| | | flag = false; |
| | | } |
| | | } |
| | | if(flag){ |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo())); |
| | | if(!Cools.isEmpty(order) && order.getSettle()==2){ |
| | | if (flag) { |
| | | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", wrkDetl.getOrderNo())); |
| | | if (!Cools.isEmpty(order) && order.getSettle() == 2) { |
| | | order.setSettle(1L); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | } |
| | | if(!orderService.update(order,new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo()))){ |
| | | if (!orderService.update(order, new EntityWrapper<Order>().eq("order_no", wrkDetl.getOrderNo()))) { |
| | | throw new CoolException("修改订单状态失败"); |
| | | } |
| | | } |
| | |
| | | // 删除工作档明细 |
| | | boolean wrkDetlRes = wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | } |
| | | if (wrkMast.getIoType()==202 || wrkMast.getIoType()==212){ |
| | | if (wrkMast.getIoType() == 202 || wrkMast.getIoType() == 212) { |
| | | return; |
| | | } |
| | | |
| | | // 修改库位状态 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消工作档失败,库位不存在:"+ locNo); |
| | | throw new CoolException("取消工作档失败,库位不存在:" + locNo); |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | |
| | | @Transactional |
| | | public void pickWrkMast(String workNo, Long userId) { |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | throw new CoolException(workNo+"工作档不存在"); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | // 入出库类型判断 |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) { |
| | |
| | | // 目标库位 |
| | | LocMast targetLoc = null; |
| | | |
| | | for (int curRow = rowLastno.getsRow(); curRow<=rowLastno.geteRow(); curRow++) { |
| | | for (int curRow = rowLastno.getsRow(); curRow <= rowLastno.geteRow(); curRow++) { |
| | | |
| | | if (Utils.isShallowLoc(slaveProperties, curRow)) { |
| | | Integer deepRow = Utils.getDeepRow(slaveProperties, curRow); |
| | |
| | | throw new CoolException("修改工作档失败"); |
| | | } |
| | | // 修改库位状态 O ===>>> S |
| | | if (targetLoc.getLocSts().equals("O")){ |
| | | if (targetLoc.getLocSts().equals("O")) { |
| | | targetLoc.setLocSts("S"); // S.入库预约 |
| | | targetLoc.setModiUser(userId); |
| | | targetLoc.setModiTime(now); |
| | | if (!locMastService.updateById(targetLoc)){ |
| | | if (!locMastService.updateById(targetLoc)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(targetLoc.getLocNo()+"目标库位已被占用"); |
| | | throw new CoolException(targetLoc.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | // 禁用异常库位 |
| | | // locMast.setLocSts("X"); // X.禁用 |
| | |
| | | @Transactional |
| | | public void turnMatLocDetl(EmptyPlateOutParam param, Long userId) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("id", param.getMatId())); |
| | | if (Cools.isEmpty(mat)){ |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException("目标库位商品编码有误!"); |
| | | } |
| | | 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()); |
| | | if (Cools.isEmpty(locDetls) || locDetls.size() < 1) { |
| | | throw new CoolException("待修改商品无库存,无需修改! 规格:" + param.getLocDetls().get(0).getMatnr()); |
| | | } |
| | | try { |
| | | locDetlService.updateMatTurn(param.getLocDetls().get(0).getMatnr(),mat.getMatnr()); |
| | | }catch (Exception e){ |
| | | locDetlService.updateMatTurn(param.getLocDetls().get(0).getMatnr(), mat.getMatnr()); |
| | | } catch (Exception e) { |
| | | throw new CoolException("对数据库修改出错!"); |
| | | } |
| | | for (LocDetl locDetl:locDetls){ |
| | | for (LocDetl locDetl : locDetls) { |
| | | // 保存调整记录 |
| | | AdjDetl adjDetl = new AdjDetl(); |
| | | adjDetl.setLocNo(locDetl.getLocNo()); |