sap.go 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "kpt.xdmy/apiserver/model"
  5. "kpt.xdmy/apiserver/service"
  6. )
  7. func ProofList(c *gin.Context) {
  8. p := new(model.ProofReq)
  9. if !Bind(c, p) {
  10. return
  11. }
  12. rp := service.ProofList(p)
  13. c.JSON(200, &rp)
  14. }
  15. func ProofOff(c *gin.Context) {
  16. p := new(model.ProofReq)
  17. if !Bind(c, p) {
  18. return
  19. }
  20. rp := svc.ProofOff(p)
  21. c.JSON(200, &rp)
  22. }
  23. func ProofOffList(c *gin.Context) {
  24. p := new(model.ProofReq)
  25. if !Bind(c, p) {
  26. return
  27. }
  28. rp := service.ProofList(p)
  29. c.JSON(rp.Code, &rp)
  30. }
  31. func ManualTransfer(c *gin.Context) {
  32. code := c.PostForm("code")
  33. count, e := service.ManualTransfer(code)
  34. c.JSON(200, map[string]interface{}{"count": count, "error": e})
  35. }
  36. func ManaulSapOrder(c *gin.Context) {
  37. code := c.PostForm("code")
  38. if e := service.ManaulSapOrderJob(code); e != nil {
  39. c.JSON(200, "success")
  40. } else {
  41. c.JSON(200, "fail")
  42. }
  43. }
  44. func ManaulSrmOrderJob(c *gin.Context) {
  45. // code := c.PostForm("code")
  46. service.ManaulSrmOrderJob()
  47. c.JSON(200, "success")
  48. }