sap.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package http
  2. import "kpt.xdmy/pkg/http"
  3. type Dest struct {
  4. DestID string `json:"DEST_ID"`
  5. BussTp string `json:"BUSS_TP"`
  6. MessID string `json:"MESS_ID"`
  7. Status string `json:"STATUS"`
  8. MessText string `json:"MESS_TEXT"`
  9. StatusOs string `json:"STATUS_OS"`
  10. Url string
  11. MESSIDOS string `json:"MESS_ID_OS"`
  12. BUSSDOCOS string `json:"BUSS_DOC_OS"`
  13. }
  14. type SapResp struct {
  15. Dest `json:"DEST"`
  16. Data SapRespMsg `json:"DATA"`
  17. }
  18. type SapRespMsg struct {
  19. Status string `json:"MSGTY"`
  20. Text string `json:"MSGTX"`
  21. ProofNumber string `json:"EXT01"`
  22. ProofYear string `json:"EXT02"`
  23. EqNumber string `json:"EXT03"`
  24. }
  25. type SapContractResp struct {
  26. Dest `json:"DEST"`
  27. Data SapContractRespMsg `json:"DATA"`
  28. //Data interface{} `json:"DATA"`
  29. }
  30. type SapContractRespMsg struct {
  31. HMSGR struct {
  32. MSGTY string `json:"MSGTY"`
  33. MSGTX string `json:"MSGTX"`
  34. EXT01 string `json:"EXT01"`
  35. } `json:"HMSGR"`
  36. }
  37. var SapAuth *http.Auth
  38. type SapQueryReq struct {
  39. Dest Dest `json:"DEST"`
  40. Data SapQueryReqData `json:"DATA"`
  41. }
  42. type SapQueryReqData struct {
  43. }
  44. type SapDest interface {
  45. GetUrl() string
  46. GetName() string
  47. GetDest() *Dest
  48. }
  49. func (d *Dest) GetUrl() string {
  50. return d.Url
  51. }
  52. func (d *Dest) GetName() string {
  53. return d.BussTp
  54. }
  55. func (d *Dest) GetDest() *Dest {
  56. return d
  57. }
  58. type SrmResp struct {
  59. Success bool `json:"success"`
  60. Code string `json:"code"`
  61. Message string `json:"message"`
  62. }
  63. type ContractDataToASP struct {
  64. MATNR string `json:"MATNR"` // 物料编码
  65. LIFNR string `json:"LIFNR"` // 供应商编码
  66. EKORG string `json:"EKORG"` // 采购组织
  67. WERKS string `json:"WERKS"` // 工厂
  68. NETPR string `json:"NETPR"` // 净价
  69. WAERS string `json:"WAERS"` // 货币
  70. BPRME string `json:"BPRME"` // 订单价格单位
  71. PEINH string `json:"PEINH"` // 订单价格
  72. MWSKZ string `json:"MWSKZ"` // 税代码
  73. EKGRP string `json:"EKGRP"` // 采购组
  74. DATAB string `json:"DATAB"` // 生效起始时间
  75. DATBI string `json:"DATBI"` // 生效结束时间
  76. LOEKZ string `json:"LOEKZ"` // 删除标识
  77. ESOKZ string `json:"ESOKZ"`
  78. MEINS string `json:"MEINS"` // 订单价格单位
  79. Code string `json:"Code"`
  80. PurchaseInfo string `json:"PurchaseInfo"`
  81. RCKEY string `json:"RCKEY"` //行号
  82. }
  83. type PostPushContractDataToSAPReq struct {
  84. PastureId int64 `json:"pastureId"`
  85. ProviderId int64 `json:"providerId"`
  86. ContractIdList []int64 `json:"contractIdList"`
  87. }