Browse Source

Merge branch 'test' of jishutao/jitao-server into prod

liliang4869 7 years ago
parent
commit
fe66f98fb8

+ 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);
+	}
 	
 	
 	

+ 139 - 61
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -1,58 +1,58 @@
 package com.goafanti.common.controller;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.goafanti.achievement.service.AchievementInterestService;
-import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.banners.enums.BannersType;
-import com.goafanti.banners.service.BannersService;
-import com.goafanti.business.bo.JtBusinessCategoryBo;
-import com.goafanti.business.bo.JtBusinessCategoryTree;
-import com.goafanti.business.bo.JtBusinessProjectResult;
-import com.goafanti.business.service.JtBusinessService;
-import com.goafanti.common.bo.PolicyEntity;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.bo.fieldGlossoryBo;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.ProjectInterestMapper;
-import com.goafanti.common.model.AchievementInterest;
-import com.goafanti.common.model.Banners;
-import com.goafanti.common.model.DemandInterest;
-import com.goafanti.common.model.JtBusinessCategory;
-import com.goafanti.common.model.JtBusinessProject;
-import com.goafanti.common.model.News;
-import com.goafanti.common.model.Policy;
-import com.goafanti.common.model.User;
-import com.goafanti.common.utils.LimitLengthUtil;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.demand.bo.DemandListBo;
-import com.goafanti.demand.service.DemandInterestService;
-import com.goafanti.demand.service.DemandService;
-import com.goafanti.user.bo.OrgIdentityBo;
-import com.goafanti.user.bo.UserIdentityBo;
-import com.goafanti.user.service.OrganizationIdentityService;
-import com.goafanti.user.service.UserIdentityService;
-import com.goafanti.user.service.UserService;
-import com.goafanti.news.bo.NewsPortalList;
-import com.goafanti.news.bo.PolicyResult;
-import com.goafanti.news.enums.NewsType;
-import com.goafanti.news.service.NewsService;
-import com.goafanti.news.service.PolicyService;
-import com.goafanti.portal.bo.AchievementObject;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.goafanti.achievement.service.AchievementInterestService;
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.banners.service.BannersService;
+import com.goafanti.business.bo.JtBusinessCategoryBo;
+import com.goafanti.business.bo.JtBusinessCategoryTree;
+import com.goafanti.business.bo.JtBusinessProjectResult;
+import com.goafanti.business.service.JtBusinessService;
+import com.goafanti.common.bo.PolicyEntity;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.bo.fieldGlossoryBo;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.ProjectInterestMapper;
+import com.goafanti.common.model.AchievementInterest;
+import com.goafanti.common.model.Banners;
+import com.goafanti.common.model.DemandInterest;
+import com.goafanti.common.model.JtBusinessCategory;
+import com.goafanti.common.model.JtBusinessProject;
+import com.goafanti.common.model.News;
+import com.goafanti.common.model.Policy;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.LimitLengthUtil;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.bo.DemandListBo;
+import com.goafanti.demand.service.DemandInterestService;
+import com.goafanti.demand.service.DemandService;
+import com.goafanti.news.bo.NewsPortalList;
+import com.goafanti.news.bo.PolicyResult;
+import com.goafanti.news.enums.NewsType;
+import com.goafanti.news.service.NewsService;
+import com.goafanti.news.service.PolicyService;
+import com.goafanti.portal.bo.AchievementObject;
+import com.goafanti.user.bo.OrgIdentityBo;
+import com.goafanti.user.bo.UserIdentityBo;
+import com.goafanti.user.service.OrganizationIdentityService;
+import com.goafanti.user.service.UserIdentityService;
+import com.goafanti.user.service.UserService;
 
 @Controller
 public class WebpageController extends BaseController {
@@ -315,7 +315,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");
@@ -328,8 +328,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);
@@ -354,7 +354,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);
@@ -363,8 +363,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);
@@ -379,7 +379,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);
@@ -401,7 +479,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>

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

@@ -527,9 +527,6 @@ public class JtBusinessProject {
 	 * @mbg.generated  Wed Aug 01 10:34:40 CST 2018
 	 */
 	public String getAdvertisement() {
-		if (StringUtils.isBlank(advertisement)) {
-			return "暂无描述";
-		}
 		return advertisement;
 	}
 

+ 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
 

+ 8 - 8
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>

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html