소스 검색

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangshan 9 년 전
부모
커밋
2282a4ac8a

+ 3 - 3
core/src/qfw/search/searchService.go

@@ -350,7 +350,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 						      }
 						    }
 						  }
-						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","RegCapCurName","s_avatar"]
+						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar","excDirect"]
 						,"from":0,
 						"size":` + fmt.Sprintf("%v", perPage) + `,
 						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
@@ -509,8 +509,8 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 
 		total = elastic.Count("enterprise", "enterprise", tempQuery)
 	}
-	if total > 500 {
-		total = 500
+	if total > 400 {
+		total = 400
 	}
 	//查询列表数据
 	client := elastic.GetEsConn()

+ 2 - 0
core/src/qfw/yellowpage/yellowpage.go

@@ -13,6 +13,8 @@ type Yellowpage struct {
 	getRelation xweb.Mapper `xweb:"/member/getRelation"`
 	//获取失信信息
 	getDishonesty xweb.Mapper `xweb:"/front/getDishonesty"`
+	//根据注册证号展示关系网
+	showRelationByRegNo xweb.Mapper `xweb:"/enterprise/relation/(\\w+)"`
 }
 
 func init() {

+ 59 - 12
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -12,6 +12,7 @@ import (
 	"log"
 	cf "qfw/coreconfig"
 	"qfw/mobile"
+	tag "qfw/tag"
 	"qfw/util"
 	"qfw/util/credit"
 	elastic "qfw/util/elastic"
@@ -212,23 +213,13 @@ func CommonEntInfo(yp *xweb.Action, id string, editFlag int, ismobile bool) erro
 		//关系网数据
 		yp.T["relflag"] = relflag
 		//著作权
-		yp.T["copyright"] = FindOne("enterprise_copyright", `{"EntId":"`+id+`"}`)
+		yp.T["copyright"] = FindOne("enterprise_copyright", `{"EntName":"`+entName+`"}`)
 		//编辑企业名片标识
 		yp.T["editFlag"] = editFlag
 		yp.T["lastService"] = getLastService(id)
 		//过滤企业名
 		if relflag && nodes != nil && len(*nodes) > 0 {
-			go func() {
-				util.Try(func() {
-					if filterEntName(nodes) > 0 {
-						relation["nodes"] = nodes
-						redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
-						redis.Del("enterprise", "enterpriseInfo_"+id)
-					}
-				}, func(e interface{}) {
-					log.Println("过滤企业名出错:", e)
-				})
-			}()
+			processRelation(nodes, relation, regNo, id)
 		}
 		if editFlag > 0 {
 			return yp.Render("/enterprise/detail.html", &yp.T)
@@ -569,6 +560,20 @@ func checkAuth(obj map[string]interface{}) (b bool, err string) {
 	}
 	return true, ""
 }
+func processRelation(nodes *[]map[string]interface{}, relation map[string]interface{}, regNo, id string) {
+	go func() {
+		util.Try(func() {
+			if filterEntName(nodes) > 0 {
+				relation["nodes"] = nodes
+				redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
+				redis.Del("enterprise", "enterpriseInfo_"+id)
+			}
+		}, func(e interface{}) {
+			log.Println("过滤企业名出错:", e)
+		})
+	}()
+}
+
 func filterEntName(nodes *[]map[string]interface{}) int {
 	if len(provinces) == 0 {
 		util.ReadConfig("./province.json", &provinces)
@@ -691,3 +696,45 @@ func filterRegion(text string) string {
 	}
 	return text
 }
+
+//根据注册证号展示关系网
+func (yp *Yellowpage) ShowRelationByRegNo(regNo string) error {
+	defer util.Catch()
+	data := tag.Ad("relation-limit", 1)
+	if strings.TrimSpace(regNo) == "" || data == nil || len(data) == 0 || len(data[0]) == 0 || data[0]["o_extend"] == nil {
+		log.Println("关系网接口没有开放!")
+		return yp.Render("/_error.html")
+	}
+	extend := data[0]["o_extend"].(map[string]interface{})
+	if util.ObjToString(extend["flag"]) != "true" {
+		log.Println("关系网接口没有开放!")
+		return yp.Render("/_error.html")
+	}
+	res := mongodbutil.FindOneByField("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, `{"RegNo":"`+regNo+`"}`, `{"EntName":1,"LegCerNO":1,"RegCapCurName":1}`)
+	var flag = -1
+	if res != nil && len(*res) > 0 {
+		id := util.BsonIdToSId((*res)["_id"])
+		entName, _ := (*res)["EntName"].(string)
+		datas, ok := getRelation(regNo, entName)
+		var nodes *[]map[string]interface{}
+		if ok {
+			d, err := json.Marshal(datas["nodes"])
+			if err != nil || json.Unmarshal(d, &nodes) != nil {
+				flag = -2
+			}
+			if ok {
+				flag = 1
+				processRelation(nodes, datas, regNo, id)
+			}
+		}
+		yp.T["RegNo"] = regNo
+		yp.T["EntName"] = entName
+		yp.T["LegCerNO"] = (*res)["LegCerNO"]
+		yp.T["RegCapCurName"] = (*res)["RegCapCurName"]
+		yp.T["relation"] = datas
+	} else {
+		flag = -3
+	}
+	yp.T["relFlag"] = flag
+	return yp.Render("/enterprise/relation.html")
+}

+ 1 - 1
core/src/web/templates/common/login.html

@@ -64,7 +64,7 @@ function loginModalShow(url){
 	$("#wxPic").attr("src","");
 	$.post("/front/wxlogin/getNum",function(data){
 		if(data&&data.num){		
-			$("#wxPic").attr("src","http://wxs.qimingxing.info/weixin/sso/"+data.num);
+			$("#wxPic").attr("src","/weixin/sso/"+data.num);
 			setTimes(data.num,35)		
 		}
 	},'json');

+ 0 - 1
core/src/web/templates/enterprise/detail.html

@@ -562,7 +562,6 @@ var dishonesty = {{.T.dishonesty}};
 var gs = {{.T.res.gs}};
 var investor = {{.T.res.investor}};
 var OpScope = {{.T.res.OpScope}};
-var service = {{.T.service}};
 var relFlag = {{.T.relflag}};
 var copyright = {{.T.copyright}};
 var editFlag = {{.T.editFlag}}==2;

+ 142 - 0
core/src/web/templates/enterprise/relation.html

@@ -0,0 +1,142 @@
+<html>
+<head>
+<title>{{.T.res.EntName}}</title>
+<link href="{{Msg "seo" "cdn"}}/css/qfw.css" rel="stylesheet">
+<script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/d3.v3.min.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/geometry.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/provinceData.min.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/relation.js"></script>
+<script type="text/javascript">
+	var regNo = {{.T.RegNo}};
+	var regCapCurName = {{.T.RegCapCurName}};
+	var legcerNo = {{.T.LegCerNO}};
+	var entName = {{.T.EntName}};
+	var relFlag = {{.T.relFlag}};
+	var relation = {{.T.relation}};
+	$(function(){
+		if(relFlag == 1){
+			var relationEntity = new Relation(legcerNo,regNo,regCapCurName,relation,relation.nodes.length>15);
+			relationEntity.init();
+		}else{
+			$("#entrelation-infovis").hide();
+			if(relFlag == -3){
+				$("#findnull h3").text("抱歉,未找到该企业!");
+			}else{
+				$("#findnull h3").text("抱歉,未找到相关数据!");
+			}
+			$("#findnull").show();
+		}
+	});
+</script>
+<style type="text/css">
+	body{
+		padding-top: 0px;
+		font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
+		color: #4e5051;
+		font-size: 14px;
+		padding: 20px;
+	}
+	.entrelation{
+		position: relative;
+		height: inherit;
+		height: 100%;
+	}
+	.entrelation svg{
+		position: relative;
+		z-index: 1;
+	}
+	.legend-text-bg>div{
+	    position: absolute;
+	    display: inline-block;
+	    border-radius: 4px;
+	    width: 110px;
+		height: 25px;
+	    line-height: 25px;
+	    text-align: center;
+		margin-top: -3px;
+	}
+	.legend-text-bg>span{
+		position: relative;
+	}
+	/*全屏代码*/
+	.entrelation .entrelation-controlls{
+		position: absolute;
+		z-index: 2;
+		right: 0px;
+	}
+	.entrelation .entrelation-controlls-fullscreen{
+		top: 15px;
+		right: 15px;
+	}
+	.entrelation .entrelation-controlls>div{
+		margin-bottom: 10px;
+		margin-left: 10px;
+		width: 35px;
+		height: 35px;
+		box-shadow: 0px 0px 5px #DADADA;
+	}
+	.entrelation .entrelation-controlls>div>span{
+		margin-top: 9px;
+	}
+	.entrelation .entrelation-controlls .entrelation-box{
+		border: 1px solid #e5e6e9;
+		text-align: center;
+		cursor: pointer;
+		vertical-align: top;
+		border-radius: 3px;
+		color: #16a086;
+		
+	}
+	.entrelation .entrelation-controlls .entrelation-box.checked{
+		display: none;
+	}
+	:-moz-full-screen .entrelation,:-webkit-full-screen .entrelation,:-o-full-screen .entrelation,
+	:-ms-full-screen .entrelation,:fullscreen .entrelation,:-ms-fullscreen .entrelation,:full-screen .entrelation{
+	  width: 100%;
+	  height: 100%;
+	  background-color:#fff;
+	}
+	:-moz-full-screen{
+		background: #fff;
+	}
+	:-webkit-full-screen{
+		background: #fff;
+	}
+	:-o-full-screen{
+		background: #fff;
+	}
+	:-ms-full-screen{
+		background: #fff;
+	}
+	:fullscreen{
+		background: #fff;
+	} 
+	:-ms-fullscreen{
+		background: #fff;
+	} 
+	:full-screen{
+		background: #fff;
+	}
+	.findnull{
+		text-align: center;
+		display: none;
+		margin-top: 13%;
+	}
+	.findnull img{
+		width: 200px;
+		height: 180px;
+	}
+</style>
+</head>
+<body class="entinfo-page">
+<!--关系网-->
+<div class="entrelation" id="entrelation">
+	<div id="entrelation-infovis"></div>
+	<div id="findnull" class="findnull">
+		<img src="{{Msg "seo" "cdn"}}/images/findnull.png">
+		<h3></h3>
+	</div>
+</div>
+</body>
+</html>