wangchuanjin 9 anos atrás
pai
commit
4d256a5676

+ 25 - 21
common/src/main.go

@@ -3,24 +3,26 @@ package main
 import (
 	"fmt"
 	"gopkg.in/mgo.v2/bson"
-	"strconv"
-	"strings"
-
 	"log"
 	"os"
+	util "qfw/util"
 	"qfw/util/elastic"
 	. "qfw/util/mongodbutil"
+	"strconv"
+	"strings"
 )
 
 var N = 200
 
 //生enterprise表
 func main() {
+	//src.exe 192.168.3.18:27080 192.168.3.18:27090 http://192.168.3.18:9800 enterprise all enterprise enterprise 2000
 	// 参数 mongodb(网站库) mongodb(公示库) elastic collection area index-db inde-type N
+	log.Println("-------------开始-----------------")
+	isEnterprise := os.Args[4] == "enterprise"
 	initConfig(os.Args[1], "web", "qfw")
 	if os.Args[4] == "enterprise" {
 		initConfig(os.Args[2], "ecps", "qfw")
-
 	}
 	InitMongodbPool()
 	elastic.InitElastic(os.Args[3])
@@ -30,34 +32,36 @@ func main() {
 			N = n1
 		}
 	}
-	ecps_session := GetMgoConn("ecps")
 	var m map[string]interface{}
 	if os.Args[5] == "all" {
 		m = nil
 	} else {
 		m = bson.M{"Area": os.Args[5]}
 	}
-	log.Printf("%v", m)
+	log.Printf("检索条件:%v", m)
 	i := 0
-	query := ecps_session.DB("qfw").C(os.Args[4]).Find(m).Iter()
-	arr := make([]map[string]interface{}, 0)
-	for tmp := make(map[string]interface{}); query.Next(tmp); i++ {
-		arr = append(arr, elastic.ConverData(&tmp))
-		if i%N == 0 && i != 0 {
-			elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
-			arr = make([]map[string]interface{}, 0)
-			log.Printf("当前索引位置:=%d \n", i)
-		}
+	var dbType = "web"
+	if isEnterprise {
+		dbType = "ecps"
 	}
-	if len(arr) > 0 {
-		elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
-		arr = make([]map[string]interface{}, 0)
+	count := Count(os.Args[4], dbType, "qfw", nil)
+	totalPages := ((count + N - 1) / N)
+	log.Println(util.If(isEnterprise, "公式库", "网站库"), os.Args[4], "表有", count, "条数据", "一共", totalPages, "页")
+	for i := 0; i < totalPages; i++ {
+		arr := Find(os.Args[4], dbType, "qfw", m, nil, nil, false, i*N, N)
+		if isEnterprise {
+			for a, v := range *arr {
+				(*arr)[a] = elastic.ConverData(&v)
+			}
+		}
+		elastic.BulkSave(os.Args[6], os.Args[7], arr, true)
+		log.Println("当前是第", i+1, "页")
 	}
-	if os.Args[4] == "enterprise" {
+	if isEnterprise {
 		//生成带名片索引
 		i = 0
 		count := Count("enterprise", "web", "qfw", m)
-		log.Println("网站库,一共", count, "条数据")
+		log.Println("网站库enterprise表,一共", count, "条数据")
 		for {
 			limit := i + N
 			if limit > count {
@@ -100,7 +104,7 @@ func main() {
 			log.Printf("当前索引位置:=%d \n", i)
 		}
 	}
-
+	log.Println("-------------结束-----------------")
 }
 func main1() {
 	// 参数 mongodb(网站库) elastic collection query

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

@@ -605,7 +605,10 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 
 	tmp2["RecCap"] = tmp["RecCap"]
 	tmp2["RegCap"] = tmp["RegCap"]
-	tmp2["excDirect"] = tmp["excDirect"]
+	tmp2["excDirect"] = false
+	if tmp["excDirect"] != nil && len(tmp["excDirect"].([]interface{})) > 0 {
+		tmp2["excDirect"] = true
+	}
 	tmp2["IndustryPhy"] = tmp["IndustryPhy"]
 	tmp2["IndustryPhyName"] = tmp["IndustryPhyName"]
 	tmp2["RegOrg"] = tmp["RegOrg"]

+ 22 - 5
core/src/web/staticres/css/entcommunity.css

@@ -397,8 +397,11 @@ a:focus, a:hover{
 .entinfo-page .b-com-head .b-com-second>span{
 	margin-right: 15px;
 }
-.entinfo-page .b-com-head .b-com-second a{
-	color: #a0a0a0;
+.entinfo-page .b-com-head a{
+	color: inherit;
+}
+.entinfo-page .b-com-head a:hover{
+	color: #415fcf;
 }
 .entinfo-page .b-com-head .b-com-second .glyphicon{
 	color: #FF5A5F;
@@ -423,8 +426,9 @@ a:focus, a:hover{
 	font-size: 17px;
 	color: #cccccc;
 	vertical-align: text-bottom;
+	margin-right: 5px;
 }
-.entinfo-page .b-com-head .b-com-last a{
+.entinfo-page .b-com-head .entinfo-lookmap{
 	color: #415fcf;
 }
 .ent-tab{
@@ -488,9 +492,22 @@ a:focus, a:hover{
 	color: #56C4B0 !important;
 }
 .entinfo-page .servicelink{
-    color: #57C4B0 !important;
-	margin-left: 10px;
+    background-color: #57C4B0 !important;
+	margin-left: 5px;
 	font-size: 14px !important;
+	display: inline-block;
+	border-radius: 50%;
+	width: 17px;
+	height: 17px;
+	position: relative;
+	top: 3px;
+}
+.entinfo-page .servicelink i{
+	position: absolute;
+    color: #fff !important;
+	font-size: 12px !important;
+	left: 6px;
+	top: 1.5px;
 }
 .ent-exception{
 	padding: 0px 6px;

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

@@ -1082,6 +1082,10 @@ span.highlight {
 	content: "\BC";
 }
 
+.qmx-icon-right:before{
+	content: "\BE";
+}
+
 .icon-small {
 	font-size: 12px;
 }

BIN
core/src/web/staticres/fonts.zip


BIN
core/src/web/staticres/fonts/qimingxing.eot


BIN
core/src/web/staticres/fonts/qimingxing.svg


BIN
core/src/web/staticres/fonts/qimingxing.ttf


BIN
core/src/web/staticres/fonts/qimingxing.woff


+ 4 - 4
core/src/web/templates/enterprise/detail.html

@@ -74,7 +74,7 @@
 						{{end}}
 					{{end}}
 				{{end}}
-				{{if .T.serviceCount}}<a>服务信息</a><i class="servicelink glyphicon xiayibu"></i>{{end}}
+				{{if .T.serviceCount}}<a>服务信息<div class="servicelink"><i class="glyphicon qmx-icon-right"></i></div></a>{{end}}
 			</div>
 			{{if eq .T.editFlag 2}}
 			<form class="b-editEnt-form" id="editForm">
@@ -146,7 +146,7 @@
 							{{.T.res.Dom}}
 						{{end}}
 					</span>
-					<a href="javascript:void(0)" class="font-size-12" onclick="showMap()">查看详细地图</a>
+					<a href="javascript:void(0)" class="entinfo-lookmap" onclick="showMap()">查看详细地图</a>
 				{{end}}
 			</div>
 			{{end}}
@@ -196,9 +196,9 @@
 							<span>
 								<div>
 									<span id="entinfo-status" class="entinfo-status">
-										{{if .T.res.excDirect}}{{if gt (len .T.res.excDirect) 0}}
+										{{if .T.res.excDirect}}
 										<span class="ent-exception">经营异常</span>
-										{{end}}{{end}}
+										{{end}}
 									</span>
 									<br>
 									{{if .T.res.EntName}}

+ 2 - 2
core/src/web/templates/search/enterpriseList.html

@@ -81,9 +81,9 @@
 									</script>
 									</span>
 									{{end}}
-									{{if $v.excDirect}}{{if gt (len $v.excDirect) 0}}
+									{{if $v.excDirect}}
 									<span class="margin-l-5 ent-exception">经营异常</span>
-									{{end}}{{end}}
+									{{end}}
 									{{ if index $v "s_action"}}
 										{{ if eq (index $v "s_action") "01"}}
 											<span class="glyphicon qyrz   margin-l-10 jhtb"></span><span class="lineb " ><small>&nbsp;已认证企业&nbsp;</small></span>

+ 2 - 0
core/src/web/templates/service/list.html

@@ -135,6 +135,7 @@
 			<div style="padding:20px 0 0 22px;">
 			<!--循环列表-->
 			{{$type:=.T.querymap.c_searchtype }}
+			{{if .T.data}}
 			{{range $k, $v := .T.data}}
 	  		<div class="d_group">
 				<div id="col-sm-2" class="col-sm-2 hidden-xs control-label" style="width:115px;height:100px">
@@ -288,6 +289,7 @@
 				</div>
 			</div>
 			{{end}}
+			{{end}}
 		</div>
 	    
 	</div>