f6322d839dbf06818b866fda0d2f92411eb27405.svn-base 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. package util
  2. import (
  3. "bytes"
  4. "encoding/xml"
  5. "fmt"
  6. "github.com/pkg/errors"
  7. "io/ioutil"
  8. "net/http"
  9. "strings"
  10. )
  11. type EASLoginInfo struct {
  12. UserName string `json:"userName"`
  13. Password string `json:"password"`
  14. SlnName string `json:"slnName"`
  15. DcName string `json:"dcName"`
  16. Language string `json:"language"`
  17. DbType string `json:"dbType"`
  18. Url string `json:"dbType"`
  19. }
  20. var (
  21. LoginStr = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:log="http://login.webservice.bos.kingdee.com">
  22. <soapenv:Header/>
  23. <soapenv:Body>
  24. <log:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  25. <userName xsi:type="xsd:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">userName?</userName>
  26. <password xsi:type="xsd:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">password?</password>
  27. <slnName xsi:type="xsd:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">slnName?</slnName>
  28. <dcName xsi:type="xsd:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">dcName?</dcName>
  29. <language xsi:type="xsd:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">language?</language>
  30. <dbType xsi:type="xsd:int">dbType?</dbType>
  31. </log:login>
  32. </soapenv:Body>
  33. </soapenv:Envelope>
  34. `
  35. LogoutStr = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:log="http://login.webservice.bos.kingdee.com">
  36. <soapenv:Header/>
  37. <soapenv:Body>
  38. <log:logout soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  39. <userName xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">userName?</userName>
  40. <slnName xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">slnName?</slnName>
  41. <dcName xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">dcName?</dcName>
  42. <language xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">language?</language>
  43. </log:logout>
  44. </soapenv:Body>
  45. </soapenv:Envelope>
  46. `
  47. InsertPartsStr = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.synfacade.modernfarming.eas.kingdee.com">
  48. <soapenv:Header>
  49. <ns1:SessionId
  50. xmlns:ns1="http://login.webservice.bos.kingdee.com">SessionId?
  51. </ns1:SessionId>
  52. </soapenv:Header>
  53. <soapenv:Body>
  54. <web:synMaterial soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  55. <request xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">strJson?</request>
  56. </web:synMaterial>
  57. </soapenv:Body>
  58. </soapenv:Envelope>
  59. `
  60. QureyPartsStr = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.synfacade.modernfarming.eas.kingdee.com">
  61. <soapenv:Header>
  62. <ns1:SessionId
  63. xmlns:ns1="http://login.webservice.bos.kingdee.com">SessionId?
  64. </ns1:SessionId>
  65. </soapenv:Header>
  66. <soapenv:Body>
  67. <web:queryMaterialData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  68. <request xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">{"number":"strJson?"}</request>
  69. </web:queryMaterialData>
  70. </soapenv:Body>
  71. </soapenv:Envelope>`
  72. InsertPartsuselaidStr = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:app="http://app.ws.scm.eas.kingdee.com">
  73. <soapenv:Header>
  74. <ns1:SessionId
  75. xmlns:ns1="http://login.webservice.bos.kingdee.com">SessionId?
  76. </ns1:SessionId>
  77. </soapenv:Header>
  78. <soapenv:Body>
  79. <app:importBill soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  80. <billType xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">billType?</billType>
  81. <billDataJSON xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">strJson?</billDataJSON>
  82. <billStatus xsi:type="xsd:int">2</billStatus>
  83. </app:importBill>
  84. </soapenv:Body>
  85. </soapenv:Envelope>
  86. `
  87. QureyBill = `<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:app="http://app.ws.scm.eas.kingdee.com">
  88. <soapenv:Header>
  89. <ns1:SessionId
  90. xmlns:ns1="http://login.webservice.bos.kingdee.com">SessionId?
  91. </ns1:SessionId>
  92. </soapenv:Header>
  93. <soapenv:Body>
  94. <app:queryScmBillData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  95. <billType xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">billType?</billType>
  96. <request xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">{"number":"strJson?"}</request>
  97. </app:queryScmBillData>
  98. </soapenv:Body>
  99. </soapenv:Envelope>`
  100. )
  101. var user EASLoginInfo
  102. type BillLaid struct { // 销售出库&其它出库 &采购入库 & 其他入库
  103. BizType BillNumber `json:"bizType"` //业务类型
  104. BizDate string `json:"bizDate"` //业务日期
  105. Description string `json:"description"` //摘要
  106. PaymentType BillNumber `json:"paymentType"` // 付款方式
  107. TransactionType BillNumber `json:"transactionType"` // 事务类型
  108. Number string `json:"number"` // 单据编号
  109. Entry []BillEntry `json:"entry"` //
  110. StorageOrgUnit BillNumber `json:"storageOrgUnit"` //库存组织
  111. Supplier BillNumber `json:"supplier"` //供应商
  112. Currency BillNumber `json:"currency"` // 币别
  113. }
  114. type BillNumber struct {
  115. Number string `json:"number"`
  116. }
  117. type BillEntry struct {
  118. ActualPrice string `json:"actualPrice"` //实际单价
  119. ActualTaxPrice string `json:"actualTaxPrice"` //实际含税单价
  120. UnitActualCost string `json:"unitActualCost"` //单位实际成本
  121. UnitPurchaseCost string `json:"unitPurchaseCost"` //单位采购成本
  122. TaxPrice string `json:"taxPrice"` //含税单价
  123. BalanceSupplier BillNumber `json:"balanceSupplier"` //结算供应商
  124. Price string `json:"price"` //单价
  125. ActualCost string `json:"actualCost"` //实际成本
  126. PurchaseCost string `json:"purchaseCost"` //采购成本
  127. Amount string `json:"amount"` // 金额
  128. TaxAmount string `json:"taxAmount"` // 价税合计
  129. ContractNumber string `json:"contractNumber"` // 合同号
  130. Warehouse BillNumber `json:"warehouse"` // 仓库
  131. Unit BillNumber `json:"unit"` // 单位
  132. Material BillNumber `json:"material"` //物料
  133. Qty string `json:"qty"` //数量
  134. }
  135. type BillUse struct { //领料出库&生产入库
  136. Head BillUseHead `json:"head"`
  137. Entrys []BillUseEntrys `json:"entrys"`
  138. }
  139. type BillUseHead struct {
  140. BillNumber string `json:"billNumber"` //单据编号
  141. BizDate string `json:"bizDate"` //业务日期
  142. BizTypeNumber string `json:"bizTypeNumber"` //业务类型
  143. TransactionType string `json:"transactionType"` //事务类型
  144. Department string `json:"department"` //部门
  145. SupplyStorageOrg string `json:"supplyStorageOrg"` //供方库存组织
  146. StorageOrg string `json:"storageOrg"` //需方库存组织
  147. CostCenter string `json:"costCenter"` //成本中心
  148. Remark string `json:"remark"` //摘要
  149. Creator string `json:"creator"` //创建者
  150. }
  151. type BillUseEntrys struct {
  152. MaterielNumber string `json:"materielNumber"` // 物料
  153. Lot string `json:"lot"` //批次
  154. Amount string `json:"amount"` //数量
  155. MeteredUnit string `json:"meteredUnit"` //单位
  156. WareHouse string `json:"wareHouse"` //需方仓库
  157. Location string `json:"location"` //需方库位
  158. Picker string `json:"picker"` // 领料员
  159. EntryRemark string `json:"entryRemark"` //备注
  160. MasterDepartment string `json:"masterDepartment"` //主制部门
  161. EntryCostCenter string `json:"entryCostCenter"` //成本中心
  162. }
  163. // 备件
  164. type Parts struct {
  165. MaterialNumber string `json:"materialNumber"`
  166. MaterialName string `json:"materialName"`
  167. MaterialGroup string `json:"materialGroup"`
  168. Model string `json:"model"`
  169. BaseUnit string `json:"baseUnit"`
  170. Status int `json:"status"`
  171. //kaClass int32 `json:"kaClass"`
  172. //planningMode int32 `json:"planningMode"`
  173. }
  174. func InitWebS(use, pass, url string) {
  175. user.Password = pass
  176. user.UserName = use
  177. user.DbType = "1"
  178. user.DcName = "MASM"
  179. user.Language = "L2"
  180. user.SlnName = "eas"
  181. user.Url = url
  182. }
  183. func eastest() {
  184. sessionid, _ := EASWebServiceLogin()
  185. //EASWebServicInsertParts(sessionid,"{}")
  186. EASWebServicInsertPartsuselaid(sessionid, "{}", "007")
  187. //EASWebServiceLogout()
  188. }
  189. type Response struct {
  190. Body rspBody `xml:"Body" json:"body"`
  191. }
  192. type rspBody struct {
  193. Record []rqRecord `xml:"multiRef" json:"multiRef"`
  194. SynMaterialResponse SMReturn `xml:"synMaterialResponse" json:"SynMaterialResponse"`
  195. ImportBillResponse ImportBillResponse `xml:"importBillResponse" json:"importBillResponse"`
  196. QueryMaterialDataResponse QureyParts `xml:"queryMaterialDataResponse" json:"queryMaterialDataResponse"`
  197. QueryScmBillDataResponse QureyBills `xml:"queryScmBillDataResponse" json:"queryScmBillDataResponse"`
  198. }
  199. type ImportBillResponse struct {
  200. ImportBillReturn string `xml:"importBillReturn" json:"importBillReturn"`
  201. }
  202. type QureyParts struct {
  203. QueryMaterialDataReturn string `xml:"queryMaterialDataReturn" json:"queryMaterialDataReturn"`
  204. }
  205. type QureyBills struct {
  206. QueryScmBillDataReturn string `xml:"queryScmBillDataReturn" json:"queryScmBillDataReturn"`
  207. }
  208. type SMReturn struct {
  209. SynMaterialReturn string `xml:"synMaterialReturn" json:"synMaterialReturn"`
  210. }
  211. type rqRecord struct {
  212. SessionId string `xml:"sessionId" json:"sessionId"`
  213. }
  214. func EASWebServiceLogin() (string, error) {
  215. client := &http.Client{}
  216. resstr := ReplaceStrWebSevice("login", user.UserName, user.Password, user.SlnName, user.DcName, user.Language, user.DbType, "", "", "")
  217. body := bytes.NewBuffer([]byte(resstr))
  218. req, err := http.NewRequest("POST",
  219. user.Url+"/ormrpc/services/EASLogin?wsdl",
  220. body,
  221. )
  222. req.Header.Set("Content-Type", "text/xml")
  223. req.Header.Set("SOAPAction", "application/soap+xml")
  224. if err != nil {
  225. return "", err
  226. }
  227. resp, err := client.Do(req)
  228. if err != nil {
  229. fmt.Println(err)
  230. return "", err
  231. }
  232. defer resp.Body.Close()
  233. result_body, err := ioutil.ReadAll(resp.Body)
  234. if err != nil {
  235. fmt.Println(err)
  236. return "", err
  237. }
  238. v := Response{}
  239. err = xml.Unmarshal([]byte(string(result_body)), &v)
  240. if err != nil {
  241. fmt.Println(err.Error())
  242. }
  243. if len(v.Body.Record) > 0 {
  244. return v.Body.Record[0].SessionId, nil
  245. }
  246. return "", err
  247. }
  248. func EASWebServiceLogout() error {
  249. client := &http.Client{}
  250. resstr := ReplaceStrWebSevice("logout", user.UserName, "", user.SlnName, user.DcName, user.Language, "", "", "", "")
  251. body := bytes.NewBuffer([]byte(resstr))
  252. req, err := http.NewRequest("POST",
  253. user.Url+"/ormrpc/services/EASLogin?wsdl",
  254. body,
  255. )
  256. req.Header.Set("Content-Type", "text/xml")
  257. req.Header.Set("SOAPAction", "application/soap+xml")
  258. if err != nil {
  259. // handle error
  260. }
  261. resp, err := client.Do(req)
  262. if err != nil {
  263. return err
  264. }
  265. defer resp.Body.Close()
  266. _, err = ioutil.ReadAll(resp.Body)
  267. if err != nil {
  268. return err
  269. }
  270. return nil
  271. //fmt.Println(string(result_body))
  272. }
  273. func EASWebServiceQureyParts(SessionId, PartCode string) error {
  274. client := &http.Client{}
  275. resstr := ReplaceStrWebSevice("QureyPartsStr", "", "", "", "", "", "", SessionId, PartCode, "")
  276. body := bytes.NewBuffer([]byte(resstr))
  277. req, err := http.NewRequest("POST",
  278. user.Url+"/ormrpc/services/WSReadEASDataFacade?wsdl",
  279. body,
  280. )
  281. req.Header.Set("Content-Type", "text/xml")
  282. req.Header.Set("SOAPAction", "application/soap+xml")
  283. if err != nil {
  284. // handle error
  285. }
  286. resp, err := client.Do(req)
  287. if err != nil {
  288. return err
  289. }
  290. defer resp.Body.Close()
  291. result_body, err := ioutil.ReadAll(resp.Body)
  292. if err != nil {
  293. return err
  294. }
  295. v := Response{}
  296. err = xml.Unmarshal(result_body, &v)
  297. if err != nil {
  298. fmt.Println(err.Error())
  299. }
  300. resmap := make(map[string]interface{}, 0)
  301. err = json.Unmarshal([]byte(v.Body.QueryMaterialDataResponse.QueryMaterialDataReturn), &resmap)
  302. //fmt.Println("resmap===============", resmap,len(resmap["data"].([]interface{})))
  303. switch resmap["data"].(type) {
  304. case []interface{}:
  305. if resmap["success"] != "1" || len(resmap["data"].([]interface{})) == 0 {
  306. return errors.New("单据未查询到")
  307. }
  308. default:
  309. return errors.New("单据未查询到")
  310. }
  311. return nil
  312. }
  313. func EASWebServiceQureyBill(SessionId, BillCode,billType string) error {
  314. client := &http.Client{}
  315. resstr := ReplaceStrWebSevice("QureyBill", "", "", "", "", "", "", SessionId, BillCode, billType)
  316. body := bytes.NewBuffer([]byte(resstr))
  317. req, err := http.NewRequest("POST",
  318. user.Url+"/ormrpc/services/WSReadEASDataFacade?wsdl",
  319. body,
  320. )
  321. req.Header.Set("Content-Type", "text/xml")
  322. req.Header.Set("SOAPAction", "application/soap+xml")
  323. if err != nil {
  324. return err
  325. }
  326. resp, err := client.Do(req)
  327. if err != nil {
  328. return err
  329. }
  330. defer resp.Body.Close()
  331. result_body, err := ioutil.ReadAll(resp.Body)
  332. fmt.Println(string(result_body))
  333. if err != nil {
  334. fmt.Println(err)
  335. return err
  336. }
  337. v := Response{}
  338. err = xml.Unmarshal(result_body, &v)
  339. if err != nil {
  340. fmt.Println(err.Error())
  341. }
  342. resmap := make(map[string]interface{}, 0)
  343. err = json.Unmarshal([]byte(v.Body.QueryScmBillDataResponse.QueryScmBillDataReturn), &resmap)
  344. //fmt.Println("resmap===============", resmap,len(resmap["data"].([]interface{})))
  345. switch resmap["data"].(type) {
  346. case []interface{}:
  347. if resmap["success"] != "1" || len(resmap["data"].([]interface{})) == 0 {
  348. return errors.New("单据未查询到")
  349. }
  350. default:
  351. return errors.New("单据未查询到")
  352. }
  353. return nil
  354. }
  355. func EASWebServicInsertParts(SessionId string, parts Parts) error {
  356. client := &http.Client{}
  357. soapencJson, err := json.Marshal(parts)
  358. if err != nil {
  359. return err
  360. }
  361. println(string(soapencJson))
  362. resstr := ReplaceStrWebSevice("InsertParts", "", "", "", "", "", "", SessionId, string(soapencJson), "")
  363. body := bytes.NewBuffer([]byte(resstr))
  364. req, err := http.NewRequest("POST",
  365. user.Url+"/ormrpc/services/WSSynMasterDataFacade?wsdl",
  366. body,
  367. )
  368. req.Header.Set("Content-Type", "text/xml")
  369. req.Header.Set("SOAPAction", "application/soap+xml")
  370. if err != nil {
  371. // handle error
  372. }
  373. resp, err := client.Do(req)
  374. if err != nil {
  375. fmt.Println(err)
  376. return err
  377. }
  378. defer resp.Body.Close()
  379. result_body, err := ioutil.ReadAll(resp.Body)
  380. if err != nil {
  381. fmt.Println(err)
  382. return err
  383. }
  384. v := Response{}
  385. err = xml.Unmarshal(result_body, &v)
  386. if err != nil {
  387. fmt.Println(err.Error())
  388. }
  389. resmap := make(map[string]string, 0)
  390. err = json.Unmarshal([]byte(v.Body.SynMaterialResponse.SynMaterialReturn), &resmap)
  391. if resmap["success"] == "0" {
  392. fmt.Println("resmap", resmap["message"])
  393. return errors.New(resmap["message"])
  394. }
  395. fmt.Println("resmap success", resmap["message"], resmap["success"])
  396. return err
  397. }
  398. func EASWebServicInsertPartsuselaid(SessionId, strJson, billType string) error { //billType采购入库单:006 销售出库单:007 其他入库单:008 其他出库单:009 领料出库单:100 生产入库单:101
  399. client := &http.Client{}
  400. resstr := ReplaceStrWebSevice("InsertPartsuselaidStr", "", "", "", "", "", "", SessionId, strJson, billType)
  401. body := bytes.NewBuffer([]byte(resstr))
  402. req, err := http.NewRequest("POST",
  403. user.Url+"/ormrpc/services/WSSCMWebServiceFacade?wsdl",
  404. body,
  405. )
  406. req.Header.Set("Content-Type", "text/xml")
  407. req.Header.Set("SOAPAction", "application/soap+xml")
  408. if err != nil {
  409. // handle error
  410. }
  411. resp, err := client.Do(req)
  412. if err != nil {
  413. fmt.Println(err)
  414. return err
  415. }
  416. defer resp.Body.Close()
  417. result_body, err := ioutil.ReadAll(resp.Body)
  418. if err != nil {
  419. fmt.Println(err)
  420. return err
  421. }
  422. v := Response{}
  423. err = xml.Unmarshal(result_body, &v)
  424. if err != nil {
  425. fmt.Println(err.Error())
  426. }
  427. println(string(result_body))
  428. resmap := make(map[string]interface{}, 0)
  429. if v.Body.ImportBillResponse.ImportBillReturn != "" {
  430. err = json.Unmarshal([]byte(v.Body.ImportBillResponse.ImportBillReturn), &resmap)
  431. fmt.Println(v.Body.ImportBillResponse.ImportBillReturn)
  432. //if len(resmap["billErrors"].([]interface{})) > 0 || resmap["status"] != "1" {
  433. //if resmap["status"] != "1" {
  434. // return errors.New(v.Body.ImportBillResponse.ImportBillReturn)
  435. //}
  436. }
  437. return nil
  438. }
  439. func ReplaceStrWebSevice(typeIn, userName, password, slnName, dcName, language, dbType, SessionId, strJson, billType string) string {
  440. res := ""
  441. switch typeIn {
  442. case "login":
  443. res = LoginStr
  444. res = strings.ReplaceAll(res, "userName?", userName)
  445. res = strings.ReplaceAll(res, "password?", password)
  446. res = strings.ReplaceAll(res, "slnName?", slnName)
  447. res = strings.ReplaceAll(res, "dcName?", dcName)
  448. res = strings.ReplaceAll(res, "language?", language)
  449. res = strings.ReplaceAll(res, "dbType?", dbType)
  450. case "logout":
  451. res = LogoutStr
  452. res = strings.ReplaceAll(res, "userName?", userName)
  453. res = strings.ReplaceAll(res, "slnName?", slnName)
  454. res = strings.ReplaceAll(res, "dcName?", dcName)
  455. res = strings.ReplaceAll(res, "language?", language)
  456. case "InsertParts":
  457. res = InsertPartsStr
  458. res = strings.ReplaceAll(res, "SessionId?", SessionId)
  459. res = strings.ReplaceAll(res, "strJson?", strJson)
  460. case "QureyPartsStr":
  461. res = QureyPartsStr
  462. res = strings.ReplaceAll(res, "SessionId?", SessionId)
  463. res = strings.ReplaceAll(res, "strJson?", strJson)
  464. case "InsertPartsuselaidStr":
  465. res = InsertPartsuselaidStr
  466. res = strings.ReplaceAll(res, "SessionId?", SessionId)
  467. res = strings.ReplaceAll(res, "strJson?", strJson)
  468. res = strings.ReplaceAll(res, "billType?", billType)
  469. case "QureyBill":
  470. res = QureyBill
  471. res = strings.ReplaceAll(res, "SessionId?", SessionId)
  472. res = strings.ReplaceAll(res, "strJson?", strJson)
  473. res = strings.ReplaceAll(res, "billType?", billType)
  474. }
  475. return res
  476. }