partpurchase.go 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package model
  2. type PartPurchase struct {
  3. Id int64 `gorm:"column:id"`
  4. BigId int64 `gorm:"column:bigId"`
  5. PastureId int64 `gorm:"column:pastureId"`
  6. PartId int64 `gorm:"column:partId"`
  7. PartName string `gorm:"column:partName"`
  8. PartCode string `gorm:"column:partCode"`
  9. Amount int64 `gorm:"column:amount"`
  10. Note string `gorm:"column:note"`
  11. IsStorage int32 `gorm:"column:isStorage"`
  12. Specification string `gorm:"column:specification"`
  13. Purpose string `gorm:"column:purpose"`
  14. Unit string `gorm:"column:unit"`
  15. BrandId int64 `gorm:"column:brandId"`
  16. StorageAmount float64 `gorm:"column:storageAmount"`
  17. Price string `gorm:"column:price"`
  18. ContractId string `gorm:"column:contractId"`
  19. LifeCycle string `gorm:"column:lifeCycle"`
  20. ContractVarianceItem string `gorm:"column:contractVarianceItem"`
  21. Reject string `gorm:"column:reject"`
  22. DepartmentId string `gorm:"column:departmentId"`
  23. Explain string `gorm:"column:explain"`
  24. Date string `gorm:"column:date"`
  25. EmployeId int64 `gorm:"column:employeId"`
  26. }
  27. func (p *PartPurchase) TableName() string {
  28. return "partpurchase"
  29. }
  30. func NewPartPurchase(
  31. bigId, pastureId, partId, brandId, amount int64,
  32. contractId, partCode, partName, specification, unit, purpose, price string,
  33. storageAmount float64, departmentId, date string, employeId int64,
  34. //func NewPartPurchase(
  35. // bigId, pastureId, partId, brandId, amount int64,
  36. // contractId, partCode, partName, specification, unit, purpose, price string,
  37. // storageAmount float64,
  38. ) *PartPurchase {
  39. return &PartPurchase{
  40. BigId: bigId,
  41. PastureId: pastureId,
  42. PartId: partId,
  43. PartName: partName,
  44. PartCode: partCode,
  45. Amount: amount,
  46. Note: "",
  47. IsStorage: 1,
  48. Specification: specification,
  49. Purpose: purpose,
  50. Unit: unit,
  51. BrandId: brandId,
  52. StorageAmount: storageAmount,
  53. Price: price,
  54. ContractId: contractId,
  55. Reject: "0",
  56. DepartmentId: departmentId,
  57. Date: date,
  58. EmployeId: employeId,
  59. }
  60. }
  61. type EditPartpurchaseReq struct {
  62. Id int64 `json:"id"`
  63. BigId int64 `json:"bigId"`
  64. PastureId int64 `json:"pastureId"`
  65. PartId int64 `json:"partId"`
  66. PartCode string `json:"partCode"`
  67. PartName string `json:"partName"`
  68. Specification string `json:"specification"`
  69. Amount int64 `json:"amount"`
  70. Unit string `json:"unit"`
  71. BrandId int64 `json:"brandId"`
  72. Purpose string `json:"purpose"`
  73. StorageAmount float64 `json:"storageAmount"`
  74. Price string `json:"price"`
  75. ContractId string `json:"contractId"`
  76. LifeCycle string `json:"lifeCycle"`
  77. ContractVarianceItem string `json:"contractVarianceItem"`
  78. Reject string `json:"reject"`
  79. DepartmentId string `json:"departmentId"`
  80. Explain string `json:"explain"`
  81. Date string `json:"date"`
  82. EmployeId int64 `json:"employeId"`
  83. }