| | |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getDevpNo(), true); |
| | | // 检索库位 |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | // List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | // List<String> batchs = param.getList().stream().map(FullStoreParam.MatCodeStore::getBatch).distinct().collect(Collectors.toList()); |
| | | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(matnrs.get(0)); |
| | | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(param.getList().get(0)); |
| | | StartupDto dto = commonService.getLocNo(1, param.getDevpNo(), findLocNoAttributeVo,locTypeDto); |
| | | if (Cools.isEmpty(dto)){ |
| | | throw new CoolException("查询库位失败!!==》startupFullPutStore ==》 commonService.getLocNo"); |
| | |
| | | |
| | | List<LocDetlAdjustParam.LocDetlAdjust> list = param.getList(); |
| | | |
| | | // 添加历史工作主档 |
| | | WrkMastLog wrkMast = new WrkMastLog(); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(5); |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceLocNo(locMast.getLocNo()); |
| | | wrkMast.setLocNo(locMast.getLocNo()); |
| | | wrkMast.setBarcode(locMast.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | |
| | | // 增删改只创建一次工作主档 |
| | | boolean updateFlag = true; |
| | | boolean deleteFlag = true; |
| | | boolean addFlag = true; |
| | | |
| | | // 修改数量 |
| | | Iterator<LocDetl> iterator = locDetls.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (updateFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(23); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-修改 保存工作档失败"); |
| | | } |
| | | updateFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(adjust.getCount()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | iterator.remove(); |
| | | iterator1.remove(); |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (deleteFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(22); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-删除 保存工作档失败"); |
| | | } |
| | | deleteFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(0.0); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | |
| | | // 添加库存 |
| | |
| | | locDetl.sync(mat); |
| | | locDetl.setBatch(adjust.getBatch()); |
| | | locDetl.setLocNo(locMast.getLocNo()); |
| | | locDetl.setZpallet(locMast.getBarcode()); |
| | | locDetl.setAnfme(adjust.getCount()); // 数量 |
| | | locDetl.setModiUser(userId); // 操作人员信息 |
| | | locDetl.setModiTime(now); |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetlService.save(adjDetl, userId); |
| | | |
| | | if (addFlag) { |
| | | wrkMast.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMast.setIoType(21); |
| | | boolean res = wrkMastLogService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("库存调整-新增 保存工作档失败"); |
| | | } |
| | | addFlag = false; |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAnfme(adjust.getCount()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | // 修改库位状态 |
| | | int count = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |