sap.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. package test
  2. import (
  3. "time"
  4. "github.com/k0kubun/pp/v3"
  5. "github.com/sirupsen/logrus"
  6. "kpt.xdmy/apiserver/model"
  7. "kpt.xdmy/apiserver/model/http"
  8. "kpt.xdmy/apiserver/service"
  9. )
  10. func TestSap() {
  11. // sapMaterial()
  12. sapSupplier()
  13. // sapAsset()
  14. // returnGoog()
  15. // useOff()
  16. // laidOff()
  17. // offlist()
  18. // transfer()
  19. // order()
  20. // refundProof()
  21. // useProof()
  22. // quitProof()
  23. // rejectProof()
  24. // laidProof()
  25. }
  26. func sapSupplier() {
  27. var t time.Time
  28. t = time.Now()
  29. var code string
  30. // code = "14.01.06.02.000216"
  31. s.SapSupplier(t, code)
  32. }
  33. func sapAsset() {
  34. var t time.Time
  35. t = time.Now()
  36. var code string
  37. // code = "14.01.06.02.000216"
  38. s.SapAsset(t, code)
  39. }
  40. func sapMaterial() {
  41. var t time.Time
  42. // t = time.Now()
  43. var code = "14.01.06.02.000216"
  44. s.SapMaterial(t, code)
  45. }
  46. func transfer() {
  47. // p := map[string]interface{}{
  48. // "id": 141,
  49. // "statue": 1,
  50. // "laidCode": "RK02220914010",
  51. // }
  52. // p := map[string]interface{}{
  53. // "id": 139,
  54. // "laidCode": "RK03220914003",
  55. // }
  56. // "id": 137,
  57. // "laidCode": "RK03220914002",
  58. // s.SapTransfer(p)
  59. }
  60. func useOff() {
  61. p := &model.ProofReq{
  62. OrderNumber: "CK01220828003",
  63. RowsNumber: []int{1},
  64. NumberType: 3,
  65. }
  66. r := s.ProofOff(p)
  67. pp.Print(r)
  68. }
  69. func proofOff() {
  70. m := new(model.ProofReq)
  71. m.OrderNumber = "TH00220822003"
  72. m.OrderNumber = "RK00220822001"
  73. m.OrderNumber = "CK00220822005"
  74. m.OrderNumber = "CK00220822002" //tuiku
  75. m.NumberType = 2
  76. m.NumberType = 1
  77. m.NumberType = 3
  78. m.NumberType = 4
  79. rpl := service.ProofList(m)
  80. r := rpl.Data.(*model.ProofReq)
  81. m.ProofCode = r.ProofCode
  82. m.ProofYear = r.ProofYear
  83. m.ChargeDate = r.ChargeDate
  84. m.OrderNumberId = r.OrderNumberId
  85. m.RowsNumber = []int{
  86. 1,
  87. }
  88. rpo := s.ProofOff(m)
  89. logrus.Info(rpo)
  90. }
  91. func material() {
  92. m := &http.MaterialDetail{
  93. Code: "14.01.07.01.000003",
  94. Type: "XD08",
  95. Group: "14010701",
  96. Description: "氧气表_YQY-07型",
  97. Unit: "个",
  98. UnitNum: "1 ",
  99. SwitchUnit: "个",
  100. SwitchUnitNum: "1 ",
  101. Name: "氧气表",
  102. Model: "YQY-07型",
  103. Dflag: "",
  104. ModifyTime: "20220815",
  105. }
  106. s.UpdatePart(m)
  107. }
  108. func quitProof() {
  109. p := ` {
  110. "deptId": 459,
  111. "note": "",
  112. "pastureId": 31,
  113. "quitDate": "2022-08-27",
  114. "quitId": 2567,
  115. "useForm": "CK01220827008"
  116. }`
  117. s.QuitProof(p)
  118. }
  119. func returnGoog() {
  120. p := ` {
  121. "id":2765
  122. }`
  123. s.RefundProof(p)
  124. }
  125. func rejectProof() {
  126. p := ` {
  127. "applicatId": 2567,
  128. "departmentId": 459,
  129. "empId": 2567,
  130. "pastureId": 31,
  131. "receiveTime": "2022-08-31",
  132. "useForm": "CK01220831007",
  133. "useType": 5
  134. }`
  135. s.UseProof(p)
  136. }
  137. func useProof() {
  138. p := `{
  139. "receiveTime": "2022-09-20",
  140. "departmentId": 61,
  141. "useForm": "CK02220921002",
  142. "useType": 0
  143. }`
  144. s.UseProof(p)
  145. }
  146. func offlist() {
  147. p := new(model.ProofReq)
  148. p.OrderNumber = "CK01220828005"
  149. p.NumberType = 3
  150. service.ProofList(p)
  151. }
  152. func refundProof() {
  153. p := `
  154. {
  155. "id": 2761
  156. }`
  157. s.RefundProof(p)
  158. }
  159. func order() {
  160. p := ` {
  161. "matchCode": "PD02220914003"
  162. }`
  163. s.PurchaseOrder(p)
  164. }
  165. func laidProof() {
  166. p := `{
  167. "No1Id": "CG05220831001",
  168. "empId": 2825,
  169. "laidCode": "RK05220831002",
  170. "laidType": 0,
  171. "pastureId": 115,
  172. "providerId": 2980,
  173. "purchaseId": "CG05220831001",
  174. "storageTime": "2022-08-31"
  175. }`
  176. s.LaidProof(p)
  177. }
  178. func laidOff() {
  179. p := &model.ProofReq{
  180. OrderNumber: "RK01220831005",
  181. RowsNumber: []int{1},
  182. NumberType: 1,
  183. }
  184. r := s.ProofOff(p)
  185. pp.Print(r)
  186. }