ContractReview.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package dto
  2. import (
  3. models "ERP_storage/models/ContractReview"
  4. )
  5. // ContractReviewPageReq 列表或者搜索使用结构体
  6. type ContractReviewPageReq struct {
  7. Pagination `search:"-"`
  8. T_name string `form:"T_name" search:"type:contains;column:t_name;table:contract_review"` // 名称
  9. T_submit string `form:"T_submit" search:"type:exact;column:t_submit;table:contract_review"` // 负责人
  10. T_audit string `form:"T_audit" search:"type:exact;column:t_audit;table:contract_review"` // 审核状态
  11. ContractReviewOrder
  12. }
  13. type ContractReviewOrder struct {
  14. IdOrder string `search:"type:order;column:id;table:contract_review" form:"T_id" default:"desc"`
  15. }
  16. func (m *ContractReviewPageReq) GetNeedSearch() interface{} {
  17. return *m
  18. }
  19. type ContractReviewSubmitUserPageReq struct {
  20. T_type string `form:"T_type" search:"-"` // 类型 财务Finance 总经理Manager
  21. }
  22. type ContractReviewSubmitUserPageRes struct {
  23. T_submit string
  24. T_name string
  25. }
  26. // ContractReviewInsertReq 增使用的结构体
  27. type ContractReviewInsertReq struct {
  28. T_name string `form:"T_name" vd:"len($)>0;msg:'项目名称不能为空'"` // 项目名称
  29. T_address string `form:"T_address"` // 项目地址
  30. T_submit string `json:"T_submit"` // 合同负责人
  31. T_predict_sign_time string `form:"T_predict_sign_time"` // 预计签约时间
  32. T_money float64 `form:"T_money"` // 总金额
  33. T_have_brokerage_fee bool `form:"T_have_brokerage_fee"` // 是否有居间费
  34. T_brokerage_fee_money float64 `form:"T_brokerage_fee_money"` // 是否有居间费
  35. T_discount_money float64 `form:"T_discount_money"` // 最终优惠金额
  36. ServiceItems string `json:"ServiceItems"` // 服务内容
  37. ServiceItemList []models.ContractReviewServiceItem `json:"ServiceItemList"` // 服务内容
  38. }
  39. func (s *ContractReviewInsertReq) Generate(model *models.ContractReview) {
  40. model.T_name = s.T_name
  41. model.T_address = s.T_address
  42. model.T_submit = s.T_submit
  43. model.T_predict_sign_time = s.T_predict_sign_time
  44. model.T_money = s.T_money
  45. model.T_have_brokerage_fee = s.T_have_brokerage_fee
  46. model.T_brokerage_fee_money = s.T_brokerage_fee_money
  47. model.T_discount_money = s.T_discount_money
  48. model.T_audit = 1
  49. model.T_State = 1
  50. }
  51. // ContractReviewUpdateReq 改使用的结构体
  52. type ContractReviewUpdateReq struct {
  53. T_id int `form:"T_id" example:"1"`
  54. T_name string `form:"T_name" vd:"len($)>0;msg:'项目名称不能为空'"` // 项目名称
  55. T_address string `form:"T_address"` // 项目地址
  56. T_predict_sign_time string `form:"T_predict_sign_time"` // 预计签约时间
  57. T_money float64 `form:"T_money"` // 总金额
  58. T_have_brokerage_fee bool `form:"T_have_brokerage_fee"` // 是否有居间费
  59. T_brokerage_fee_money float64 `form:"T_brokerage_fee_money"` // 居间费金额
  60. T_discount_money float64 `form:"T_discount_money"` // 最终优惠金额
  61. ServiceItems string `json:"ServiceItems"` // 服务内容
  62. ServiceItemList []models.ContractReviewServiceItem `json:"ServiceItemList"` // 服务内容
  63. }
  64. func (s *ContractReviewUpdateReq) Generate(model *models.ContractReview) {
  65. model.Id = s.T_id
  66. model.T_name = s.T_name
  67. model.T_address = s.T_address
  68. model.T_predict_sign_time = s.T_predict_sign_time
  69. model.T_money = s.T_money
  70. model.T_have_brokerage_fee = s.T_have_brokerage_fee
  71. model.T_brokerage_fee_money = s.T_brokerage_fee_money
  72. model.T_discount_money = s.T_discount_money
  73. }
  74. func (s *ContractReviewUpdateReq) GetId() interface{} {
  75. return s.T_id
  76. }
  77. // ContractReviewGetReq 获取单个的结构体
  78. type ContractReviewGetReq struct {
  79. T_id int `form:"T_id"`
  80. }
  81. func (s *ContractReviewGetReq) GetId() interface{} {
  82. return s.T_id
  83. }
  84. // ContractReviewDeleteReq 删除的结构体
  85. type ContractReviewDeleteReq struct {
  86. T_id int `form:"T_id"`
  87. }
  88. func (s *ContractReviewDeleteReq) GetId() interface{} {
  89. return s.T_id
  90. }
  91. type ContractReviewAuditReq struct {
  92. T_id int `form:"T_id" example:"1"`
  93. T_audit int `form:"T_audit" vd:"$>0;msg:'项目名称不能为空'"` // 审核 财务通过3 财务驳回4 总经理通过5 总经理驳回6
  94. T_approval_opinion string `form:"T_approval_opinion"` // 审批意见
  95. }
  96. func (s *ContractReviewAuditReq) GetId() interface{} {
  97. return s.T_id
  98. }