diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/persistence/ReservationInMaterialDetailImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/persistence/ReservationInMaterialDetailImpl.java index 37b8b9401..4cabf9899 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/persistence/ReservationInMaterialDetailImpl.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInMaterialDetail/repository/persistence/ReservationInMaterialDetailImpl.java @@ -16,6 +16,8 @@ import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryA import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailBaseDO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDO; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService; import com.mhd.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +49,9 @@ public class ReservationInMaterialDetailImpl extends ServiceImpl inMaterialDetailList) { + for (ReservationInMaterialDetail reservationInMaterialDetail : inMaterialDetailList) { + ReservationMaterialInventory reservationMaterialInventory = new ReservationMaterialInventory(); + BeanUtils.copyProperties(reservationInMaterialDetail, reservationMaterialInventory); + reservationMaterialInventory.setLotNumber(reservationInMaterialDetail.getLotNo()); + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda() + .eq(reservationMaterialInventory.getShipperId() != null,ReservationMaterialInventory::getShipperId, reservationMaterialInventory.getShipperId()) + .eq(reservationMaterialInventory.getWarehouseId() != null,ReservationMaterialInventory::getWarehouseId, reservationMaterialInventory.getWarehouseId()) + .eq(reservationMaterialInventory.getMaterialBaseInfoId() != null,ReservationMaterialInventory::getMaterialBaseInfoId, reservationMaterialInventory.getMaterialBaseInfoId()) + .eq(reservationMaterialInventory.getInOrderNumber() != null,ReservationMaterialInventory::getInOrderNumber, reservationMaterialInventory.getInOrderNumber()) + .eq(reservationMaterialInventory.getLotNumber() != null,ReservationMaterialInventory::getLotNumber, reservationMaterialInventory.getLotNumber()) + .eq(reservationMaterialInventory.getBatchNumber() != null,ReservationMaterialInventory::getBatchNumber, reservationMaterialInventory.getBatchNumber()) + ; + reservationMaterialInventoryService.saveOrUpdate(reservationMaterialInventory,updateWrapper); + } + } + /** * @description 批量修改物流明细 * @author ZhouGY diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java index 830011805..aa1f619ba 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java @@ -27,7 +27,7 @@ public class ReservationMaterialInventory extends BaseVOEntity { @ApiModelProperty("物料库存id") @TableId(type = IdType.AUTO) - private Long materialInventoryId; + private Long reservationMaterialInventoryId; @ApiModelProperty("组织表ID") @Excel(name = "组织表ID") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java index f1dbc09dd..4e695cb07 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java @@ -100,7 +100,7 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl list = new ArrayList<>(); for (Long id : materialInventoryIds) { ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); - materialInventory.setMaterialInventoryId(id); + materialInventory.setReservationMaterialInventoryId(id); materialInventory.setDelFlag(2); list.add(materialInventory); } @@ -133,7 +133,7 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl 0) { ReservationMaterialInventory reservationMaterialInventory = reservationMaterialInventories.get(0); - Long materialInventoryId = reservationMaterialInventory.getMaterialInventoryId(); + Long materialInventoryId = reservationMaterialInventory.getReservationMaterialInventoryId(); materialInventoryOmsParamDO.setMaterialInventoryId(materialInventoryId); } kctzjl(materialInventoryOmsParamDO, materialInventoryOmsParamDO.getKctzType(), materialInventoryOmsParamDO.getLoginUser()); @@ -211,7 +211,7 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl().lambda() - .eq(ReservationMaterialInventory::getMaterialInventoryId, materialInventoryId)); + .eq(ReservationMaterialInventory::getReservationMaterialInventoryId, materialInventoryId)); if (materialInventory == null) { throw new ServiceException("物料库存不存在,无法生成库存调整记录"); } @@ -258,7 +258,7 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl