商品库存流水
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.czg.product.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品库存变动记录
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-21
|
||||
*/
|
||||
@Data
|
||||
@Table("tb_product_stock_flow")
|
||||
public class ProductStockFlow implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 出入库类型 in-入库 out-出库
|
||||
*/
|
||||
private String inOutType;
|
||||
/**
|
||||
* 出入库名目 manual-in:手动入库 manual-out:手动出库 win-in:盘盈入库 loss-out:盘亏出库 order-in:订单退款入库 order-out:订单消费出库 damage-out:损耗出库
|
||||
*/
|
||||
private String inOutItem;
|
||||
/**
|
||||
* 出入库日期
|
||||
*/
|
||||
private LocalDate inOutDate;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitName;
|
||||
/**
|
||||
* 变动前的库存
|
||||
*/
|
||||
private BigDecimal beforeNumber;
|
||||
/**
|
||||
* 出入库数量
|
||||
*/
|
||||
private BigDecimal inOutNumber;
|
||||
/**
|
||||
* 变动后的库存
|
||||
*/
|
||||
private BigDecimal afterNumber;
|
||||
/**
|
||||
* 商品订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 相关图片urls,json数组
|
||||
*/
|
||||
private String imgUrls;
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long createUserId;
|
||||
/**
|
||||
* 创建人name
|
||||
*/
|
||||
private String createUserName;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品出入库数据统计入参
|
||||
* @author tankaikai
|
||||
* @since 2025-03-12 17:30
|
||||
*/
|
||||
@Data
|
||||
public class ProductInfoParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
private Long categoryId;
|
||||
/**
|
||||
* 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Long shopId;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.czg.product.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品出入库流水查询
|
||||
* @author tankaikai
|
||||
* @since 2025-03-13 15:59
|
||||
*/
|
||||
@Data
|
||||
public class ProductStockFlowParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 出入库类型 in-增加 out-减少
|
||||
*/
|
||||
private String inOutType;
|
||||
/**
|
||||
* 出入库名目 win-in:手动增加 order-in:退货 loss-out:手动减少 order-out:销售量 damage-out:报损
|
||||
*/
|
||||
private String inOutItem;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.czg.product.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品统计
|
||||
* @author tankaikai
|
||||
* @since 2025-03-12 17:34
|
||||
*/
|
||||
@Data
|
||||
public class ProductStatisticsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 增加数量
|
||||
*/
|
||||
private BigDecimal inSumTotal = BigDecimal.ZERO;
|
||||
/**
|
||||
* 盘盈增加数量(手动增加)
|
||||
*/
|
||||
private BigDecimal winInNum = BigDecimal.ZERO;
|
||||
/**
|
||||
* 退货数量
|
||||
*/
|
||||
private BigDecimal refundInNum = BigDecimal.ZERO;
|
||||
/**
|
||||
* 减少数量
|
||||
*/
|
||||
private BigDecimal outSumTotal = BigDecimal.ZERO;
|
||||
/**
|
||||
* 盘亏减少数量(手动减少)
|
||||
*/
|
||||
private BigDecimal lossOutNum = BigDecimal.ZERO;
|
||||
/**
|
||||
* 销售数量
|
||||
*/
|
||||
private BigDecimal salesNum = BigDecimal.ZERO;
|
||||
/**
|
||||
* 报损数量
|
||||
*/
|
||||
private BigDecimal damageNum = BigDecimal.ZERO;
|
||||
}
|
||||
Reference in New Issue
Block a user