commodity_coal.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. package services
  2. import (
  3. "encoding/json"
  4. "eta/eta_data_analysis/models"
  5. "eta/eta_data_analysis/utils"
  6. "fmt"
  7. "github.com/tealeg/xlsx"
  8. "os"
  9. )
  10. func JsmHistory(path string) (err error) {
  11. defer func() {
  12. if err != nil {
  13. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  14. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  15. }
  16. }()
  17. //path := "/home/code/python/coal_mail/emailFile/沿海八省动力煤终端用户供耗存数据更新.xlsx"
  18. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省历史数据/442家晋陕蒙历史数据.xlsx"
  19. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\442家晋陕蒙历史数据.xlsx"
  20. var xlFile *xlsx.File
  21. exist, err := PathExists(path)
  22. if err != nil {
  23. fmt.Println(err)
  24. return
  25. }
  26. if exist {
  27. xlFile, err = xlsx.OpenFile(path)
  28. if err != nil {
  29. fmt.Println("OpenFile err:", err)
  30. return
  31. }
  32. } else {
  33. fmt.Println("Not Exist")
  34. return
  35. }
  36. //sheetData, err := json.Marshal(xlFile)
  37. //if err != nil {
  38. // fmt.Println("json.Marshal err:", err)
  39. // return
  40. //}
  41. sheetDatas := make([]models.SheetData, 0)
  42. data := *xlFile.Sheets[0]
  43. sheetData := models.SheetData{
  44. Name: data.Name,
  45. MaxRow: data.MaxRow,
  46. MaxCol: data.MaxCol,
  47. Hidden: data.Hidden,
  48. Selected: data.Selected,
  49. }
  50. rows := make([]models.Row, 0)
  51. for _, v := range data.Rows {
  52. cells := make([]models.Cell, 0)
  53. for _, cell := range v.Cells {
  54. cells = append(cells, models.Cell{
  55. Value: cell.String(),
  56. })
  57. }
  58. row := models.Row{
  59. Cells: cells,
  60. }
  61. rows = append(rows, row)
  62. }
  63. sheetData.Rows = rows
  64. sheetDatas = append(sheetDatas, sheetData)
  65. params := make(map[string]interface{})
  66. params["SheetData"] = sheetDatas
  67. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_JSM_HISTORY)
  68. if e != nil {
  69. b, _ := json.Marshal(params)
  70. fmt.Println(e)
  71. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  72. return
  73. }
  74. resp := new(models.BaseEdbLibResponse)
  75. if e := json.Unmarshal(result, &resp); e != nil {
  76. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  77. return
  78. }
  79. if resp.Ret != 200 {
  80. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  81. return
  82. }
  83. return
  84. }
  85. func CoastalHistory(path string) (err error) {
  86. defer func() {
  87. if err != nil {
  88. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  89. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  90. }
  91. }()
  92. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省历史数据/CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  93. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  94. var xlFile *xlsx.File
  95. exist, err := PathExists(path)
  96. if err != nil {
  97. fmt.Println(err)
  98. return
  99. }
  100. if exist {
  101. xlFile, err = xlsx.OpenFile(path)
  102. if err != nil {
  103. fmt.Println("OpenFile err:", err)
  104. return
  105. }
  106. } else {
  107. fmt.Println("Not Exist")
  108. return
  109. }
  110. sheetDatas := make([]models.SheetData, 0)
  111. for i, sheet := range xlFile.Sheets {
  112. if i < 4 {
  113. data := sheet
  114. sheetData := models.SheetData{
  115. Name: data.Name,
  116. MaxRow: data.MaxRow,
  117. MaxCol: data.MaxCol,
  118. Hidden: data.Hidden,
  119. Selected: data.Selected,
  120. }
  121. rows := make([]models.Row, 0)
  122. for _, v := range data.Rows {
  123. cells := make([]models.Cell, 0)
  124. for _, cell := range v.Cells {
  125. cells = append(cells, models.Cell{
  126. Value: cell.String(),
  127. })
  128. }
  129. row := models.Row{
  130. Cells: cells,
  131. }
  132. rows = append(rows, row)
  133. }
  134. sheetData.Rows = rows
  135. sheetDatas = append(sheetDatas, sheetData)
  136. }
  137. }
  138. params := make(map[string]interface{})
  139. params["SheetData"] = sheetDatas
  140. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_COASTAL_HISTORY)
  141. if e != nil {
  142. b, _ := json.Marshal(params)
  143. fmt.Println(e)
  144. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  145. return
  146. }
  147. resp := new(models.BaseEdbLibResponse)
  148. if e := json.Unmarshal(result, &resp); e != nil {
  149. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  150. return
  151. }
  152. if resp.Ret != 200 {
  153. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  154. return
  155. }
  156. return
  157. }
  158. func InlandHistory(path string) (err error) {
  159. defer func() {
  160. if err != nil {
  161. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  162. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  163. }
  164. }()
  165. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省历史数据/CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  166. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  167. var xlFile *xlsx.File
  168. exist, err := PathExists(path)
  169. if err != nil {
  170. fmt.Println(err)
  171. return
  172. }
  173. if exist {
  174. xlFile, err = xlsx.OpenFile(path)
  175. if err != nil {
  176. fmt.Println("OpenFile err:", err)
  177. return
  178. }
  179. } else {
  180. fmt.Println("Not Exist")
  181. return
  182. }
  183. sheetDatas := make([]models.SheetData, 0)
  184. for i, sheet := range xlFile.Sheets {
  185. if i > 3 {
  186. data := sheet
  187. sheetData := models.SheetData{
  188. Name: data.Name,
  189. MaxRow: data.MaxRow,
  190. MaxCol: data.MaxCol,
  191. Hidden: data.Hidden,
  192. Selected: data.Selected,
  193. }
  194. rows := make([]models.Row, 0)
  195. for _, v := range data.Rows {
  196. cells := make([]models.Cell, 0)
  197. for _, cell := range v.Cells {
  198. cells = append(cells, models.Cell{
  199. Value: cell.String(),
  200. })
  201. }
  202. row := models.Row{
  203. Cells: cells,
  204. }
  205. rows = append(rows, row)
  206. }
  207. sheetData.Rows = rows
  208. sheetDatas = append(sheetDatas, sheetData)
  209. }
  210. }
  211. params := make(map[string]interface{})
  212. params["SheetData"] = sheetDatas
  213. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_INLAND_HISTORY)
  214. if e != nil {
  215. b, _ := json.Marshal(params)
  216. fmt.Println(e)
  217. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  218. return
  219. }
  220. resp := new(models.BaseEdbLibResponse)
  221. if e := json.Unmarshal(result, &resp); e != nil {
  222. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  223. return
  224. }
  225. if resp.Ret != 200 {
  226. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  227. return
  228. }
  229. return
  230. }
  231. func PathExists(path string) (bool, error) {
  232. _, err := os.Stat(path)
  233. if err == nil { //文件或者目录存在
  234. return true, nil
  235. }
  236. if os.IsNotExist(err) {
  237. return false, nil
  238. }
  239. return false, err
  240. }
  241. func Jsm(path string) (err error) {
  242. defer func() {
  243. if err != nil {
  244. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  245. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  246. }
  247. }()
  248. //path := "/home/code/python/coal_mail/emailFile/沿海八省动力煤终端用户供耗存数据更新.xlsx"
  249. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省最新数据/442家晋陕蒙煤矿周度产量数据-20231201.xlsx"
  250. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\442家晋陕蒙历史数据.xlsx"
  251. var xlFile *xlsx.File
  252. exist, err := PathExists(path)
  253. if err != nil {
  254. fmt.Println(err)
  255. return
  256. }
  257. if exist {
  258. xlFile, err = xlsx.OpenFile(path)
  259. if err != nil {
  260. fmt.Println("OpenFile err:", err)
  261. return
  262. }
  263. } else {
  264. fmt.Println("Not Exist")
  265. return
  266. }
  267. sheetDatas := make([]models.SheetData, 0)
  268. data := *xlFile.Sheets[0]
  269. sheetData := models.SheetData{
  270. Name: data.Name,
  271. MaxRow: data.MaxRow,
  272. MaxCol: data.MaxCol,
  273. Hidden: data.Hidden,
  274. Selected: data.Selected,
  275. }
  276. rows := make([]models.Row, 0)
  277. for _, v := range data.Rows {
  278. cells := make([]models.Cell, 0)
  279. for _, cell := range v.Cells {
  280. cells = append(cells, models.Cell{
  281. Value: cell.String(),
  282. })
  283. }
  284. row := models.Row{
  285. Cells: cells,
  286. }
  287. rows = append(rows, row)
  288. }
  289. sheetData.Rows = rows
  290. sheetDatas = append(sheetDatas, sheetData)
  291. params := make(map[string]interface{})
  292. params["SheetData"] = sheetDatas
  293. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_JSM)
  294. if e != nil {
  295. b, _ := json.Marshal(params)
  296. fmt.Println(e)
  297. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  298. return
  299. }
  300. resp := new(models.BaseEdbLibResponse)
  301. if e := json.Unmarshal(result, &resp); e != nil {
  302. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  303. return
  304. }
  305. if resp.Ret != 200 {
  306. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  307. return
  308. }
  309. return
  310. }
  311. func Coastal(path string) (err error) {
  312. defer func() {
  313. if err != nil {
  314. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  315. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  316. }
  317. }()
  318. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省最新数据/内陆17省动力煤终端用户供耗存.xlsx"
  319. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  320. fmt.Println("沿海开始")
  321. var xlFile *xlsx.File
  322. exist, err := PathExists(path)
  323. if err != nil {
  324. fmt.Println(err)
  325. return
  326. }
  327. if exist {
  328. xlFile, err = xlsx.OpenFile(path)
  329. if err != nil {
  330. fmt.Println("OpenFile err:", err)
  331. return
  332. }
  333. } else {
  334. fmt.Println("Not Exist")
  335. return
  336. }
  337. sheetDatas := make([]models.SheetData, 0)
  338. for _, sheet := range xlFile.Sheets {
  339. data := sheet
  340. sheetData := models.SheetData{
  341. Name: data.Name,
  342. MaxRow: data.MaxRow,
  343. MaxCol: data.MaxCol,
  344. Hidden: data.Hidden,
  345. Selected: data.Selected,
  346. }
  347. rows := make([]models.Row, 0)
  348. for _, v := range data.Rows {
  349. cells := make([]models.Cell, 0)
  350. for _, cell := range v.Cells {
  351. cells = append(cells, models.Cell{
  352. Value: cell.String(),
  353. })
  354. }
  355. row := models.Row{
  356. Cells: cells,
  357. }
  358. rows = append(rows, row)
  359. }
  360. sheetData.Rows = rows
  361. fmt.Println("rows:", len(rows))
  362. sheetDatas = append(sheetDatas, sheetData)
  363. }
  364. fmt.Println("sheetDatas:", len(sheetDatas))
  365. params := make(map[string]interface{})
  366. params["SheetData"] = sheetDatas
  367. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_COASTAL)
  368. if e != nil {
  369. b, _ := json.Marshal(params)
  370. fmt.Println(e)
  371. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  372. return
  373. }
  374. resp := new(models.BaseEdbLibResponse)
  375. if e := json.Unmarshal(result, &resp); e != nil {
  376. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  377. return
  378. }
  379. if resp.Ret != 200 {
  380. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  381. return
  382. }
  383. return
  384. }
  385. func Inland(path string) (err error) {
  386. defer func() {
  387. if err != nil {
  388. fmt.Println("RefreshDataFromCoalCoastal Err:" + err.Error())
  389. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalCoastal, Err: %s", err))
  390. }
  391. }()
  392. //path := "/Users/xi/Desktop/瑞茂通-中国煤炭市场网数据/442家晋陕蒙、沿海8省、内陆17省最新数据/内陆17省动力煤终端用户供耗存.xlsx"
  393. //path := "D:\\瑞茂通-中国煤炭市场网数据\\442家晋陕蒙、沿海8省、内陆17省历史数据\\CⅢ-8-16 25省市库存和日耗情况(CCTD).xlsx"
  394. var xlFile *xlsx.File
  395. exist, err := PathExists(path)
  396. if err != nil {
  397. fmt.Println(err)
  398. return
  399. }
  400. if exist {
  401. xlFile, err = xlsx.OpenFile(path)
  402. if err != nil {
  403. fmt.Println("OpenFile err:", err)
  404. return
  405. }
  406. } else {
  407. fmt.Println("Not Exist")
  408. return
  409. }
  410. sheetDatas := make([]models.SheetData, 0)
  411. for _, sheet := range xlFile.Sheets {
  412. data := sheet
  413. sheetData := models.SheetData{
  414. Name: data.Name,
  415. MaxRow: data.MaxRow,
  416. MaxCol: data.MaxCol,
  417. Hidden: data.Hidden,
  418. Selected: data.Selected,
  419. }
  420. rows := make([]models.Row, 0)
  421. for _, v := range data.Rows {
  422. cells := make([]models.Cell, 0)
  423. for _, cell := range v.Cells {
  424. cells = append(cells, models.Cell{
  425. Value: cell.String(),
  426. })
  427. }
  428. row := models.Row{
  429. Cells: cells,
  430. }
  431. rows = append(rows, row)
  432. }
  433. sheetData.Rows = rows
  434. sheetDatas = append(sheetDatas, sheetData)
  435. }
  436. params := make(map[string]interface{})
  437. params["SheetData"] = sheetDatas
  438. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_INLAND)
  439. if e != nil {
  440. b, _ := json.Marshal(params)
  441. fmt.Println(e)
  442. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  443. return
  444. }
  445. resp := new(models.BaseEdbLibResponse)
  446. if e := json.Unmarshal(result, &resp); e != nil {
  447. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  448. return
  449. }
  450. if resp.Ret != 200 {
  451. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  452. return
  453. }
  454. return
  455. }
  456. func Mtjh(path string) (err error) {
  457. defer func() {
  458. if err != nil {
  459. fmt.Println("RefreshDataFromCoalMtjh Err:" + err.Error())
  460. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalMtjh, Err: %s", err))
  461. }
  462. }()
  463. //path = "/Users/xi/Desktop/煤炭江湖数据定制化服务——中国主流港口煤炭库存20231129.xlsx"
  464. var xlFile *xlsx.File
  465. exist, err := PathExists(path)
  466. if err != nil {
  467. fmt.Println(err)
  468. return
  469. }
  470. if exist {
  471. xlFile, err = xlsx.OpenFile(path)
  472. if err != nil {
  473. fmt.Println("OpenFile err:", err)
  474. return
  475. }
  476. } else {
  477. fmt.Println("Not Exist")
  478. return
  479. }
  480. sheetDatas := make([]models.SheetData, 0)
  481. for i, sheet := range xlFile.Sheets {
  482. if i > 0 {
  483. break
  484. }
  485. data := sheet
  486. sheetData := models.SheetData{
  487. Name: data.Name,
  488. MaxRow: data.MaxRow,
  489. MaxCol: data.MaxCol,
  490. Hidden: data.Hidden,
  491. Selected: data.Selected,
  492. }
  493. rows := make([]models.Row, 0)
  494. for _, v := range data.Rows {
  495. cells := make([]models.Cell, 0)
  496. for _, cell := range v.Cells {
  497. cells = append(cells, models.Cell{
  498. Value: cell.String(),
  499. })
  500. }
  501. row := models.Row{
  502. Cells: cells,
  503. }
  504. rows = append(rows, row)
  505. }
  506. sheetData.Rows = rows
  507. sheetDatas = append(sheetDatas, sheetData)
  508. }
  509. params := make(map[string]interface{})
  510. params["SheetData"] = sheetDatas
  511. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_MTJH)
  512. if e != nil {
  513. b, _ := json.Marshal(params)
  514. fmt.Println(e)
  515. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  516. return
  517. }
  518. resp := new(models.BaseEdbLibResponse)
  519. if e := json.Unmarshal(result, &resp); e != nil {
  520. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  521. return
  522. }
  523. if resp.Ret != 200 {
  524. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  525. return
  526. }
  527. return
  528. }
  529. func Firm(path string) (err error) {
  530. defer func() {
  531. if err != nil {
  532. fmt.Println("RefreshDataFromCoalFirm Err:" + err.Error())
  533. utils.FileLog.Info(fmt.Sprintf("RefreshDataFromCoalFirm, Err: %s", err))
  534. }
  535. }()
  536. //path = "/Users/xi/Desktop/煤炭江湖数据定制化服务——中国主流港口煤炭库存20231129.xlsx"
  537. var xlFile *xlsx.File
  538. exist, err := PathExists(path)
  539. if err != nil {
  540. fmt.Println(err)
  541. return
  542. }
  543. if exist {
  544. xlFile, err = xlsx.OpenFile(path)
  545. if err != nil {
  546. fmt.Println("OpenFile err:", err)
  547. return
  548. }
  549. } else {
  550. fmt.Println("Not Exist")
  551. return
  552. }
  553. sheetDatas := make([]models.SheetData, 0)
  554. for _, sheet := range xlFile.Sheets {
  555. data := sheet
  556. sheetData := models.SheetData{
  557. Name: data.Name,
  558. MaxRow: data.MaxRow,
  559. MaxCol: data.MaxCol,
  560. Hidden: data.Hidden,
  561. Selected: data.Selected,
  562. }
  563. rows := make([]models.Row, 0)
  564. for _, v := range data.Rows {
  565. cells := make([]models.Cell, 0)
  566. for _, cell := range v.Cells {
  567. cells = append(cells, models.Cell{
  568. Value: cell.String(),
  569. })
  570. }
  571. row := models.Row{
  572. Cells: cells,
  573. }
  574. rows = append(rows, row)
  575. }
  576. sheetData.Rows = rows
  577. sheetDatas = append(sheetDatas, sheetData)
  578. }
  579. params := make(map[string]interface{})
  580. params["SheetData"] = sheetDatas
  581. result, e := PostEdbLib(params, utils.LIB_ROUTE_COAL_MINE_FIRM)
  582. if e != nil {
  583. b, _ := json.Marshal(params)
  584. fmt.Println(e)
  585. utils.FileLog.Info(fmt.Sprintf("PostEdbLib err: %s, params: %s", e.Error(), string(b)))
  586. return
  587. }
  588. resp := new(models.BaseEdbLibResponse)
  589. if e := json.Unmarshal(result, &resp); e != nil {
  590. utils.FileLog.Info(fmt.Sprintf("json.Unmarshal err: %s", e))
  591. return
  592. }
  593. if resp.Ret != 200 {
  594. utils.FileLog.Info(fmt.Sprintf("Msg: %s, ErrMsg: %s", resp.Msg, resp.ErrMsg))
  595. return
  596. }
  597. return
  598. }