bill.go 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. IsSend bool `bson:"isSend,omitempty" json:"isSend"`
  62. SendTime time.Time `bson:"sendTime,omitempty" json:"sendTime"`
  63. }
  64. // 工艺生产数据
  65. type ProduceBillData struct {
  66. //名字
  67. Name string `bson:"name,omitempty" json:"name"`
  68. //规格(质量要求)
  69. Norm string `bson:"norm,omitempty" json:"norm"`
  70. //单价 数量
  71. Price float64 `bson:"price,omitempty" json:"price"`
  72. Price2 float64 `bson:"price2,omitempty" json:"price2"` // 对应unit2
  73. // 下单数量
  74. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  75. // 下单单价
  76. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  77. // 确认收货数量
  78. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  79. //备注
  80. Remark string `bson:"remark,omitempty" json:"remark"`
  81. //纸张
  82. Paper string `bson:"paper,omitempty" json:"paper"`
  83. //来纸尺寸
  84. PaperSize string `bson:"paperSize,omitempty" json:"paperSize"`
  85. //印刷尺寸/覆膜尺寸
  86. PrintSize string `bson:"printSize,omitempty" json:"printSize"`
  87. //交货时间
  88. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  89. Unit string `bson:"unit,omitempty" json:"unit"`
  90. Unit2 string `bson:"unit2,omitempty" json:"unit2"`
  91. }
  92. type ProduceBill struct {
  93. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  94. PackId primitive.ObjectID `bson:"packId,omitempty" json:"packId"`
  95. PlanId primitive.ObjectID `bson:"planId,omitempty" json:"planId"`
  96. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  97. UserId primitive.ObjectID `bson:"userId,omitempty" json:"userId"`
  98. UserName string `bson:"userName,omitempty" json:"userName"`
  99. // 类别
  100. Type string `bson:"type,omitempty" json:"type"`
  101. // 进行中 created 已完成 complete 已弃用 deprecated
  102. Status string `bson:"status,omitempty" json:"status"`
  103. Reviewed int `bson:"reviewed,omitempty" json:"reviewed"` // -1 代表未审核 1已审核
  104. SignUsers []primitive.ObjectID `bson:"signUsers,omitempty" json:"signUsers"` // 多个签名人
  105. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  106. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  107. CompleteTime time.Time `bson:"completeTime,omitempty" json:"completeTime"`
  108. //供应商
  109. Supplier string `bson:"supplier,omitempty" json:"supplier"`
  110. //送货地址
  111. SendTo string `bson:"sendTo,omitempty" json:"sendTo"`
  112. //商品名字
  113. ProductName string `bson:"productName,omitempty" json:"productName"`
  114. //纸张类采购
  115. Produces []*ProduceBillData `bson:"produces,omitempty" json:"produces"`
  116. // 序号
  117. SerialNumber string `bson:"serialNumber,omitempty" json:"serialNumber"`
  118. IsPrint bool `bson:"isPrint,omitempty" json:"isPrint"`
  119. IsLam bool `bson:"isLam,omitempty" json:"isLam"`
  120. // 单据类型
  121. BillType string `bson:"billType,omitempty" json:"billType"`
  122. // 发送给供应商
  123. IsSend bool `bson:"isSend,omitempty" json:"isSend"`
  124. SendTime time.Time `bson:"sendTime,omitempty" json:"sendTime"`
  125. }
  126. // 成品采购单据
  127. type ProductBill struct {
  128. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  129. PackId primitive.ObjectID `bson:"packId,omitempty" json:"packId"`
  130. PlanId primitive.ObjectID `bson:"planId,omitempty" json:"planId"`
  131. SupplierId primitive.ObjectID `bson:"supplierId,omitempty" json:"supplierId"`
  132. UserId primitive.ObjectID `bson:"userId,omitempty" json:"userId"`
  133. UserName string `bson:"userName,omitempty" json:"userName"`
  134. // 类别
  135. Type string `bson:"type,omitempty" json:"type"`
  136. // 进行中 created 已完成 complete 已弃用 deprecated
  137. Status string `bson:"status,omitempty" json:"status"`
  138. Reviewed int `bson:"reviewed,omitempty" json:"reviewed"` // -1 代表未审核 1已审核
  139. SignUsers []primitive.ObjectID `bson:"signUsers,omitempty" json:"signUsers"` // 多个签名人
  140. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  141. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  142. CompleteTime time.Time `bson:"completeTime,omitempty" json:"completeTime"`
  143. //供应商
  144. Supplier string `bson:"supplier,omitempty" json:"supplier"`
  145. //送货地址
  146. SendTo string `bson:"sendTo,omitempty" json:"sendTo"`
  147. //商品名字
  148. ProductName string `bson:"productName,omitempty" json:"productName"`
  149. //有哪些成品采购数据
  150. Products []*ProductBillData `bson:"products,omitempty" json:"products"`
  151. // 序号
  152. SerialNumber string `bson:"serialNumber,omitempty" json:"serialNumber"`
  153. //备注
  154. Remark string `bson:"remark,omitempty" json:"remark"`
  155. // 单据类型
  156. BillType string `bson:"billType,omitempty" json:"billType"`
  157. // 发送给供应商
  158. IsSend bool `bson:"isSend,omitempty" json:"isSend"`
  159. SendTime time.Time `bson:"sendTime,omitempty" json:"sendTime"`
  160. }
  161. // 工艺生产数据
  162. type ProductBillData struct {
  163. //名字
  164. Name string `bson:"name,omitempty" json:"name"`
  165. //规格(质量要求)
  166. Norm string `bson:"norm,omitempty" json:"norm"`
  167. //单价 数量
  168. Price float64 `bson:"price,omitempty" json:"price"`
  169. // 下单数量
  170. OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
  171. // 下单单价
  172. OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
  173. //备注
  174. Remark string `bson:"remark,omitempty" json:"remark"`
  175. //交货时间
  176. DeliveryTime time.Time `bson:"deliveryTime,omitempty" json:"deliveryTime"`
  177. // 确认收货数量
  178. ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
  179. //纸张
  180. Unit string `bson:"unit,omitempty" json:"unit"`
  181. }