waybill.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package router
  2. import (
  3. "cold-delivery/app/admin/controller"
  4. "cold-delivery/common/actions"
  5. "github.com/gin-gonic/gin"
  6. jwt "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerWaybillRouter)
  10. routerNoCheckRole = append(routerNoCheckRole, registerWaybillRouter2)
  11. }
  12. // 派费管理
  13. // 需认证的路由代码
  14. func registerWaybillRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  15. cont := controller.WaybillController{}
  16. r := v1.Group("/waybill").Use(authMiddleware.MiddlewareFunc()).Use(actions.PermissionAction())
  17. {
  18. r.GET("", cont.GetPage)
  19. r.GET("/:id", cont.Get)
  20. r.POST("", cont.Insert)
  21. r.POST("/delivery", cont.Delivery)
  22. r.PUT("", cont.Update)
  23. r.DELETE("", cont.Delete)
  24. r.PUT("/adminaudit", cont.AdminAudit) //管理员审核订单
  25. r.POST("/receipt", cont.Receipt) // 签收
  26. r.GET("/customer", cont.GetCustomerPage) // 客户下单列表
  27. r.POST("/customer", cont.CustomerInsert) // 客户下单
  28. r.PUT("/update-status", cont.UpdateStatus) // 修改订单状态
  29. r.PUT("/audit", cont.Audit) // 审核订单
  30. r.GET("/applet", cont.GetAppletPage) // app 运单列表
  31. r.GET("/applet-count", cont.GetAppletCount) // app 运单-统计
  32. r.POST("/import", cont.Import) // 导入运单
  33. r.GET("/export-template", cont.ExportTemplate) // 导出运单模板
  34. r.GET("/home", cont.Home) // 首页统计
  35. r.POST("/user-stats", cont.UserStats) // 用户运单统计
  36. r.GET("/export", cont.Export) // 运单管理-导出
  37. r.GET("/customer/export", cont.CustomerExport) // 客户下单
  38. r.GET("/temperature-pdf", cont.TemperaturePDF) // 导出温湿度pdf
  39. r.GET("/createsole", cont.CreateSole) // 生成唯一订单编号
  40. r.PUT("/turnarounds", cont.Turnarounds) // 订单转门店
  41. }
  42. }
  43. func registerWaybillRouter2(v1 *gin.RouterGroup) {
  44. cont := controller.WaybillController{}
  45. test := controller.CoolerBoxController{}
  46. r := v1.Group("/waybill")
  47. {
  48. r.POST("/customer/receipt", cont.CustomerReceipt) // 客户签收
  49. r.GET("/no", cont.GetByWaybillNo)
  50. r.GET("/newlocus", test.GetCoolerBoxNewestLocus)
  51. }
  52. }