浏览代码

数据迁移

wangchuanjin 9 年之前
父节点
当前提交
2ebe53e92c

+ 12 - 1
common/src/qfw/util/elastic/elasticutil.go

@@ -12,6 +12,7 @@ import (
 	"log"
 	"qfw/util"
 	"qfw/util/mongodb"
+	mongodbutil "qfw/util/mongodbutil"
 	"reflect"
 
 	"strconv"
@@ -508,7 +509,17 @@ func UpdateNewDoc(index, itype string, obj ...interface{}) bool {
 
 func UpdateEntDoc(id string) bool {
 	b := false
-	ent := mongodb.FindById("enterprise", id, "")
+	map2 := map[string]interface{}{}
+	util.ReadConfig(&map2)
+	log.Println(map2)
+	ent := mongodbutil.FindById("enterprise", map2["entMongodbAlias"].(string), map2["entMongodbName"].(string), id, "")
+	_ent := mongodb.FindById("enterprise", id, "")
+	if _ent != nil && len(*_ent) > 0 {
+		for k, v := range *_ent {
+			(*ent)[k] = v
+		}
+	}
+	log.Println(ent)
 	if ent != nil {
 		b = UpdateNewDoc("enterprise", "enterprise", ConverData(ent))
 	}

+ 29 - 0
common/src/qfw/util/mongodbutil/mongodbutil.go

@@ -132,6 +132,35 @@ func FindOneByField(c, alias, db string, query interface{}, fields interface{})
 	return nil
 }
 
+//查询单条对象
+func FindById(c, alias, db, query string, fields interface{}) *map[string]interface{} {
+	sess := GetMgoConn(alias)
+	var res map[string]interface{}
+	if sess != nil {
+		defer func() {
+			if r := recover(); r != nil {
+				log.Println("[E]", r)
+				for skip := 1; ; skip++ {
+					_, file, line, ok := runtime.Caller(skip)
+					if !ok {
+						break
+					}
+					go log.Printf("%v,%v\n", file, line)
+				}
+			}
+		}()
+		defer DestoryMongoConn(alias, sess)
+		res = make(map[string]interface{})
+		coll := sess.DB(db).C(c)
+		var err error
+		err = coll.FindId(ObjectIdHex(query)).Select(ObjToOth(fields)).One(&res)
+		if nil != err {
+			log.Println("FindByIdError", err)
+		}
+	}
+	return &res
+}
+
 //底层查询方法
 func Find(c, alias, db string, query interface{}, order interface{}, fields interface{}, single bool, start int, limit int) *[]map[string]interface{} {
 	sess := GetMgoConn(alias)

+ 0 - 1
core/src/config.json

@@ -33,7 +33,6 @@
     "ocr_uid": "120.25.216.197",
     "ocr_servicekey": "c1608f6b-b507-46d4-98de-12e98f613715",
     "ocr_servicecode": "91f6a58d-e418-4e58-8ec2-61b583c55ba2",
-	"mongodbAlias":"A",
 	"entMongodbServers": "192.168.3.18:27090",
 	"entMongodbPoolSize": 5,
     "entMongodbName": "qfw",

+ 0 - 7
core/src/main.go

@@ -55,13 +55,6 @@ func init() {
 	mongodb.InitMongodbPool(SysConfig.MongodbPoolSize, SysConfig.Mongodbservers, SysConfig.MongodbName)
 	//企业mongodb初始化
 	conf := *new(mongodbutil.PoolConfig)
-	conf.Addr = SysConfig.Mongodbservers
-	conf.Alias = SysConfig.MongodbAlias
-	conf.DB = SysConfig.MongodbName
-	conf.Size = SysConfig.MongodbPoolSize
-	mongodbutil.Config = append(mongodbutil.Config, conf)
-
-	conf = *new(mongodbutil.PoolConfig)
 	conf.Addr = SysConfig.EntMongodbservers
 	conf.Alias = SysConfig.EntMongodbAlias
 	conf.DB = SysConfig.EntMongodbName

+ 0 - 1
core/src/qfw/coreconfig/SysConfig.go

@@ -12,7 +12,6 @@ type config struct {
 	MongodbPoolSize    int         `json:"mongodbPoolSize"`
 	MongodbName        string      `json:"mongodbName"`
 	Elasticsearch      string      `json:"elasticsearch"`
-	MongodbAlias       string      `json:"mongodbAlias"`
 	Smtp               smtp        `json:"smtp"`
 	Sms                sms         `json:"sms"`
 	Entrelation        entrelation `json:"entrelation”`

+ 5 - 0
core/src/qfw/front/index.go

@@ -131,6 +131,11 @@ func (i *Index) GetWebSiteTop() error {
 		}
 		if audittype := i.GetSession("audittype"); audittype != nil && audittype == "y" {
 			i.DelSession("audittype")
+			if userId := i.GetSession("userId"); userId != nil {
+				Update("user", &map[string]interface{}{
+					"_id": ObjectIdHex(userId.(string)),
+				}, `{'$set':{'s_audittype':'n'}}`, false, false)
+			}
 			result["auditType"] = audittype.(string)
 			result["entId"] = i.GetSession("entid")
 			result["entName"] = i.GetSession("entname")

+ 53 - 41
core/src/qfw/manage/auditing.go

@@ -18,6 +18,7 @@ import (
 	credit "qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/mongodb"
+	mongodbutil "qfw/util/mongodbutil"
 	. "qfw/util/msg"
 	"qfw/util/redis"
 	qrpc "qfw/util/rpc"
@@ -464,10 +465,10 @@ func (s *SystemManage) Updateaudit() error {
 		s_submitname := s.GetString("s_submitname")                 //提交者名称
 		i_identificationtype := s.GetString("i_identificationtype") //认证类型
 		s_id_new := s.GetString("s_id_new")                         //个人变更企业 更改前的企业注册号
-		s_enterprisename_new := s.GetString("s_enterprisename_new") //个人变更企业 更改前的企业名称
-		i_organizetype, _ := s.GetInt("i_organizetype")             //机构认证 机构类型
-		s_comauthenttype := s.GetString("s_comauthenttype")         //企业名片认证追加营业执照认证
-		i_comauthenttype, _ := s.GetInt("i_comauthenttype")         //企业名片认证追加营业执照认证类型
+		//s_enterprisename_new := s.GetString("s_enterprisename_new") //个人变更企业 更改前的企业名称
+		i_organizetype, _ := s.GetInt("i_organizetype")     //机构认证 机构类型
+		s_comauthenttype := s.GetString("s_comauthenttype") //企业名片认证追加营业执照认证
+		i_comauthenttype, _ := s.GetInt("i_comauthenttype") //企业名片认证追加营业执照认证类型
 		//s_mail := s.GetString("s_mail")                             //年报邮箱
 		data := make(M)
 		_status, _ := s.GetInteger("i_identificationstatus")
@@ -522,6 +523,7 @@ func (s *SystemManage) Updateaudit() error {
 			title = s_result
 			content = s_remark
 		} else {
+			_data4 := make(map[string]interface{})
 			data4 := make(map[string]interface{})
 			var query = ""
 			if s_id != "" {
@@ -531,7 +533,7 @@ func (s *SystemManage) Updateaudit() error {
 				//当审核通过的时候,根据企业名称查看企业表是否有数据
 				query = `{"EntName":"` + s_enterprisename + `"}`
 			}
-			t := Find("enterprise", query, nil, `{"_id":1}`, true, -1, -1)
+			t := mongodbutil.Find("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, query, nil, `{"_id":1}`, true, -1, -1)
 			ret := (*t)[0]
 			if nil != ret["_id"] {
 				//如果存在此企业,取出企业名称和企业id 更新企业表
@@ -560,9 +562,15 @@ func (s *SystemManage) Updateaudit() error {
 					i_identType = 1
 				}
 				tm := fmt.Sprintf("%d", time.Now().Unix())
-				Update("enterprise", &map[string]interface{}{
-					"_id": ObjectIdHex(s_enterpriseid),
-				}, `{'$set':{'s_action':'`+s_action+`','EntName':'`+s_enterprisename+`','RegNo':'`+s_id+`','s_submitid':'`+s_submitid+`','s_submitname':'`+s_submitname+`','l_submittime':`+tm+`}}`, false, false)
+				mongodbutil.Update("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, M{"_id": ret["_id"]}, M{"$set": M{"EntName": s_enterprisename}}, false, false)
+				Update("enterprise", M{"_id": ret["_id"]}, M{"$set": M{"_id": ret["_id"],
+					"RegNo":        s_id,
+					"s_action":     s_action,
+					"s_submitid":   s_submitid,
+					"s_submitname": s_submitname,
+					"l_submittime": tm,
+				}}, true, false)
+
 				elastic.UpdateEntDoc(s_enterpriseid)
 				if i_identificationtype == "5" {
 					per := FindOne("enterprise", M{"RegNo": s_id_new})
@@ -571,59 +579,60 @@ func (s *SystemManage) Updateaudit() error {
 						Del("enterprise", M{"RegNo": s_id_new})
 					}
 				}
-
 			} else {
 				if i_identificationtype == "5" {
+					s_enterpriseid = s.GetString("s_enterpriseid")
 					s_action = "01"              //是否已认证并判断认证类型-个人变更企业
-					data4["SourceType"] = "02"   //网站录入个人变更企业信息
+					_data4["SourceType"] = "02"  //网站录入个人变更企业信息
 					data4["s_action"] = s_action //是否已认证并判断认证类型-个人变更企业
-					var querynew = ""
-					if s_id_new != "" {
-						//当审核通过的时候,根据注册号查看企业表是否有数据
-						querynew = `{"RegNo":"` + s_id_new + `"}`
-					} else {
-						//当审核通过的时候,根据企业名称查看企业表是否有数据
-						querynew = `{"EntName":"` + s_enterprisename_new + `"}`
-					}
-					Update("enterprise", querynew, `{'$set':{'s_action':'`+s_action+`','s_submitid':'`+s_submitid+`','EntName':'`+s_enterprisename+`','RegNo':'`+s_id+`'}}`, false, false)
-					s_enterpriseid = s.GetString("s_enterpriseid")
+					var querynew = `{"_id":"` + s_enterpriseid + `"}`
+					_data4["EntName"] = s_enterprisename
+					_data4["RegNo"] = s_id
+					mongodbutil.Update("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, querynew, M{"$set": _data4}, false, false)
+					data4["RegNo"] = s_id
+					data4["s_action"] = s_action
+					data4["s_submitid"] = s_submitid
+					Update("enterprise", querynew, M{"$set": data4}, false, false)
 					elastic.UpdateEntDoc(s_enterpriseid)
-
 				} else {
+					//如果没有此企业,则把此企业保存到公式企业表里
+					_data4["EntName"] = s.GetString("s_enterprisename")    //企业名称
+					_data4["RegNo"] = s_id                                 //注册号
+					_data4["LeRep"] = s.GetString("s_legalrepresentative") //法定代表人
+					_data4["EstDate"], _ = s.GetInt("l_establishmentdate") //成立日期
+					_data4["Dom"] = s.GetString("s_enterpriseaddress")     //住所
 					//如果没有此企业,则把此企业保存到企业表里
-					data4["EntName"] = s.GetString("s_enterprisename")    //企业名称
-					data4["RegNo"] = s_id                                 //注册号
-					data4["LeRep"] = s.GetString("s_legalrepresentative") //法定代表人
-					data4["EstDate"], _ = s.GetInt("l_establishmentdate") //成立日期
-					data4["Dom"] = s.GetString("s_enterpriseaddress")     //住所
-					data4["i_organizetype"] = i_organizetype              //组织机构类型
-					data4["s_pic"] = s.GetString("s_pic")                 //组织机构代码证
-					rel := s.GetString("l_submitdate")                    //提交审核时间
+					data4["RegNo"] = s_id
+					data4["i_organizetype"] = i_organizetype //组织机构类型
+					data4["s_pic"] = s.GetString("s_pic")    //组织机构代码证
+					rel := s.GetString("l_submitdate")       //提交审核时间
 					tim, _ := time.ParseInLocation("2006-01-02 15:04:05", rel, time.Local)
 					data4["l_submitdate"] = tim.Unix()
 					data4["s_submitname"] = s.GetString("s_submitname")
 					data4["s_submitid"] = s_submitid
 					data4["l_submittime"] = time.Now().Unix() //审核时间
 					if i_identificationtype == "1" {
-						data4["SourceType"] = "02" //网站录入企业认证信息
-						data4["s_action"] = "01"   //是否已认证并判断认证类型-企业认证
+						_data4["SourceType"] = "02" //网站录入企业认证信息
+						data4["s_action"] = "01"    //是否已认证并判断认证类型-企业认证
 						i_identType = 1
 					} else if i_identificationtype == "2" {
-						data4["SourceType"] = "03" //网站录入个人认证信息
-						data4["s_action"] = "02"   //是否已认证并判断认证类型-个人认证
+						_data4["SourceType"] = "03" //网站录入个人认证信息
+						data4["s_action"] = "02"    //是否已认证并判断认证类型-个人认证
 						i_identType = 2
 					} else if i_identificationtype == "3" {
-						data4["SourceType"] = "04" //网站录入机构认证信息
-						data4["s_action"] = "03"   //是否已认证并判断认证类型-机构认证
+						_data4["SourceType"] = "04" //网站录入机构认证信息
+						data4["s_action"] = "03"    //是否已认证并判断认证类型-机构认证
 						i_identType = 3
 					} else if i_identificationtype == "4" {
 						//data4["SourceType"] = "03" //网站录入商家名称变更信息
 						data4["s_action"] = "02" //是否已认证并判断认证类型-商家名称变更
 						i_identType = 2
 					}
-					i := Save("enterprise", data4)
-					elastic.UpdateEntDoc(i)
-					s_enterpriseid = i
+					_data4_id := mongodbutil.Save("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, _data4)
+					data4["_id"] = ObjectIdHex(_data4_id)
+					Update("enterprise", `{"_id":"`+_data4_id+`"}`, M{"$set": data4}, true, false)
+					elastic.UpdateEntDoc(_data4_id)
+					s_enterpriseid = _data4_id
 				}
 			}
 			//根据提交人id更新到user表中
@@ -632,9 +641,12 @@ func (s *SystemManage) Updateaudit() error {
 			data1["freezeremark"] = freezeremark
 			data1["s_enterprisename"] = s_enterprisename
 			data1["s_enterpriseid"] = s_enterpriseid
-			data1["i_identificationway"] = 1             //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
-			data1["s_role"] = "9"                        //权限设为企业管理员
-			data1["s_audittype"] = "y"                   //作为认证后第一次登录的标识
+			data1["i_identificationway"] = 1 //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
+			data1["s_role"] = "9"            //权限设为企业管理员
+			//作为认证后第一次登录的标识
+			if i_identificationtype == "1" || i_identificationtype == "2" || i_identificationtype == "3" {
+				data1["s_audittype"] = "y"
+			}
 			data1["i_comauthenttype"] = i_comauthenttype //user企业认证是名片认证和营业执照认证
 			data1["s_audit_record_id"] = _id
 			if i_identificationtype == "5" {

+ 1 - 1
core/src/qfw/member/memberindex.go

@@ -147,7 +147,7 @@ func (m *MemberIndex) ModifySellerNamePs() error {
 		data := make(M)
 		data["i_identificationstatus"] = 2
 		data["i_identificationtype"] = 4
-		data["s_submitname"] = m.Session().Get("nickName")
+		data["s_submitname"] = m.GetSession("userName")
 		data["s_submitid"] = userId
 		data["s_enterprisename_new"] = cname
 		data["l_submitdate"] = time.Now().Unix()

+ 0 - 10
core/src/qfw/member/membermanager.go

@@ -217,7 +217,6 @@ func (m *Member) GetLogin(key string) error {
 			}
 			if bcon {
 				UpdateCookieSession(m.Action, "s_name", false, *user)
-				updateAudittype(m.Action, user)
 				flag := 0
 				if redis.GetStr("sso", "new_"+key) == res {
 					flag = 1
@@ -425,14 +424,6 @@ func (m *Member) RegisterComplete() error {
 	return m.Render("/member/registercomplete.html", &m.T)
 }
 
-func updateAudittype(action *xweb.Action, r *map[string]interface{}) {
-	if action.GetSession("audittype") == "y" {
-		Update("user", &map[string]interface{}{
-			"_id": ObjectIdHex(strings.Split(fmt.Sprintf("%s", (*r)["_id"]), `"`)[1]),
-		}, `{'$set':{'s_audittype':'n'}}`, false, false)
-	}
-}
-
 //登录
 func (m *Member) Login() {
 	var status string = "n"
@@ -470,7 +461,6 @@ func (m *Member) Login() {
 					//更新session、cookie
 					UpdateCookieSession(m.Action, loginType, m.GetString("rememberMe") == "y", *r)
 				}
-				updateAudittype(m.Action, r)
 			}
 		}
 	} else {

+ 1 - 1
core/src/qfw/member/yellowpage.go

@@ -231,7 +231,7 @@ func (yp *Yellowpage) Dosave() error {
 	flag := mongodb.Update(ESTYPE, "{'_id':'"+entid+"'}", &dataSet, false, false)
 	redis.Del("enterprise", "enterpriseInfo_"+entid)
 	redis.Del("enterprise", "enterpriseInfo_user_"+entid)
-	elastic.UpdateNewDoc("enterprise", "enterprise", mongodb.FindById("enterprise", entid, nil))
+	elastic.UpdateEntDoc(entid)
 	redis.DelByCodePattern("enterprise", "ipcity_*")
 	if !flag {
 		status = "n"

+ 9 - 5
core/src/qfw/microwebsite/microwebsite.go

@@ -9,10 +9,12 @@ import (
 	"encoding/json"
 	"github.com/go-xweb/xweb"
 	. "gopkg.in/mgo.v2/bson"
+	. "qfw/coreconfig"
 	. "qfw/util"
 	elastic "qfw/util/elastic"
 	"qfw/util/fsw"
 	. "qfw/util/mongodb"
+	mongodbutil "qfw/util/mongodbutil"
 	"qfw/util/redis"
 	"strings"
 	"time"
@@ -173,12 +175,13 @@ func (m *MicroWebsite) Preview(entId string) error {
  */
 func getDetail(entId string, m *MicroWebsite) bool {
 	//企业查询
+	_e := mongodbutil.FindOneByField("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, "{'_id':'"+entId+"'}", `{"EntName":1}`)
 	e := *FindOne("enterprise", "{'_id':'"+entId+"'}")
 	if e == nil {
 		return false
 	}
+	m.T["EntName"] = (*_e)["EntName"]           //企业名
 	m.T["entId"] = entId                        //企业id
-	m.T["EntName"] = e["EntName"]               //企业名
 	m.T["s_persion"] = e["s_persion"]           //联系人
 	m.T["s_mobile"] = e["s_mobile"]             //手机号
 	m.T["s_address"] = e["s_address"]           //地址
@@ -229,15 +232,16 @@ func (m *MicroWebsite) AjaxPorcess() error {
 			break
 		case 2:
 			if EntName := fsw.Repl(m.GetString("EntName")); EntName != "" {
-				entObj["EntName"] = fsw.Repl(m.GetString("EntName")) //修改企业名称
+				mongodbutil.Update("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, "{'_id':'"+entId+"'}", M{"$set": M{"EntName": fsw.Repl(m.GetString("EntName"))}}, false, false) //修改企业名称
 			}
 			entObj["s_synopsis"] = fsw.Repl(m.GetStringComm("s_synopsis")) //修改企业简介
 			break
 		}
-		//修改企业信息
-		if len(entObj) > 0 && Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": entObj}, false, false) {
-			elastic.UpdateEntDoc(entId) //更新该企业的elastic数据
+		if len(entObj) > 0 {
+			Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": entObj}, false, false)
 		}
+		//修改企业信息
+		elastic.UpdateEntDoc(entId) //更新该企业的elastic数据
 	} else if reqType == "addService" {
 		tempId := m.GetString("tempId")
 		serviceObj := make(M)

+ 25 - 18
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -17,6 +17,7 @@ import (
 	"qfw/util/credit"
 	elastic "qfw/util/elastic"
 	. "qfw/util/mongodb"
+	mongodbutil "qfw/util/mongodbutil"
 	"qfw/util/redis"
 	"regexp"
 	"strconv"
@@ -47,21 +48,14 @@ func FormatDate(src *interface{}) string {
 }
 
 func GetEntInfo(id string) map[string]interface{} {
-	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1, "s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1,"staffinfo":1,"RegCapCurName":1}`)
+	res := mongodbutil.FindById("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1,"SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1,"staffinfo":1,"RegCapCurName":1}`)
 	if res != nil && len(*res) > 0 {
-		id := (*res)["s_submitid"]
-		if id != nil {
-			ud := FindById("user", id.(string), `{"i_comauthenttype":1}`)
-			(*res)["i_comauthenttype"] = (*ud)["i_comauthenttype"]
-		}
 		opl, _ := (*res)["OpLocDistrict"].(string)
 		if len(opl) >= 2 {
 			if v, ok := city_map[opl[:2]]; ok {
 				(*res)["OpLoc"] = v
 			}
 		}
-		syno, _ := (*res)["s_synopsis"].(string)
-		(*res)["s_synopsis"] = template.HTML(syno)
 		ty, _ := (*res)["SourceType"].(string)
 		if ty == "01" {
 			(*res)["gs"] = true
@@ -77,10 +71,6 @@ func GetEntInfo(id string) map[string]interface{} {
 			(*res)["OpTo"] = FormatDate(&OpTo)
 		}
 		IssBLicDate := (*res)["IssBLicDate"]
-		s_action := (*res)["s_action"]
-		if s_action == nil || s_action == "" {
-			(*res)["s_action"] = "N"
-		}
 		if OpFrom != nil {
 			(*res)["IssBLicDate"] = FormatDate(&IssBLicDate)
 		}
@@ -108,7 +98,6 @@ func GetEntInfo(id string) map[string]interface{} {
 		}
 		//
 		(*res)["EntTypeLabel"] = (mobile.GetDiffName(EntType))[0]
-		(*res)["entid"] = id
 		//企业变更排序
 		var alterInfo []map[string]interface{}
 		if d, err := json.Marshal((*res)["alterInfo"]); err == nil {
@@ -126,6 +115,24 @@ func GetEntInfo(id string) map[string]interface{} {
 			}
 		}
 		(*res)["alterInfo"] = alterInfo
+		ent := FindById("enterprise", id, `{"s_synopsis":1,"s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1}`)
+		if ent != nil && len(*ent) > 0 {
+			for k, v := range *ent {
+				(*res)[k] = v
+			}
+			id := (*res)["s_submitid"]
+			if id != nil {
+				ud := FindById("user", id.(string), `{"i_comauthenttype":1}`)
+				(*res)["i_comauthenttype"] = (*ud)["i_comauthenttype"]
+			}
+			syno, _ := (*res)["s_synopsis"].(string)
+			(*res)["s_synopsis"] = template.HTML(syno)
+			s_action := (*res)["s_action"]
+			if s_action == nil || s_action == "" {
+				(*res)["s_action"] = "N"
+			}
+		}
+		log.Println(res)
 		return *res
 	}
 	return nil
@@ -226,7 +233,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 	if len(ismobile) > 0 {
 		key = "menterpriseInfo_"
 	}
-	if ret, err := redis.GetBytes("enterprise", key+id); err == nil {
+	if ret, err := redis.GetBytes("enterprise", key+id); err == nil && false {
 		return yp.SetBody(*ret)
 	} else {
 		if info := GetEntInfo(id); info != nil {
@@ -245,7 +252,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 						}
 					}
 					if len(entmids) > 0 {
-						relevantEnts := Find("enterprise", M{"_id": M{"$in": entmids}}, nil, `{"s_avatar":1,"RegNo":1,"EntName":1}`, false, -1, -1)
+						relevantEnts := mongodbutil.Find("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, M{"_id": M{"$in": entmids}}, nil, `{"s_avatar":1,"RegNo":1,"EntName":1}`, false, -1, -1)
 						if relevantEnts != nil && len(*relevantEnts) > 0 {
 							for _, relevantEnt := range *relevantEnts {
 								relevantEnt["_id"] = util.BsonIdToSId(relevantEnt["_id"])
@@ -485,8 +492,8 @@ func getRelation(regNo, entName string) (r map[string]interface{}, ok bool) {
 //生成图用的结果
 func makeRelation(mnregno, mnname string) interface{} {
 	t1 := time.Now()
-	sess := GetMgoConn()
-	defer DestoryMongoConn(sess)
+	sess := mongodbutil.GetMgoConn(cf.SysConfig.EntMongodbAlias)
+	defer mongodbutil.DestoryMongoConn(cf.SysConfig.EntMongodbAlias, sess)
 	//mnregno := "410522010001059"
 	//mnname := "安阳市长江工程有限责任公司"
 	mntype := "ce"
@@ -718,7 +725,7 @@ func filterEntName(nodes *[]map[string]interface{}) int {
 				v["shorttext"] = shortText
 				count++
 				if v["type"] == "e" {
-					Update("entrelation", `{"_id":"`+v["_id"].(string)+`"}`, `{"$set":{"shortname":"`+shortText+`"}}`, false, false)
+					mongodbutil.Update("entrelation", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, `{"_id":"`+v["_id"].(string)+`"}`, `{"$set":{"shortname":"`+shortText+`"}}`, false, false)
 				}
 			}
 		}

+ 2 - 1
core/src/web/staticres/css/dev-qfw.css

@@ -2378,7 +2378,8 @@ style="color:#D03102;margin-right:5px;"
 	margin-right: 5px;
 }
 .b-head .b-loginStatus{
-	padding-left: 15px;
+	padding-left: 5px;
+	padding-right: 5px;
 	position: relative;
 	cursor: pointer;
 }

+ 1 - 0
core/src/web/staticres/css/qfw.css

@@ -364,6 +364,7 @@ a.new_red:hover, a.new_red:active {
 .member-left, .member-right {
 	vertical-align: top;
 	display: inline-block;
+	width: 942px;
 }
 
 .member-left {

+ 1 - 1
core/src/web/templates/manage/audithead.html

@@ -2,7 +2,7 @@
 <div class="container-fluid" style="border-bottom: 1px solid #eeeeee;">
 <div class="row qfw-header">
 <div class="col-lg-5 col-md-6  hidden-sm hidden-xs ">
-	<a href="/"><img id="searchHeader-logo" src="{{Msg "seo" "cdn"}}/images/logo.png" class="lineb header_logo"/></a>
+	<a href="/"><img id="searchHeader-logo" src="{{Msg "seo" "cdn"}}/images/logo.png" class="lineb logo"/></a>
 	<img  src="{{Msg "seo" "cdn"}}/images/v_line.png" class="lineb" style="margin:0 5px;" />
 	<div class="text-muted lineb fontb" style="font-size:30px;height:80px;line-height:80px;vertical-align:middle">系统设置</div>
 </div>

+ 8 - 6
core/src/web/templates/member/comauthent.html

@@ -40,11 +40,9 @@ label {
 .Validform_wrong{
 	display:inline;
 	line-height:16px;
-	width:50%;
 }.Validform_wrongbottom{
 	display: table-cell;
 	line-height:16px;
-	width:50%;
 	color: #97310e;
     background-image: url('{{Msg "seo" "cdn"}}/images/error_bg.png');
 }
@@ -181,8 +179,8 @@ label {
 			 <!--div 模拟表格布局结束-->
 			  <div style="position:relative">
 				<input type="hidden" name="imgurl" id="imgurl" value="" datatype="*" /><span id="imgurlv" style="width:105px;" class="Validform_checktip"></span> 
-				<div class="text-left margin-t-15" id="mm"></div>
-				<span id="showImgTip" class="Validform_checktip Validform_wrongbottom" style="width:25%;display:none">请上传营业执照</span>
+				<div class="text-left margin-t-15" id="mm" style="display: inline-block;margin-right: 15px;"></div>
+				<div style="display: inline-block;vertical-align:sub;"><span id="showImgTip" class="Validform_checktip Validform_wrongbottom" style="display:none">请上传营业执照</span></div>
 				<!--<a class="btn btn-default" style="position:absolute;top:0;left:120px;color:#000 " onclick="viewimg()">预览</a>-->
 			  </div>
 		
@@ -338,6 +336,7 @@ function checkcname(){
 	if (!obj){
 		($("#cnamev").removeClass("Validform_right").addClass("Validform_wrong"))[0].innerHTML="请输入企业名称"
 		$("#btn").addClass("disabled");
+		$("#cnamev").next().hide();
 	}else{
 		//根据企业名称查询
 		$.ajax({
@@ -348,11 +347,13 @@ function checkcname(){
 			success:function(data){
 				if(data){
 					if(data.msg){
-						$("#cnamev").removeClass("Validform_wrong")[0].innerHTML=""
+						$("#cnamev").removeClass("Validform_wrong font-size-12")[0].innerHTML=""
 						$("#btn").removeClass("disabled");
+						$("#cnamev").next().show();
 					}else{
-						($("#cnamev").addClass("Validform_wrong"))[0].innerHTML="企业名称已经认证过,请仔细核对或联系网站工作人员";
+						($("#cnamev").addClass("Validform_wrong font-size-12"))[0].innerHTML="企业名称已经认证过,请仔细核对或联系网站工作人员";
 						$("#btn").addClass("disabled");
+						$("#cnamev").next().hide();
 					}
 				}
 			}
@@ -405,6 +406,7 @@ function upcomauthent(){
 	if(cname.length==0){
 		($("#cnamev").removeClass("Validform_right").addClass("Validform_wrong"))[0].innerHTML="请输入企业名称"
 		$("#btn").addClass("disabled");
+		$("#cnamev").next().hide();
 		return;
 	}
 	

+ 11 - 8
core/src/web/templates/member/otherauthentication.html

@@ -125,8 +125,8 @@
 						<!--身份证右边显示信息结束-->
 						 <div style="position:relative">
 							<input type="hidden" name="imgurl" id="imgurl" value="" datatype="*" />
-							<span id="imgurlv" style="width:105px;" class="Validform_checktip"></span> 
-							<div class="text-left" style="margin-left:5px;" id="mm"></div>
+							<div class="text-left" style="margin-top:15px;margin-right: 15px;display:inline-block;" id="mm"></div>
+							<div style="display:inline-block;vertical-align:sub;"><span id="imgurlv" class="Validform_checktip"></span> </div>
 							<div id="showImgTip" class="Validform_checktip Validform_wrongbottom" style="width:100%;display:none">请上传身份证照片</div>
 							<!--<a class="btn btn-default" style="position:absolute;top:0;left:120px;color:#000 " onclick="viewimg()">预览</a>-->
 						  </div>
@@ -137,10 +137,11 @@
 					<span class="col-sm-2" ></span>
 					<span class="col-sm-10" style="margin:0px;padding:0px;font-size:12px;color:#999;">您提供的照片信息将予以保护,不会挪作他用,详见<span style="color:#dd4814;">企业网隐私权政策</span></span>
 				</div>
-				
-				<div style="text-align:left; width:100%;margin:20px;margin-left:108px;">
-					<button id="btn" type="button" onclick="upcomauthent()" class="btn btn-primary" >提交审核
-			        </button>
+				<div class="form-group">
+					<span class="col-sm-2" ></span>
+					<span class="col-sm-10">
+						<button id="btn" type="button" onclick="upcomauthent()" class="btn btn-primary" >提交审核</button>
+					</span>
 				</div>
 			</form>
 	      
@@ -180,11 +181,13 @@ function checkname(obj){
 	if (obj.trim()==""){
 		$("#namev").addClass("Validform_wrong")
 		document.getElementById("namev").innerHTML="请输入组织名称"
-		$("#btn").addClass("disabled")
+		$("#btn").addClass("disabled");
+		$("#namev").next().hide();
 	}else{
 		$("#namev").removeClass("Validform_wrong")
 		document.getElementById("namev").innerHTML=""
-		$("#btn").removeClass("disabled")
+		$("#btn").removeClass("disabled");
+		$("#namev").next().show();
 	}
 }
 function checkorganizetype(obj){

+ 14 - 6
core/src/web/templates/member/personalauthent.html

@@ -133,8 +133,8 @@ label {
 							<!--身份证右边显示信息结束-->
 							 <div style="position:relative">							
 								<input type="hidden" name="imgurl" id="imgurl" value="" datatype="*" />
-								<span id="imgurlv" style="width:105px;" class="Validform_checktip"></span> 
-								<div class="text-left margin-t-15" id="mm"></div>
+								<div class="text-left margin-t-15" id="mm" style="margin-right: 15px;display: inline-block;"></div>
+								<div style="display:inline-block;vertical-align:sub;"><span id="imgurlv" class="Validform_checktip"></span></div>
 								<div id="showImgTip" class="Validform_checktip Validform_wrongbottom" style="width:100%;display:none">请上传身份证照片</div>
 								<!--<a class="btn btn-default" style="position:absolute;top:0;left:120px;color:#000 " onclick="viewimg()">预览</a>-->
 							</div>
@@ -165,10 +165,11 @@ label {
 				         
 					  </div>
 					</div>
-					
-					<div style="text-align:left; width:100%;margin:20px;margin-left:140px;">
+					<div class="form-group">
+					  <div class="col-sm-offset-2 col-sm-10">
 						<a id="btnshangyibu" class="btn btn-primary" onclick="btnshangyibu();"  >上一步</a>
 						<button id="btn" type="button" onclick="upcomauthent();" class="btn btn-primary" >提交审核</button>
+					  </div>
 					</div>
 				</div><!--secondform-->
 				
@@ -251,14 +252,17 @@ function checkname(obj){
 		$("#namev").addClass("Validform_wrong");
 		document.getElementById("namev").innerHTML="请输入姓名";
 		$("#btnnext").addClass("disabled");
+		$("#namev").next().hide();
 	}else if(obj.trim().length>50){
 		$("#namev").addClass("Validform_wrong");
 		document.getElementById("namev").innerHTML="长度小于50";
 		$("#btnnext").addClass("disabled");
+		$("#namev").next().hide();
 	}else{
 		$("#namev").removeClass("Validform_wrong");
 		document.getElementById("namev").innerHTML="";
 		$("#btnnext").removeClass("disabled");
+		$("#namev").next().show();
 	}
 }
 
@@ -361,11 +365,13 @@ function checkshopname(obj){
 	if(obj.trim()==""){
 		$("#shopnamev").addClass("Validform_wrong")
 		document.getElementById("shopnamev").innerHTML="请输入商家名称"
-		$("#btn").addClass("disabled")
+		$("#btn").addClass("disabled");
+		$("#shopnamev").next().hide();
 	}else{
 		$("#shopnamev").removeClass("Validform_wrong")
 		document.getElementById("shopnamev").innerHTML=""
-		$("#btn").removeClass("disabled")
+		$("#btn").removeClass("disabled");
+		$("#shopnamev").next().show();
 	}
 }
 
@@ -429,10 +435,12 @@ $(function(){
 	    if(name.trim()==""){
 			$("#namev").addClass("Validform_wrong");
 			document.getElementById("namev").innerHTML="请输入姓名";
+			$("#namev").next().hide();
 			return;
 		}else if(name.trim().length>30){
 			$("#namev").addClass("Validform_wrong");
 			document.getElementById("namev").innerHTML="姓名长度小于30";
+			$("#namev").next().hide();
 		}
 		var cardnum = $("#cardnum").val();    
 	    if(cardnum.trim()==""){

+ 1 - 1
core/src/web/templates/member/register.html

@@ -53,7 +53,7 @@
 <div class="container-fluid">
 	<div class="qfw-header">
 		<div>
-			<a href="/"><img alt="" src="{{Msg "seo" "cdn"}}/images/logo.png" class="header_logo"></a>
+			<a href="/"><img alt="" src="{{Msg "seo" "cdn"}}/images/logo.png" class="logo"></a>
 			<img alt="" src="{{Msg "seo" "cdn"}}/images/v_line.png" class="header_line">
 			<font class="text-muted">注册</font>
 		</div>

+ 1 - 1
core/src/web/templates/member/registercomplete.html

@@ -63,7 +63,7 @@ function getRecomService(){
 <div class="container-fluid">
 	<div class="qfw-header">
 		<div>
-			<a href="/"><img alt="" src="{{Msg "seo" "cdn"}}/images/logo.png" class="header_logo"></a>
+			<a href="/"><img alt="" src="{{Msg "seo" "cdn"}}/images/logo.png" class="logo"></a>
 			<img alt="" src="{{Msg "seo" "cdn"}}/images/v_line.png" class="header_line">
 			<font class="text-muted">注册完成</font>
 		</div>

+ 1 - 1
core/src/web/templates/swordfish/rssset.html

@@ -13,7 +13,7 @@
 	<div class="b-left">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
-			<span >继续使用表明已经同意了<span><a href='/member/swordfish/protocol'>剑鱼用户服务协议</a>
+			<span >继续使用表明已经同意了<span><a href='/member/swordfish/protocol'>剑鱼用户服务协议</a>
 			<span style="float:right;width:190px">
 			<a id="ckys">查看演示&nbsp;&nbsp;</a>
 			<a id="sfbz" onclick="$('#sfbzModal').modal('show')">收费标准</a>

+ 3 - 3
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -129,13 +129,13 @@
 	</div>
 	<!--切换-->
 	<ul class="ent-tab">
-		<li class="ent-active"><div class="b-com-border-top"></div>{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}概况</li>
+		<li class="ent-active"><div class="b-com-border-top"></div>{{if .T.res.s_action}}{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}{{else}}企业{{end}}概况</li>
 		<li><div class="b-com-border-top"></div>关系网</li>
 		<li{{if not .T.res.staffinfo}} class="disabled"{{end}}><div class="b-com-border-top"></div>主要人员<front class="badge" id="ent-tab-staffinfo">0</front></li>
 		<li{{if and (not .T.copyright.WorkCopyRight) (not .T.copyright.SoftWareCopyRight) (not .T.copyright.Patent)}} class="disabled"{{end}}><div class="b-com-border-top"></div>著作权<front class="badge" id="ent-tab-copyright">0</front></li>
 		<li{{if not .T.res.alterInfo}} class="disabled"{{end}}><div class="b-com-border-top"></div>变更信息<front class="badge{{if .T.res.alterInfo}}{{if eq (len .T.res.alterInfo) 0}} disabled{{end}}{{else}} disabled{{end}}">{{if .T.res.alterInfo}}{{len .T.res.alterInfo}}{{else}}0{{end}}</front></li>
 		<li{{if not .T.dishonesty.count}} class="disabled"{{end}}><div class="b-com-border-top"></div>失信信息<front class="badge" id="ent-tab-dishonesty">0</front></li>
-		<li class="{{if and (not .T.service.count) (not .T.res.s_synopsis)}}disabled {{end}}border-r-0"><div class="b-com-border-top"></div>{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}黄页</li>
+		<li class="{{if and (not .T.service.count) (not .T.res.s_synopsis)}}disabled {{end}}border-r-0"><div class="b-com-border-top"></div>{{if .T.res.s_action}}{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}{{else}}企业{{end}}黄页</li>
 	</ul>
 	<div class="ent-tab-content b-left{{if and (not .T.relevantNews) (not .T.relevantEnts)}} b-right-none{{end}}">
 		<!--企业概况-->
@@ -456,7 +456,7 @@
 			{{if .T.res.s_synopsis}}
 			<div class="ent-layout-down">
 				<div class="b-com-title">
-					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}介绍
+					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>{{if .T.res.s_action}}{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}{{else}}企业{{end}}介绍
 				</div>
 				<div class="b-com-content">{{.T.res.s_synopsis}}</div>
 			</div>