diff --git a/README.md b/README.md index 49476f4..d2470e8 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,12 @@ golang web服务框架 支持数据库db:mysql、sqlite3 支持缓存cache:redis,memory,数据库 自带工具类,上下文,以及session等功能 - +下载分析接口 +http://192.168.6.27:8081/app/analyse/home_excel?org_id=4 +使用方式直接后台上传 +分析使用接口 +http://127.0.0.1:8081/admin/test/analyse?org_id=4 +整体分析接口 +http://127.0.0.1:8081/admin/company_inout/total_analyse?org_id=4 +行业分析接口 +http://127.0.0.1:8081/admin/company_inout/industry_analyse?org_id=4 \ No newline at end of file diff --git a/example/admin/companyinout.go b/example/admin/companyinout.go index aee8dea..d737b66 100644 --- a/example/admin/companyinout.go +++ b/example/admin/companyinout.go @@ -1,7 +1,7 @@ package admin import ( - . "../../../hotime" + . "../../../iedc-go" . "../../common" "fmt" "github.com/chain-zhang/pinyin" diff --git a/example/admin/org3.go b/example/admin/org3.go index 9231e78..7f5fdc1 100644 --- a/example/admin/org3.go +++ b/example/admin/org3.go @@ -1,7 +1,7 @@ package admin import ( - . "../../../hotime" + . "../../../iedc-go" . "../../common" "fmt" "github.com/chain-zhang/pinyin" diff --git a/example/admin/test.go b/example/admin/test.go index 3ccc3d2..b43a5f8 100644 --- a/example/admin/test.go +++ b/example/admin/test.go @@ -1,7 +1,7 @@ package admin import ( - . "../../../hotime" + . "../../../iedc-go" . "../../common" "../../dri/baidu" "fmt" diff --git a/example/app/analyse.go b/example/app/analyse.go index a871508..de324be 100644 --- a/example/app/analyse.go +++ b/example/app/analyse.go @@ -1,7 +1,7 @@ package app import ( - . "../../../hotime" + . "../../../iedc-go" . "../../common" "fmt" "github.com/xuri/excelize" @@ -64,6 +64,7 @@ var analyseCtr = Ctr{ filePath := "temp/home" + ObjToStr(orgId) + ".xlsx" f, e := excelize.OpenFile(this.Config.GetString("tpt") + "/" + filePath) + //fmt.Println(e) // 设置单元格的值 tagCompany1 := this.Db.Select("tag", "*", Map{"AND": Map{"type": 2, "org_id": orgId}, "ORDER": Slice{"`sort` DESC", "id ASC"}}) if e != nil { @@ -77,38 +78,39 @@ var analyseCtr = Ctr{ f.NewSheet("“3”项定性") f.NewSheet("“N”项特色") f.DeleteSheet("Sheet1") + } - //cs := append(NewCompanys{}, companys...) - f.SetCellValue("企业分析", convertToTitle(1)+"1", "企业名") - for k, tag := range tagCompany1 { + //cs := append(NewCompanys{}, companys...) + f.SetCellValue("企业分析", convertToTitle(1)+"1", "企业名") + for k, tag := range tagCompany1 { - f.SetCellValue("企业分析", convertToTitle(k+2)+"1", tag.GetString("name")) - - } - - // 设置单元格的值 - f.SetCellValue("IEDC全局分析", "A1", "指标项") - f.SetCellValue("IEDC全局分析", "B1", "指标值") - // 设置单元格的值 - f.SetCellValue("“6”项量化", "A1", "指标项") - f.SetCellValue("“6”项量化", "B1", "指标值") - // 设置单元格的值 - f.SetCellValue("“3”项定性", "A1", "指标项") - f.SetCellValue("“3”项定性", "B1", "指标值") - // 设置单元格的值 - f.SetCellValue("“N”项特色", "A1", "指标项") - f.SetCellValue("“N”项特色", "B1", "指标值") - - os.MkdirAll(this.Config.GetString("tpt")+"/temp/", os.ModeDir) - // 根据指定路径保存文件 - if err := f.SaveAs(this.Config.GetString("tpt") + "/" + filePath); err != nil { - fmt.Println(err) - this.Display(4, "输出异常") - return - } + f.SetCellValue("企业分析", convertToTitle(k+2)+"1", tag.GetString("name")) } + // 设置单元格的值 + f.SetCellValue("IEDC全局分析", "A1", "指标项") + f.SetCellValue("IEDC全局分析", "B1", "指标值") + // 设置单元格的值 + f.SetCellValue("“6”项量化", "A1", "指标项") + f.SetCellValue("“6”项量化", "B1", "指标值") + // 设置单元格的值 + f.SetCellValue("“3”项定性", "A1", "指标项") + f.SetCellValue("“3”项定性", "B1", "指标值") + // 设置单元格的值 + f.SetCellValue("“N”项特色", "A1", "指标项") + f.SetCellValue("“N”项特色", "B1", "指标值") + + os.MkdirAll(this.Config.GetString("tpt")+"/temp/", os.ModeDir) + // 根据指定路径保存文件 + if err := f.SaveAs(this.Config.GetString("tpt") + "/" + filePath); err != nil { + fmt.Println(err) + this.Display(4, "输出异常") + return + } + + //} + run := func(str string, data Map, f *excelize.File) { var keys []string for k := range data { diff --git a/example/app/category.go b/example/app/category.go index 044c292..9e747c2 100644 --- a/example/app/category.go +++ b/example/app/category.go @@ -1,8 +1,8 @@ package app import ( - . "../../../hotime" - . "../../../hotime/common" + . "../../../iedc-go" + . "../../common" //"strings" ) diff --git a/example/app/init.go b/example/app/init.go index 97d2200..052d9fd 100644 --- a/example/app/init.go +++ b/example/app/init.go @@ -1,8 +1,8 @@ package app import ( - . "../../../hotime" - . "../../../hotime/common" + . "../../../iedc-go" + . "../../common" "../../dri/aliyun" "../../dri/tencent" "fmt" diff --git a/example/app/question.go b/example/app/question.go index 8835b9b..6b7e755 100644 --- a/example/app/question.go +++ b/example/app/question.go @@ -1,8 +1,8 @@ package app import ( - . "../../../hotime" - . "../../../hotime/common" + . "../../../iedc-go" + . "../../common" "fmt" "time" //"strings" diff --git a/example/app/sms.go b/example/app/sms.go index f7651b4..983fa64 100644 --- a/example/app/sms.go +++ b/example/app/sms.go @@ -1,7 +1,7 @@ package app import ( - . "../../../hotime" + . "../../../iedc-go" "../../dri/ddsms" ) diff --git a/example/app/tag.go b/example/app/tag.go index af45e6c..d7fe562 100644 --- a/example/app/tag.go +++ b/example/app/tag.go @@ -1,7 +1,7 @@ package app import ( - . "../../../hotime" + . "../../../iedc-go" . "../../common" ) diff --git a/example/app/user.go b/example/app/user.go index 5743dab..56a5a03 100644 --- a/example/app/user.go +++ b/example/app/user.go @@ -1,10 +1,10 @@ package app import ( - . "../../../hotime" - . "../../../hotime/common" - "../../../hotime/dri/download" - "../../../hotime/dri/tencent" + . "../../../iedc-go" + . "../../common" + "../../dri/download" + "../../dri/tencent" "encoding/base64" "fmt" "io/ioutil" diff --git a/example/app/wechat.go b/example/app/wechat.go index 23c325c..e2ad3fb 100644 --- a/example/app/wechat.go +++ b/example/app/wechat.go @@ -1,9 +1,9 @@ package app import ( - . "../../../hotime" - . "../../../hotime/cache" - . "../../../hotime/common" + . "../../../iedc-go" + . "../../../iedc-go/cache" + . "../../../iedc-go/common" "fmt" "github.com/silenceper/wechat" "github.com/silenceper/wechat/cache" diff --git a/example/iedc.exe b/example/iedc.exe index e019305..c126262 100644 Binary files a/example/iedc.exe and b/example/iedc.exe differ diff --git a/example/main.go b/example/main.go index 1f2a71a..e90a70a 100644 --- a/example/main.go +++ b/example/main.go @@ -1,7 +1,7 @@ package main import ( - "../../hotime" + "../../iedc-go" "strings" //"../dri/aliyun" diff --git a/example/tpt/temp/home32022-03-02-00-17-33.xlsx b/example/tpt/temp/home32022-03-02-00-17-33.xlsx deleted file mode 100644 index 2bcac90..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-17-33.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-24-12.xlsx b/example/tpt/temp/home32022-03-02-00-24-12.xlsx deleted file mode 100644 index f6c2424..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-24-12.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-24-15.xlsx b/example/tpt/temp/home32022-03-02-00-24-15.xlsx deleted file mode 100644 index e56408d..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-24-15.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-26-10.xlsx b/example/tpt/temp/home32022-03-02-00-26-10.xlsx deleted file mode 100644 index c7474df..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-26-10.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-26-16.xlsx b/example/tpt/temp/home32022-03-02-00-26-16.xlsx deleted file mode 100644 index a5f54f7..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-26-16.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-27-22.xlsx b/example/tpt/temp/home32022-03-02-00-27-22.xlsx deleted file mode 100644 index d6cafc8..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-27-22.xlsx and /dev/null differ diff --git a/example/tpt/temp/home32022-03-02-00-27-59.xlsx b/example/tpt/temp/home32022-03-02-00-27-59.xlsx deleted file mode 100644 index 1d386bd..0000000 Binary files a/example/tpt/temp/home32022-03-02-00-27-59.xlsx and /dev/null differ diff --git a/example/tpt/temp/home5.xlsx b/example/tpt/temp/home5.xlsx deleted file mode 100644 index 9aa6c21..0000000 Binary files a/example/tpt/temp/home5.xlsx and /dev/null differ diff --git a/example/tpt/temp/home6.xlsx b/example/tpt/temp/home6.xlsx deleted file mode 100644 index 47b4b86..0000000 Binary files a/example/tpt/temp/home6.xlsx and /dev/null differ diff --git a/example/tpt/temp/home62022-03-02-00-46-22.xlsx b/example/tpt/temp/home62022-03-02-00-46-22.xlsx deleted file mode 100644 index e4e598a..0000000 Binary files a/example/tpt/temp/home62022-03-02-00-46-22.xlsx and /dev/null differ diff --git a/example/tpt/temp/home72022-03-02-00-36-30.xlsx b/example/tpt/temp/home72022-03-02-00-36-30.xlsx deleted file mode 100644 index c0fecef..0000000 Binary files a/example/tpt/temp/home72022-03-02-00-36-30.xlsx and /dev/null differ diff --git a/example/tpt/temp/industry20x6.xlsx b/example/tpt/temp/industry20x6.xlsx deleted file mode 100644 index 486fc2d..0000000 Binary files a/example/tpt/temp/industry20x6.xlsx and /dev/null differ diff --git a/example/tpt/temp/industry22x6.xlsx b/example/tpt/temp/industry22x6.xlsx deleted file mode 100644 index 9264a19..0000000 Binary files a/example/tpt/temp/industry22x6.xlsx and /dev/null differ diff --git a/example/tpt/temp/industry6.xlsx b/example/tpt/temp/industry6.xlsx deleted file mode 100644 index 8e63976..0000000 Binary files a/example/tpt/temp/industry6.xlsx and /dev/null differ diff --git a/example/tpt/temp/industry62022-03-02-00-42-21.xlsx b/example/tpt/temp/industry62022-03-02-00-42-21.xlsx deleted file mode 100644 index 11ae5c5..0000000 Binary files a/example/tpt/temp/industry62022-03-02-00-42-21.xlsx and /dev/null differ