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() + - "库存数量不足"); + " 库存数量不足"); } }