mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
完善仓库管理
This commit is contained in:
@@ -13,4 +13,12 @@ public class WarehouseDto extends OrgCommonDto {
|
||||
private String contact;
|
||||
|
||||
private String contactPhone;
|
||||
|
||||
|
||||
private Double goodsCount;
|
||||
|
||||
|
||||
private Double goodsNumber;
|
||||
|
||||
private Double goodsAmount;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import jakarta.persistence.Entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WarehouseEntity extends OrgCommonEntity {
|
||||
@@ -19,4 +21,16 @@ public class WarehouseEntity extends OrgCommonEntity {
|
||||
private String contactPhone;
|
||||
|
||||
|
||||
|
||||
@Formula("(select count(1) from t_warehouse_goods_summary s where s.warehouse_id = id)")
|
||||
private Double goodsCount;
|
||||
|
||||
|
||||
@Formula("(select sum(s.number) from t_warehouse_goods_summary s where s.warehouse_id = id)")
|
||||
private Double goodsNumber;
|
||||
|
||||
@Formula("(select sum(s.number * s.price) from t_warehouse_goods_summary s where s.warehouse_id = id)")
|
||||
private Double goodsAmount;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,11 +7,14 @@ import cn.lihongjie.coal.warehouseGoodsUnit.entity.WarehouseGoodsUnitEntity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.OneToMany;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WarehouseGoodsEntity extends OrgCommonEntity {
|
||||
@@ -52,4 +55,11 @@ public class WarehouseGoodsEntity extends OrgCommonEntity {
|
||||
private Double price5;
|
||||
|
||||
|
||||
// 不同的规格
|
||||
@OneToMany(mappedBy = "parent")
|
||||
private List<WarehouseGoodsEntity> children;
|
||||
|
||||
@ManyToOne
|
||||
private WarehouseGoodsEntity parent;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,19 @@ import cn.lihongjie.coal.warehouse.dto.WarehouseDto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
@Data
|
||||
public class WarehouseShelveDto extends OrgCommonDto {
|
||||
|
||||
private WarehouseDto warehouse;
|
||||
@Formula("(select count(1) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsCount;
|
||||
|
||||
|
||||
@Formula("(select sum(s.number) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsNumber;
|
||||
|
||||
@Formula("(select sum(s.number * s.price) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsAmount;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import jakarta.persistence.ManyToOne;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class WarehouseShelveEntity extends OrgCommonEntity {
|
||||
@@ -18,4 +20,15 @@ public class WarehouseShelveEntity extends OrgCommonEntity {
|
||||
|
||||
|
||||
|
||||
@Formula("(select count(1) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsCount;
|
||||
|
||||
|
||||
@Formula("(select sum(s.number) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsNumber;
|
||||
|
||||
@Formula("(select sum(s.number * s.price) from t_warehouse_goods_summary s where s.shelve_id = id)")
|
||||
private Double goodsAmount;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user