wangchuanjin 9 anni fa
parent
commit
1f8856284b

+ 4 - 0
core/src/qfw/manage/article.go

@@ -92,6 +92,7 @@ func (a *Article) Savearticle() error {
 			elastic.UpdateNewDoc("content", "content", FindById("content", id, ""))
 			redis.Del("other", string(id))
 			redis.Del("other", "/")
+			redis.Del("other", "latestNews") //最新消息
 		} else {
 			flag = "false"
 			msg = "保存失败!"
@@ -140,6 +141,7 @@ func (a *Article) Updatearticle() error {
 			redis.Del("other", "/front/webcontent/"+_id+".html")
 			redis.Del("other", "/front/weixincontent/"+_id)
 			redis.Del("other", "/")
+			redis.Del("other", "latestNews") //最新消息
 		} else {
 			flag = "false"
 			msg = "修改失败!"
@@ -162,6 +164,8 @@ func (a *Article) Delearticle() error {
 		if DelById("content", _id) {
 			flag = "true"
 			msg = "删除成功!"
+			redis.Del("other", "/")
+			redis.Del("other", "latestNews") //最新消息
 			elastic.DelById("content", "content", _id)
 		} else {
 			flag = "false"

+ 3 - 0
core/src/qfw/member/yellowpage.go

@@ -85,6 +85,7 @@ func (u *Yellowpage) Delservice() error {
 		flag := mongodb.Del("service", query)
 		if flag {
 			//再删除elasticsearch中的数据
+			redis.DelByCodePattern("enterprise", "service-"+entid.(string)+"-*")
 			flag2 := elastic.DelById(index, itype, id)
 			if flag2 {
 				u.ServeJson(&map[string]interface{}{
@@ -139,6 +140,7 @@ func (u *Yellowpage) Removeservice() error {
 			sid := strings.Split(fmt.Sprintf("%s", obj["_id"]), `"`)[1]
 			flag := mongodb.Update("service", `{"_id":"`+sid+`"}`, bson.M{"$set": bson.M{"i_status": 1}}, false, false)
 			if flag {
+				redis.DelByCodePattern("enterprise", "service-"+entid.(string)+"-*")
 				//修改elasticsearch中的数据
 				isUpdate := elastic.UpdateNewDoc(index, itype, mongodb.FindById("service", sid, nil))
 
@@ -448,6 +450,7 @@ func (yp *Yellowpage) AddService() error {
 		//删除缓存信息
 		redis.Del("enterprise", "enterpriseInfo_"+enterpriseid)
 		redis.Del("enterprise", "enterpriseInfo_user_"+enterpriseid)
+		redis.DelByCodePattern("enterprise", "service-"+enterpriseid+"-*")
 		//将数据存到elastic中
 		flag2 := elastic.UpdateNewDoc("service", "service", doc)
 		//Insertservicenames(enterpriseid)

+ 39 - 32
core/src/qfw/search/searchService.go

@@ -120,50 +120,57 @@ func (search *Search) SearchEntSer(id string) error {
 func (search *Search) FindServiceByEntId() error {
 	if search.Method() == "POST" {
 		id := search.GetString("entId")
-		limit, _ := search.GetInteger("pageSize")
 		currentPage, _ := search.GetInteger("currentPage")
-		start := (currentPage - 1) * limit
-		var count int64
-		//分页
-		mustnot := `{"term" : {"i_status" : 1 }}`
-		var fields, collection, query, tempstrquery string
-		collection = "service"
-		tempstrquery = `{"query_string":{"default_field": "s_enterpriseid","query":"` + id + `"}}`
-		servicequery := ""
-		if search.GetSession("entid") == nil || search.GetSession("entid").(string) != id {
-			servicequery = `,"must_not" : [` + mustnot + `]`
-		}
-		query = `{"query": {
+		var res map[string]interface{}
+		if ret := redis.Get("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage)); ret != nil {
+			res = ret.(map[string]interface{})
+		} else {
+			limit, _ := search.GetInteger("pageSize")
+			start := (currentPage - 1) * limit
+			var count int64
+			//分页
+			mustnot := `{"term" : {"i_status" : 1 }}`
+			var fields, collection, query, tempstrquery string
+			collection = "service"
+			tempstrquery = `{"query_string":{"default_field": "s_enterpriseid","query":"` + id + `"}}`
+			servicequery := ""
+			if search.GetSession("entid") == nil || search.GetSession("entid").(string) != id {
+				servicequery = `,"must_not" : [` + mustnot + `]`
+			}
+			query = `{"query": {
 		    "bool": {
 			  "must":[` + tempstrquery + `]` + servicequery + `
 		    }
 		  }}`
-		//需要查到的字段信息
-		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price","i_sales"`
-		if currentPage == 1 {
-			count = elastic.Count("service", collection, query)
-		}
-		//查询服务列表数据
-		result := elastic.Get("service", collection, `{"query":{"bool": {"must":[`+tempstrquery+`]`+servicequery+`}},
+			//需要查到的字段信息
+			fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price","i_sales"`
+			if currentPage == 1 {
+				count = elastic.Count("service", collection, query)
+			}
+			//查询服务列表数据
+			result := elastic.Get("service", collection, `{"query":{"bool": {"must":[`+tempstrquery+`]`+servicequery+`}},
 		_source:[`+fields+`],
 		sort:{"l_createdate":"desc"},
 		from:`+fmt.Sprintf("%v", start)+`,
 		size:`+fmt.Sprintf("%v", limit)+`
 		}`)
-		for _, v := range *result {
-			b, _ := CheckAuth(v)
-			if b {
-				v["s_isEdit"] = "1"
-			} else {
-				v["s_isEdit"] = "0"
-			}
-			if IntAll(v["i_status"]) == 1 {
-				v["s_remove"] = 1
-			} else {
-				v["s_remove"] = 0
+			for _, v := range *result {
+				b, _ := CheckAuth(v)
+				if b {
+					v["s_isEdit"] = "1"
+				} else {
+					v["s_isEdit"] = "0"
+				}
+				if IntAll(v["i_status"]) == 1 {
+					v["s_remove"] = 1
+				} else {
+					v["s_remove"] = 0
+				}
 			}
+			res = map[string]interface{}{"list": result, "count": count}
+			redis.Put("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
 		}
-		search.ServeJson(&map[string]interface{}{"list": result, "count": count})
+		search.ServeJson(res)
 	}
 	return nil
 }

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

@@ -17,7 +17,10 @@ type Yellowpage struct {
 	enterpriseInfo xweb.Mapper `xweb:"/enterprise/(\\w+).html"`
 	//根据企业注册号进入企业黄页
 	enterpriseInfoByRegNO xweb.Mapper `xweb:"/enterpriseInfoByRegNO/(\\w+).html"`
-	getRelation           xweb.Mapper `xweb:"/member/getRelation"`
+	//获取关系网数据
+	getRelation xweb.Mapper `xweb:"/member/getRelation"`
+	//获取失信信息
+	getDishonesty xweb.Mapper `xweb:"/front/getDishonesty"`
 }
 
 func (yp *Yellowpage) EnterpriseInfoByRegNO(regNO string) error {

+ 21 - 0
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -529,3 +529,24 @@ func makeRelation(mnregno, mnname string) interface{} {
 	log.Println("生成 ", mnname, "关系网数据,耗时[", time.Now().Sub(t1).Seconds(), "]秒")
 	return data
 }
+
+//获取失信信息
+func (yp *Yellowpage) GetDishonesty() error {
+	if yp.Method() == "POST" {
+		legcerNo := yp.GetString("legcerNo")
+		currentPage, _ := yp.GetInteger("currentPage")
+		var res map[string]interface{}
+		if ret := redis.Get("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage)); ret != nil {
+			res = ret.(map[string]interface{})
+		} else {
+			limit, _ := yp.GetInteger("pageSize")
+			start := (currentPage - 1) * limit
+			count := Count("laolai", `{"s_cardnum":"`+legcerNo+`"}`)
+			r := Find("laolai", `{"s_cardnum":"`+legcerNo+`"}`, `{"l_date":-1}`, `{"l_date":1,"iname":1,"court_name":1,"case_code":1,"performance":1}`, false, start, limit)
+			res = map[string]interface{}{"list": r, "count": count}
+			redis.Put("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
+		}
+		yp.ServeJson(res)
+	}
+	return nil
+}

+ 25 - 1
core/src/web/staticres/css/entcommunity.css

@@ -886,7 +886,31 @@ a:focus, a:hover{
 .ent-table tr:first-child{
 	border-top: none !important;
 }
-.ent-table tr:nth-child(2n+1){
+.ent-dishonesty .b-com-content{
+	padding: 0px 20px 0px 20px;
+}
+.ent-dishonesty .ent-table td{
+	word-wrap: break-word;
+	word-break: break-all;
+	white-space: normal !important;
+}
+.ent-dishonesty .ent-table .b-com-first{
+	margin-bottom: 10px;
+	font-weight: bold;
+	font-size: 16px;
+}
+.ent-dishonesty .ent-table .b-com-second{
+	margin-bottom: 5px;
+	color: #a0a0a0;
+}
+.ent-dishonesty .ent-table .b-com-third span{
+	margin-right: 10px;
+	color: #a0a0a0;
+}
+.ent-dishonesty .ent-table tr{
+	border-top: 1px solid #e5e6e9;
+}
+.ent-yellowpage .ent-table tr:nth-child(2n+1){
 	border-top: 1px solid #e5e6e9;
 	font-size: 16px;
 }

+ 31 - 1
core/src/web/staticres/js/entportrait.js

@@ -1,6 +1,7 @@
 var entType = "企业";
 var relation = null;
 var serviceList = null;
+var dishonesty = null;
 //解析服务列表
 $(function(){
 	//右侧最新消息
@@ -118,6 +119,9 @@ $(function(){
 		$(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
 		if($(this).index() == 1){
 			b_afterLogin();
+		}else if($(this).index() == 4 && dishonesty == null){
+			//加载服务列表
+			dishonesty = new Dishonesty();
 		}else if($(this).index() == 5 && serviceList == null){
 			//加载服务列表
 			serviceList = new ServiceList();
@@ -201,7 +205,7 @@ function initRelation(){
 //服务列表
 function ServiceList(){
 	loadJS("/js/paging.js",function(){
-		paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){
+		new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){
 			if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && r.length == 0){
 				$(".ent-yellowpage .ent-findnull").removeClass("hide");
 				$(".ent-yellowpage .ent-layout-down").remove();
@@ -255,4 +259,30 @@ function ServiceList(){
 			});
 		});
 	});
+}
+//失信信息
+function Dishonesty(){
+	loadJS("/js/paging.js",function(){
+		new Paging("dishonestyListPaging","/front/getDishonesty",{legcerNo:legcerNo},1,function(r){
+			if(r.length == 0){
+				$(".ent-dishonesty .ent-findnull").removeClass("hide");
+				$(".ent-dishonesty .ent-layout-up").remove();
+				return;
+			}
+			var html = '';
+			for(var i=0;i<r.length;i++){
+				html += '<tr><td>'
+					+'<div class="b-com-first">'+r[i].iname+'</div>'
+					+'<div class="b-com-second">案号:'+r[i].case_code+'</div>'
+					+'<div class="b-com-third">'
+						+'<span>法院:'+r[i].court_name+'</span>'
+						+'<span>状态:'+r[i].performance+'</span>'
+						+'<span>立案日期:'+new Date(Number(r[i].l_date+"000")).Format("yyyy-MM-dd")+'</span>'
+					+'</div>'
+					+'</td></tr>';;
+			}
+			$("#dishonestyListPaging").parent().prevAll().remove();
+			$("#dishonestyListPaging").parent().before(html);
+		});
+	});
 }

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

@@ -363,8 +363,20 @@
 			</div>
 		{{end}}
 		</div>
-		<div class="hide">
-			<div class="ent-findnull">
+		<div class="hide ent-dishonesty">
+			<div class="ent-layout-up">
+				<div class="b-com-title">
+					<span><span class="glyphicon jianzhu"></span></span>失信信息
+				</div>
+				<div class="b-com-content">
+					<table class="table ent-table" id="dishonestyList">
+						<tr>
+							<td class="text-center ent-dishonestypaging" id="dishonestyListPaging"></td>
+						</tr>
+					</table>
+				</div>
+			</div>
+			<div class="ent-findnull hide">
 				<img src="/images/findnull.png" class="b-findnull">
 				<h4>抱歉,未找到相关数据!</h4>
 			</div>
@@ -421,7 +433,6 @@
 			<div class="b-adver-title">新闻动态</div>
 			<div class="b-adver-content newsInfo"></div>
 		</div>
-		
 	</div>
 </div>
 <!--显示地图信息-->