waybill.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package router
  2. import (
  3. "cold-logistics/app/admin/controller"
  4. "cold-logistics/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("/:waybillNo", cont.Get)
  20. r.POST("", cont.Insert)
  21. r.POST("/applet", cont.AppletInsert)
  22. r.POST("/delivery", cont.Delivery)
  23. r.PUT("", cont.Update)
  24. r.DELETE("", cont.Delete)
  25. r.POST("/warehouse-in", cont.WarehouseIn) // 入库
  26. //r.POST("/warehouse-out", cont.WarehouseOut) // 出库
  27. r.POST("/car-in", cont.CarIn) // 装车
  28. //r.POST("/car-out", cont.CarOut) // 下车
  29. r.POST("/cooler-box-in", cont.CoolerBoxIn) // 装箱
  30. r.POST("/stop-record", cont.StopRecord) // 停止记录
  31. r.POST("/receipt", cont.Receipt) // 签收
  32. r.GET("/customer", cont.GetCustomerPage) // 客户下单列表
  33. r.POST("/customer", cont.CustomerInsert) // 客户下单
  34. r.GET("/applet", cont.GetAppletPage) // app 运单列表
  35. r.GET("/applet-count", cont.GetAppletCount) // app 运单-统计
  36. r.POST("/import", cont.Import) // 导入运单
  37. r.GET("/export-template", cont.ExportTemplate) // 导出运单模板
  38. r.GET("/home", cont.Home) // 首页统计
  39. r.GET("/export", cont.Export) // 运单管理-导出
  40. r.GET("/customer/export", cont.CustomerExport) // 运单管理-客户导出
  41. r.POST("/temperature-pdf", cont.TemperaturePDF) // 导出温湿度pdf
  42. r.GET("/waybill-pdf", cont.WaybillPDF) // 导出运单pdf
  43. r.POST("/send-mail", cont.SendMail) // 发送温湿度邮件
  44. }
  45. }
  46. func registerWaybillRouter2(v1 *gin.RouterGroup) {
  47. cont := controller.WaybillController{}
  48. r := v1.Group("/waybill")
  49. {
  50. r.POST("/temperature-pdf-url", cont.TemperaturePDFUrl) // 导出温湿度pdf
  51. }
  52. }