waybill.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.POST("/warehouse-in", cont.WarehouseIn) // 入库
  25. //r.POST("/warehouse-out", cont.WarehouseOut) // 出库
  26. //r.POST("/car-in", cont.CarIn) // 装车
  27. //r.POST("/car-out", cont.CarOut) // 下车
  28. r.POST("/receipt", cont.Receipt) // 签收
  29. r.GET("/customer", cont.GetCustomerPage) // 客户下单列表
  30. r.POST("/customer", cont.CustomerInsert) // 客户下单
  31. r.GET("/applet", cont.GetAppletPage) // app 运单列表
  32. r.GET("/applet-count", cont.GetAppletCount) // app 运单-统计
  33. r.POST("/import", cont.Import) // 导入运单
  34. r.GET("/export-template", cont.ExportTemplate) // 导出运单模板
  35. r.GET("/home", cont.Home) // 首页统计
  36. r.GET("/user-stats", cont.UserStats) // 用户运单统计
  37. r.GET("/export", cont.Export) // 运单管理-导出
  38. r.GET("/customer/export", cont.CustomerExport) // 客户下单
  39. r.GET("/temperature-pdf", cont.TemperaturePDF) // 导出温湿度pdf
  40. }
  41. }
  42. func registerWaybillRouter2(v1 *gin.RouterGroup) {
  43. cont := controller.WaybillController{}
  44. r := v1.Group("/waybill")
  45. {
  46. r.POST("/customer/receipt", cont.CustomerReceipt) // 客户签收
  47. r.GET("/no", cont.GetByWaybillNo)
  48. }
  49. }