bill.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. )
  6. // 采购单
  7. type PaperBill struct {
  8. //名字
  9. Name string `bson:"name,omitempty" json:"name"`
  10. //规格
  11. Norm string `bson:"norm,omitempty" json:"norm"`
  12. //宽
  13. Width string `bson:"width,omitempty" json:"width"`
  14. //长
  15. Height string `bson:"height,omitempty" json:"height"`
  16. Price float64 `bson:"price,omitempty" json:"price"`
  17. Price2 float64 `bson:"price2,omitempty" json:"price2"`
  18. PriceUnit string `bson:"priceUnit,omitempty" json:"priceUnit"`
  19. Price2Unit string `bson:"price2Unit,omitempty" json:"price2Unit"`
  20. // 下单数量
  21. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  22. // 下单单价
  23. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  24. //备注
  25. Remark string `bson:"remark,omitempty" json:"remark"`
  26. //备注
  27. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  28. //交货时间
  29. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  30. }
  31. type PurchaseBill struct {
  32. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  33. PackId primitive.ObjectID `bson:"packId,omitempty" json:"packId"`
  34. PlanId primitive.ObjectID `bson:"planId,omitempty" json:"planId"`
  35. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  36. UserId primitive.ObjectID `bson:"userId,omitempty" json:"userId"`
  37. UserName string `bson:"userName,omitempty" json:"userName"`
  38. //类别
  39. Type string `bson:"type,omitempty" json:"type"`
  40. // 进行中 created 已完成 complete 已弃用 deprecated 已审核 reviewed
  41. Status string `bson:"status,omitempty" json:"status"`
  42. Reviewed int `bson:"reviewed,omitempty" json:"reviewed"` // -1 代表未审核 1已审核
  43. SignUsers []primitive.ObjectID `bson:"signUsers,omitempty" json:"signUsers"` // 多个签名人
  44. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  45. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  46. CompleteTime time.Time `bson:"completeTime,omitempty" json:"completeTime"`
  47. //供应商
  48. Supplier string `bson:"supplier,omitempty" json:"supplier"`
  49. //送货地址
  50. SendTo string `bson:"sendTo,omitempty" json:"sendTo"`
  51. //商品名字
  52. ProductName string `bson:"productName,omitempty" json:"productName"`
  53. //纸张类采购
  54. Paper []*PaperBill `bson:"papers,omitempty" json:"papers"`
  55. // 序号
  56. SerialNumber string `bson:"serialNumber,omitempty" json:"serialNumber"`
  57. Remark string `bson:"remark,omitempty" json:"remark"`
  58. // 单据类型
  59. BillType string `bson:"billType,omitempty" json:"billType"`
  60. }
  61. // 工艺生产数据
  62. type ProduceBillData struct {
  63. //名字
  64. Name string `bson:"name,omitempty" json:"name"`
  65. //规格(质量要求)
  66. Norm string `bson:"norm,omitempty" json:"norm"`
  67. //单价 数量
  68. Price float64 `bson:"price,omitempty" json:"price"`
  69. Price2 float64 `bson:"price2,omitempty" json:"price2"`
  70. // 下单数量
  71. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  72. // 下单单价
  73. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  74. // 确认收货数量
  75. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  76. //备注
  77. Remark string `bson:"remark,omitempty" json:"remark"`
  78. //纸张
  79. Paper string `bson:"paper,omitempty" json:"paper"`
  80. //来纸尺寸
  81. PaperSize string `bson:"paperSize,omitempty" json:"paperSize"`
  82. //印刷尺寸
  83. PrintSize string `bson:"printSize,omitempty" json:"printSize"`
  84. //交货时间
  85. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  86. Unit string `bson:"unit,omitempty" json:"unit"`
  87. }
  88. type ProduceBill struct {
  89. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  90. PackId primitive.ObjectID `bson:"packId,omitempty" json:"packId"`
  91. PlanId primitive.ObjectID `bson:"planId,omitempty" json:"planId"`
  92. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  93. UserId primitive.ObjectID `bson:"userId,omitempty" json:"userId"`
  94. UserName string `bson:"userName,omitempty" json:"userName"`
  95. // 类别
  96. Type string `bson:"type,omitempty" json:"type"`
  97. // 进行中 created 已完成 complete 已弃用 deprecated
  98. Status string `bson:"status,omitempty" json:"status"`
  99. Reviewed int `bson:"reviewed,omitempty" json:"reviewed"` // -1 代表未审核 1已审核
  100. SignUsers []primitive.ObjectID `bson:"signUsers,omitempty" json:"signUsers"` // 多个签名人
  101. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  102. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  103. CompleteTime time.Time `bson:"completeTime,omitempty" json:"completeTime"`
  104. //供应商
  105. Supplier string `bson:"supplier,omitempty" json:"supplier"`
  106. //送货地址
  107. SendTo string `bson:"sendTo,omitempty" json:"sendTo"`
  108. //商品名字
  109. ProductName string `bson:"productName,omitempty" json:"productName"`
  110. //纸张类采购
  111. Produces []*ProduceBillData `bson:"produces,omitempty" json:"produces"`
  112. // 序号
  113. SerialNumber string `bson:"serialNumber,omitempty" json:"serialNumber"`
  114. IsPrint bool `bson:"isPrint,omitempty" json:"isPrint"`
  115. // 单据类型
  116. BillType string `bson:"billType,omitempty" json:"billType"`
  117. }
  118. // 成品采购单据
  119. type ProductBill struct {
  120. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  121. PackId primitive.ObjectID `bson:"packId,omitempty" json:"packId"`
  122. PlanId primitive.ObjectID `bson:"planId,omitempty" json:"planId"`
  123. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  124. UserId primitive.ObjectID `bson:"userId,omitempty" json:"userId"`
  125. UserName string `bson:"userName,omitempty" json:"userName"`
  126. // 类别
  127. Type string `bson:"type,omitempty" json:"type"`
  128. // 进行中 created 已完成 complete 已弃用 deprecated
  129. Status string `bson:"status,omitempty" json:"status"`
  130. Reviewed int `bson:"reviewed,omitempty" json:"reviewed"` // -1 代表未审核 1已审核
  131. SignUsers []primitive.ObjectID `bson:"signUsers,omitempty" json:"signUsers"` // 多个签名人
  132. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  133. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  134. CompleteTime time.Time `bson:"completeTime,omitempty" json:"completeTime"`
  135. //供应商
  136. Supplier string `bson:"supplier,omitempty" json:"supplier"`
  137. //送货地址
  138. SendTo string `bson:"sendTo,omitempty" json:"sendTo"`
  139. //商品名字
  140. ProductName string `bson:"productName,omitempty" json:"productName"`
  141. //有哪些成品采购数据
  142. Products []*ProductBillData `bson:"products,omitempty" json:"products"`
  143. // 序号
  144. SerialNumber string `bson:"serialNumber,omitempty" json:"serialNumber"`
  145. //备注
  146. Remark string `bson:"remark,omitempty" json:"remark"`
  147. // 单据类型
  148. BillType string `bson:"billType,omitempty" json:"billType"`
  149. }
  150. // 工艺生产数据
  151. type ProductBillData struct {
  152. //名字
  153. Name string `bson:"name,omitempty" json:"name"`
  154. //规格(质量要求)
  155. Norm string `bson:"norm,omitempty" json:"norm"`
  156. //单价 数量
  157. Price float64 `bson:"price,omitempty" json:"price"`
  158. // 下单数量
  159. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  160. // 下单单价
  161. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  162. //备注
  163. Remark string `bson:"remark,omitempty" json:"remark"`
  164. //交货时间
  165. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  166. // 确认收货数量
  167. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  168. //纸张
  169. Unit string `bson:"unit,omitempty" json:"unit"`
  170. }