bigpartpurchase.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package model
  2. import (
  3. "fmt"
  4. modernPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/xdmy"
  5. "time"
  6. )
  7. type BigPartPurchase struct {
  8. Id int64 `gorm:"column:id"`
  9. PastureId int64 `gorm:"column:pastureId"`
  10. OrderNumber string `gorm:"column:orderNumber"`
  11. DepartmentId int64 `gorm:"column:departmentId"`
  12. EmployeId int64 `gorm:"column:employeId"`
  13. CreateTime time.Time `gorm:"column:createTime"`
  14. IsUrgent int32 `gorm:"column:isUrgent"`
  15. WorkflowId int64 `gorm:"column:workflowId"`
  16. FlowCompeleted int32 `gorm:"column:flowCompeleted"`
  17. FlowWorkNote string `gorm:"column:flowworkNote"`
  18. BuyStatue int32 `gorm:"column:buyStatu"`
  19. KGChargeId int32 `gorm:"column:KGChargeId"`
  20. KGChargeDate time.Time `gorm:"column:KGChargedate"`
  21. ChargeId int64 `gorm:"column:chargeId"`
  22. ChargeDate time.Time `gorm:"column:chargeDate"`
  23. CGChargeId int64 `gorm:"column:CGChargeId"`
  24. CGChargeDate time.Time `gorm:"column:CGChargeDate"`
  25. WorkflowNote string `gorm:"column:workflowNote"`
  26. Statue int32 `gorm:"column:statue"`
  27. MatchCode string `gorm:"column:matchCode"`
  28. ProviderId int64 `gorm:"column:providerId"`
  29. Equipment string `gorm:"column:equipment"`
  30. EquipmentDate time.Time `gorm:"column:equipmentDate"`
  31. Field string `gorm:"column:field"`
  32. FieldDate time.Time `gorm:"column:fieldDate"`
  33. PurchaseType modernPb.PurchaseType_Kind `gorm:"column:purchase_type"`
  34. ProviderName string `gorm:"column:providerName"`
  35. }
  36. func (b *BigPartPurchase) TableName() string {
  37. return "bigpartpurchase"
  38. }
  39. func NewBigPartPurchase(pastureId, departmentId, employeeId, providerId int64,
  40. purchaseType modernPb.PurchaseType_Kind, orderNumber, createdTime, providerName string,
  41. ) *BigPartPurchase {
  42. local, _ := time.LoadLocation("Asia/Shanghai")
  43. createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprintf("%s 00:00:00", createdTime), local)
  44. return &BigPartPurchase{
  45. PastureId: pastureId,
  46. OrderNumber: orderNumber,
  47. DepartmentId: departmentId,
  48. EmployeId: employeeId,
  49. CreateTime: createTime,
  50. IsUrgent: 0,
  51. FlowCompeleted: 1,
  52. FlowWorkNote: "",
  53. BuyStatue: 0,
  54. WorkflowNote: "",
  55. Statue: 7,
  56. ProviderId: providerId,
  57. ProviderName: providerName,
  58. PurchaseType: purchaseType,
  59. }
  60. }