inspect_record.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // 入库安全检查
  9. type InspectRecordGetPageReq struct {
  10. dto.Pagination `search:"-"`
  11. State int `form:"state" search:"type:exact;column:state;table:inspect_record"` // 订单状态 状态 0-待整改 1-整改中 2-已整改 -1 合格
  12. InspectStartTime string `form:"inspectStartTime" search:"type:gte;column:inspect_time;table:inspect_record"` // 检查开始时间
  13. InspectEndTime string `form:"inspectEndTime" search:"type:lte;column:inspect_time;table:inspect_record"` // 检查结束时间
  14. CustomerName string `form:"customerName" search:"-"` // 客户名称
  15. InspectorName string `form:"inspectorName" search:"-"` // 检查人
  16. InspectRecordOrder
  17. }
  18. type InspectRecordOrder struct {
  19. CreatedAtOrder string `search:"type:order;column:created_at;table:inspect_record" form:"createdAtOrder" default:"desc"`
  20. }
  21. func (m *InspectRecordGetPageReq) GetNeedSearch() interface{} {
  22. return *m
  23. }
  24. type InspectRecordInsertReq struct {
  25. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  26. OrderId string `json:"orderId"`
  27. model.ProvInspectRecord
  28. common.ControlBy `swaggerignore:"true"`
  29. common.DeptBy `swaggerignore:"true"`
  30. }
  31. func (s *InspectRecordInsertReq) Generate(model *model.InspectRecord) {
  32. if s.Id != 0 {
  33. model.Id = s.Id
  34. }
  35. model.OrderId = s.OrderId
  36. model.ProvInspectRecord = s.ProvInspectRecord
  37. model.ProvInspectRecord.InspectTime = time.Now().Format("2006-01-02 15:04:05")
  38. if s.ControlBy.UpdateBy != 0 {
  39. model.UpdateBy = s.UpdateBy
  40. }
  41. if s.ControlBy.CreateBy != 0 {
  42. model.CreateBy = s.CreateBy
  43. }
  44. if s.DeptBy.DeptId != 0 {
  45. model.DeptId = s.DeptId
  46. }
  47. }
  48. func (s *InspectRecordInsertReq) GetId() interface{} {
  49. return s.Id
  50. }
  51. func (s *InspectRecordInsertReq) UpdateGenerate(model *model.InspectRecord) {
  52. if s.Id != 0 {
  53. model.Id = s.Id
  54. }
  55. model.AfterRectifyImg = s.AfterRectifyImg
  56. model.State = s.State
  57. model.Remark = s.Remark
  58. model.InspectExpandList = s.InspectExpandList
  59. if s.ControlBy.UpdateBy != 0 {
  60. model.UpdateBy = s.UpdateBy
  61. }
  62. if s.ControlBy.CreateBy != 0 {
  63. model.CreateBy = s.CreateBy
  64. }
  65. }
  66. type InspectRecordGetReq struct {
  67. Id int `uri:"id"`
  68. }
  69. func (s *InspectRecordGetReq) GetId() interface{} {
  70. return s.Id
  71. }
  72. // 入库安全检查
  73. type InspectRecordGetByOrderReq struct {
  74. OrderId string `form:"orderId" search:"type:exact;column:order_id;table:inspect_record"` // 检查开始时间
  75. }
  76. func (m *InspectRecordGetByOrderReq) GetNeedSearch() interface{} {
  77. return *m
  78. }