|  |  | 
 |  |  | 
 | 
 |  |  |     /**
 | 
 |  |  |      * 波次出库预览
 | 
 |  |  |      *
 | 
 |  |  |      * @param param
 | 
 |  |  |      * @return
 | 
 |  |  |      */
 | 
 |  |  | 
 |  |  |                 throw new CoolException("保存工作档失败");
 | 
 |  |  |             }
 | 
 |  |  | 
 | 
 |  |  |             wave.setSite(operationPort.getFlag());
 | 
 |  |  |             if (!waveService.updateById(wave)) {
 | 
 |  |  |                 throw new CoolException("波次站口状态更新失败!!");
 | 
 |  |  |             }
 | 
 |  |  | 
 | 
 |  |  |             for (OrderOutMergeDto merge : list) {
 | 
 |  |  |                 LocDetl locDetl = locDetlService.getById(merge.getLocDetlId());
 | 
 |  |  |                 if (locDetl == null) {
 | 
 |  |  | 
 |  |  |                         .eq(WaveDetl::getStockIndex, matUniqueKey)
 | 
 |  |  |                         .eq(WaveDetl::getWaveId, wave.getId()));
 | 
 |  |  |                 if (waveDetl == null) {
 | 
 |  |  |                     throw new CoolException("waveId:" + wave.getId()  + "物料:" + taskDetl.getMatnr() + "波次数据不存在");
 | 
 |  |  |                     throw new CoolException("waveId:" + wave.getId() + "物料:" + taskDetl.getMatnr() + "波次数据不存在");
 | 
 |  |  |                 }
 | 
 |  |  |                 waveDetl.setWorkQty(waveDetl.getWorkQty() + taskDetl.getAnfme());
 | 
 |  |  |                 waveDetl.setUpdateTime(new Date());
 | 
 |  |  | 
 |  |  |             if (orders.isEmpty()) {
 | 
 |  |  |                 throw new CoolException("当前波次订单不存在!!");
 | 
 |  |  |             }
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | //            List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
 | 
 |  |  | //                    .eq(CacheSite::getSiteStatus, CacheSiteStatusType.O.id).eq(CacheSite::getChannel, task.getTargetSite()));
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  |         for (LocDetl locDetl : param.getLocDetls()) {
 | 
 |  |  |             List<OrderOutMergeParam> orders = new ArrayList<>();
 | 
 |  |  |             LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocNo, locDetl.getLocNo()));
 | 
 |  |  |             LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>()
 | 
 |  |  |                     .eq(LocDetl::getMatId, locDetl.getMatId())
 | 
 |  |  |                     .eq(LocDetl::getBatch, locDetl.getBatch())
 | 
 |  |  |                     .eq(LocDetl::getLocNo, locDetl.getLocNo()));
 | 
 |  |  |             if (Objects.isNull(detl)) {
 | 
 |  |  |                 continue;
 | 
 |  |  |             }
 |