plan.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. //所有包装部件的工序
  21. Components []*PackComp `bson:"components,omitempty" json:"components"`
  22. UpdateTime time.Time `bson:"updteTime,omitempty" json:"updateTime"`
  23. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  24. }
  25. type PackComp struct {
  26. //包装部件Id
  27. Id primitive.ObjectID `bson:"id,omitempty" json:"id"`
  28. Steps []*ProductUnit `bson:"steps,omitempty" json:"steps"`
  29. //生产的工序列表
  30. }
  31. // 工序单位
  32. type ProductUnit struct {
  33. //工序Id
  34. Id string `bson:"id,omitempty" json:"id"`
  35. //mat craft process
  36. Type string `bson:"type,omitempty" json:"type"`
  37. //type类型对应的Id
  38. TypeId string `bson:"typeId,omitempty" json:"typeId"`
  39. //生产工艺的规格要求
  40. CraftNorm *CraftNorm `bson:"craftNorm,omitempty" json:"craftNorm"`
  41. MatNorm *MatNorm `bson:"matNorm,omitempty" json:"matNorm"`
  42. //生产数量
  43. PlanCount float64 `bson:"planCount,omitempty" json:"planCount"`
  44. //最终数量
  45. FinalCount float64 `bson:"finalCount,omitempty" json:"finalCount"`
  46. //总价 需要计算
  47. TotalPrice float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
  48. //交货时间 需要处理
  49. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  50. //单价
  51. Price float64 `bson:"price,omitempty" json:"price"`
  52. //供应商
  53. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  54. //计价
  55. PriceStrategy *PriceStrategy `bson:"priceStrategy,omitempty" json:"priceStrategy"`
  56. //单据Id
  57. BillId primitive.ObjectID `bson:"billId,omitempty" json:"billId"`
  58. }
  59. type MatNorm struct {
  60. //下纸尺寸
  61. PaperWidth string `bson:"paperWidth,omitempty" json:"paperWidth"`
  62. PaperHeight string `bson:"paperHeight,omitempty" json:"paperHeight"`
  63. }
  64. type CraftNorm struct {
  65. //印刷尺寸
  66. PrintWidth string `bson:"printWidth,omitempty" json:"printWidth"`
  67. PrintHeight string `bson:"printHeight,omitempty" json:"printHeight"`
  68. }
  69. type ProcessNorm struct {
  70. Norm string `bson:"norm,omitempty" json:"norm"`
  71. }