plan.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. )
  6. // 生产计划
  7. type ProductPlan struct {
  8. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  9. Name string `bson:"name,omitempty" json:"name"`
  10. // 包装 待生产的产品
  11. Pack *Pack `bson:"pack,omitempty" json:"pack"`
  12. Thumbnail string `bson:"thumbnail,omitempty" json:"thumbnail"`
  13. CreateUser string `bson:"createUser,omitempty" json:"createUser"`
  14. //生产数量
  15. Total int `bson:"total,omitempty" json:"total"`
  16. //状态
  17. Status string `bson:"status,omitempty" json:"status"`
  18. //总价
  19. TotalPrice float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
  20. UpdateTime time.Time `bson:"updteTime,omitempty" json:"updateTime"`
  21. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  22. }
  23. // 包装
  24. type Pack struct {
  25. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  26. Name string `bson:"name,omitempty" json:"name"`
  27. Thumbnail string `bson:"thumbnail,omitempty" json:"thumbnail"`
  28. // 部件数量
  29. CompCounts int `bson:"compCounts,omitempty" json:"compCounts"`
  30. // 设计师
  31. Designer string `bson:"designer,omitempty" json:"designer"`
  32. // 组成包装的部件
  33. Components []*PackComponent `bson:"components,omitempty" json:"components"`
  34. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  35. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  36. }
  37. type PackComponent struct {
  38. Id string `bson:"id,omitempty" json:"id"`
  39. Name string `bson:"name,omitempty" json:"name"`
  40. Thumbnail string `bson:"thumbnail,omitempty" json:"thumbnail"`
  41. //数量
  42. Count int `bson:"count,omitempty" json:"count"`
  43. //刀版图
  44. Uv string `bson:"uv,omitempty" json:"uv"`
  45. //部件尺寸
  46. UvSize string `bson:"uvSize,omitempty" json:"uvSize"`
  47. //所有材料
  48. Stages []*ComponentStage `bson:"stages,omitempty" json:"stages"`
  49. Remark string `bson:"remark,omitempty" json:"remark"`
  50. //部件总价
  51. TotalPrice float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
  52. }
  53. type ComponentStage struct {
  54. Id string `bson:"id,omitempty" json:"id"`
  55. TypeId primitive.ObjectID `bson:"typeId,omitempty" json:"typeId"`
  56. // 下单单价
  57. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  58. // 下单数量
  59. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  60. //实际价格 OrderPrice*ConfirmCount
  61. //预算价格 OrderPrice*OrderCount
  62. //确认收货数量
  63. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  64. // 供应相关信息
  65. // 交货时间
  66. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  67. // 供应商信息
  68. SupplierInfo *Supplier `bson:"supplierInfo,omitempty" json:"supplierInfo"`
  69. BatchCount float64 `bson:"batchCount,omitempty" json:"batchCount"` //拼版数量
  70. BatchSizeWidth int `bson:"batchSizeWidth,omitempty" json:"batchSizeWidth"` //平板尺寸
  71. BatchSizeHeight int `bson:"batchSizeHeight,omitempty" json:"batchSizeHeight"` //平板尺寸
  72. Remark string `bson:"remark,omitempty" json:"remark"` //备注
  73. Size string `bson:"size,omitempty" json:"size"` //工艺尺寸
  74. Name string `bson:"name,omitempty" json:"name"` //名称
  75. Category string `bson:"category,omitempty" json:"category"` //分类
  76. Price float64 `bson:"price,omitempty" json:"price"` //单价
  77. Unit string `bson:"unit,omitempty" json:"unit"` //单位
  78. Norm string `bson:"norm,omitempty" json:"norm"` // 规格
  79. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  80. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  81. Type int `bson:"type,omitempty" json:"type"` //1-材料 2-工艺 3-成品
  82. Group string `bson:"group,omitempty" json:"group"` //工序合标记,相同Group的数据合并成一个单据
  83. BillId string `bson:"billId,omitempty" json:"billId"` //订单Id
  84. BillType int `bson:"billType,omitempty" json:"billType"` //订单type // 1,2,3
  85. }
  86. // 供应商
  87. type Supplier struct {
  88. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  89. Name string `bson:"name,omitempty" json:"name"`
  90. Address string `bson:"address,omitempty" json:"address"`
  91. Phone string `bson:"phone,omitempty" json:"phone"`
  92. Categorys []string `bson:"categorys,omitempty" json:"categorys"` // 多个分类
  93. Category string `bson:"category,omitempty" json:"category"` // todo 旧的待删除
  94. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  95. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  96. }