diff --git a/src/main/java/cn/lihongjie/coal/warehouseGoods/service/WarehouseGoodsService.java b/src/main/java/cn/lihongjie/coal/warehouseGoods/service/WarehouseGoodsService.java index 0d537e84..278b73bc 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseGoods/service/WarehouseGoodsService.java +++ b/src/main/java/cn/lihongjie/coal/warehouseGoods/service/WarehouseGoodsService.java @@ -54,10 +54,13 @@ public class WarehouseGoodsService @Autowired private ConversionService conversionService; + + public WarehouseGoodsDto create(CreateWarehouseGoodsDto request) { WarehouseGoodsEntity entity = mapper.toEntity(request); this.repository.save(entity); + em.refresh(entity); return getById(entity.getId()); } @@ -67,6 +70,8 @@ public class WarehouseGoodsService this.repository.save(entity); + em.refresh(entity); + return getById(entity.getId()); }