Эх сурвалжийг харах

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

wangshan 9 жил өмнө
parent
commit
4281a452fd

+ 27 - 23
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 main1() {
+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 main1() {
 			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, 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,9 +104,9 @@ func main1() {
 			log.Printf("当前索引位置:=%d \n", i)
 		}
 	}
-
+	log.Println("-------------结束-----------------")
 }
-func main() {
+func main1() {
 	// 参数 mongodb(网站库) elastic collection query
 	initConfig(os.Args[1], "web", "qfw")
 	InitMongodbPool()

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

@@ -604,7 +604,11 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 	tmp2["OpLocDistrictName"] = getLoc(tmpLoc, &LocCity)
 
 	tmp2["RecCap"] = tmp["RecCap"]
-	tmp2["excDirect"] = tmp["excDirect"]
+	tmp2["RegCap"] = tmp["RegCap"]
+	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"]
@@ -623,9 +627,6 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 	if tmp["Nb_email"] != nil {
 		tmp2["Nb_email"] = tmp["Nb_email"]
 	}
-	if tmp["Nb_email"] != nil {
-		tmp2["Nb_email"] = tmp["Nb_email"]
-	}
 	if tmp["Nb_tel"] != nil {
 		tmp2["Nb_tel"] = tmp["Nb_tel"]
 	}

+ 28 - 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,27 @@ 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;
+	border: 1px solid #FF5A5F;
+	color: #FF5A5F;
 }
 /********************企业画像**********************/
 .entinfo-basicinfo .b-com-content{
@@ -543,6 +565,7 @@ a:focus, a:hover{
 	font-size: 14px;
 	font-weight: normal;
 	float: right;
+	margin-left: 5px;
 }
 .entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:first-child{
 	width: 80px;

+ 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


+ 3 - 0
core/src/web/staticres/js/entportrait.js

@@ -277,6 +277,9 @@ $(function(){
 	$("#thinkAgain").click(function(){
 		TipAssembly.triangleHide();
 	});
+	if($("#entinfo-opState").length > 0){
+		$("#entinfo-status").prepend($("#entinfo-opState").clone());
+	}
 });
 function afterReLoadTop(flag,result){
 	//关系网如果没有数据,选项卡不可点

+ 7 - 13
core/src/web/templates/enterprise/detail.html

@@ -29,7 +29,7 @@
 			<div class="b-com-first">
 				<font class="b-com-title">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</font>
 				{{if .T.res.OpState}}
-				<span class="{{if eq .T.res.OpState "07" "08" "11"}}ent-status-r{{else}}ent-status-g{{end}}">
+				<span id="entinfo-opState" class="{{if eq .T.res.OpState "07" "08" "11"}}ent-status-r{{else}}ent-status-g{{end}}">
 				<script>
 					var OpState = {{.T.res.OpState}};
 					var OpStateName = {{.T.res.OpStateName}};
@@ -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}}
@@ -195,18 +195,12 @@
 						<div>
 							<span>
 								<div>
-									{{if .T.res.OpStateName}}
-									<span class="{{if eq .T.res.OpStateName "注销" "吊销"}}ent-status-r{{else}}ent-status-g{{end}}">
-									<script>
-										var OpStateName = {{.T.res.OpStateName}};
-										if(OpStateName.length > 2){
-											OpStateName = OpStateName.substring(0,2);
-										}
-										document.write(OpStateName);
-									</script>
+									<span id="entinfo-status" class="entinfo-status">
+										{{if .T.res.excDirect}}
+										<span class="ent-exception">经营异常</span>
+										{{end}}
 									</span>
 									<br>
-									{{end}}
 									{{if .T.res.EntName}}
 									<script>
 										var entName = {{.T.res.EntName}};

+ 3 - 0
core/src/web/templates/search/enterpriseList.html

@@ -81,6 +81,9 @@
 									</script>
 									</span>
 									{{end}}
+									{{if $v.excDirect}}
+									<span class="margin-l-5 ent-exception">经营异常</span>
+									{{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>