sap.go 887 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. }