pack.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. )
  6. // 包装
  7. type Pack struct {
  8. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  9. Name string `bson:"name,omitempty" json:"name"`
  10. Thumbnail string `bson:"thumbnail,omitempty" json:"thumbnail"`
  11. // 部件数量
  12. CompCounts int `bson:"compCounts,omitempty" json:"compCounts"`
  13. // 设计师
  14. Designer string `bson:"designer,omitempty" json:"designer"`
  15. // 组成包装的部件
  16. Components []*PackComponent `bson:"components,omitempty" json:"components"`
  17. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  18. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  19. }
  20. type PackComponent struct {
  21. Id string `bson:"id,omitempty" json:"id"`
  22. Name string `bson:"name,omitempty" json:"name"`
  23. Thumbnail string `bson:"thumbnail,omitempty" json:"thumbnail"`
  24. //数量
  25. Count int `bson:"count,omitempty" json:"count"`
  26. //刀版图
  27. Uv string `bson:"uv,omitempty" json:"uv"`
  28. //部件尺寸
  29. UvSize string `bson:"uvSize,omitempty" json:"uvSize"`
  30. //所有材料
  31. Mats []*PackComponentMat `bson:"mats,omitempty" json:"mats"`
  32. Remark string `bson:"remark,omitempty" json:"remark"`
  33. //部件总价
  34. TotalPrice float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
  35. }
  36. type SupplierPriceVo struct {
  37. Calc *PriceCalc `bson:"calc,omitempty" json:"calc"` //计价策略
  38. //交货时间
  39. DeliveryTime *time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  40. //订单单价
  41. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  42. //订单数据量
  43. OrderCount float64 `bson:"orderCount,omitempty" json:"orderCount"`
  44. //订单实际金额
  45. OrderRealPrice float32 `bson:"orderRealPrice,omitempty" json:"orderRealPrice"`
  46. //供应商信息
  47. SupplierInfo *Supplier `bson:"supplierInfo,omitempty" json:"supplierInfo"`
  48. }
  49. type PackComponentMat struct {
  50. Id string `bson:"id,omitempty" json:"id"`
  51. //所有工艺
  52. Crafts []*PackComponentMatCraft `bson:"crafts,omitempty" json:"crafts"`
  53. MatInfo *Material `bson:"matInfo,omitempty" json:"matInfo"`
  54. Supplier *SupplierPriceVo `bson:"supplier,omitempty" json:"supplier"`
  55. BatchCount int `bson:"batchCount,omitempty" json:"batchCount"` //拼版数量
  56. BatchSizeWidth int `bson:"batchSizeWidth,omitempty" json:"batchSizeWidth"` //平板尺寸
  57. BatchSizeHeight int `bson:"batchSizeHeight,omitempty" json:"batchSizeHeight"` //平板尺寸
  58. BillId string `bson:"billId,omitempty" json:"billId"`
  59. Remark string `bson:"remark,omitempty" json:"remark"` //备注
  60. //确认收货数量
  61. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  62. }
  63. type PackComponentMatCraft struct {
  64. Id string `bson:"id,omitempty" json:"id"`
  65. //工艺尺寸
  66. Size string `bson:"size,omitempty" json:"size"`
  67. //工艺数量
  68. Count int `bson:"count,omitempty" json:"count"`
  69. //工艺信息
  70. CraftInfo *Craft `bson:"craftInfo,omitempty" json:"craftInfo"` //材料Id
  71. Supplier *SupplierPriceVo `bson:"supplier,omitempty" json:"supplier"`
  72. BatchCount int `bson:"batchCount,omitempty" json:"batchCount"` //拼版数量
  73. BatchSizeWidth int `bson:"batchSizeWidth,omitempty" json:"batchSizeWidth"` //平板尺寸
  74. BatchSizeHeight int `bson:"batchSizeHeight,omitempty" json:"batchSizeHeight"` //平板尺寸
  75. BillId string `bson:"billId,omitempty" json:"billId"`
  76. Remark string `bson:"remark,omitempty" json:"remark"` //备注
  77. //确认收货数量
  78. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  79. }