Kaynağa Gözat

Merge remote-tracking branch 'origin/test'

Conflicts:
	src/main/java/com/goafanti/common/controller/WebpageController.java
	src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html
limin 7 yıl önce
ebeveyn
işleme
10f0ee2345

+ 0 - 3
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -132,9 +132,6 @@ public class UserJtBusinessController extends CertifyApiController{
 		if(StringUtils.isNotBlank(jtBusinessProject.getApplyConditions()) && jtBusinessProject.getApplyConditions().length() > 512){
 			result.getError().add(buildError("512", "项目客户条件字数不能超过512"));
 		}
-		if(StringUtils.isNotBlank(jtBusinessProject.getIntroduce()) && jtBusinessProject.getIntroduce().length() > 2048){
-			result.getError().add(buildError("2048", "项目服务内容字数不能超过2048"));
-		}
 		if(result.getError().size()>0) {
 			return result;
 		}

+ 6 - 0
src/main/java/com/goafanti/business/service/JtBusinessService.java

@@ -33,5 +33,11 @@ public interface JtBusinessService {
 	Pagination<MyCollection> myCollectionProject(Integer pageNo, Integer pageSize);
 	List<makeMoneyCategoryListBo> makeMoneyCategoryList();
 	Pagination<MyCollection> recommendedApplication( Integer type,Integer pageNo, Integer pageSize);
+	/**
+	 * 获得某模块的所有业务数据
+	 * @param module
+	 * @return
+	 */
+	List<JtBusinessCategory> getCategoryByModule(Integer module);
 	
 }

+ 12 - 1
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -68,6 +68,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		JtBusinessProjectResult j=jtBusinessProjectMapper.selectByPrimaryKeyWithModule(id,uid);
 		j.setCommentDetailResult(jtCommodityCommentMapper.selectByProjectId(id));
 		j.setTags(jtTagMapper.selectProjectTag(id));
+		if (StringUtils.isBlank(j.getAdvertisement()))j.setAdvertisement("暂无描述");
 		return j;
 	}
 
@@ -118,7 +119,12 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if(orderType!=null)params.put("orderType", orderType);
 		if(orderSort!=null)params.put("orderSort", orderSort);
 		if(StringUtils.isNotBlank(tag))params.put("tag", tag);
-		return (Pagination<JtBusinessProjectResult>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
+		Pagination<JtBusinessProjectResult> pagination=(Pagination<JtBusinessProjectResult>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
+		List<JtBusinessProjectResult> list =(List<JtBusinessProjectResult>) pagination.getList();
+		for (JtBusinessProjectResult j : list) {
+			if (StringUtils.isBlank(j.getAdvertisement()))j.setAdvertisement("暂无描述");
+		}
+		return pagination;
 	}
 	
 	private Map<String, Object> disposeParams(String topId, String secondId,  String name) {
@@ -427,6 +433,11 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if (null!=type)params.put("type", type); 
 		return (Pagination<MyCollection>) findPage("recommendedApplicationList", "recommendedApplicationCount", params, pageNo, pageSize);
 	}
+
+	@Override
+	public List<JtBusinessCategory> getCategoryByModule(Integer module) {
+		return jtBusinessCategoryMapper.getCategoryByModule(module);
+	}
 	
 	
 	

+ 5 - 0
src/main/java/com/goafanti/common/bo/MyCollection.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.bo;
 
+import org.apache.commons.lang3.StringUtils;
+
 public class MyCollection {
 	 	private String id; 
 		private String name;
@@ -22,6 +24,9 @@ public class MyCollection {
 			this.name = name;
 		}
 		public String getIntroduction() {
+			if (StringUtils.isBlank(introduction)) {
+				return "暂无描述";
+			}
 			return introduction;
 		}
 		public void setIntroduction(String introduction) {

+ 88 - 8
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.controller;
 
+
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -314,7 +316,7 @@ public class WebpageController extends BaseController {
 	/**
 	 * 服务汇
 	 */
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
 	public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/portal/service/serviceIndex");
@@ -327,8 +329,8 @@ public class WebpageController extends BaseController {
 		List<News> news = (List<News>) newsService.portalNewsList(5, 1, null, null, null, null, 2).getList();
 		modelview.addObject("newsList", news);
 		// 高企服务
-		JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高企服务");
-		JtBusinessCategory gaoqi2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "高企服务");
+		/*JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高新技术服务");
+		JtBusinessCategory gaoqi2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "高新技术服务");
 		if (gaoqi2 != null) {
 			List<JtBusinessProject> gaoqiList = jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(), 6,
 					null);
@@ -353,7 +355,7 @@ public class WebpageController extends BaseController {
 			modelview.addObject("zscqc1", zscqgb);
 		}
 		// 企业认证
-		JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业认证");
+		JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业资质认定");
 		if (qiyerenzheng != null) {
 			List<JtBusinessCategory> qyrzCategories = jtBusinessService
 					.getBusinessCategoryBySuperId(qiyerenzheng.getId(), 2);
@@ -362,8 +364,8 @@ public class WebpageController extends BaseController {
 			modelview.addObject("qyrzc1", qiyerenzheng);
 		}
 		// 管理体系
-		JtBusinessCategory manageSys = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系");
-		JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系");
+		JtBusinessCategory manageSys = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系认证");
+		JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系认证");
 		if (manageSys2 != null) {
 			List<JtBusinessProject> manageSysPro = jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(),
 					18, null);
@@ -378,7 +380,85 @@ public class WebpageController extends BaseController {
 					.getBusinessProjectByCategoryId(scienceProject2.getId(), 12, AFTConstants.YES);
 			modelview.addObject("scienceProjectList", scienceProjects);
 			modelview.addObject("spc1", scienceProject);
-		}
+		}
+		*/
+		/*************以下是重新查询的数据********************************/
+		//高企服务
+		JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高新技术企业服务");
+		if (gaoqi != null) {
+			List<JtBusinessCategory> scienceProject = jtBusinessService.getCategoryByModule(2);
+			List<JtBusinessProject> gaoqiList = new ArrayList<JtBusinessProject>();
+			for (JtBusinessCategory jtBusinessCategory : scienceProject) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategory.getId(), 6, null);
+				gaoqiList.addAll(list);
+			}
+			if(gaoqiList.size()>6){
+				gaoqiList.subList(0, 6);
+			}
+			/*List<JtBusinessProject> gaoqiList = jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(), 6, null);*/
+			for (JtBusinessProject project : gaoqiList) {
+				if (project.getMinImgUrl() != null && project.getMinImgUrl().length() <= 0)
+					project.setMinImgUrl(null);
+				//去除数据中的标签
+				if(StringUtils.isNotBlank(project.getIntroduce())){
+					project.setIntroduce(project.getIntroduce().replaceAll("\\<.*?>", "")); 
+				}
+			}
+			
+			modelview.addObject("gaoqiList", gaoqiList);
+			modelview.addObject("gqc1", gaoqi);
+		}
+		//企业资质认证
+		JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业资质认定");
+		if (qiyerenzheng != null) {
+			//获得所有下级id
+			List<JtBusinessCategory> xaiji = jtBusinessService.getBusinessCategoryBySuperId(qiyerenzheng.getId(), 10);
+			List<JtBusinessProject> qyrzCategories = new ArrayList<JtBusinessProject>();
+			for (int i = 0; i < xaiji.size(); i++) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(xaiji.get(i).getId(), 10, null);
+				qyrzCategories.addAll(list);
+			}
+			if(qyrzCategories.size()>10){
+				qyrzCategories.subList(0, 10);
+			}
+			modelview.addObject("qyrzCategories", qyrzCategories);
+			modelview.addObject("qyrzc1", qiyerenzheng);
+		}
+		//管理体系认证
+		JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系认证");
+		if (manageSys2 != null) {
+			//获得所有下级id
+			List<JtBusinessCategory> xaiji = jtBusinessService.getBusinessCategoryBySuperId(manageSys2.getId(), 10);
+			List<JtBusinessProject> qyrzCategories = new ArrayList<JtBusinessProject>();
+			for (int i = 0; i < xaiji.size(); i++) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(xaiji.get(i).getId(), 18, null);
+				qyrzCategories.addAll(list);
+			}
+			if(qyrzCategories.size()>18){
+				qyrzCategories.subList(0, 18);
+			}
+			//List<JtBusinessProject> manageSysPro = jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(),18, null);
+			modelview.addObject("manageSystemList", qyrzCategories);
+			modelview.addObject("managerSysc1", manageSys2);
+		}
+		
+		//科技项目
+		//获得所有模块为5的科技项目id
+		JtBusinessCategory scienceProject1 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
+		List<JtBusinessCategory> scienceProject = jtBusinessService.getCategoryByModule(5);
+		List<JtBusinessProject> manageSysPro = new ArrayList<JtBusinessProject>();
+		for (JtBusinessCategory jtBusinessCategory : scienceProject) {
+			List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategory.getId(), 12, 1);
+			manageSysPro.addAll(list);
+		}
+		if(null != manageSysPro){
+			if(manageSysPro.size()>12){
+				manageSysPro.subList(0, 12);
+			}
+			modelview.addObject("scienceProjectList", manageSysPro);
+			modelview.addObject("spc1", scienceProject1);
+		}
+		/****************************以上是新修改的部分********************************************/
 		// 咨询师
 		List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(8);
 		// List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
@@ -400,7 +480,7 @@ public class WebpageController extends BaseController {
 	public ModelAndView portalServiceServiceDetail(HttpServletRequest request, ModelAndView modelview, String id) {
 		modelview.setViewName("/portal/service/serviceDetails");
 		JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
-		if (jtBusinessProject != null) {
+		if (null != jtBusinessProject) {
 			if (jtBusinessProject.getMaxImgUrl() != null && jtBusinessProject.getMaxImgUrl().length() <= 0)
 				jtBusinessProject.setMaxImgUrl(null);
 		}

+ 2 - 0
src/main/java/com/goafanti/common/dao/JtBusinessCategoryMapper.java

@@ -95,4 +95,6 @@ public interface JtBusinessCategoryMapper {
     
     Integer updateNumberPrefix(JtBusinessCategory jtBusinessCategory);
     
+    List<JtBusinessCategory> getCategoryByModule(Integer module);
+    
 }

+ 6 - 0
src/main/java/com/goafanti/common/mapper/JtBusinessCategoryMapper.xml

@@ -512,4 +512,10 @@ and layer=#{0}
 		module = #{module,jdbcType=INTEGER}
 		where `number` like #{number, jdbcType=VARCHAR}
     </update>
+    
+    <!-- 获得所有指定模块的业务 -->
+    <select id="getCategoryByModule" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select id, name, summary, number, create_time, super_id, img_url, layer, sort, module
+    from jt_business_category where module = #{module,jdbcType=INTEGER} order by layer,sort
+    </select>
 </mapper>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -576,7 +576,7 @@
     from jt_business_project jtbp left join `user` u on jtbp.owner_id=u.id
     left join jt_business_category jtbc on jtbc.id =  jtbp.category_id
     left join (select project_id,count(*) as count from project_interest group by project_id) p on jtbp.id=p.project_id
-    left join (select project_id from project_interest where uid= #{uid,jdbcType=VARCHAR} ) x on jtbp.id=x.project_id
+    left join (select project_id from project_interest <if test="uid != null"> where uid= #{uid,jdbcType=VARCHAR} </if>) x on jtbp.id=x.project_id
     where jtbp.id = #{id,jdbcType=VARCHAR}
   </select>
   
@@ -831,7 +831,7 @@
   select count(*)
   	from jt_business_project a
   	left join jt_business_category b on  a.category_id=b.id
-  	where a.is_hot=1
+  	where  a.is_hot=1 and a.audit_status=2
   	<if test="type==1">
   	and b.module != 1 
   	</if>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -364,7 +364,7 @@
 			a.title_img as titleImg
 		from news a
 		left join district_glossory d on a.province_id=d.id
-		where a.type =0
+		where a.type =0 and audit_status=2
 		order by a.release_date desc
 		<if test="page_sql != null">
 			${page_sql}
@@ -404,7 +404,7 @@ where audit_status = 2 and p.id=#{0}
 			a.title_img as titleImg
 		from news a
 		left join district_glossory d on a.province_id=d.id
-		where a.type =98
+		where a.type =98 and audit_status=2
 		order by a.release_date desc
 		<if test="page_sql != null">
 			${page_sql}

+ 1 - 1
src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml

@@ -211,7 +211,7 @@
   <select id="selectinformationDetail" resultType="com.goafanti.news.bo.NewsPortalList">
   	select id,create_time as createTime,title,title_img as titleImg,type,hot,
 summary,source,audit_status as auditStatus,release_date as releaseDate,release_status as releaseStatus
-from news where type=0
+from news where type=0 and audit_status=2
   and id= #{id,jdbcType=VARCHAR}
   </select>
 </mapper>

+ 1 - 0
src/main/java/com/goafanti/common/mapper/PolicyMapper.xml

@@ -625,6 +625,7 @@
   date_format(p.release_date,'%Y-%m-%d %H:%I:%S')as releaseDate,
   p.title_img as titleImg 
   from policy p
+  where audit_status=2
   order by p.release_date desc
   <if test="page_sql!=null">
   ${page_sql}

+ 2 - 0
src/main/java/com/goafanti/common/model/JtBusinessProject.java

@@ -3,6 +3,8 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import com.goafanti.common.utils.StringUtils;
+
 public class JtBusinessProject {
 
 	/**

+ 3 - 1
src/main/resources/props/config_local.properties

@@ -55,8 +55,10 @@ app.name=AFT
 app.mobile.website=http://m.kedexinxi.com
 template.cacheable=false
 
-static.host=//sclient.jishutao.com:80/client/1.0.0
+static.host=//sclient.jishutao.com:8088/client/1.0.0
+
 portal.host=//sportal.jishutao.com:80/portal/1.0.0
+
 avatar.host=//sclient.jishutao.com
 avatar.upload.host=//sclient.jishutao.com/upload
 

+ 10 - 10
src/main/webapp/WEB-INF/views/common.html

@@ -83,23 +83,23 @@
 						<img th:src="${portalHost+'/img/index/index_webkit2.png'}" alt="">
 					</span>
 					<p>
-						<a th:href="@{/portal/service/serviceIndex#serviceHigh}">高企服务</a>
-						<a th:href="@{/portal/service/serviceIndex#serviceProject}">科技项目</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceHigh}">高新技术企业服务</a>
 					</p>
 					<p>
-						<a th:href="@{/portal/service/serviceIndex#serviceProperty}">知识产权</a>
-						<a th:href="@{/portal/service/serviceIndex#serviceCustomer}">合作客户</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceAuthentication}">企业资质认定</a>
 					</p>
 					<p>
-						<a th:href="@{/portal/service/serviceIndex#serviceAuthentication}">企业认证</a>
-						<a th:href="@{/portal/service/serviceIndex#serviceAbility}">服务能力</a>
+						<!-- <a th:href="@{/portal/service/serviceIndex#serviceProperty}">知识产权</a> -->
+						<a th:href="@{/portal/service/serviceIndex#serviceProject}">科技项目</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceCustomer}">合作客户</a>
 					</p>
 					<p>
 						<a th:href="@{/portal/service/serviceIndex#serviceAdministration}">管理体系</a>
-						<a th:href="@{/portal/service/serviceIndex#serviceProcess}">服务流程</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceAbility}">服务能力</a>
 					</p>
 					<p>
-						<a th:href="@{/portal/service/serviceIndex#serviceBrand}">品牌通</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceProcess}">服务流程</a>
+						<a th:href="@{/portal/service/serviceIndex#serviceBrand}">品牌通   </a>
 					</p>
 				</li>
 				<li>
@@ -212,12 +212,12 @@
 	                        </ol>
                         </div>
                     </li>                           
-                    <!-- <li th:class="${subM}=='safeguarding'?active:''" >
+                    <li th:class="${subM}=='safeguarding'?active:''" >
                     <div>
                         <a th:href="@{/portal/service/safeguarding}">知识产权维权</a>
  
                        </div>
-                    </li> -->
+                    </li>
  <!--                    <li th:class="${subM}=='protect'?active:''" >
                     <div>
                         <a th:href="@{/portal/service/serviceIndex}">知识产权维权</a>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html