|
@@ -1,6 +1,14 @@
|
|
package main
|
|
package main
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "fmt"
|
|
|
|
+ "github.com/flipped-aurora/gin-vue-admin/server/core"
|
|
|
|
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
|
|
|
|
+ "github.com/flipped-aurora/gin-vue-admin/server/initialize"
|
|
|
|
+ "github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
|
|
|
|
+ "github.com/flipped-aurora/gin-vue-admin/server/service"
|
|
|
|
+ "github.com/xuri/excelize/v2"
|
|
|
|
+ "strings"
|
|
"testing"
|
|
"testing"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -10,9 +18,9 @@ func TestName(t *testing.T) {
|
|
//vi:="gIEEvlb9cEjErJxZ5sflrw=="
|
|
//vi:="gIEEvlb9cEjErJxZ5sflrw=="
|
|
//phone , _ := weapp.DecryptMobile(ssk, r, vi)
|
|
//phone , _ := weapp.DecryptMobile(ssk, r, vi)
|
|
//fmt.Print(phone)
|
|
//fmt.Print(phone)
|
|
- //global.GVA_VP = core.Viper() // 初始化Viper
|
|
|
|
- //global.GVA_LOG = core.Zap() // 初始化zap日志库
|
|
|
|
- //global.GVA_DB = initialize.Gorm() // gorm连接数据库
|
|
|
|
|
|
+ global.GVA_VP = core.Viper() // 初始化Viper
|
|
|
|
+ global.GVA_LOG = core.Zap() // 初始化zap日志库
|
|
|
|
+ global.GVA_DB = initialize.Gorm() // gorm连接数据库
|
|
//var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
|
|
//var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
|
|
//f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
|
|
//f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
|
|
//files := f.GetSheetList()
|
|
//files := f.GetSheetList()
|
|
@@ -44,4 +52,19 @@ func TestName(t *testing.T) {
|
|
// j++
|
|
// j++
|
|
// fmt.Println()
|
|
// fmt.Println()
|
|
//}
|
|
//}
|
|
|
|
+ var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
|
|
|
|
+ f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
|
|
|
|
+ files := f.GetSheetList()
|
|
|
|
+ for _, sheet := range files {
|
|
|
|
+ rows, _ := f.GetRows(sheet)
|
|
|
|
+ for _, row := range rows {
|
|
|
|
+ if len(row) > 1 && row[1] != "" {
|
|
|
|
+ fmt.Printf("\t%v", row[0])
|
|
|
|
+ places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1),Position:strings.Replace(row[1], "\n", "", -1) ,
|
|
|
|
+ Type:strings.Replace(row[2], "\n", "", -1),Region:strings.Replace(row[3], "\n", "", -1) })
|
|
|
|
+ fmt.Println()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ fmt.Println()
|
|
|
|
+ }
|
|
}
|
|
}
|