bill.go 9.1 KB

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