mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
feat: 商品添加默认供应商
This commit is contained in:
@@ -68,4 +68,7 @@ public class CreateWarehouseGoodsDto extends OrgCommonDto {
|
||||
|
||||
@Comment("保质期 天")
|
||||
private Integer shelfLife;
|
||||
|
||||
|
||||
private String defaultSupplier;
|
||||
}
|
||||
|
||||
@@ -66,4 +66,7 @@ public class UpdateWarehouseGoodsDto extends OrgCommonDto {
|
||||
|
||||
@Comment("保质期 天")
|
||||
private Integer shelfLife;
|
||||
|
||||
private String defaultSupplier;
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
//
|
||||
|
||||
@@ -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() +
|
||||
"库存数量不足");
|
||||
" 库存数量不足");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user