| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.PakinItem; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | |
| | | } |
| | | items.add(pakinItem); |
| | | } |
| | | |
| | | |
| | | } |
| | | double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | |
| | | if (!waitPakinItemService.saveBatch(items)) { |
| | | throw new CoolException("组拖明细保存失败!!"); |
| | | } |
| | | |
| | | for (WaitPakinItem pakinItem : items) { |
| | | WarehouseAreasItem one = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(WarehouseAreasItem::getTrackCode, pakinItem.getTrackCode()) |
| | | .eq(WarehouseAreasItem::getSplrBatch, pakinItem.getBatch())); |
| | | if (Objects.isNull(one)) { |
| | | throw new CoolException("收货区数据错误!!"); |
| | | } |
| | | one.setWorkQty(one.getWorkQty() + pakinItem.getAnfme() + one.getQty()) ; |
| | | if (one.getWorkQty() > one.getAnfme()) { |
| | | throw new CoolException("组托数量不能大于收货数量!!"); |
| | | } |
| | | if (!warehouseAreasItemService.saveOrUpdate(one)) { |
| | | throw new CoolException("收货区执行数量修改失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | waitPakin1.setAnfme(sum1); |
| | | if (!this.updateById(waitPakin1)) { |
| | | throw new CoolException("组拖数量修改失败!!"); |