bill.go 8.4 KB

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