瀏覽代碼

知识产权赚钱和维权

limin 7 年之前
父節點
當前提交
9d0dc51b1f

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

@@ -40,4 +40,21 @@ public interface JtBusinessService {
 	 */
 	List<JtBusinessCategory> getCategoryByModule(Integer module);
 	
+	/**
+	 * 查看模块项目
+	 * @param module
+	 * @param isHost
+	 * @param size
+	 * @return
+	 */
+	List<JtBusinessProject> getKJListByIds(Integer module, Integer isHost, Integer size);
+	/**
+	 * 根据名字查看二级分类
+	 * @param name
+	 * @param isHost
+	 * @param size
+	 * @return
+	 */
+	List<JtBusinessProject> getModuleByName(String  name, Integer isHost, Integer size);
+	
 }

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

@@ -439,7 +439,17 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		return jtBusinessCategoryMapper.getCategoryByModule(module);
 	}
 	
-	
+	@Override
+	public List<JtBusinessProject> getKJListByIds(Integer module,
+			Integer isHost, Integer size) {
+		return jtBusinessProjectMapper.getKJListByIds( module,  isHost,  size);
+	}
+
+	@Override
+	public List<JtBusinessProject> getModuleByName(String name, Integer isHost,
+			Integer size) {
+		return jtBusinessProjectMapper.getModuleByName(name, isHost, size);
+	}
 	
 
 }

+ 6 - 43
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -386,15 +386,7 @@ public class WebpageController extends BaseController {
 		//高企服务
 		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.getKJListByIds(2,null,6);
 			/*List<JtBusinessProject> gaoqiList = jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(), 6, null);*/
 			for (JtBusinessProject project : gaoqiList) {
 				if (project.getMinImgUrl() != null && project.getMinImgUrl().length() <= 0)
@@ -411,33 +403,14 @@ public class WebpageController extends BaseController {
 		//企业资质认证
 		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);
-			}
+			List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("企业资质认定", null, 12);
 			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);
+			List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("管理体系认证", null, 18);
 			modelview.addObject("manageSystemList", qyrzCategories);
 			modelview.addObject("managerSysc1", manageSys2);
 		}
@@ -445,19 +418,9 @@ public class WebpageController extends BaseController {
 		//科技项目
 		//获得所有模块为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<JtBusinessProject> manageSysPro = jtBusinessService.getKJListByIds(5,1,12);
+		modelview.addObject("scienceProjectList", manageSysPro);
+		modelview.addObject("spc1", scienceProject1);
 		/****************************以上是新修改的部分********************************************/
 		// 咨询师
 		List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(8);

+ 2 - 1
src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java

@@ -84,7 +84,8 @@ public interface JtBusinessProjectMapper {
   
 	JtBusinessProjectResult selectByPrimaryKeyWithModule(@Param("id")String id,@Param("uid")String uid);
   
-
+	List<JtBusinessProject> getKJListByIds(@Param("module")Integer module, @Param("isHot")Integer isHost, @Param("size")Integer size);
+	List<JtBusinessProject> getModuleByName(@Param("name")String name, @Param("isHot")Integer isHost, @Param("size")Integer size);
      
   
 }

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

@@ -839,4 +839,38 @@
   	and b.module = 5 
   	</if>
   </select>
+  <!-- 查看科技服务项目   -->
+  <select id="getKJListByIds" resultType="com.goafanti.common.model.JtBusinessProject">
+    select 
+	    p.id,
+	  	p.name,
+	  	p.introduce,
+	  	p.min_img_url as minImgUrl
+  	from jt_business_project p
+    left join jt_business_category c on p.category_id = c.id
+    where c.module = #{module} 
+    and p.audit_status = 2 
+    <if test="isHot">
+    and is_hot = #{isHot}
+    </if>
+    order by release_date desc
+	  	limit #{size}
+   </select>
+	   
+	 <!-- 根据二级分类名称查 -->
+  <select id="getModuleByName" resultType="com.goafanti.common.model.JtBusinessProject">
+	 select  b.id,
+	  	b.name,
+	  	b.introduce,
+	  	b.min_img_url as minImgUrl
+	from (select x.id from jt_business_category x inner join jt_business_category y on x.super_id = y.id where y.name=#{name})a 
+	left join jt_business_project b on a.id = b.category_id
+	where  
+	b.audit_status = 2 
+	<if test="isHot">
+    and is_hot = #{isHot}
+    </if>
+	order by b.release_date desc 
+	limit #{size}
+  </select>
 </mapper>

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

@@ -211,7 +211,12 @@
 	                            </li>
 	                        </ol>
                         </div>
-                    </li>                           
+                    </li>  
+                     <li th:class="${subM}=='safeguarding'?active:''" >
+                     	<div>
+                         <a th:href="@{/portal/service/safeguarding}">知识产权维权</a>
+                        </div>
+-                    </li>                         
  <!--                    <li th:class="${subM}=='protect'?active:''" >
                     <div>
                         <a th:href="@{/portal/service/serviceIndex}">知识产权维权</a>