diff --git a/admin/companyinout.go b/admin/companyinout.go index c8e4359..2fab25c 100644 --- a/admin/companyinout.go +++ b/admin/companyinout.go @@ -491,8 +491,8 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error { companyData := Map{ "name": rowData["IEDCQYM"], //"sn": rowData["IEDCTYSHXYDM"], - //"address": rowData["IEDCQYDZ"], - //"unit": rowData["IEDCSDMC"], + "address": rowData["IEDCQYDZ"], + "unit": rowData["IEDCSDMC"], "zdmj": rowData["IEDCZDMJ"], "yysr": rowData["IEDCYYSR1"], "lrze": rowData["IEDCLRZE1"], @@ -509,6 +509,45 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error { //"lat": lat, //"lng": lng, } + + if companyData["name"] == nil && companyData["yysr"] == nil && companyData["sn"] == nil { + companyData = Map{ + "name": rowData["IEDCQYMC"], + "sn": rowData["IEDCTYSHXYDM"], + "address": rowData["IEDCQYDZ"], + "unit": rowData["IEDCSDMC"], + "zdmj": rowData["IEDCYDMJ"], + "yysr": rowData["IEDC2NYYSR"], + "lrze": rowData["IEDC2NLRZE"], + "yjsj": rowData["IEDCYNSJ"], + "yfjf": rowData["IEDCNYFFY"], + "zgrs": rowData["IEDCSBRS"], + "zywrwpfdl": rowData["IEDCZYWRWPFDL"], + "zhnh": rowData["IEDCZHNH"], + "admin_id": this.Session("admin_id").ToInt(), + "upload_data": rowData.ToJsonString(), + "org_id": orgId, + //"create_time": time.Now().Unix(), + "modify_time": time.Now().Unix(), + //"lat": lat, + //"lng": lng, + } + } + + if companyData.GetString("name") == "" { + companyData["name"] = rowData["IEDCQYMC"] + } + + if companyData.GetString("sn") == "" && rowData["IEDCTYSHXYDM"] != nil { + companyData["sn"] = rowData["sn"] + } + if companyData.GetString("address") == "" && rowData["IEDCQYDZ"] != nil { + companyData["address"] = rowData["IEDCQYDZ"] + } + if companyData.GetString("unit") == "" && rowData["IEDCSDMC"] != nil { + companyData["unit"] = rowData["IEDCSDMC"] + } + //行业ID //org := this.Db.Get("org", "id,name", Map{"id": orgId}) //regin := "全国" diff --git a/app/init.go b/app/init.go index 43d6de3..b368ca9 100644 --- a/app/init.go +++ b/app/init.go @@ -7,6 +7,7 @@ import ( "code.hoteas.com/golang/hotime/dri/tencent" "fmt" "github.com/silenceper/wechat" + "github.com/silenceper/wechat/cache" "gopkg.in/chanxuehong/wechat.v2/mch/core" "gopkg.in/chanxuehong/wechat.v2/mch/pay" "io/ioutil" @@ -93,15 +94,15 @@ func getCompany(name, path string) Map { } //微信获取个人信息 -//func Weixin(this *Context) *wechat.Wechat { -// if weixin == nil { -// cache1 := cache.Cache(WechatCache{this.CacheIns}) -// config := wechat.Config{Cache: cache1, AppID: this.Config.GetString("wechatAppID"), AppSecret: this.Config.GetString("wechatAppSecret")} -// weixin = wechat.NewWechat(&config) -// } -// -// return weixin -//} +func Weixin(this *Context) *wechat.Wechat { + if weixin == nil { + cache1 := cache.NewMemory() + config := wechat.Config{Cache: cache1, AppID: this.Config.GetString("wechatAppID"), AppSecret: this.Config.GetString("wechatAppSecret")} + weixin = wechat.NewWechat(&config) + } + + return weixin +} //微信获取个人信息 func WxPayClient(this *Context, sn string, money int64, openid string) Map { diff --git a/app/user.go b/app/user.go index b245f2b..fb66386 100644 --- a/app/user.go +++ b/app/user.go @@ -126,7 +126,7 @@ var User = Ctr{ name := this.Req.FormValue("name") phone := this.Req.FormValue("phone") code := this.Req.FormValue("code") - authImg := this.Req.FormValue("auth_img") + //authImg := this.Req.FormValue("auth_img") categoryId := ObjToInt(this.Req.FormValue("category_id")) companyImg := this.Req.FormValue("company_img") companyName := this.Req.FormValue("company_name") @@ -137,7 +137,11 @@ var User = Ctr{ return } - if name == "" || phone == "" || authImg == "" || categoryId == 0 || companyImg == "" || companyName == "" || companySn == "" { + if name == "" || phone == "" || + //authImg == "" || + categoryId == 0 || + //companyImg == "" || + companyName == "" || companySn == "" { this.Display(3, "参数异常") return } @@ -192,7 +196,7 @@ var User = Ctr{ //"idcard_front_img": idcardFrontImg, "company_id": company.GetCeilInt("id"), //"idcard_back_img": idcardBackImg, - "auth_img": authImg, + //"auth_img": authImg, "modify_time": t, "status": 1, "company_img": companyImg} @@ -286,7 +290,7 @@ var User = Ctr{ //uimgPath:=time.Now().Format(this.Config.GetString("uimgPath")) path := time.Now().Format(this.Config.GetString("wxFilePath")) os.MkdirAll(this.Config.GetString("tpt")+"/"+path, os.ModeDir) - filePath := path + Md5(ObjToStr(time.Now().Unix())) + ".jpg" + filePath := "/" + path + Md5(ObjToStr(time.Now().Unix())) + ".jpg" err2 := ioutil.WriteFile(this.Config.GetString("tpt")+"/"+filePath, btes, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件) diff --git a/app/wechat.go b/app/wechat.go index aebefca..e42de0e 100644 --- a/app/wechat.go +++ b/app/wechat.go @@ -4,8 +4,8 @@ import ( . "code.hoteas.com/golang/hotime" . "code.hoteas.com/golang/hotime/cache" . "code.hoteas.com/golang/hotime/common" - //"github.com/silenceper/wechat" - //"github.com/silenceper/wechat/cache" + "fmt" + "time" ) @@ -44,106 +44,106 @@ var Wechat = Ctr{ this.Display(0, this.Session("wechatInfo").ToMap()) }, //微信注册,0已经完整的注册了,1还没有注册 - //"codebase": func(this *Context) { - // wx := Weixin(this) - // //auth := wx.GetOauth(this.Req, this.Resp) - //auth :=wx.GetOauth() - // resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) - // if err != nil { - // this.Display(6, "code错误") - // return - // } - // - // //判断用户是否已经注册 - // user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) - // if user != nil { - // this.Session("user_id", user.Get("id")) - // this.Display(0, 0) - // return - // } - // - // user_id := this.Db.Insert("user", Map{"time": time.Now().Unix(), "state": 2}) - // if user_id == 0 { - // this.Display(4, "创建用户失败") - // return - // } - // - // wid := this.Db.Insert("wechat", Map{"openid": resToken.OpenID, "appid": this.Config.GetString("wechatAppID"), "state": 1, "user_id": user_id}) - // if wid == 0 { - // this.Display(4, "关联微信失败!") - // return - // } - // - // this.Session("user_id", user.Get("id")) - // - // this.Display(0, 1) - //}, - ////微信注册,0已经完整的注册了,1还没有注册 - //"code": func(this *Context) { - // - // orgId := ObjToInt(this.Req.FormValue("org_id")) - // //if orgId==0{ - // // this.Display(3, "缺少组织id") - // // return - // //} - // - // wx := Weixin(this) - // //auth := wx.GetOauth(this.Req, this.Resp) - // auth := wx.GetOauth() - // resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) - // if err != nil { - // this.Display(5, "code错误") - // return - // } - // - // //判断用户是否已经注册 - // user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) - // if user != nil && user.GetCeilInt("id") != 0 && user.GetCeilInt("state") == 0 { - // this.Session("user_id", user.Get("id")) - // this.Display(0, Map{"type": 0, "token": this.SessionId}) - // return - // } - // //getUserInfo - // userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) - // if err != nil { - // this.Display(6, "微信个人信息无法获取") - // return - // } - // - // //wechatInfo := ObjToMap(userInfo) - // t := time.Now().Unix() - // wechatInfo := Map{ - // "openid": userInfo.OpenID, - // "acttoken": resToken.AccessToken, - // "retoken": resToken.RefreshToken, - // "appid": this.Config.GetString("wechatAppID"), - // "unionid": userInfo.Unionid, - // "nickname": userInfo.Nickname, - // "avatar": userInfo.HeadImgURL, - // } - // if orgId != 0 { - // wechatInfo["org_id"] = orgId - // wechatInfo["status"] = 0 - // } - // - // wechatDb := this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) - // - // if wechatDb != nil { - // - // this.Db.Update("wechat", wechatInfo, Map{"id": wechatDb.GetCeilInt("id")}) - // //userInfo["wid"]=wechatDb.GetCeilInt("wid") - // } else { - // wechatInfo["create_time"] = t - // wechatInfo["id"] = this.Db.Insert("wechat", wechatInfo) - // } - // wechatDb = this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) - // - // this.Session("wechatInfo", wechatDb) - // fmt.Println(wechatDb) - // fmt.Println(this.Session("wechatInfo")) - // //this.Display(0, 1) - // this.Display(0, Map{"type": 1, "token": this.SessionId}) - //}, + "codebase": func(this *Context) { + wx := Weixin(this) + //auth := wx.GetOauth(this.Req, this.Resp) + auth := wx.GetOauth() + resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) + if err != nil { + this.Display(6, "code错误") + return + } + + //判断用户是否已经注册 + user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) + if user != nil { + this.Session("user_id", user.Get("id")) + this.Display(0, 0) + return + } + + user_id := this.Db.Insert("user", Map{"create_time": time.Now().Unix(), "modify_time": time.Now().Unix(), "state": 2}) + if user_id == 0 { + this.Display(4, "创建用户失败") + return + } + + wid := this.Db.Insert("wechat", Map{"openid": resToken.OpenID, "appid": this.Config.GetString("wechatAppID"), "state": 1, "user_id": user_id}) + if wid == 0 { + this.Display(4, "关联微信失败!") + return + } + + this.Session("user_id", user.Get("id")) + + this.Display(0, 1) + }, + //微信注册,0已经完整的注册了,1还没有注册 + "code": func(this *Context) { + + orgId := ObjToInt(this.Req.FormValue("org_id")) + //if orgId==0{ + // this.Display(3, "缺少组织id") + // return + //} + + wx := Weixin(this) + //auth := wx.GetOauth(this.Req, this.Resp) + auth := wx.GetOauth() + resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) + if err != nil { + this.Display(5, "code错误") + return + } + + //判断用户是否已经注册 + user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) + if user != nil && user.GetCeilInt("id") != 0 && user.GetCeilInt("state") == 0 { + this.Session("user_id", user.Get("id")) + this.Display(0, Map{"type": 0, "token": this.SessionId}) + return + } + //getUserInfo + userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) + if err != nil { + this.Display(6, "微信个人信息无法获取") + return + } + + //wechatInfo := ObjToMap(userInfo) + t := time.Now().Unix() + wechatInfo := Map{ + "openid": userInfo.OpenID, + "acttoken": resToken.AccessToken, + "retoken": resToken.RefreshToken, + "appid": this.Config.GetString("wechatAppID"), + "unionid": userInfo.Unionid, + "nickname": userInfo.Nickname, + "avatar": userInfo.HeadImgURL, + } + if orgId != 0 { + wechatInfo["org_id"] = orgId + wechatInfo["status"] = 0 + } + + wechatDb := this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) + + if wechatDb != nil { + + this.Db.Update("wechat", wechatInfo, Map{"id": wechatDb.GetCeilInt("id")}) + //userInfo["wid"]=wechatDb.GetCeilInt("wid") + } else { + wechatInfo["create_time"] = t + wechatInfo["id"] = this.Db.Insert("wechat", wechatInfo) + } + wechatDb = this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) + + this.Session("wechatInfo", wechatDb) + fmt.Println(wechatDb) + fmt.Println(this.Session("wechatInfo")) + //this.Display(0, 1) + this.Display(0, Map{"type": 1, "token": this.SessionId}) + }, //网页签名 "sign": func(this *Context) { diff --git a/config/admin.json b/config/admin.json index af4da94..bd8f976 100644 --- a/config/admin.json +++ b/config/admin.json @@ -77,7 +77,7 @@ "menus": [ { "auth": ["show"], - "icon": "Setting", + "icon": "House", "label": "首 页", "name": "HelloWorld" }, @@ -85,7 +85,7 @@ "auth": [ "show" ], - "icon": "Setting", + "icon": "Monitor", "label": "企业管理", "menus": [ { @@ -133,7 +133,143 @@ "auth": [ "show" ], - "icon": "Setting", + "icon": "Histogram", + "label": "产业分析", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "产业分析", + "table": "industry_analyse" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "产业分类", + "table": "industry" + } + ], + "name": "sys:industry" + }, + { + "auth": [ + "show" + ], + "icon": "Grid", + "label": "区域评价", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "区域评价", + "table": "org_analyse" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "区域管理", + "table": "org" + } + ], + "name": "sys:org" + }, + { + "auth": [ + "show" + ], + "icon": "Promotion", + "label": "调查管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "调查管理", + "table": "question" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "调查结果", + "table": "question_company" + } + ], + "name": "sys:question" + }, + { + "auth": [ + "show" + ], + "icon": "Memo", + "label": "指标管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "指标分类", + "table": "tag_ctg" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "指标管理", + "table": "tag" + } + ], + "name": "sys:tag" + }, + { + "auth": [ + "show" + ], + "icon": "Collection", "label": "行业分类", "menus": [ { @@ -163,6 +299,7 @@ ], "name": "sys:category" }, + { "auth": [ "show" @@ -214,18 +351,7 @@ "label": "微信信息", "table": "wechat" }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "地区管理", - "table": "area" - }, + { "auth": [ "show", @@ -252,143 +378,6 @@ } ], "name": "sys" - }, - - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "产业分析", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "产业分析", - "table": "industry_analyse" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "产业分类", - "table": "industry" - } - ], - "name": "sys:industry" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "行业评价", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "行业评价", - "table": "org_analyse" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "部门管理", - "table": "org" - } - ], - "name": "sys:org" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "指标分类", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "指标分类", - "table": "tag_ctg" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "指标管理", - "table": "tag" - } - ], - "name": "sys:tag" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "调查管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "调查管理", - "table": "question" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "调查结果", - "table": "question_company" - } - ], - "name": "sys:question" } ], "name": "admin", diff --git a/config/adminDB.json b/config/adminDB.json index b987e06..a784205 100644 --- a/config/adminDB.json +++ b/config/adminDB.json @@ -1,5 +1,13 @@ { "flow": { + "admin": { + "sql": { + "org_id": "org_id", + "role_id": "role_id" + }, + "stop": false, + "table": "admin" + }, "category": { "sql": { "admin_id": "id" @@ -7,16 +15,25 @@ "stop": false, "table": "category" }, + "category_analyse": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "category_analyse" + }, "company": { "sql": { - "admin_id": "id" + "admin_id": "id", + "org_id": "org_id" }, "stop": false, "table": "company" }, "company_history": { "sql": { - "admin_id": "id" + "admin_id": "id", + "org_id": "org_id" }, "stop": false, "table": "company_history" @@ -35,6 +52,13 @@ "stop": false, "table": "industry" }, + "industry_analyse": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "industry_analyse" + }, "logs": { "sql": { "admin_id": "id" @@ -44,27 +68,72 @@ }, "org": { "sql": { - "admin_id": "id" + "admin_id": "id", + "parent_ids[~]": "%,org_id,%" + }, + "stop": true, + "table": "org" + }, + "org_analyse": { + "sql": { + "org_id": "org_id" }, "stop": false, - "table": "org" + "table": "org_analyse" + }, + "question": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "question" + }, + "question_company": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "question_company" + }, + "role": { + "sql": { + "id": "role_id" + }, + "stop": true, + "table": "role" }, "tag": { "sql": { - "admin_id": "id" + "admin_id": "id", + "org_id": "org_id" }, "stop": false, "table": "tag" }, "tag_ctg": { "sql": { - "admin_id": "id" + "admin_id": "id", + "org_id": "org_id" }, "stop": false, "table": "tag_ctg" + }, + "user": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "user" + }, + "wechat": { + "sql": { + "org_id": "org_id" + }, + "stop": false, + "table": "wechat" } }, - "id": "9997520cd653386cbace95a787c95b7c", + "id": "170b672bebd3d57fc84c4b1c65071b03", "label": "HoTime管理平台", "labelConfig": { "add": "添加", @@ -103,8 +172,8 @@ "info", "download" ], - "label": "企业管理", - "table": "company" + "label": "历史信息", + "table": "company_history" }, { "auth": [ @@ -115,8 +184,8 @@ "info", "download" ], - "label": "历史信息", - "table": "company_history" + "label": "企业管理", + "table": "company" } ], "name": "sys:company" @@ -155,164 +224,6 @@ ], "name": "sys:industry" }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "部门管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "部门管理", - "table": "org" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "行业评价", - "table": "org_analyse" - } - ], - "name": "sys:org" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "调查结果", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "调查结果", - "table": "question_company" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "调查管理", - "table": "question" - } - ], - "name": "sys:question" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "系统管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "企业用户", - "table": "user" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "城市管理", - "table": "city" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "微信信息", - "table": "wechat" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "地区管理", - "table": "area" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "角色管理", - "table": "role" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "人员管理", - "table": "admin" - }, - { - "auth": [ - "show", - "download" - ], - "label": "日志管理", - "table": "logs" - } - ], - "name": "sys" - }, { "auth": [ "show" @@ -347,6 +258,96 @@ ], "name": "sys:tag" }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "系统管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "角色管理", + "table": "role" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "企业用户", + "table": "user" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "地区管理", + "table": "area" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "人员管理", + "table": "admin" + }, + { + "auth": [ + "show", + "download" + ], + "label": "日志管理", + "table": "logs" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "微信信息", + "table": "wechat" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "城市管理", + "table": "city" + } + ], + "name": "sys" + }, { "auth": [ "show" @@ -380,6 +381,74 @@ } ], "name": "sys:category" + }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "部门管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "部门管理", + "table": "org" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "行业评价", + "table": "org_analyse" + } + ], + "name": "sys:org" + }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "调查管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "调查管理", + "table": "question" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "调查结果", + "table": "question_company" + } + ], + "name": "sys:question" } ], "name": "admin", @@ -467,6 +536,22 @@ "label": "职位", "name": "title", "type": "text" + }, + { + "label": "角色", + "link": "role", + "name": "role_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "管理区域", + "link": "org", + "name": "org_id", + "sortable": true, + "type": "number", + "value": "name" } ], "label": "人员管理", @@ -483,14 +568,14 @@ "name": "ID", "value": "id" }, - { - "name": "手机号", - "value": "phone" - }, { "name": "名称", "value": "name" }, + { + "name": "手机号", + "value": "phone" + }, { "name": "职位", "value": "title" @@ -552,6 +637,13 @@ ], "type": "select", "value": null + }, + { + "label": "管理区域", + "link": "org", + "name": "org_id", + "type": "tree", + "value": "name" } ], "table": "admin" @@ -807,13 +899,13 @@ "name": "名称", "value": "name" }, - { - "name": "ID", - "value": "id" - }, { "name": "行业代码", "value": "code" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -980,14 +1072,14 @@ "name": "无", "value": null }, - { - "name": "名称", - "value": "name" - }, { "name": "ID", "value": "id" }, + { + "name": "名称", + "value": "name" + }, { "name": "分析结果", "value": "data" @@ -1051,9 +1143,9 @@ "value": null }, { - "label": "城市", - "link": "city", - "name": "city_id", + "label": "组织", + "link": "org", + "name": "org_id", "type": "tree", "value": "name" }, @@ -1065,9 +1157,9 @@ "value": "name" }, { - "label": "组织", - "link": "org", - "name": "org_id", + "label": "城市", + "link": "city", + "name": "city_id", "type": "tree", "value": "name" } @@ -1502,17 +1594,17 @@ "value": null }, { - "name": "统一社会信用代码", - "value": "sn" - }, - { - "name": "企业地址", - "value": "address" + "name": "企业名称", + "value": "name" }, { "name": "id", "value": "id" }, + { + "name": "占地面积", + "value": "zdmj" + }, { "name": "研发经费", "value": "yfjf" @@ -1521,22 +1613,22 @@ "name": "职工人数", "value": "zgrs" }, - { - "name": "利润总额", - "value": "lrze" - }, - { - "name": "应缴税金", - "value": "yjsj" - }, - { - "name": "占地面积", - "value": "zdmj" - }, { "name": "综合能耗", "value": "zhnh" }, + { + "name": "上传数据", + "value": "upload_data" + }, + { + "name": "企业地址", + "value": "address" + }, + { + "name": "利润总额", + "value": "lrze" + }, { "name": "主要污染物排放当量", "value": "zywrwpfdl" @@ -1545,25 +1637,25 @@ "name": "属地名称", "value": "unit" }, - { - "name": "营业收入", - "value": "yysr" - }, { "name": "企业画像", "value": "analyse" }, - { - "name": "上传数据", - "value": "upload_data" - }, { "name": "采集数据", "value": "collect_data" }, { - "name": "企业名称", - "value": "name" + "name": "统一社会信用代码", + "value": "sn" + }, + { + "name": "营业收入", + "value": "yysr" + }, + { + "name": "应缴税金", + "value": "yjsj" } ], "type": "search", @@ -1599,6 +1691,54 @@ "type": "search", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "认证状态", + "name": "status", + "options": [ + { + "name": "未认证", + "value": "0" + }, + { + "name": "已认证", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "add": false, "edit": false, @@ -1631,54 +1771,6 @@ "type": "select", "value": null }, - { - "label": "认证状态", - "name": "status", - "options": [ - { - "name": "未认证", - "value": "0" - }, - { - "name": "已认证", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "企业规模", "name": "gs", @@ -1701,16 +1793,16 @@ "value": null }, { - "label": "行业类型", - "link": "category", - "name": "category_id", + "label": "城市", + "link": "city", + "name": "city_id", "type": "tree", "value": "name" }, { - "label": "城市", - "link": "city", - "name": "city_id", + "label": "行业类型", + "link": "category", + "name": "category_id", "type": "tree", "value": "name" }, @@ -1980,52 +2072,52 @@ "value": "yysr" }, { - "name": "统一社会信用代码", - "value": "sn" + "name": "利润总额", + "value": "lrze" }, { "name": "采集数据", "value": "collect_data" }, { - "name": "利润总额", - "value": "lrze" + "name": "属地名称", + "value": "unit" }, { - "name": "应缴税金", - "value": "yjsj" - }, - { - "name": "企业名称", - "value": "name" - }, - { - "name": "研发经费", - "value": "yfjf" - }, - { - "name": "职工人数", - "value": "zgrs" - }, - { - "name": "id", - "value": "id" + "name": "统一社会信用代码", + "value": "sn" }, { "name": "主要污染物排放当量", "value": "zywrwpfdl" }, + { + "name": "id", + "value": "id" + }, + { + "name": "研发经费", + "value": "yfjf" + }, { "name": "企业画像", "value": "analyse" }, + { + "name": "企业名称", + "value": "name" + }, + { + "name": "企业地址", + "value": "address" + }, { "name": "占地面积", "value": "zdmj" }, { - "name": "属地名称", - "value": "unit" + "name": "职工人数", + "value": "zgrs" }, { "name": "综合能耗", @@ -2036,8 +2128,8 @@ "value": "upload_data" }, { - "name": "企业地址", - "value": "address" + "name": "应缴税金", + "value": "yjsj" } ], "type": "search", @@ -2073,27 +2165,6 @@ "type": "search", "value": null }, - { - "label": "企业规模", - "name": "gs", - "options": [ - { - "name": "规下", - "value": "0" - }, - { - "name": "规上", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "sortable": true, - "type": "select", - "value": null - }, { "label": "状态", "name": "state", @@ -2118,6 +2189,27 @@ "type": "select", "value": null }, + { + "label": "企业规模", + "name": "gs", + "options": [ + { + "name": "规下", + "value": "0" + }, + { + "name": "规上", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, { "add": false, "edit": false, @@ -2150,6 +2242,13 @@ "type": "select", "value": null }, + { + "label": "城市", + "link": "city", + "name": "city_id", + "type": "tree", + "value": "name" + }, { "label": "归属组织", "link": "org", @@ -2163,13 +2262,6 @@ "name": "category_id", "type": "tree", "value": "name" - }, - { - "label": "城市", - "link": "city", - "name": "city_id", - "type": "tree", - "value": "name" } ], "table": "company_history" @@ -2284,20 +2376,20 @@ "value": null }, { - "name": "调整级别", - "value": "level" + "name": "ID", + "value": "id" }, { "name": "调整理由", "value": "content" }, - { - "name": "ID", - "value": "id" - }, { "name": "名称", "value": "name" + }, + { + "name": "调整级别", + "value": "level" } ], "type": "search", @@ -2613,13 +2705,13 @@ "name": "分析结果", "value": "data" }, - { - "name": "ID", - "value": "id" - }, { "name": "名称", "value": "name" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -2710,11 +2802,6 @@ "sortable": true, "type": "number" }, - { - "label": "日志名", - "name": "name", - "type": "text" - }, { "label": "操作类型", "name": "type", @@ -2742,27 +2829,30 @@ { "add": false, "edit": false, - "label": "操作值", - "name": "table_id", - "type": "table_id" - }, - { - "add": false, - "edit": false, - "label": "操作表", + "label": "操作模块", "name": "table", "type": "table" }, { - "label": "用户", - "link": "user", - "name": "user_id", - "sortable": true, - "type": "number", - "value": "name" + "add": false, + "edit": false, + "label": "操作数据", + "name": "table_id", + "type": "table_id" }, { - "label": "管理员", + "label": "操作时间", + "name": "time", + "ps": "ces", + "type": "time" + }, + { + "label": "IP地址", + "name": "ip", + "type": "text" + }, + { + "label": "操作员", "link": "admin", "name": "admin_id", "sortable": true, @@ -2787,6 +2877,11 @@ } ], "type": "select" + }, + { + "label": "其他内容", + "name": "name", + "type": "text" } ], "label": "日志管理", @@ -2800,12 +2895,16 @@ "value": null }, { - "name": "ID", - "value": "id" + "name": "其他内容", + "value": "name" }, { - "name": "日志名", - "value": "name" + "name": "IP地址", + "value": "ip" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -2818,6 +2917,10 @@ { "name": "无", "value": null + }, + { + "name": "操作时间", + "value": "time" } ], "type": "search", @@ -3173,12 +3276,8 @@ "value": null }, { - "name": "“3”项定性", - "value": "three_item_data" - }, - { - "name": "ID", - "value": "id" + "name": "“6”项量化", + "value": "six_item_data" }, { "name": "分析名称", @@ -3189,12 +3288,16 @@ "value": "home_data" }, { - "name": "“6”项量化", - "value": "six_item_data" + "name": "“3”项定性", + "value": "three_item_data" }, { "name": "“N”项特色", "value": "n_item_data" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -3355,6 +3458,10 @@ "name": "无", "value": null }, + { + "name": "内容", + "value": "question_data" + }, { "name": "ID", "value": "id" @@ -3362,10 +3469,6 @@ { "name": "名称", "value": "name" - }, - { - "name": "内容", - "value": "question_data" } ], "type": "search", @@ -3567,6 +3670,10 @@ "name": "无", "value": null }, + { + "name": "ID", + "value": "id" + }, { "name": "名称", "value": "name" @@ -3574,10 +3681,6 @@ { "name": "填报内容", "value": "question_data" - }, - { - "name": "ID", - "value": "id" } ], "type": "search", @@ -3613,6 +3716,30 @@ "type": "search", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "填报状态", "name": "status", @@ -3645,30 +3772,6 @@ "type": "select", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "组织", "link": "org", @@ -3736,11 +3839,6 @@ ], "type": "select" }, - { - "label": "规则", - "name": "rule", - "type": "form" - }, { "label": "权限", "list": false, @@ -3981,13 +4079,17 @@ "name": "ID", "value": "id" }, + { + "name": "指标名", + "value": "name" + }, { "name": "指标标志", "value": "sn" }, { - "name": "指标名", - "value": "name" + "name": "单位", + "value": "unit" }, { "name": "指标描述", @@ -3996,10 +4098,6 @@ { "name": "运行命令", "value": "cmd" - }, - { - "name": "单位", - "value": "unit" } ], "type": "search", @@ -4035,30 +4133,6 @@ "type": "search", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "类型", "name": "type", @@ -4092,6 +4166,30 @@ "type": "select", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "指标分类", "link": "tag_ctg", @@ -4287,16 +4385,16 @@ "value": null }, { - "label": "组织", - "link": "org", - "name": "org_id", + "label": "上级分类", + "link": "tag_ctg", + "name": "parent_id", "type": "tree", "value": "name" }, { - "label": "上级分类", - "link": "tag_ctg", - "name": "parent_id", + "label": "组织", + "link": "org", + "name": "org_id", "type": "tree", "value": "name" } @@ -4459,21 +4557,13 @@ "value": null }, { - "name": "身份证号码", - "value": "idcard" - }, - { - "name": "昵称", - "value": "nickname" + "name": "ID", + "value": "id" }, { "name": "手机号码", "value": "phone" }, - { - "name": "ID", - "value": "id" - }, { "name": "邮箱", "value": "email" @@ -4481,6 +4571,14 @@ { "name": "用户姓名", "value": "name" + }, + { + "name": "身份证号码", + "value": "idcard" + }, + { + "name": "昵称", + "value": "nickname" } ], "type": "search", @@ -4516,30 +4614,6 @@ "type": "search", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "正常", - "value": "0" - }, - { - "name": "异常", - "value": "1" - }, - { - "name": "隐藏", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "认证状态", "name": "status", @@ -4564,6 +4638,30 @@ "type": "select", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "隐藏", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "组织", "link": "org", @@ -4705,32 +4803,32 @@ "value": null }, { - "name": "access_token", - "value": "acttoken" + "name": "微信appid", + "value": "appid" }, { "name": "昵称", "value": "nickname" }, { - "name": "openid", - "value": "openid" - }, - { - "name": "微信appid", - "value": "appid" + "name": "微信组id", + "value": "unionid" }, { "name": "refresh_token", "value": "retoken" }, + { + "name": "openid", + "value": "openid" + }, { "name": "ID", "value": "id" }, { - "name": "微信组id", - "value": "unionid" + "name": "access_token", + "value": "acttoken" } ], "type": "search", @@ -4766,6 +4864,26 @@ "type": "search", "value": null }, + { + "label": "组织传递", + "name": "status", + "options": [ + { + "name": "未传递", + "value": "0" + }, + { + "name": "已传递", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "状态", "name": "state", @@ -4790,26 +4908,6 @@ "type": "select", "value": null }, - { - "label": "组织传递", - "name": "status", - "options": [ - { - "name": "未传递", - "value": "0" - }, - { - "name": "已传递", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "关联组织", "link": "org", diff --git a/config/config.json b/config/config.json index 1c712ae..83cd457 100644 --- a/config/config.json +++ b/config/config.json @@ -1,12 +1,15 @@ { + "aliyunApiCode": "06c6a07e89dd45c88de040ee1489eef7", "avatarPath": "avatar/2006/01/02/", + "baiduAk": "ZeT902EZvVgIoGVWEFK3osUm", "cache": { "db": { "db": false, - "session": true + "session": true, + "timeout": 7200 }, "memory": { - "db": true, + "db": false, "session": true, "timeout": 7200 } @@ -19,7 +22,7 @@ "table": "admin" } ], - "crossDomain": "auto", + "crossDomain": "", "db": { "mysql": { "host": "192.168.6.253", @@ -47,6 +50,8 @@ "sessionName": "HOTIME", "smsKey": "b0eb4bf0198b9983cffcb85b69fdf4fa", "smsLogin": "【政企超链接】您的验证码为:{code},请在5分钟内使用,切勿将验证码泄露于他人,如非本人操作请忽略。", + "tencentSecretId": "AKIDklZa1qBr3B0x1G643cg8B6UO5JZm2KX8o43G", + "tencentSecretKey": "tdda7oro526h96dvicYkep1xsWFmHkt33xvqs2K", "tpt": "tpt", "wechatAppID": "wx2edb802f5c3ae1ae", "wechatAppSecret": "4ff97e523c3de6bad47051b568522386", diff --git a/config/rule.json b/config/rule.json index ac3cee9..5d354bd 100644 --- a/config/rule.json +++ b/config/rule.json @@ -269,6 +269,16 @@ "strict": false, "type": "" }, + { + "add": true, + "edit": true, + "info": true, + "list": false, + "must": false, + "name": "auth_img", + "strict": false, + "type": "image" + }, { "add": false, "edit": false, diff --git a/iedc.zip b/iedc.zip deleted file mode 100644 index f2b1d1c..0000000 Binary files a/iedc.zip and /dev/null differ diff --git a/main.go b/main.go index 5a26c25..c69c6b1 100644 --- a/main.go +++ b/main.go @@ -3,11 +3,10 @@ package main import ( "code.hoteas.com/golang/hotime" "code.hoteas.com/golang/hotime/dri/aliyun" + "code.hoteas.com/golang/hotime/dri/baidu" "code.hoteas.com/golang/hotime/dri/tencent" "strings" - //"../dri/aliyun" - "code.hoteas.com/golang/hotime/dri/baidu" "code.hoteas.com/golang/hotime/dri/ddsms" "fmt" "iedc-go/admin" @@ -19,7 +18,6 @@ func main() { date, _ := time.Parse("2006-01-02 15:04", time.Now().Format("2006-01-02")+" 14:00") fmt.Println(date, date.Unix()) - baidu.BaiDuMap.Init("ZeT902EZvVgIoGVWEFK3osUm") //fmt.Println("0123456"[1:7]) appIns := hotime.Init("config/config.json") notNeedLogin := []string{"token", "login", "test", "auth", "upload", "info"} //不需要登录的操作 @@ -82,8 +80,9 @@ func main() { ddsms.DDY.Init(appIns.Config.GetString("smsKey")) } - tencent.Company.Init("AKIDklZa1qBr3B0x1G643cg8B6UO5JZm2KX8o43G", "tdda7oro526h96dvicYkep1xsWFmHkt33xvqs2K") - aliyun.Company.Init("06c6a07e89dd45c88de040ee1489eef7") + tencent.Company.Init(appIns.Config.GetString("tencentSecretId"), appIns.Config.GetString("tencentSecretKey")) + aliyun.Company.Init(appIns.Config.GetString("aliyunApiCode")) + baidu.BaiDuMap.Init(appIns.Config.GetString("baiduAk")) appIns.Run(hotime.Router{ "app": app.Project, })