Browse Source

著作权

wangchuanjin 9 years ago
parent
commit
0d7c08b5a2

+ 9 - 0
common/src/qfw/util/common.go

@@ -11,6 +11,7 @@ import (
 	"io"
 	"log"
 	mathRand "math/rand"
+	"regexp"
 	"runtime"
 	"strconv"
 	"strings"
@@ -398,3 +399,11 @@ func GetSubDay(t1 int64) int {
 	nt2 := time.Date(tt2.Year(), tt2.Month(), tt2.Day(), 0, 0, 0, 0, time.Local)
 	return int((nt1.Unix() - nt2.Unix()) / 86400)
 }
+func StartWith(value, str string) bool {
+	ok, _ := regexp.MatchString("^"+str, value)
+	return ok
+}
+func EndWith(value, str string) bool {
+	ok, _ := regexp.MatchString(str+"$", value)
+	return ok
+}

File diff suppressed because it is too large
+ 0 - 0
core/src/province.json


+ 159 - 23
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -18,6 +18,7 @@ import (
 	elastic "qfw/util/elastic"
 	. "qfw/util/mongodb"
 	"qfw/util/redis"
+	"regexp"
 	"strconv"
 	"strings"
 	"time"
@@ -27,6 +28,8 @@ const ESINDEX string = "enterprise"
 const ESTYPE string = "enterprise"
 const ONEDAY int = 24 * 60 * 60
 
+var provinces []map[string]interface{}
+
 //常量代码表
 var city_map map[string]interface{} = map[string]interface{}{"11": "北京市", "12": "天津市", "13": "河北省", "14": "山西省", "15": "内蒙古",
 	"21": "辽宁省", "22": "吉林省", "23": "黑龙江省", "31": "上海市", "32": "江苏省", "33": "浙江省", "34": "安徽省",
@@ -130,9 +133,9 @@ func GetEntInfo(id string) map[string]interface{} {
 func WxGetEntInfo(id string, flag bool) 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, "s_weixin":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}`)
 	if res != nil {
-		id := (*res)["s_submitid"]
-		if id != nil {
-			ud := FindById("user", id.(string), `{"i_comauthenttype":1}`)
+		submitid := (*res)["s_submitid"]
+		if submitid != nil {
+			ud := FindById("user", submitid.(string), `{"i_comauthenttype":1}`)
 			(*res)["i_comauthenttype"] = (*ud)["i_comauthenttype"]
 		}
 		opl, _ := (*res)["OpLocDistrict"].(string)
@@ -263,11 +266,11 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 			yp.T["res"] = info
 			regNo, _ := info["RegNo"].(string)
 			entName, _ := info["EntName"].(string)
-			//相关企业
-			relation := getRelation(regNo, entName)
-			if relation != nil {
-				var nodes *[]map[string]interface{}
-				if d, err := json.Marshal(relation.(map[string]interface{})["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
+			relation, ok := getRelation(regNo, entName).(map[string]interface{})
+			var nodes *[]map[string]interface{}
+			if ok {
+				if d, err := json.Marshal(relation["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
+					//相关企业
 					var regNos []string
 					for _, v := range *nodes {
 						if v["type"] == "e" {
@@ -302,9 +305,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 					}
 				}
 				if len(ids) > 0 {
-					log.Println(ids)
 					news := Find("trs_news", M{"_id": M{"$in": ids}}, `{"l_comeintime":-1}`, `{"s_link":1,"s_title":1,"l_comeintime":1}`, false, 0, 8)
-					log.Println(news)
 					if news != nil && len(*news) > 0 {
 						yp.T["relevantNews"] = news
 					}
@@ -316,10 +317,26 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 			yp.T["service"] = findServiceByEntId(id, 1, yp.Session())
 			//关系网数据
 			yp.T["relation"] = relation
+			//著作权
+			yp.T["copyright"] = FindOne("enterprise_copyright", `{"EntId":"`+id+`"}`)
 			contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
 			if erruser == nil {
 				redis.PutBytes("enterprise", "enterpriseInfo_"+id, &contentuser, 7*ONEDAY)
 			}
+			//过滤企业名
+			if ok && 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)
+					})
+				}()
+			}
 			return yp.SetBody(contentuser)
 		} else {
 			return yp.Render("/_error.html")
@@ -415,19 +432,11 @@ func storeNode(data *map[string]interface{}, ls *list.List, dir /*方向反转*/
 	regcap, _ := (*data)["regcap"].(float64)
 	invregcap, _ := (*data)["invregcap"].(float64)
 	legcerno, _ := (*data)["legcerno"].(string)
-	opstate := ""
-	if (*data)["opstate"] != nil {
-		opstate = (*data)["opstate"].(string)
-	}
-	invopstate := ""
-	if (*data)["invopstate"] != nil {
-		invopstate = (*data)["invopstate"].(string)
-	}
-	regcapcurname := ""
-	if (*data)["regcapcurname"] != nil {
-		regcapcurname = (*data)["regcapcurname"].(string)
-	}
-	ls.PushBack([]string{invtype, invcerno, invname, entregno, entname, strconv.Itoa(level), fmt.Sprint(invweight), invacconam, fmt.Sprint(regcap), fmt.Sprint(invregcap), legcerno, opstate, invopstate, regcapcurname})
+	opstate, _ := (*data)["opstate"].(string)
+	invopstate, _ := (*data)["invopstate"].(string)
+	regcapcurname, _ := (*data)["regcapcurname"].(string)
+	shortname, _ := (*data)["shortname"].(string)
+	ls.PushBack([]string{invtype, invcerno, invname, entregno, entname, strconv.Itoa(level), fmt.Sprint(invweight), invacconam, fmt.Sprint(regcap), fmt.Sprint(invregcap), legcerno, opstate, invopstate, regcapcurname, util.BsonIdToSId((*data)["_id"]), shortname})
 }
 
 func findIndex(code string, arr []interface{}) (index int, mtType string) {
@@ -526,6 +535,8 @@ func makeRelation(mnregno, mnname string) interface{} {
 				"legcerno":      v[10],
 				"opstate":       v[12],
 				"regcapcurname": v[13],
+				"_id":           v[14],
+				"shorttext":     v[15],
 			}
 		}
 		//加企业
@@ -539,6 +550,8 @@ func makeRelation(mnregno, mnname string) interface{} {
 				"legcerno":      v[10],
 				"opstate":       v[11],
 				"regcapcurname": v[13],
+				"_id":           v[14],
+				"shorttext":     v[15],
 			}
 		}
 	}
@@ -656,6 +669,7 @@ func findServiceByEntId(id string, currentPage int, session *httpsession.Session
 	}
 	return res
 }
+
 func checkAuth(obj map[string]interface{}) (b bool, err string) {
 	if len(obj) > 0 {
 		//判断有没有预约的情况
@@ -679,3 +693,125 @@ func checkAuth(obj map[string]interface{}) (b bool, err string) {
 	}
 	return true, ""
 }
+func filterEntName(nodes *[]map[string]interface{}) int {
+	if len(provinces) == 0 {
+		util.ReadConfig("./province.json", &provinces)
+	}
+	var count int
+	for _, v := range *nodes {
+		if v["text"] == nil {
+			continue
+		}
+		text, ok := v["text"].(string)
+		text = strings.Trim(text, " ")
+		if !ok || text == "" {
+			continue
+		}
+		shortText := text
+		if v["type"] == "e" || v["type"] == "ce" {
+			if v["shorttext"] == nil || v["shorttext"] == "" {
+				if len([]rune(shortText)) > 2 { //先替换结尾
+					r := regexp.MustCompile("(有限公司|有限责任公司|股份有限公司|总公司|分公司|公司|事务所|合伙企业)$|\\([^\\)]*\\)|([^)]*)")
+					shortTextTemp := r.ReplaceAllString(shortText, "")
+					if len([]rune(shortTextTemp)) > 2 {
+						shortText = shortTextTemp
+					}
+					if len([]rune(shortTextTemp)) > 4 { //再替换开头地区
+						shortTextTemp = filterRegion(shortText)
+						if len([]rune(shortTextTemp)) > 2 {
+							shortText = shortTextTemp
+						}
+					}
+				}
+				v["shorttext"] = shortText
+				count++
+				if v["type"] == "e" {
+					Update("entrelation", `{"_id":"`+v["_id"].(string)+`"}`, `{"$set":{"shortname":"`+shortText+`"}}`, false, false)
+				}
+			}
+		}
+	}
+	log.Println("过滤", count, "个企业的名字!")
+	return count
+}
+func filterRegion(text string) string {
+	var commonReplace = func(t string) bool {
+		if len(t) > 1 && util.StartWith(text, t) {
+			r := regexp.MustCompile("^" + t)
+			var textCopy = r.ReplaceAllString(text, "")
+			if len(textCopy) > 2 {
+				text = textCopy
+			}
+			return true
+		}
+		return false
+	}
+	var replaceStart = func(t string, f bool) bool {
+		if t == "" {
+			return false
+		}
+		var flag bool
+		var minus int
+		if commonReplace(t) { //替换省、市、县、区
+			return true
+		}
+		if f { //不替换
+			flag = false
+		} else if util.EndWith(t, "维吾尔自治区") {
+			flag = true
+			minus = 6
+		} else if util.EndWith(t, "回族自治区") || util.EndWith(t, "壮族自治区") || util.EndWith(t, "特别行政区") {
+			flag = true
+			minus = 5
+		} else if util.EndWith(t, "自治州") || util.EndWith(t, "自治县") || util.EndWith(t, "自治区") {
+			flag = true
+			minus = 3
+		} else if util.EndWith(t, "地区") {
+			flag = true
+			minus = 2
+		} else if util.EndWith(t, "省") || util.EndWith(t, "市") || util.EndWith(t, "区") {
+			flag = true
+			minus = 1
+		}
+		if flag {
+			return commonReplace(util.SubString(t, 0, len([]rune(t))-minus))
+		}
+		return false
+	}
+	/*var replaceAreas = func(areas []interface{}) bool {
+		if len(areas) > 0 {
+			for _, _a := range areas { //县、区
+				a, a_ok := _a.(map[string]interface{})
+				if a_ok && replaceStart(util.ObjToString(a["n"]), true) {
+					return true
+				}
+			}
+		}
+		return false
+	}*/
+	var replaceCity = func(citys []interface{}) bool {
+		if len(citys) > 0 {
+			for _, _c := range citys { //市
+				c, c_ok := _c.(map[string]interface{})
+				if c_ok && replaceStart(util.ObjToString(c["n"]), false) {
+					/*if c["s"] != nil {
+						replaceAreas(c["s"].([]interface{}))
+					}*/
+					return true
+				} /*else if c["s"] != nil && replaceAreas(c["s"].([]interface{})) {
+					return true
+				}*/
+			}
+		}
+		return false
+	}
+	for _, p := range provinces { //省
+		if replaceStart(util.ObjToString(p["n"]), false) {
+			replaceCity(p["s"].([]interface{}))
+			break
+		} else if replaceCity(p["s"].([]interface{})) {
+			break
+		}
+	}
+	return text
+}

+ 27 - 0
core/src/web/staticres/css/entcommunity.css

@@ -140,6 +140,7 @@ a:focus, a:hover{
 	background-size: 100% 100%;
 	padding-left: 100px;
 	padding-top: 95px;
+	padding-right: 10px;
 }
 .ent-indexpage .ent-index-search>div{
 	margin-top: 10px;
@@ -945,4 +946,30 @@ a:focus, a:hover{
 .dashed{
 	height: 1px;
 	background: url("/images/entcommunity/dashed.png");
+}
+.ent-copyright .ent-table td{
+	padding: 5px 0px !important;
+	border-bottom: 1px solid #e5e6e9 !important;
+}
+.ent-copyright .ent-table tr:last-child td{
+	border-bottom-width: 0px !important;
+}
+.ent-copyright .ent-table td span{
+	margin-right: 30px;
+}
+.ent-copyright .ent-table div{
+	margin-bottom: 5px;
+}
+.ent-copyright .ent-table .b-com-first{
+	font-weight: bold;
+	font-size: 16px;
+}
+.ent-copyright .ent-table .b-com-second{
+	color: #A0A0A0;
+}
+.ent-copyright{
+	padding: 10px;
+}
+.ent-copyright table{
+	margin-top: 15px;
 }

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

@@ -1,5 +1,6 @@
 var entType = "企业";
 var relationEntity = null;
+var copyrightEntity = null;
 //var servicePaging = null;
 //var dishonestyPaging = null;
 var hasLoadPagingJs = false;
@@ -141,6 +142,9 @@ $(function(){
 		}
 		if(index == 1){
 			b_afterLogin();
+		}else if($(this).index() == 3 && copyrightEntity == null){
+			//加载服务列表
+			copyrightEntity = new CopyrightEntity();
 		}/*else if($(this).index() == 4 && dishonestyPaging == null){
 			//加载服务列表
 			dishonestyPaging = new DishonestyPaging();
@@ -254,6 +258,95 @@ function initRelation(){
 		$("#entrelation-limit,#entrelation-nologin").removeClass("hide");
 	}
 }
+function CopyrightEntity(){
+	//著作权
+	if(typeof(copyright) != "undefined" && copyright != null){
+		loadJS("/js/frontpaging.js",function(){
+			var workCopyRight = copyright.WorkCopyRight;
+			if(typeof(workCopyRight) != "undefined" && workCopyRight != null){
+				workCopyRight.sort(function(a,b){
+					if(a.FirstPublishDate<b.FirstPublishDate){
+						return 1;
+					}else if(a.FirstPublishDate==b.FirstPublishDate){
+						return 0;
+					}
+					return -1;
+				});
+				var frontPaging = new FrontPaging("workCopyRightListPaging",workCopyRight,5,function(r){
+					var hm = '';
+					for(var i=0;i<r.length;i++){
+						hm += '<tr><td><div class="b-com-first">'+(r[i].WorkName?r[i].WorkName:"")+'</div>'
+							+'<div class="b-com-second"><div>'
+							+'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
+							+'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
+							+'</div><span>作品类别:'+(r[i].WorkType?r[i].WorkType:"")+'</span>'
+							+'<span>创作完成日期:'+(r[i].FinishedDate?r[i].FinishedDate:"")+'</span>'
+							+'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
+							+'</div></td></tr>';
+					}
+					$("#workCopyRightListPaging").parent().prevAll().remove();
+					$("#workCopyRightListPaging").parent().before(hm);
+				});
+			}
+			var computerSoftCopyRight = copyright.ComputerSoftCopyRight;
+			if(typeof(computerSoftCopyRight) != "undefined" && computerSoftCopyRight != null){
+				computerSoftCopyRight.sort(function(a,b){
+					if(a.FirstPublishDate<b.FirstPublishDate){
+						return 1;
+					}else if(a.FirstPublishDate==b.FirstPublishDate){
+						return 0;
+					}
+					return -1;
+				});
+				var frontPaging = new FrontPaging("computerSoftCopyRightListPaging",computerSoftCopyRight,5,function(r){
+					var hm = '';
+					for(var i=0;i<r.length;i++){
+						hm += '<tr><td><div class="b-com-first">'+(r[i].SoftFullName?r[i].SoftFullName:"")+'</div>'
+							+'<div class="b-com-second"><div>'
+							+'<span>登记号:'+(r[i].RegNo?r[i].RegNo:"")+'</span>'
+							+'<span>分类号:'+(r[i].SortNo?r[i].SortNo:"")+'</span>'
+							+'<span>简称:'+(r[i].SoftSimpleName?r[i].SoftSimpleName:"")+'</span>'
+							+'</div><span>版本号:'+(r[i].Version?r[i].Version:"")+'</span>'
+							+'<span>登记日期:'+(r[i].RegDate?r[i].RegDate:"")+'</span>'
+							+'<span>首次发表日期:'+(r[i].FirstPublishDate?r[i].FirstPublishDate:"")+'</span>'
+							+'</div></td></tr>';
+					}
+					$("#computerSoftCopyRightListPaging").parent().prevAll().remove();
+					$("#computerSoftCopyRightListPaging").parent().before(hm);
+				});
+			}
+			var patent = copyright.Patent;
+			if(typeof(patent) != "undefined" && patent != null){
+				patent.sort(function(a,b){
+					if(a.PublicDate<b.PublicDate){
+						return 1;
+					}else if(a.PublicDate==b.PublicDate){
+						return 0;
+					}
+					return -1;
+				});
+				var frontPaging = new FrontPaging("patentListPaging",patent,5,function(r){
+					var hm = '';
+					for(var i=0;i<r.length;i++){
+						hm += '<tr><td><div class="b-com-first">'+(r[i].PatentName?r[i].PatentName:"")+'</div>'
+							+'<div class="b-com-second"><div>'
+							+'<span>申请人:'+(r[i].ApplyPerson?r[i].ApplyPerson:"")+'</span>'
+							+'<span>申请号:'+(r[i].ApplyNo?r[i].ApplyNo:"")+'</span>'
+							+'<span>申请日期:'+(r[i].ApplyDate?r[i].ApplyDate.replace(/\./g,"-"):"")+'</span>'
+							+'</div><span>分类号:'+(r[i].IpcTypeNo?r[i].IpcTypeNo:"")+'</span>'
+							+'<span>公开号:'+(r[i].PublicNo?r[i].PublicNo:"")+'</span>'
+							+'<span>公开日期:'+(r[i].PublicDate?r[i].PublicDate.replace(/\./g,"-"):"")+'</span>'
+							+'</div></td></tr>';
+					}
+					$("#patentListPaging").parent().prevAll().remove();
+					$("#patentListPaging").parent().before(hm);
+				});
+			}
+		});
+	}else{
+		$("#copyright .ent-findnull").removeClass("hide");
+	}
+}
 //服务列表
 function ServicePaging(){
 	this.initServiceList = function(){

+ 168 - 0
core/src/web/staticres/js/frontpaging.js

@@ -0,0 +1,168 @@
+var FrontPaging = function(nodeid,datas,pageSize,callBack){
+	this.currentPage = 1;
+	this.totalPages = 0;
+	this.count = 0;
+	//初始化
+	this.init = function(){
+		this.totalPages = parseInt((this.count + pageSize - 1) / pageSize);
+		if(this.totalPages > 1){
+			var html = '<nav>'
+						+'<ul class="pagination"><li';
+			if(!this.hasPrevPage()){
+				html += ' class="disabled"';
+			}
+			html += ' id="firstPage"><a>&laquo;</a></li><li';
+			if(!this.hasPrevPage()){
+				html += ' class="disabled"';
+			}
+			html += ' id="prevPage">'
+				      	+'<a>&lsaquo;</a>'
+				    +'</li>';
+			for(var i=0;i<this.totalPages;i++){
+				html += '<li id="pageNum-'+(i+1)+'"';
+				if(i == 0){
+					html += ' class="disabled"';
+				}else if(i >= 10){
+					html += ' class="hide"';
+				}
+				html += '><a>'+(i+1)+'</a></li>';
+			}
+			html += '<li';
+			if(!this.hasNextPage()){
+				html += ' class="disabled"';
+			}
+			html += ' id="nextPage"><a>&rsaquo;</a></li><li';
+			if(!this.hasNextPage()){
+				html += ' class="disabled"';
+			}
+			html += ' id="lastPage"><a>&raquo;</a></li></ul></nav>';
+			$("#"+nodeid).html(html);
+			var thisClass = this;
+			var getThisClass = function(){
+				return thisClass;
+			}
+			$("#"+nodeid+" #firstPage").click(function(){
+				if($(this).hasClass("disabled")){
+					return;
+				}
+				thisClass.currentPage = 1;
+				$(this).addClass("disabled");
+				$("#"+nodeid+" #prevPage").addClass("disabled");
+				$("#"+nodeid+" #nextPage,#"+nodeid+" #lastPage").removeClass("disabled");
+				thisClass.commonMethod();
+			});
+			$("#"+nodeid+" #prevPage").click(function(){
+				if($(this).hasClass("disabled")){
+					return;
+				}
+				$("#"+nodeid+" #pageNum-"+(--thisClass.currentPage)).addClass("disabled");
+				if(thisClass.hasPrevPage()){
+					$(this).removeClass("disabled");
+					$("#"+nodeid+" #firstPage").removeClass("disabled");
+				}else{
+					$(this).addClass("disabled");
+					$("#"+nodeid+" #firstPage").addClass("disabled");
+				}
+				$("#"+nodeid+" #nextPage,#"+nodeid+" #lastPage").removeClass("disabled");
+				thisClass.commonMethod();
+			});
+			$("#"+nodeid+" #nextPage").click(function(){
+				if($(this).hasClass("disabled")){
+					return;
+				}
+				$("#"+nodeid+" #pageNum-"+(++thisClass.currentPage)).addClass("disabled");
+				if(thisClass.hasNextPage()){
+					$(this).removeClass("disabled");
+					$("#"+nodeid+" #lastPage").removeClass("disabled");
+				}else{
+					$(this).addClass("disabled");
+					$("#"+nodeid+" #lastPage").addClass("disabled");
+				}
+				$("#"+nodeid+" #firstPage,#prevPage").removeClass("disabled");
+				thisClass.commonMethod();
+			});
+			$("#"+nodeid+" #lastPage").click(function(){
+				if($(this).hasClass("disabled")){
+					return;
+				}
+				thisClass.currentPage = thisClass.totalPages;
+				$("#"+nodeid+" #firstPage,#"+nodeid+" #prevPage").removeClass("disabled");
+				$("#"+nodeid+" #nextPage,#"+nodeid+" #lastPage").addClass("disabled");
+				thisClass.commonMethod();
+			});
+			$("#"+nodeid+" [id^='pageNum-']").click(function(){
+				if($(this).hasClass("disabled")){
+					return;
+				}
+				thisClass.currentPage = parseInt(this.id.split("-")[1]);
+				if(thisClass.hasPrevPage()){
+					$("#"+nodeid+" #firstPage,#"+nodeid+" #prevPage").removeClass("disabled");
+				}else{
+					$("#"+nodeid+" #firstPage,#"+nodeid+" #prevPage").addClass("disabled");
+				}
+				if(thisClass.hasNextPage()){
+					$("#"+nodeid+" #nextPage,#"+nodeid+" #lastPage").removeClass("disabled");
+				}else{
+					$("#"+nodeid+" #nextPage,#"+nodeid+" #lastPage").addClass("disabled");
+				}
+				thisClass.commonMethod();
+			});
+		}
+	}
+	this.commonMethod = function(){
+		$("#"+nodeid+" [id^='pageNum-']").removeClass("disabled");
+		$("#"+nodeid+" #pageNum-"+this.currentPage).addClass("disabled");
+		if(this.currentPage == 1){
+			$("#"+nodeid+" [id^='pageNum-']").addClass("hide");
+			for(var i=1;i<=10;i++){
+				if(i > this.totalPages){
+					break;
+				}
+				$("#"+nodeid+" #pageNum-"+i).removeClass("hide");
+			}
+		}else if(this.currentPage >= 5){
+			var start = this.currentPage-5;
+			var end = this.currentPage+5;
+			if(this.currentPage > this.totalPages - 5){
+				start = this.totalPages - 10;
+				end = this.totalPages;
+			}
+			for(var i=1;i<=start;i++){
+				$("#"+nodeid+" #pageNum-"+i).addClass("hide");
+			}
+			for(var i=start+1;i<=end;i++){
+				$("#"+nodeid+" #pageNum-"+i).removeClass("hide");
+			}
+			for(var i=end+1;i<=this.totalPages;i++){
+				$("#"+nodeid+" #pageNum-"+i).addClass("hide");
+			}
+		}
+		this.getDatas();
+	}
+	//从服务端获取数据
+	this.getDatas = function(){
+		if(this.totalPages == 0){
+			this.count = datas.length;
+			this.init();
+		}
+		var start = (this.currentPage - 1) * pageSize;
+		var end = start + pageSize;
+		callBack(datas.slice(start,end));
+	}
+	//是否有上一页
+	this.hasPrevPage = function(){
+		if(this.currentPage > 1){
+			return true;
+		}
+		return false;
+	}
+	//是否有下一页
+	this.hasNextPage = function(){
+		if(this.currentPage < this.totalPages){
+			return true;
+		}
+		return false;
+	}
+	//第一次获取数据和总数
+	this.getDatas();
+}

+ 27 - 0
core/src/web/staticres/js/paging.js

@@ -23,6 +23,8 @@ var Paging = function(nodeid,url,datas,pageSize,callBack,firstPageDatas){
 				html += '<li id="pageNum-'+(i+1)+'"';
 				if(i == 0){
 					html += ' class="disabled"';
+				}else if(i >= 10){
+					html += ' class="hide"';
 				}
 				html += '><a>'+(i+1)+'</a></li>';
 			}
@@ -111,6 +113,31 @@ var Paging = function(nodeid,url,datas,pageSize,callBack,firstPageDatas){
 	this.commonMethod = function(){
 		$("#"+nodeid+" [id^='pageNum-']").removeClass("disabled");
 		$("#"+nodeid+" #pageNum-"+this.currentPage).addClass("disabled");
+		if(this.currentPage == 1){
+			$("#"+nodeid+" [id^='pageNum-']").addClass("hide");
+			for(var i=1;i<=10;i++){
+				if(i > this.totalPages){
+					break;
+				}
+				$("#"+nodeid+" #pageNum-"+i).removeClass("hide");
+			}
+		}else if(this.currentPage >= 5){
+			var start = this.currentPage-5;
+			var end = this.currentPage+5;
+			if(this.currentPage > this.totalPages - 5){
+				start = this.totalPages - 10;
+				end = this.totalPages;
+			}
+			for(var i=1;i<=start;i++){
+				$("#"+nodeid+" #pageNum-"+i).addClass("hide");
+			}
+			for(var i=start+1;i<=end;i++){
+				$("#"+nodeid+" #pageNum-"+i).removeClass("hide");
+			}
+			for(var i=end+1;i<=this.totalPages;i++){
+				$("#"+nodeid+" #pageNum-"+i).addClass("hide");
+			}
+		}
 		this.getDatas();
 	}
 	//从服务端获取数据

+ 18 - 13
core/src/web/staticres/js/relation.js

@@ -104,7 +104,7 @@ Relation.prototype.pattern = function(){
 	var thisClass = this;
 	d3.selectAll("text").each(function (p){
 		if(p.type == "ce" || p.type == "e"){
-			$(this).text(p.shortText);
+			$(this).text(p.shorttext);
 		}
 	});
 	this.modleFlag = true;
@@ -144,19 +144,24 @@ Relation.prototype.dataProcess = function(){
 	for(var i=0;i<this.data.nodes.length;i++){
 		var nodeObj = this.data.nodes[i];
 		nodeObj.text = $.trim(nodeObj.text);
-		nodeObj.shortText = nodeObj.text;
+		var shortText = nodeObj.text;
 		if(nodeObj.type == "e" || nodeObj.type == "ce"){
-			var text = nodeObj.shortText;
-			if(text.length > 2){//先替换结尾
-				text = text.replace(reg,"");
-			}
-			if(text.length > 2){//再替换开头
-				text = this.filterEntName(text);
-			}
-			if(text.length > 2){//小于两个字符不生效
-				nodeObj.shortText = text;
+			if(typeof(nodeObj.shorttext) == "undefined" || nodeObj.shorttext == ""){
+				if(shortText.length > 2){//先替换结尾
+					var shortTextTemp = shortText.replace(reg,"");
+					if(shortTextTemp.length > 2){
+						shortText = shortTextTemp;
+					}
+					if(shortTextTemp.length > 4){//再替换开头地区
+						shortTextTemp = this.filterEntName(shortTextTemp);
+						if(shortTextTemp.length > 2){
+							shortText = shortTextTemp;
+						}
+					}
+				}
+				nodeObj.shorttext = shortText;
 			}
-			if(nodeObj.name == this.regNo){//先找本企业位置
+			if(nodeObj.type == "ce"){//先找本企业位置
 				this.index = i;
 				nodeObj["regcap"] = (typeof(d1) == "undefined")?0:d1;
 				nodeObj["legcerno"] = this.legcerNo;
@@ -729,7 +734,7 @@ Relation.prototype.makeRelation = function(){
 	this.nodes.append('text')
     .text(function(d){
 		if(thisClass.modleFlag){
-			return d.shortText;
+			return d.shorttext;
 		}else{
 			return d.text;
 		}

+ 48 - 1
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -121,6 +121,7 @@
 		<li class="ent-active">{{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>关系网</li>
 		<li{{if not .T.res.staffinfo}} class="disabled"{{end}}>主要人员</li>
+		<li{{if and (not .T.copyright.WorkCopyRight) (not .T.copyright.ComputerSoftCopyRight) (not .T.copyright.Patent)}} class="disabled"{{end}}>著作权</li>
 		<li{{if not .T.res.alterInfo}} class="disabled"{{end}}>变更信息</li>
 		<li{{if not .T.dishonesty.count}} class="disabled"{{end}}>失信信息</li>
 		<li class="{{if and (not .T.service.count) (not .T.res.s_synopsis)}}disabled {{end}}border-r-0">{{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>
@@ -323,6 +324,51 @@
 				<h4>抱歉,未找到相关数据!</h4>
 			</div>
 		</div>
+		<div class="ent-copyright hide">
+			<!--计算机软件著作权信息-->
+			{{if .T.copyright.ComputerSoftCopyRight}}
+			<div class="ent-layout-down">
+				<div class="b-com-title">
+					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>计算机软件著作权信息
+				</div>
+				<table class="table ent-table" id="computerSoftCopyRightList">
+					<tr>
+						<td class="text-center" id="computerSoftCopyRightListPaging"></td>
+					</tr>
+				</table>
+			</div>
+			{{end}}
+			<!--作品著作权信息-->
+			{{if .T.copyright.WorkCopyRight}}
+			<div class="ent-layout-down">
+				<div class="b-com-title">
+					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>作品著作权信息
+				</div>
+				<table class="table ent-table" id="workCopyRightList">
+					<tr>
+						<td class="text-center" id="workCopyRightListPaging"></td>
+					</tr>
+				</table>
+			</div>
+			{{end}}
+			<!--专利信息-->
+			{{if .T.copyright.Patent}}
+			<div class="ent-layout-down">
+				<div class="b-com-title">
+					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>专利信息
+				</div>
+				<table class="table ent-table" id="patentList">
+					<tr>
+						<td class="text-center" id="patentListPaging"></td>
+					</tr>
+				</table>
+			</div>
+			{{end}}
+			<div class="ent-findnull hide">
+				<img src="/images/findnull.png" class="b-findnull">
+				<h4>抱歉,未找到相关数据!</h4>
+			</div>
+		</div>
 		<div class="ent-alterinfo hide">
 		{{if gt (len .T.res.alterInfo) 0}}
 			<div class="ent-layout-up">
@@ -365,7 +411,7 @@
 					</ul>
 				</div>
 			</div>
-			{{else}}
+		{{else}}
 			<div class="ent-findnull">
 				<img src="/images/findnull.png" class="b-findnull">
 				<h4>抱歉,未找到相关数据!</h4>
@@ -482,6 +528,7 @@ var investor = {{.T.res.investor}};
 var OpScope = {{.T.res.OpScope}};
 var service = {{.T.service}};
 var relation = {{.T.relation}};
+var copyright = {{.T.copyright}};
 /*var entId = "556db79cc2e8753072b3c9dd";
 var regNo = "410000100052878";
 var regCapCurName = "";

Some files were not shown because too many files changed in this diff