更新研发

This commit is contained in:
hoteas
2022-01-23 05:13:19 +08:00
parent 789b0a14d1
commit b2e9701826
112 changed files with 11587 additions and 8 deletions
+13 -1
View File
@@ -2,10 +2,12 @@ package app
import (
. "../../../hotime"
. "../../../hotime/common"
. "../../common"
"time"
)
var analyseCtr = Ctr{
"home_data": func(this *Context) {
orgId := ObjToInt(this.Req.FormValue("org_id"))
if orgId == 0 {
@@ -146,6 +148,16 @@ var analyseCtr = Ctr{
res["upload_data"] = res.GetMap("upload_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()}, Map{"id": res.GetCeilInt("id")})
res["collect_data"] = data
}
}
this.Display(0, res)
},
+54
View File
@@ -3,6 +3,11 @@ package app
import (
. "../../../hotime"
. "../../../hotime/common"
"../../dri/aliyun"
"../../dri/tencent"
"io/ioutil"
"os"
"path/filepath"
)
// Project 管理端项目
@@ -19,3 +24,52 @@ func getCode() string {
//}
return res
}
func getCompany(name, path string) Map {
res := tencent.GetCompany("AKIDklZa1qBr3B0x1G643cg8B6UO5JZm2KX8o43G", "tdda7oro526h96dvicYkep1xsWFmHkt33xvqs2K", name)
c := Map{}
base := Map{}
if res.GetInt("code") == 200 {
c = res.GetMap("data").GetMap("data")
base = c.GetMap("base")
base["allows"] = len(c.GetSlice("allows"))
base["branches"] = len(c.GetSlice("branches"))
base["changes"] = len(c.GetSlice("changes"))
base["employees"] = len(c.GetSlice("employees"))
base["exceptions"] = len(c.GetSlice("exceptions"))
base["mPledges"] = len(c.GetSlice("mPledges"))
base["originalName"] = len(c.GetSlice("originalName"))
base["partners"] = len(c.GetSlice("partners"))
base["pledges"] = len(c.GetSlice("pledges"))
base["punishes"] = len(c.GetSlice("punishes"))
base["shiXinItems"] = len(c.GetSlice("shiXinItems"))
base["spotChecks"] = len(c.GetSlice("spotChecks"))
base["taxCreditltems"] = len(c.GetSlice("taxCreditltems"))
base["zhiXingItems"] = len(c.GetSlice("zhiXingItems"))
base["contactInfo"] = c["contactInfo"]
base["industry"] = c["industry"]
base["liquidation"] = c["liquidation"]
}
aliyun.DefaultCompany.Init("06c6a07e89dd45c88de040ee1489eef7")
data := aliyun.DefaultCompany.GetCompanyOtherAll(name)
base["OtherCopyrightsInfo"] = data.GetMap("OtherCopyrightsInfo").GetInt("total")
base["PatentsInfo"] = data.GetMap("PatentsInfo").GetInt("total")
base["ProfileTags"] = data.GetMap("ProfileTags").GetSlice("data")
base["SoftwareCopyrightsInfo"] = data.GetMap("SoftwareCopyrightsInfo").GetInt("total")
base["TrademarksInfo"] = data.GetMap("TrademarksInfo").GetInt("total")
if res.GetInt("code") == 200 {
data["base"] = c
}
_ = os.MkdirAll(filepath.Dir(path), os.ModeDir)
ioutil.WriteFile(path, []byte(data.ToJsonString()), os.ModePerm)
return base
}