business_approve.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package business_trip
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type BusinessApplyApproveReq struct {
  7. BusinessApplyId int `description:"出差申请id"`
  8. ApproveStatus int `description:"审批状态:1:通过,2:驳回"`
  9. RefuseReason string `description:"驳回理由"`
  10. }
  11. type BusinessTripApproveView struct {
  12. BusinessApplyId int `description:"出差申请id"`
  13. ApplyAdminId int `description:"申请人id"`
  14. ApplyRealName string `description:"申请人姓名"`
  15. ArriveDate time.Time `description:"到达日期"`
  16. ReturnDate time.Time `description:"返程日期"`
  17. Province string `description:"目的地省"`
  18. City string `description:"目的地市"`
  19. Reason string `description:"出差事由"`
  20. Transportation string `description:"交通工具"`
  21. PeerPeopleId string `description:"同行人id"`
  22. PeerPeopleName string `description:"同行人"`
  23. PeerPeopleList []*PeerItem
  24. Status string `description:"状态:'待审批','已审批','已驳回','已撤回','已过期'"`
  25. ApproveId int `description:"审批人id"`
  26. ApproveName string `description:"审批人姓名"`
  27. RefuseReason string `description:"拒绝理由"`
  28. RefuseTime string `description:"拒绝时间"`
  29. ApproveTime string `description:"审批时间"`
  30. CreateTime string `description:"创建时间"`
  31. ModifyTime string `description:"修改时间"`
  32. DepartmentId int
  33. GroupName string `description:"分组"`
  34. DayTotal int `description:"出差天数"`
  35. Itinerary string `description:"行程说明"`
  36. }
  37. type PeerItem struct {
  38. PeerPeopleId int `description:"同行人id"`
  39. PeerPeopleName string `description:"同行人"`
  40. PeerGroupName string
  41. }
  42. func GetBusinessTripApproveList(condition string, pars []interface{}) (list []*BusinessTripApproveView, err error) {
  43. o := orm.NewOrm()
  44. sql := ` SELECT a.*,b.department_id FROM business_apply AS a
  45. INNER JOIN admin AS b ON a.apply_admin_id=b.admin_id `
  46. if condition != "" {
  47. sql += condition
  48. }
  49. sql += ` ORDER BY a.create_time DESC `
  50. _, err = o.Raw(sql, pars).QueryRows(&list)
  51. return
  52. }