inspect_record.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package dto
  2. import (
  3. "gas-cylinder-api/app/admin/model"
  4. "gas-cylinder-api/common/dto"
  5. common "gas-cylinder-api/common/model"
  6. "time"
  7. )
  8. type InspectRecordGetPageReq struct {
  9. dto.Pagination `search:"-"`
  10. State int `form:"state" search:"type:exact;column:state;table:inspect_record"` // 订单状态 状态 0-待整改 1-整改中 2-已整改
  11. InspectStartTime string `form:"inspectStartTime" search:"type:gte;column:inspect_time;table:inspect_record"` // 检查开始时间
  12. InspectEndTime string `form:"inspectEndTime" search:"type:lte;column:inspect_time;table:inspect_record"` // 检查结束时间
  13. CustomerName string `form:"customerName" search:"-"` // 客户名称
  14. InspectorName string `form:"inspectorName" search:"-"` // 检查人
  15. }
  16. func (m *InspectRecordGetPageReq) GetNeedSearch() interface{} {
  17. return *m
  18. }
  19. type InspectRecordInsertReq struct {
  20. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  21. OrderId string `json:"orderId"`
  22. model.ProvInspectRecord
  23. common.ControlBy `swaggerignore:"true"`
  24. common.DeptBy `swaggerignore:"true"`
  25. }
  26. func (s *InspectRecordInsertReq) Generate(model *model.InspectRecord) {
  27. if s.Id != 0 {
  28. model.Id = s.Id
  29. }
  30. model.OrderId = s.OrderId
  31. model.ProvInspectRecord = s.ProvInspectRecord
  32. model.ProvInspectRecord.InspectTime = time.Now().Format("2006-01-02 15:04:05")
  33. if s.ControlBy.UpdateBy != 0 {
  34. model.UpdateBy = s.UpdateBy
  35. }
  36. if s.ControlBy.CreateBy != 0 {
  37. model.CreateBy = s.CreateBy
  38. }
  39. if s.DeptBy.DeptId != 0 {
  40. model.DeptId = s.DeptId
  41. }
  42. }
  43. func (s *InspectRecordInsertReq) GetId() interface{} {
  44. return s.Id
  45. }
  46. func (s *InspectRecordInsertReq) UpdateGenerate(model *model.InspectRecord) {
  47. if s.Id != 0 {
  48. model.Id = s.Id
  49. }
  50. model.AfterRectifyImg = s.AfterRectifyImg
  51. model.State = s.State
  52. model.Remark = s.Remark
  53. model.InspectExpandList = s.InspectExpandList
  54. if s.ControlBy.UpdateBy != 0 {
  55. model.UpdateBy = s.UpdateBy
  56. }
  57. if s.ControlBy.CreateBy != 0 {
  58. model.CreateBy = s.CreateBy
  59. }
  60. }
  61. type InspectRecordGetReq struct {
  62. Id int `uri:"id"`
  63. }
  64. func (s *InspectRecordGetReq) GetId() interface{} {
  65. return s.Id
  66. }