| | |
| | | if (Objects.isNull(pl)) {
|
| | | throw new CoolException("集货区不存在!!");
|
| | | }
|
| | | List<WaveSeed> waveSeeds = waveSeedService.list(new LambdaQueryWrapper<WaveSeed>().eq(WaveSeed::getWaveId, platform.getWaveId()).eq(WaveSeed::getOrderId, platform.getOrderId()));
|
| | |
|
| | | List<CacheSite> list = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
|
| | | .eq(CacheSite::getOrderId, platform.getOrderId()));
|
| | | if (list.isEmpty()) {
|
| | | throw new CoolException("订单未绑定播种库位,请完成拣货后,再打印订单!!");
|
| | | }
|
| | |
|
| | | if (!cacheSiteService.update(new LambdaUpdateWrapper<CacheSite>()
|
| | | .eq(CacheSite::getOrderId, platform.getOrderId())
|
| | | .set(CacheSite::getPlatformId, pl.getId())
|
| | | .set(CacheSite::getPlatformNo, pl.getPlatformNo()))) {
|
| | | throw new CoolException("播种墙站点绑定集货区失败!!");
|
| | | }
|
| | |
|
| | | List<WaveSeed> waveSeeds = waveSeedService.list(new LambdaQueryWrapper<WaveSeed>()
|
| | | .eq(WaveSeed::getWaveId, platform.getWaveId())
|
| | | .eq(WaveSeed::getOrderId, platform.getOrderId()));
|
| | | if (waveSeeds.isEmpty()) {
|
| | | throw new CoolException("分拣明细信息不存在,数据错误!!");
|
| | | }
|
| | |
|
| | | ArrayList<PlatformDetl> detls = new ArrayList<>();
|
| | | waveSeeds.forEach(waveSeed -> {
|
| | | for (WaveSeed waveSeed : waveSeeds) {
|
| | | PlatformDetl platformDetl = new PlatformDetl();
|
| | | BeanUtils.copyProperties(waveSeed, platformDetl);
|
| | | platformDetl.setPlatformId(pl.getId());
|
| | | platformDetl.setPlatformNo(pl.getPlatformNo());
|
| | |
|
| | | List<PlatformDetl> list = platformDetlService.list(new LambdaQueryWrapper<PlatformDetl>()
|
| | | List<PlatformDetl> plats = platformDetlService.list(new LambdaQueryWrapper<PlatformDetl>()
|
| | | .eq(PlatformDetl::getTaskDetlId, waveSeed.getTaskDetlId())
|
| | | .eq(PlatformDetl::getOrderDetlId, waveSeed.getOrderDetlId())
|
| | | .eq(PlatformDetl::getMatnr, waveSeed.getMatnr()));
|
| | | if (!list.isEmpty()) {
|
| | | throw new CoolException("订单已入集货区!!");
|
| | | if (!plats.isEmpty()) {
|
| | | continue;
|
| | | }
|
| | | detls.add(platformDetl);
|
| | | });
|
| | | }
|
| | |
|
| | | if (!platformDetlService.saveOrUpdateBatch(detls)) {
|
| | | throw new CoolException("集货区明细保存失败!!");
|
| | | }
|
| | |
|
| | | List<CacheSite> list = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, platform.getOrderId()));
|
| | | if (list.isEmpty()) {
|
| | | throw new CoolException("订单未绑定播种库位,请完成拣货后,再打印订单!!");
|
| | | }
|
| | |
|
| | | boolean update = cacheSiteService.update(new LambdaUpdateWrapper<CacheSite>()
|
| | | .eq(CacheSite::getOrderId, platform.getOrderId())
|
| | | .set(CacheSite::getPlatformId, pl.getId())
|
| | | .set(CacheSite::getPlatformNo, pl.getPlatformNo()));
|
| | |
|
| | | if (!update) {
|
| | | throw new CoolException("播种墙站点绑定集货区失败!!");
|
| | | }
|
| | |
|
| | | return R.ok("绑定成功!!");
|