简阳版本
This commit is contained in:
parent
181295e54e
commit
a23037a437
@ -10,11 +10,13 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
gourl "net/url"
|
||||
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func calcAuthorization(source string, secretId string, secretKey string) (auth string, datetime string, err error) {
|
||||
|
||||
timeLocation, _ := time.LoadLocation("Etc/GMT")
|
||||
datetime = time.Now().In(timeLocation).Format("Mon, 02 Jan 2006 15:04:05 GMT")
|
||||
signStr := fmt.Sprintf("x-date: %s\nx-source: %s", datetime, source)
|
||||
|
@ -3,7 +3,6 @@ package app
|
||||
import (
|
||||
. "../../../hotime"
|
||||
. "../../common"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -15,15 +14,15 @@ var analyseCtr = Ctr{
|
||||
this.Display(3, "参数错误")
|
||||
return
|
||||
}
|
||||
res := this.Db.Get("org_analyse", "home_data", Map{"org_id": orgId})
|
||||
res := this.Db.Get("org_analyse", "*", Map{"org_id": orgId})
|
||||
if res == nil {
|
||||
this.Display(4, "找不到该数据")
|
||||
return
|
||||
}
|
||||
res["home_data"] = res.GetMap("home_data")
|
||||
//res["six_item_data"] = res.GetMap("six_item_data")
|
||||
//res["three_item_data"] = res.GetMap("three_item_data")
|
||||
//res["n_item_data"] = res.GetMap("n_item_data")
|
||||
res["six_item_data"] = res.GetMap("six_item_data")
|
||||
res["three_item_data"] = res.GetMap("three_item_data")
|
||||
res["n_item_data"] = res.GetMap("n_item_data")
|
||||
this.Display(0, res)
|
||||
},
|
||||
"home1_data": func(this *Context) {
|
||||
@ -142,25 +141,25 @@ var analyseCtr = Ctr{
|
||||
for _, res := range companys {
|
||||
|
||||
res["collect_data"] = res.GetMap("collect_data")
|
||||
if res.GetMap("collect_data") == nil {
|
||||
path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
|
||||
|
||||
data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
|
||||
|
||||
if len(data) != 0 {
|
||||
data["path"] = path
|
||||
re := this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
|
||||
"address": data.GetString("companyAddress"),
|
||||
"sn": data.GetString("creditNo"),
|
||||
"unit": data.GetString("authority"),
|
||||
}, Map{"id": res.GetCeilInt("id")})
|
||||
fmt.Println(re)
|
||||
res["collect_data"] = data
|
||||
res["address"] = data.GetString("companyAddress")
|
||||
res["sn"] = data.GetString("creditNo")
|
||||
res["unit"] = data.GetString("authority")
|
||||
}
|
||||
}
|
||||
//if res.GetMap("collect_data") == nil {
|
||||
// path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
|
||||
//
|
||||
// data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
|
||||
//
|
||||
// if len(data) != 0 {
|
||||
// data["path"] = path
|
||||
// re := this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
|
||||
// "address": data.GetString("companyAddress"),
|
||||
// "sn": data.GetString("creditNo"),
|
||||
// "unit": data.GetString("authority"),
|
||||
// }, Map{"id": res.GetCeilInt("id")})
|
||||
// fmt.Println(re)
|
||||
// res["collect_data"] = data
|
||||
// res["address"] = data.GetString("companyAddress")
|
||||
// res["sn"] = data.GetString("creditNo")
|
||||
// res["unit"] = data.GetString("authority")
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@ -230,21 +229,21 @@ var analyseCtr = Ctr{
|
||||
res["upload_data"] = res.GetMap("upload_data")
|
||||
res["collect_data"] = res.GetMap("collect_data")
|
||||
res["collect_data"] = res.GetMap("collect_data")
|
||||
if res.GetMap("collect_data") == nil {
|
||||
path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
|
||||
|
||||
data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
|
||||
|
||||
if len(data) != 0 {
|
||||
data["path"] = path
|
||||
this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
|
||||
"address": data.GetString("companyAddress"),
|
||||
"sn": data.GetString("creditNo"),
|
||||
"unit": data.GetString("authority"),
|
||||
}, Map{"id": res.GetCeilInt("id")})
|
||||
res["collect_data"] = data
|
||||
}
|
||||
}
|
||||
//if res.GetMap("collect_data") == nil {
|
||||
// path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json")
|
||||
//
|
||||
// data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path)
|
||||
//
|
||||
// if len(data) != 0 {
|
||||
// data["path"] = path
|
||||
// this.Db.Update("company", Map{"collect_data": data.ToJsonString(),
|
||||
// "address": data.GetString("companyAddress"),
|
||||
// "sn": data.GetString("creditNo"),
|
||||
// "unit": data.GetString("authority"),
|
||||
// }, Map{"id": res.GetCeilInt("id")})
|
||||
// res["collect_data"] = data
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@ -312,7 +311,7 @@ var analyseCtr = Ctr{
|
||||
}
|
||||
|
||||
uploadData := res.GetMap("upload_data")
|
||||
tags := this.Db.Select("tag", "name,sn,`unit`,description", Map{"type": 0})
|
||||
tags := this.Db.Select("tag", "name,sn,`unit`,description", Map{"type": 1})
|
||||
for _, v := range tags {
|
||||
v["value"] = uploadData[v.GetString("sn")]
|
||||
}
|
||||
|
@ -14,22 +14,18 @@ var tagCtr = Ctr{
|
||||
// return
|
||||
//}
|
||||
data := Map{}
|
||||
run := func(id int) []Map {
|
||||
run := func(t int) []Map {
|
||||
//upCtg:=this.Db.Select("tag_ctg","*",Map{"parent_id":id})
|
||||
//for _,v:=range upCtg{
|
||||
upTag := this.Db.Select("tag", "*", Map{"tag_ctg_id": id})
|
||||
upTag := this.Db.Select("tag", "*", Map{"type": t})
|
||||
//v["tag"]=upTag
|
||||
//}
|
||||
return upTag
|
||||
}
|
||||
upCtg := this.Db.Select("tag_ctg", "*", Map{"parent_id": 1})
|
||||
for _, v := range upCtg {
|
||||
upTag := this.Db.Select("tag", "*", Map{"tag_ctg_id": v.GetCeilInt("id")})
|
||||
v["tag"] = upTag
|
||||
}
|
||||
data["upload"] = upCtg
|
||||
|
||||
data["upload"] = run(1)
|
||||
data["api"] = run(2)
|
||||
data["analyse"] = run(3)
|
||||
data["analyse"] = run(0)
|
||||
|
||||
this.Display(0, data)
|
||||
},
|
||||
|
@ -24,7 +24,7 @@
|
||||
"db": {
|
||||
"mysql": {
|
||||
"host": "192.168.6.253",
|
||||
"name": "xhxyy",
|
||||
"name": "iedc_dev",
|
||||
"password": "dasda8454456",
|
||||
"port": "3306",
|
||||
"prefix": "",
|
||||
@ -43,7 +43,7 @@
|
||||
"5": "数据结果异常"
|
||||
},
|
||||
"mode": 3,
|
||||
"port": "8080",
|
||||
"port": "8081",
|
||||
"sessionName": "HOTIME",
|
||||
"tpt": "tpt"
|
||||
}
|
BIN
example/iedc.exe
BIN
example/iedc.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user