business_approve.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. }
  36. type PeerItem struct {
  37. PeerPeopleId int `description:"同行人id"`
  38. PeerPeopleName string `description:"同行人"`
  39. PeerGroupName string
  40. }
  41. func GetBusinessTripApproveList(condition string, pars []interface{}) (list []*BusinessTripApproveView, err error) {
  42. o := orm.NewOrm()
  43. sql := ` SELECT a.*,b.department_id FROM business_apply AS a
  44. INNER JOIN admin AS b ON a.apply_admin_id=b.admin_id `
  45. if condition != "" {
  46. sql += condition
  47. }
  48. sql += ` ORDER BY a.create_time DESC `
  49. _, err = o.Raw(sql, pars).QueryRows(&list)
  50. return
  51. }