main.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. package main
  2. import (
  3. "encoding/json"
  4. "log"
  5. "mongodb"
  6. "os"
  7. qu "qfw/util"
  8. "qfw/util/elastic"
  9. "regexp"
  10. "strconv"
  11. "strings"
  12. // "github.com/lauyoume/gopinyin"
  13. "time"
  14. "github.com/tealeg/xlsx"
  15. )
  16. type Config struct {
  17. MgoAddr string `json:"mgoAddr"`
  18. MgoDbName string `json:"mgoDbName"`
  19. MgoColl string `json:"mgoColl"`
  20. MgoSize int `json:"mgoSize"`
  21. DataType int `json:"dataType"`
  22. ExportType int `json:"exportType"`
  23. TermFind map[string]interface{} `json:"termFind"`
  24. KeyWordFind map[string]map[string]interface{} `json:"keyWordFind"`
  25. Fields map[string]string `json:"fields"`
  26. FieldSort []string `json:"fieldSort"`
  27. }
  28. var (
  29. sysConfig Config
  30. Mgo *mongodb.MongodbSim
  31. SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
  32. ClearHtml = regexp.MustCompile("<[^>]*>")
  33. ClearOther = regexp.MustCompile("[\n\r\\s\u3000\u2003\u00a0]")
  34. Es *elastic.Elastic
  35. MaxWorker = os.Getenv("MAX_WORKERS")
  36. MaxQueue = os.Getenv("MAX_QUEUE")
  37. // industry = []string{"烟草", "军队", "教育", "公安", "税务", "能源", "金融", "数字政府", "水利", "应急管理", "公路", "生态环境", "纪委", "自然资源", "运营商", "机场", "法院", "检察院", "铁路", "轨道交通"}
  38. )
  39. func init() {
  40. qu.ReadConfig(&sysConfig)
  41. log.Println("配置加载成功")
  42. Mgo = &mongodb.MongodbSim{
  43. MongodbAddr: "172.17.145.163:27083,172.17.4.187:27082",
  44. DbName: "mixdata",
  45. Size: 20,
  46. UserName: "JS3Z_Rbid_ProG",
  47. Password: "JS3Z@B5I3aR7Ch",
  48. }
  49. Mgo.InitPool()
  50. log.Println("数据库加载成功")
  51. }
  52. // 生成xlsx
  53. func GetXlsx(mMap []map[string]interface{}, item string) {
  54. xf, err := xlsx.OpenFile("./fields.xlsx")
  55. if err != nil {
  56. log.Println("fields file not foud", err.Error())
  57. }
  58. dataType := sysConfig.DataType
  59. if dataType == 1 {
  60. sh := xf.Sheets[0]
  61. for i, v := range mMap {
  62. row := sh.AddRow()
  63. row.AddCell().SetInt(i + 1)
  64. row.AddCell().SetValue(v["matchkey"])
  65. row.AddCell().SetValue(v["area"])
  66. row.AddCell().SetValue(v["city"])
  67. row.AddCell().SetValue(v["title"])
  68. row.AddCell().SetValue(v["subtype"])
  69. if v["publishtime"] != nil {
  70. row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
  71. } else {
  72. row.AddCell()
  73. }
  74. row.AddCell().SetValue(v["buyer"])
  75. row.AddCell().SetValue(v["winner"])
  76. if v["bidamount"] != nil {
  77. row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
  78. } else {
  79. row.AddCell()
  80. }
  81. row.AddCell().SetValue(v["projectname"])
  82. row.AddCell().SetValue(v["detail"])
  83. row.AddCell().SetValue(v["jybxhref"])
  84. ids := SE.EncodeString(qu.ObjToString(v["id"]))
  85. row.AddCell().SetValue(ids)
  86. // row.AddCell().SetValue(v["buyerclass"])
  87. // row.AddCell().SetValue(v["buyer_level"])
  88. // row.AddCell().SetValue(v["s_winner_new"])
  89. // row.AddCell().SetValue(v["winner_level"])
  90. // row.AddCell().SetValue(v["company_area"])
  91. // row.AddCell().SetValue(v["company_city"])
  92. // row.AddCell().SetValue(v["key_all"])
  93. // row.AddCell().SetValue(v["href"])
  94. // row.AddCell().SetValue(v["id_1"])
  95. }
  96. xf.Sheets = xf.Sheets[0:1]
  97. } else if dataType == 2 {
  98. sh := xf.Sheets[1]
  99. for _, v := range mMap {
  100. row := sh.AddRow()
  101. // row.AddCell().SetInt(i + 1)
  102. row.AddCell().SetValue(v["matchkey"])
  103. row.AddCell().SetValue(v["area"])
  104. row.AddCell().SetValue(v["city"])
  105. row.AddCell().SetValue(v["title"])
  106. row.AddCell().SetValue(v["subtype"])
  107. row.AddCell().SetValue(v["detail"])
  108. if v["publishtime"] != nil {
  109. row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
  110. } else {
  111. row.AddCell()
  112. }
  113. row.AddCell().SetValue(v["href"])
  114. row.AddCell().SetValue(v["jybxhref"])
  115. row.AddCell().SetValue(v["projectname"])
  116. row.AddCell().SetValue(v["projectcode"])
  117. row.AddCell().SetValue(v["projectscope"])
  118. if v["budget"] != nil {
  119. row.AddCell().SetFloat(qu.Float64All(v["budget"]))
  120. } else {
  121. row.AddCell()
  122. }
  123. if v["bidamount"] != nil {
  124. row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
  125. } else {
  126. row.AddCell()
  127. }
  128. if v["bidopentime"] != nil {
  129. row.AddCell().SetValue(time.Unix(qu.Int64All(v["bidopentime"]), 0).Format("2006-01-02"))
  130. } else {
  131. row.AddCell()
  132. }
  133. row.AddCell().SetValue(v["buyer"])
  134. row.AddCell().SetValue(v["buyerperson"])
  135. row.AddCell().SetValue(v["buyertel"])
  136. row.AddCell().SetValue(v["agency"])
  137. row.AddCell().SetValue(v["s_winner"])
  138. row.AddCell().SetValue(v["winnerperson"])
  139. row.AddCell().SetValue(v["winnertel"])
  140. row.AddCell().SetValue(v["legal_person"])
  141. row.AddCell().SetValue(v["company_phone"])
  142. row.AddCell().SetValue(v["company_email"])
  143. ids := SE.EncodeString(qu.ObjToString(v["id"]))
  144. row.AddCell().SetValue(ids)
  145. if v["contact"] != nil {
  146. jsonStr, _ := json.Marshal(v["contact"])
  147. json1 := strings.ReplaceAll(string(jsonStr), "contact_person", "联系人")
  148. json2 := strings.ReplaceAll(json1, "phone", "联系电话")
  149. json3 := strings.ReplaceAll(json2, "winner", "中标企业")
  150. row.AddCell().SetValue(json3)
  151. } else {
  152. row.AddCell()
  153. }
  154. // row.AddCell().SetValue(v["buyerclass"])
  155. // row.AddCell().SetValue(v["filetext"])
  156. // row.AddCell().SetValue(v["company_address"])
  157. // row.AddCell().SetValue(v["tagname"])
  158. // row.AddCell().SetValue(time.Unix(qu.Int64All(v["createtime"]), 0).Format("2006-01-02"))
  159. // projectIds := SE.EncodeString(qu.ObjToString(v["projectId"]))
  160. // row.AddCell().SetValue(projectIds) //项目标识
  161. // row.AddCell().SetValue(v["bud_to_bid"])
  162. // row.AddCell().SetValue(v["company_area"])
  163. // row.AddCell().SetValue(v["company_city"])
  164. // row.AddCell().SetValue(v["company_district"])
  165. // row.AddCell().SetValue(v["company_address"])
  166. }
  167. xf.Sheets = xf.Sheets[1:2]
  168. } else if dataType == 3 {
  169. sh := xf.Sheets[2]
  170. for _, v := range mMap {
  171. row := sh.AddRow()
  172. // row.AddCell().SetInt(i + 1)
  173. row.AddCell().SetValue(v["departname"])
  174. row.AddCell().SetValue(v["rulename"])
  175. row.AddCell().SetValue(v["matchkey"])
  176. row.AddCell().SetValue(v["toptype"])
  177. row.AddCell().SetValue(v["area"])
  178. row.AddCell().SetValue(v["city"])
  179. row.AddCell().SetValue(v["district"])
  180. row.AddCell().SetValue(v["title"])
  181. row.AddCell().SetValue(v["detail"])
  182. if v["publishtime"] != nil {
  183. row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
  184. } else {
  185. row.AddCell()
  186. }
  187. row.AddCell().SetValue(v["href"])
  188. if v["bidamount"] != nil {
  189. row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
  190. } else {
  191. row.AddCell()
  192. }
  193. row.AddCell().SetValue(v["purchasing"])
  194. row.AddCell().SetValue(v["buyer"])
  195. row.AddCell().SetValue(v["buyerclass"])
  196. row.AddCell().SetValue(v["buyerperson"])
  197. row.AddCell().SetValue(v["buyertel"])
  198. row.AddCell().SetValue(v["buyer_credit_no"])
  199. row.AddCell().SetValue(v["rank"])
  200. row.AddCell().SetValue(v["s_winner"])
  201. row.AddCell().SetValue(v["legal_person"])
  202. row.AddCell().SetValue(v["company_phone"])
  203. row.AddCell().SetValue(v["winner_credit_no"])
  204. row.AddCell().SetValue(v["company_address"])
  205. row.AddCell().SetValue(v["capital"])
  206. row.AddCell().SetValue(v["establish_date"])
  207. row.AddCell().SetValue(v["business_scope"])
  208. row.AddCell().SetValue(v["stock_name"])
  209. ids := SE.EncodeString(qu.ObjToString(v["id"]))
  210. row.AddCell().SetValue(ids)
  211. }
  212. xf.Sheets = xf.Sheets[2:3]
  213. } else if dataType == 4 {
  214. sh := xf.Sheets[3]
  215. for _, v := range mMap {
  216. row := sh.AddRow()
  217. row.AddCell().SetValue(v["departname"])
  218. row.AddCell().SetValue(v["rulename"])
  219. row.AddCell().SetValue(v["matchkey"])
  220. row.AddCell().SetValue(v["area"])
  221. row.AddCell().SetValue(v["city"])
  222. row.AddCell().SetValue(v["title"])
  223. row.AddCell().SetValue(v["subtype"])
  224. row.AddCell().SetValue(v["detail"])
  225. if v["publishtime"] != nil {
  226. row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
  227. } else {
  228. row.AddCell()
  229. }
  230. row.AddCell().SetValue(v["href"])
  231. row.AddCell().SetValue(v["jybxhref"])
  232. row.AddCell().SetValue(v["projectname"])
  233. row.AddCell().SetValue(v["projectcode"])
  234. row.AddCell().SetValue(v["projectscope"])
  235. if v["budget"] != nil {
  236. row.AddCell().SetFloat(qu.Float64All(v["budget"]))
  237. } else {
  238. row.AddCell()
  239. }
  240. if v["bidamount"] != nil {
  241. row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
  242. } else {
  243. row.AddCell()
  244. }
  245. if v["bidopentime"] != nil {
  246. row.AddCell().SetValue(time.Unix(qu.Int64All(v["bidopentime"]), 0).Format("2006-01-02"))
  247. } else {
  248. row.AddCell()
  249. }
  250. row.AddCell().SetValue(v["buyer"])
  251. row.AddCell().SetValue(v["buyerperson"])
  252. row.AddCell().SetValue(v["buyertel"])
  253. row.AddCell().SetValue(v["agency"])
  254. row.AddCell().SetValue(v["winner"])
  255. row.AddCell().SetValue(v["winnerperson"])
  256. row.AddCell().SetValue(v["winnertel"])
  257. row.AddCell().SetValue(v["legal_person"])
  258. row.AddCell().SetValue(v["company_phone"])
  259. row.AddCell().SetValue(v["company_email"])
  260. ids := SE.EncodeString(qu.ObjToString(v["id"]))
  261. row.AddCell().SetValue(ids)
  262. row.AddCell().SetValue(v["company_address"])
  263. jsonStr, _ := json.Marshal(v["contact"])
  264. row.AddCell().SetValue(jsonStr)
  265. }
  266. xf.Sheets = xf.Sheets[3:4]
  267. } else if dataType == 5 {
  268. sh := xf.Sheets[4]
  269. //if isfile {
  270. // cell := sh.Rows[0].AddCell()
  271. // cell.SetValue("附件")
  272. // cell.SetStyle(style)
  273. //}
  274. for _, v := range mMap {
  275. row := sh.AddRow()
  276. // row.AddCell().SetInt(i + 1)
  277. row.AddCell().SetValue(v["matchkey"]) //信息匹配词
  278. row.AddCell().SetValue(v["city"]) //城市
  279. row.AddCell().SetValue(v["district"]) //县区
  280. row.AddCell().SetValue(v["projectname"]) //项目名称
  281. row.AddCell().SetValue(v["buyer"]) //采购单位
  282. row.AddCell().SetValue(v["tagname"])
  283. // row.AddCell().SetValue(v["buyer_type"]) //采购单位类别---私有标签tagname
  284. if v["bidamount"] != nil { //中标金额
  285. row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
  286. } else {
  287. row.AddCell()
  288. }
  289. if v["budget"] != nil { //预算
  290. row.AddCell().SetFloat(qu.Float64All(v["budget"]))
  291. } else {
  292. row.AddCell()
  293. }
  294. if v["publishtime"] != nil { //公告发布时间
  295. row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
  296. } else {
  297. row.AddCell()
  298. }
  299. if v["bidopentime"] != nil { //开标日期
  300. row.AddCell().SetValue(time.Unix(qu.Int64All(v["bidopentime"]), 0).Format("2006-01-02"))
  301. } else {
  302. row.AddCell()
  303. }
  304. row.AddCell().SetValue(v["s_winner"]) //中标单位
  305. row.AddCell().SetValue(v["winner_type"]) //中标模式--移动、电信、联通
  306. row.AddCell().SetValue(v["title"]) //公告标题
  307. row.AddCell().SetValue(v["subtype"]) //公告类别
  308. row.AddCell().SetValue(v["area"]) //省份
  309. row.AddCell().SetValue(v["projectcode"]) //项目编号
  310. row.AddCell().SetValue(v["projectscope"]) //项目范围
  311. row.AddCell().SetValue(v["agency"]) //招标代理机构
  312. row.AddCell().SetValue(v["detail"]) //公告内容
  313. row.AddCell().SetValue(v["href"]) //公告地址
  314. row.AddCell().SetValue(v["buyerperson"]) //采购单位联系人
  315. row.AddCell().SetValue(v["buyertel"]) //采购单位联系电话
  316. row.AddCell().SetValue(v["winnerperson"]) //中标单位联系人
  317. row.AddCell().SetValue(v["winnertel"]) //中标单位联系电话
  318. row.AddCell().SetValue(v["legal_person"]) //中标企业联系人
  319. row.AddCell().SetValue(v["company_phone"]) //中标企业联系电话
  320. row.AddCell().SetValue(v["company_email"]) //中标企业邮箱
  321. ids := SE.EncodeString(qu.ObjToString(v["id"])) //唯一标识
  322. row.AddCell().SetValue(ids)
  323. projectIds := SE.EncodeString(qu.ObjToString(v["projectId"]))
  324. row.AddCell().SetValue(projectIds) //项目标识
  325. row.AddCell().SetValue(v["jybxhref"]) //剑鱼标讯地址
  326. //row.AddCell().SetValue(v["projectcode"])
  327. }
  328. xf.Sheets = xf.Sheets[4:5]
  329. } else {
  330. sh := xf.Sheets[5]
  331. for _, v := range mMap {
  332. row := sh.AddRow()
  333. row.AddCell().SetValue(v["title"])
  334. row.AddCell().SetValue(v["toptype"])
  335. row.AddCell().SetValue(v["subtype"])
  336. row.AddCell().SetValue(v["area"])
  337. row.AddCell().SetValue(v["city"])
  338. row.AddCell().SetValue(v["district"])
  339. row.AddCell().SetValue(v["s_topscopeclass"])
  340. row.AddCell().SetValue(v["publishtime_1"])
  341. row.AddCell().SetValue(v["comeintime_1"])
  342. row.AddCell().SetValue(v["projectcode"])
  343. row.AddCell().SetValue(v["buyer"])
  344. row.AddCell().SetValue(v["buyerperson"])
  345. row.AddCell().SetValue(v["buyertel"])
  346. row.AddCell().SetValue(v["buyeraddr"])
  347. row.AddCell().SetValue(v["projectname"])
  348. row.AddCell().SetValue(v["agency"])
  349. row.AddCell().SetValue(v["agencyperson"])
  350. row.AddCell().SetValue(v["agencytel"])
  351. row.AddCell().SetValue(v["agencyaddr"])
  352. row.AddCell().SetValue(v["s_winner"])
  353. row.AddCell().SetValue(v["winnerperson"])
  354. row.AddCell().SetValue(v["winnertel"])
  355. row.AddCell().SetValue(v["winneraddr"])
  356. row.AddCell().SetValue(v["winnerorder"])
  357. row.AddCell().SetValue(v["budget"])
  358. row.AddCell().SetValue(v["bidamount"])
  359. row.AddCell().SetValue(v["href"])
  360. row.AddCell().SetValue(v["site"])
  361. row.AddCell().SetValue(v["detail"])
  362. row.AddCell().SetValue(v["purchasing"])
  363. row.AddCell().SetValue(v["funds"])
  364. row.AddCell().SetValue(v["projectscope"])
  365. row.AddCell().SetValue(v["jybxhref"])
  366. row.AddCell().SetValue(v["id_1"])
  367. // mapB, _ := json.Marshal(v["purchasinglist"])
  368. // row.AddCell().SetValue(string(mapB))
  369. }
  370. xf.Sheets = xf.Sheets[5:6]
  371. }
  372. xf.Sheets[0].Name = "详细数据"
  373. //生文件
  374. // t := strconv.FormatInt(time.Now().Unix(), 10)
  375. t := "20210419"
  376. dir := "./xlsx/" + t + "/"
  377. if b, _ := PathExists(dir); !b {
  378. err1 := os.MkdirAll(dir, os.ModePerm)
  379. if err1 != nil {
  380. log.Println("mkdir err", dir)
  381. }
  382. }
  383. // fname := "_" + t + ".xlsx"
  384. fname := item + ".xlsx"
  385. err = xf.Save(dir + fname)
  386. if err != nil {
  387. log.Println("xls error", fname)
  388. }
  389. }
  390. func GetXlsxs(mMap []map[string]interface{}) {
  391. xf, err := xlsx.OpenFile("./fields.xlsx")
  392. if err != nil {
  393. log.Println("fields file not foud", err.Error())
  394. }
  395. xf.Sheets[0] = &xlsx.Sheet{}
  396. sh := xf.Sheets[0]
  397. rows := sh.AddRow()
  398. for _, f := range sysConfig.FieldSort {
  399. if sysConfig.Fields[f] != "" {
  400. rows.AddCell().SetValue(sysConfig.Fields[f])
  401. }
  402. }
  403. for _, v := range mMap {
  404. v["cancel_date"] = strings.ReplaceAll(qu.ObjToString(v["cancel_date"]), "-", "/")
  405. v["establish_date"] = strings.ReplaceAll(qu.ObjToString(v["establish_date"]), "-", "/")
  406. v["issue_date"] = strings.ReplaceAll(qu.ObjToString(v["issue_date"]), "-", "/")
  407. v["operation_startdate"] = strings.ReplaceAll(qu.ObjToString(v["operation_startdate"]), "-", "/")
  408. v["operation_enddate"] = strings.ReplaceAll(qu.ObjToString(v["operation_enddate"]), "-", "/")
  409. v["revoke_date"] = strings.ReplaceAll(qu.ObjToString(v["revoke_date"]), "-", "/")
  410. v["company_id"] = qu.EncodeArticleId2ByCheck(mongodb.BsonIdToSId(v["_id"]))
  411. row := sh.AddRow()
  412. for _, f := range sysConfig.FieldSort {
  413. cell := row.AddCell()
  414. for kk, vvv := range v {
  415. if f == kk {
  416. if vvv != nil {
  417. cell.SetValue(vvv)
  418. }
  419. }
  420. }
  421. }
  422. delete(v, "_id")
  423. }
  424. xf.Sheets = xf.Sheets[0:1]
  425. xf.Sheets[0].Name = "详细数据"
  426. //生文件
  427. t := strconv.FormatInt(time.Now().Unix(), 10)
  428. dir := "./xlsx/" + t + "/"
  429. if b, _ := PathExists(dir); !b {
  430. err1 := os.MkdirAll(dir, os.ModePerm)
  431. if err1 != nil {
  432. log.Println("mkdir err", dir)
  433. }
  434. }
  435. fname := "_" + t + ".xlsx"
  436. err = xf.Save(dir + fname)
  437. if err != nil {
  438. log.Println("xls error", fname)
  439. }
  440. }
  441. func PathExists(path string) (bool, error) {
  442. _, err := os.Stat(path)
  443. if err == nil {
  444. return true, nil
  445. }
  446. if os.IsNotExist(err) {
  447. return false, nil
  448. }
  449. return false, err
  450. }
  451. func main() {
  452. query := map[string]interface{}{}
  453. log.Println("config", sysConfig)
  454. if sysConfig.TermFind != nil && len(sysConfig.TermFind) > 0 {
  455. for k, v := range sysConfig.TermFind {
  456. query[k] = v
  457. }
  458. }
  459. if sysConfig.KeyWordFind != nil && len(sysConfig.KeyWordFind) > 0 {
  460. for k, v := range sysConfig.KeyWordFind {
  461. keyMap := map[string]interface{}{}
  462. for kk, vv := range v {
  463. keyMap[kk] = vv
  464. }
  465. query[k] = keyMap
  466. }
  467. }
  468. log.Println("查询条件 ", query)
  469. count, session := 0, Mgo.GetMgoConn()
  470. defer func() {
  471. Mgo.DestoryMongoConn(session)
  472. }()
  473. iter := session.DB("mixdata").C("qyxy_wuhu").Find(&query).Sort("_id").Iter()
  474. data := []map[string]interface{}{}
  475. thisData := map[string]interface{}{}
  476. for {
  477. if !iter.Next(&thisData) {
  478. break
  479. }
  480. count++
  481. log.Println("第", count, "条")
  482. data = append(data, thisData)
  483. }
  484. // data, ok := Mgo.Find("qyxy_wuhu", query, nil, `{"_id":1,"winnerorder":1}`, false, -1, -1)
  485. // if ok && data != nil && len(*data) > 0 {
  486. // log.Println("数据条数 ", len(*data))
  487. // if sysConfig.ExportType == 0 {
  488. // GetXlsx(*data, "1")
  489. // } else if sysConfig.ExportType == 1 {
  490. // GetXlsxs(*data)
  491. // }
  492. // log.Println("生成excel成功")
  493. // }
  494. if len(data) > 0 {
  495. log.Println("数据条数 ", len(data))
  496. if sysConfig.ExportType == 0 {
  497. GetXlsx(data, "1")
  498. } else if sysConfig.ExportType == 1 {
  499. GetXlsxs(data)
  500. }
  501. log.Println("生成excel成功")
  502. }
  503. }