feat: 商品添加默认供应商

This commit is contained in:
2024-11-12 21:02:48 +08:00
parent 2e238696d3
commit 8bcb674279
5 changed files with 20 additions and 3 deletions

View File

@@ -68,4 +68,7 @@ public class CreateWarehouseGoodsDto extends OrgCommonDto {
@Comment("保质期 天")
private Integer shelfLife;
private String defaultSupplier;
}

View File

@@ -66,4 +66,7 @@ public class UpdateWarehouseGoodsDto extends OrgCommonDto {
@Comment("保质期 天")
private Integer shelfLife;
private String defaultSupplier;
}

View File

@@ -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;
}

View File

@@ -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;
//

View File

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