| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> doIn(WrkMast wrkMast) { |
| | | if (wrkMast.getTaskType().equals("agv")) { |
| | | Date now = new Date(); |
| | |
| | | if (Objects.isNull(locCache)) { |
| | | throw new CoolException("数据错误,库位不存在!!"); |
| | | } |
| | | List<WaitPakin> apallet = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("apallet", wrkMast.getBarcode())); |
| | | List<WaitPakin> apallet = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | if (Objects.isNull(apallet)) { |
| | | throw new CoolException("数据错误:组托数据不存在!!"); |
| | | } |
| | | |
| | | List<LocDetl> detls = new ArrayList<>(); |
| | | apallet.forEach(pakin -> { |
| | | LocDetl detl = new LocDetl(); |
| | | BeanUtils.copyProperties(pakin, detl); |
| | |
| | | .setAreaName(locCache.getAreaName()) |
| | | .setUnit(pakin.getUnit()) |
| | | .setBatch(pakin.getBatch()); |
| | | detls.add(detl); |
| | | }); |
| | | |
| | | if (!locDetlService.insertBatch(detls)) { |
| | | throw new CoolException("库位明细保存失败!!"); |
| | | } |
| | | if (!locDetlService.insert(detl)) { |
| | | throw new CoolException("库位明细保存失败!!"); |
| | | } |
| | | }); |
| | | |
| | | locCache.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | locCache.setModiTime(new Date()); |
| | | |
| | | locCache.setBarcode(""); |
| | | locCache.setModiTime(new Date()); |
| | | locCache.setIoTime(new Date()); |
| | | if (!locCacheService.updateById(locCache)) { |
| | | throw new CoolException("库位状态修改失败!"); |
| | | } |
| | | wrkMast.setWrkSts(5L); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |