From 8bcb674279db55e843a0b0bcddc858d216dd11dd Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Tue, 12 Nov 2024 21:02:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coal/warehouseGoods/dto/CreateWarehouseGoodsDto.java | 3 +++ .../coal/warehouseGoods/dto/UpdateWarehouseGoodsDto.java | 3 +++ .../coal/warehouseGoods/dto/WarehouseGoodsDto.java | 5 +++++ .../coal/warehouseGoods/entity/WarehouseGoodsEntity.java | 6 ++++++ .../warehouseReceipt/service/WarehouseReceiptService.java | 6 +++--- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/CreateWarehouseGoodsDto.java b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/CreateWarehouseGoodsDto.java index 85cc9fa5..316a500e 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/CreateWarehouseGoodsDto.java +++ b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/CreateWarehouseGoodsDto.java @@ -68,4 +68,7 @@ public class CreateWarehouseGoodsDto extends OrgCommonDto { @Comment("保质期 天") private Integer shelfLife; + + + private String defaultSupplier; } diff --git a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/UpdateWarehouseGoodsDto.java b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/UpdateWarehouseGoodsDto.java index 1988eec2..e68f3c06 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/UpdateWarehouseGoodsDto.java +++ b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/UpdateWarehouseGoodsDto.java @@ -66,4 +66,7 @@ public class UpdateWarehouseGoodsDto extends OrgCommonDto { @Comment("保质期 天") private Integer shelfLife; + + private String defaultSupplier; + } diff --git a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/WarehouseGoodsDto.java b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/WarehouseGoodsDto.java index 002784bb..a28092f6 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/WarehouseGoodsDto.java +++ b/src/main/java/cn/lihongjie/coal/warehouseGoods/dto/WarehouseGoodsDto.java @@ -2,6 +2,7 @@ package cn.lihongjie.coal.warehouseGoods.dto; import cn.lihongjie.coal.base.dto.OrgCommonDto; import cn.lihongjie.coal.base.dto.SimpleDto; +import cn.lihongjie.coal.warehouseSupplier.dto.WarehouseSupplierDto; import jakarta.persistence.ManyToOne; @@ -68,4 +69,8 @@ public class WarehouseGoodsDto extends OrgCommonDto { @Comment("保质期 天") private Integer shelfLife; + + + + private WarehouseSupplierDto defaultSupplier; } diff --git a/src/main/java/cn/lihongjie/coal/warehouseGoods/entity/WarehouseGoodsEntity.java b/src/main/java/cn/lihongjie/coal/warehouseGoods/entity/WarehouseGoodsEntity.java index 56e2ba92..f6f7715e 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseGoods/entity/WarehouseGoodsEntity.java +++ b/src/main/java/cn/lihongjie/coal/warehouseGoods/entity/WarehouseGoodsEntity.java @@ -6,6 +6,7 @@ import cn.lihongjie.coal.warehouseGoodsBrand.entity.WarehouseGoodsBrandEntity; import cn.lihongjie.coal.warehouseGoodsCategory.entity.WarehouseGoodsCategoryEntity; import cn.lihongjie.coal.warehouseGoodsUnit.entity.WarehouseGoodsUnitEntity; import cn.lihongjie.coal.warehouseShelve.entity.WarehouseShelveEntity; +import cn.lihongjie.coal.warehouseSupplier.entity.WarehouseSupplierEntity; import jakarta.persistence.Entity; import jakarta.persistence.ManyToOne; @@ -80,6 +81,11 @@ public class WarehouseGoodsEntity extends OrgCommonEntity { @Comment("保质期 天") private Integer shelfLife; + + + @ManyToOne + private WarehouseSupplierEntity defaultSupplier; + // @Comment("是否启用属性") // private Boolean enableAttribute; // diff --git a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java index 88ff57b8..de6dfb13 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java +++ b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java @@ -104,18 +104,18 @@ public class WarehouseReceiptService Integer goodsCount = warehouseGoodsService.goodsCount(request); WarehouseGoodsDto goods = warehouseGoodsService.getById(warehouseReceiptDetailEntity.getGoods().getId()); - if (ObjectUtils.notEqual(goodsCount, warehouseReceiptDetailEntity.getStock())){ + if (ObjectUtils.notEqual(goodsCount, warehouseReceiptDetailEntity.getStock().intValue())){ throw new BizException("商品 " + goods.getName() + - "库存数量发生变化, 请重新操作"); + " 库存数量发生变化, 请重新操作"); } if (StringUtils.equals(entity.getReceiptType(), "1")){ if (goodsCount < warehouseReceiptDetailEntity.getNumber()){ throw new BizException("商品 " + goods.getName() + - "库存数量不足"); + " 库存数量不足"); } }