重新索引

This commit is contained in:
hoteas 2023-03-03 02:46:29 +08:00
parent 3a7603fa54
commit 3c0946510e
10 changed files with 924 additions and 779 deletions

View File

@ -491,8 +491,8 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error {
companyData := Map{ companyData := Map{
"name": rowData["IEDCQYM"], "name": rowData["IEDCQYM"],
//"sn": rowData["IEDCTYSHXYDM"], //"sn": rowData["IEDCTYSHXYDM"],
//"address": rowData["IEDCQYDZ"], "address": rowData["IEDCQYDZ"],
//"unit": rowData["IEDCSDMC"], "unit": rowData["IEDCSDMC"],
"zdmj": rowData["IEDCZDMJ"], "zdmj": rowData["IEDCZDMJ"],
"yysr": rowData["IEDCYYSR1"], "yysr": rowData["IEDCYYSR1"],
"lrze": rowData["IEDCLRZE1"], "lrze": rowData["IEDCLRZE1"],
@ -509,6 +509,45 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error {
//"lat": lat, //"lat": lat,
//"lng": lng, //"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 //行业ID
//org := this.Db.Get("org", "id,name", Map{"id": orgId}) //org := this.Db.Get("org", "id,name", Map{"id": orgId})
//regin := "全国" //regin := "全国"

View File

@ -7,6 +7,7 @@ import (
"code.hoteas.com/golang/hotime/dri/tencent" "code.hoteas.com/golang/hotime/dri/tencent"
"fmt" "fmt"
"github.com/silenceper/wechat" "github.com/silenceper/wechat"
"github.com/silenceper/wechat/cache"
"gopkg.in/chanxuehong/wechat.v2/mch/core" "gopkg.in/chanxuehong/wechat.v2/mch/core"
"gopkg.in/chanxuehong/wechat.v2/mch/pay" "gopkg.in/chanxuehong/wechat.v2/mch/pay"
"io/ioutil" "io/ioutil"
@ -93,15 +94,15 @@ func getCompany(name, path string) Map {
} }
//微信获取个人信息 //微信获取个人信息
//func Weixin(this *Context) *wechat.Wechat { func Weixin(this *Context) *wechat.Wechat {
// if weixin == nil { if weixin == nil {
// cache1 := cache.Cache(WechatCache{this.CacheIns}) cache1 := cache.NewMemory()
// config := wechat.Config{Cache: cache1, AppID: this.Config.GetString("wechatAppID"), AppSecret: this.Config.GetString("wechatAppSecret")} config := wechat.Config{Cache: cache1, AppID: this.Config.GetString("wechatAppID"), AppSecret: this.Config.GetString("wechatAppSecret")}
// weixin = wechat.NewWechat(&config) weixin = wechat.NewWechat(&config)
// } }
//
// return weixin return weixin
//} }
//微信获取个人信息 //微信获取个人信息
func WxPayClient(this *Context, sn string, money int64, openid string) Map { func WxPayClient(this *Context, sn string, money int64, openid string) Map {

View File

@ -126,7 +126,7 @@ var User = Ctr{
name := this.Req.FormValue("name") name := this.Req.FormValue("name")
phone := this.Req.FormValue("phone") phone := this.Req.FormValue("phone")
code := this.Req.FormValue("code") code := this.Req.FormValue("code")
authImg := this.Req.FormValue("auth_img") //authImg := this.Req.FormValue("auth_img")
categoryId := ObjToInt(this.Req.FormValue("category_id")) categoryId := ObjToInt(this.Req.FormValue("category_id"))
companyImg := this.Req.FormValue("company_img") companyImg := this.Req.FormValue("company_img")
companyName := this.Req.FormValue("company_name") companyName := this.Req.FormValue("company_name")
@ -137,7 +137,11 @@ var User = Ctr{
return return
} }
if name == "" || phone == "" || authImg == "" || categoryId == 0 || companyImg == "" || companyName == "" || companySn == "" { if name == "" || phone == "" ||
//authImg == "" ||
categoryId == 0 ||
//companyImg == "" ||
companyName == "" || companySn == "" {
this.Display(3, "参数异常") this.Display(3, "参数异常")
return return
} }
@ -192,7 +196,7 @@ var User = Ctr{
//"idcard_front_img": idcardFrontImg, //"idcard_front_img": idcardFrontImg,
"company_id": company.GetCeilInt("id"), "company_id": company.GetCeilInt("id"),
//"idcard_back_img": idcardBackImg, //"idcard_back_img": idcardBackImg,
"auth_img": authImg, //"auth_img": authImg,
"modify_time": t, "modify_time": t,
"status": 1, "status": 1,
"company_img": companyImg} "company_img": companyImg}
@ -286,7 +290,7 @@ var User = Ctr{
//uimgPath:=time.Now().Format(this.Config.GetString("uimgPath")) //uimgPath:=time.Now().Format(this.Config.GetString("uimgPath"))
path := time.Now().Format(this.Config.GetString("wxFilePath")) path := time.Now().Format(this.Config.GetString("wxFilePath"))
os.MkdirAll(this.Config.GetString("tpt")+"/"+path, os.ModeDir) 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文件中不做处理直接写到文件 err2 := ioutil.WriteFile(this.Config.GetString("tpt")+"/"+filePath, btes, 0666) //buffer输出到jpg文件中不做处理直接写到文件

View File

@ -4,8 +4,8 @@ import (
. "code.hoteas.com/golang/hotime" . "code.hoteas.com/golang/hotime"
. "code.hoteas.com/golang/hotime/cache" . "code.hoteas.com/golang/hotime/cache"
. "code.hoteas.com/golang/hotime/common" . "code.hoteas.com/golang/hotime/common"
//"github.com/silenceper/wechat" "fmt"
//"github.com/silenceper/wechat/cache"
"time" "time"
) )
@ -44,106 +44,106 @@ var Wechat = Ctr{
this.Display(0, this.Session("wechatInfo").ToMap()) this.Display(0, this.Session("wechatInfo").ToMap())
}, },
//微信注册0已经完整的注册了1还没有注册 //微信注册0已经完整的注册了1还没有注册
//"codebase": func(this *Context) { "codebase": func(this *Context) {
// wx := Weixin(this) wx := Weixin(this)
// //auth := wx.GetOauth(this.Req, this.Resp) //auth := wx.GetOauth(this.Req, this.Resp)
//auth :=wx.GetOauth() auth := wx.GetOauth()
// resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code"))
// if err != nil { if err != nil {
// this.Display(6, "code错误") this.Display(6, "code错误")
// return return
// } }
//
// //判断用户是否已经注册 //判断用户是否已经注册
// user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID})
// if user != nil { if user != nil {
// this.Session("user_id", user.Get("id")) this.Session("user_id", user.Get("id"))
// this.Display(0, 0) this.Display(0, 0)
// return return
// } }
//
// user_id := this.Db.Insert("user", Map{"time": time.Now().Unix(), "state": 2}) user_id := this.Db.Insert("user", Map{"create_time": time.Now().Unix(), "modify_time": time.Now().Unix(), "state": 2})
// if user_id == 0 { if user_id == 0 {
// this.Display(4, "创建用户失败") this.Display(4, "创建用户失败")
// return return
// } }
//
// wid := this.Db.Insert("wechat", Map{"openid": resToken.OpenID, "appid": this.Config.GetString("wechatAppID"), "state": 1, "user_id": user_id}) wid := this.Db.Insert("wechat", Map{"openid": resToken.OpenID, "appid": this.Config.GetString("wechatAppID"), "state": 1, "user_id": user_id})
// if wid == 0 { if wid == 0 {
// this.Display(4, "关联微信失败!") this.Display(4, "关联微信失败!")
// return return
// } }
//
// this.Session("user_id", user.Get("id")) this.Session("user_id", user.Get("id"))
//
// this.Display(0, 1) this.Display(0, 1)
//}, },
////微信注册0已经完整的注册了1还没有注册 //微信注册0已经完整的注册了1还没有注册
//"code": func(this *Context) { "code": func(this *Context) {
//
// orgId := ObjToInt(this.Req.FormValue("org_id")) orgId := ObjToInt(this.Req.FormValue("org_id"))
// //if orgId==0{ //if orgId==0{
// // this.Display(3, "缺少组织id") // this.Display(3, "缺少组织id")
// // return // return
// //} //}
//
// wx := Weixin(this) wx := Weixin(this)
// //auth := wx.GetOauth(this.Req, this.Resp) //auth := wx.GetOauth(this.Req, this.Resp)
// auth := wx.GetOauth() auth := wx.GetOauth()
// resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code")) resToken, err := auth.GetUserAccessToken(this.Req.FormValue("code"))
// if err != nil { if err != nil {
// this.Display(5, "code错误") this.Display(5, "code错误")
// return return
// } }
//
// //判断用户是否已经注册 //判断用户是否已经注册
// user := this.Db.Get("wechat", Map{"[><]user": "wechat.user_id=user.id"}, "user.id,user.state", Map{"openid": resToken.OpenID}) 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 { if user != nil && user.GetCeilInt("id") != 0 && user.GetCeilInt("state") == 0 {
// this.Session("user_id", user.Get("id")) this.Session("user_id", user.Get("id"))
// this.Display(0, Map{"type": 0, "token": this.SessionId}) this.Display(0, Map{"type": 0, "token": this.SessionId})
// return return
// } }
// //getUserInfo //getUserInfo
// userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID)
// if err != nil { if err != nil {
// this.Display(6, "微信个人信息无法获取") this.Display(6, "微信个人信息无法获取")
// return return
// } }
//
// //wechatInfo := ObjToMap(userInfo) //wechatInfo := ObjToMap(userInfo)
// t := time.Now().Unix() t := time.Now().Unix()
// wechatInfo := Map{ wechatInfo := Map{
// "openid": userInfo.OpenID, "openid": userInfo.OpenID,
// "acttoken": resToken.AccessToken, "acttoken": resToken.AccessToken,
// "retoken": resToken.RefreshToken, "retoken": resToken.RefreshToken,
// "appid": this.Config.GetString("wechatAppID"), "appid": this.Config.GetString("wechatAppID"),
// "unionid": userInfo.Unionid, "unionid": userInfo.Unionid,
// "nickname": userInfo.Nickname, "nickname": userInfo.Nickname,
// "avatar": userInfo.HeadImgURL, "avatar": userInfo.HeadImgURL,
// } }
// if orgId != 0 { if orgId != 0 {
// wechatInfo["org_id"] = orgId wechatInfo["org_id"] = orgId
// wechatInfo["status"] = 0 wechatInfo["status"] = 0
// } }
//
// wechatDb := this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) wechatDb := this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")})
//
// if wechatDb != nil { if wechatDb != nil {
//
// this.Db.Update("wechat", wechatInfo, Map{"id": wechatDb.GetCeilInt("id")}) this.Db.Update("wechat", wechatInfo, Map{"id": wechatDb.GetCeilInt("id")})
// //userInfo["wid"]=wechatDb.GetCeilInt("wid") //userInfo["wid"]=wechatDb.GetCeilInt("wid")
// } else { } else {
// wechatInfo["create_time"] = t wechatInfo["create_time"] = t
// wechatInfo["id"] = this.Db.Insert("wechat", wechatInfo) wechatInfo["id"] = this.Db.Insert("wechat", wechatInfo)
// } }
// wechatDb = this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")}) wechatDb = this.Db.Get("wechat", "*", Map{"openid": wechatInfo.GetString("openid")})
//
// this.Session("wechatInfo", wechatDb) this.Session("wechatInfo", wechatDb)
// fmt.Println(wechatDb) fmt.Println(wechatDb)
// fmt.Println(this.Session("wechatInfo")) fmt.Println(this.Session("wechatInfo"))
// //this.Display(0, 1) //this.Display(0, 1)
// this.Display(0, Map{"type": 1, "token": this.SessionId}) this.Display(0, Map{"type": 1, "token": this.SessionId})
//}, },
//网页签名 //网页签名
"sign": func(this *Context) { "sign": func(this *Context) {

View File

@ -77,7 +77,7 @@
"menus": [ "menus": [
{ {
"auth": ["show"], "auth": ["show"],
"icon": "Setting", "icon": "House",
"label": "首 页", "label": "首 页",
"name": "HelloWorld" "name": "HelloWorld"
}, },
@ -85,7 +85,7 @@
"auth": [ "auth": [
"show" "show"
], ],
"icon": "Setting", "icon": "Monitor",
"label": "企业管理", "label": "企业管理",
"menus": [ "menus": [
{ {
@ -133,7 +133,143 @@
"auth": [ "auth": [
"show" "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": "行业分类", "label": "行业分类",
"menus": [ "menus": [
{ {
@ -163,6 +299,7 @@
], ],
"name": "sys:category" "name": "sys:category"
}, },
{ {
"auth": [ "auth": [
"show" "show"
@ -214,18 +351,7 @@
"label": "微信信息", "label": "微信信息",
"table": "wechat" "table": "wechat"
}, },
{
"auth": [
"show",
"add",
"delete",
"edit",
"info",
"download"
],
"label": "地区管理",
"table": "area"
},
{ {
"auth": [ "auth": [
"show", "show",
@ -252,143 +378,6 @@
} }
], ],
"name": "sys" "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", "name": "admin",

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,15 @@
{ {
"aliyunApiCode": "06c6a07e89dd45c88de040ee1489eef7",
"avatarPath": "avatar/2006/01/02/", "avatarPath": "avatar/2006/01/02/",
"baiduAk": "ZeT902EZvVgIoGVWEFK3osUm",
"cache": { "cache": {
"db": { "db": {
"db": false, "db": false,
"session": true "session": true,
"timeout": 7200
}, },
"memory": { "memory": {
"db": true, "db": false,
"session": true, "session": true,
"timeout": 7200 "timeout": 7200
} }
@ -19,7 +22,7 @@
"table": "admin" "table": "admin"
} }
], ],
"crossDomain": "auto", "crossDomain": "",
"db": { "db": {
"mysql": { "mysql": {
"host": "192.168.6.253", "host": "192.168.6.253",
@ -47,6 +50,8 @@
"sessionName": "HOTIME", "sessionName": "HOTIME",
"smsKey": "b0eb4bf0198b9983cffcb85b69fdf4fa", "smsKey": "b0eb4bf0198b9983cffcb85b69fdf4fa",
"smsLogin": "【政企超链接】您的验证码为:{code}请在5分钟内使用切勿将验证码泄露于他人如非本人操作请忽略。", "smsLogin": "【政企超链接】您的验证码为:{code}请在5分钟内使用切勿将验证码泄露于他人如非本人操作请忽略。",
"tencentSecretId": "AKIDklZa1qBr3B0x1G643cg8B6UO5JZm2KX8o43G",
"tencentSecretKey": "tdda7oro526h96dvicYkep1xsWFmHkt33xvqs2K",
"tpt": "tpt", "tpt": "tpt",
"wechatAppID": "wx2edb802f5c3ae1ae", "wechatAppID": "wx2edb802f5c3ae1ae",
"wechatAppSecret": "4ff97e523c3de6bad47051b568522386", "wechatAppSecret": "4ff97e523c3de6bad47051b568522386",

View File

@ -269,6 +269,16 @@
"strict": false, "strict": false,
"type": "" "type": ""
}, },
{
"add": true,
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "auth_img",
"strict": false,
"type": "image"
},
{ {
"add": false, "add": false,
"edit": false, "edit": false,

BIN
iedc.zip

Binary file not shown.

View File

@ -3,11 +3,10 @@ package main
import ( import (
"code.hoteas.com/golang/hotime" "code.hoteas.com/golang/hotime"
"code.hoteas.com/golang/hotime/dri/aliyun" "code.hoteas.com/golang/hotime/dri/aliyun"
"code.hoteas.com/golang/hotime/dri/baidu"
"code.hoteas.com/golang/hotime/dri/tencent" "code.hoteas.com/golang/hotime/dri/tencent"
"strings" "strings"
//"../dri/aliyun"
"code.hoteas.com/golang/hotime/dri/baidu"
"code.hoteas.com/golang/hotime/dri/ddsms" "code.hoteas.com/golang/hotime/dri/ddsms"
"fmt" "fmt"
"iedc-go/admin" "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") date, _ := time.Parse("2006-01-02 15:04", time.Now().Format("2006-01-02")+" 14:00")
fmt.Println(date, date.Unix()) fmt.Println(date, date.Unix())
baidu.BaiDuMap.Init("ZeT902EZvVgIoGVWEFK3osUm")
//fmt.Println("0123456"[1:7]) //fmt.Println("0123456"[1:7])
appIns := hotime.Init("config/config.json") appIns := hotime.Init("config/config.json")
notNeedLogin := []string{"token", "login", "test", "auth", "upload", "info"} //不需要登录的操作 notNeedLogin := []string{"token", "login", "test", "auth", "upload", "info"} //不需要登录的操作
@ -82,8 +80,9 @@ func main() {
ddsms.DDY.Init(appIns.Config.GetString("smsKey")) ddsms.DDY.Init(appIns.Config.GetString("smsKey"))
} }
tencent.Company.Init("AKIDklZa1qBr3B0x1G643cg8B6UO5JZm2KX8o43G", "tdda7oro526h96dvicYkep1xsWFmHkt33xvqs2K") tencent.Company.Init(appIns.Config.GetString("tencentSecretId"), appIns.Config.GetString("tencentSecretKey"))
aliyun.Company.Init("06c6a07e89dd45c88de040ee1489eef7") aliyun.Company.Init(appIns.Config.GetString("aliyunApiCode"))
baidu.BaiDuMap.Init(appIns.Config.GetString("baiduAk"))
appIns.Run(hotime.Router{ appIns.Run(hotime.Router{
"app": app.Project, "app": app.Project,
}) })