修改
This commit is contained in:
1 parent
f604fbf61d
commit
944422a4c0
3 files changed
+109
-8
No files matched your search
+3
-1
@@ -13,7 +13,9 @@ public enum InventoryTypeEnum {
|
||||
CGRK(1, "CGSQ"),
|
||||
CKDD(2, "CGDD"),
|
||||
CKRK(3, "CGRK"),
|
||||
CKTH(4, "CGTH")
|
||||
CKTH(4, "CGTH"),
|
||||
LSCK(5, "LSCK"),
|
||||
LSTH(6, "LSTH")
|
||||
;
|
||||
private final Integer type;
|
||||
private final String value;
|
||||
|
||||
+97
-6
@@ -1,15 +1,106 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.stockwarn;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||
import com.bsd.pjcloud.common.core.util.MoneySerializer;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpAuxiliaryCodeEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpUnitEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StockWarnVO extends SmErpSpuEntity {
|
||||
public class StockWarnVO {
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="商品 SPU 编号,自增")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 货号
|
||||
*/
|
||||
@Schema(description="货号")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 自编码/条码
|
||||
*/
|
||||
@Schema(description="自编码/条码")
|
||||
private String barcode;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="单位")
|
||||
private String unit;
|
||||
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description="商品分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description="商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="库存")
|
||||
@TableField(exist = false)
|
||||
private Integer stock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@Schema(description="规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
/**
|
||||
* 装数
|
||||
*/
|
||||
@Schema(description="基础装数")
|
||||
private Integer packageNum;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 库存上限
|
||||
*/
|
||||
@Schema(description="库存上限")
|
||||
private Integer inventoryUpperLimit;
|
||||
|
||||
/**
|
||||
* 库存下限
|
||||
*/
|
||||
@Schema(description="库存下限")
|
||||
private Integer inventoryLowerLimit;
|
||||
|
||||
@Schema(description="预警类型,1,库存不足,2 库存超额")
|
||||
private String warnType; // 预警类型字段
|
||||
|
||||
private Long spuId;
|
||||
|
||||
private Integer baseStock;
|
||||
|
||||
private Integer currentStock;
|
||||
}
|
||||
+9
-1
@@ -38,10 +38,18 @@
|
||||
|
||||
<select id="selectWarnStockWithSpu" resultMap="stockWarnResultMap">
|
||||
SELECT
|
||||
stock.*,
|
||||
stock.inventory_upper_limit,
|
||||
stock.inventory_lower_limit,
|
||||
stock.current_stock+stock+base_stock as stock,
|
||||
spu.product_code,
|
||||
spu.product_name,
|
||||
spu.barcode,
|
||||
spu.spec,
|
||||
spu.unit,
|
||||
spu.package_num,
|
||||
spu.pic_url,
|
||||
spu.category_id,
|
||||
spu.id,
|
||||
CASE
|
||||
WHEN (stock.base_stock + stock.current_stock) > stock.inventory_upper_limit THEN '2'
|
||||
ELSE '1'
|
||||
|
||||
Reference in new issue
Block a user