Quellcode durchsuchen

首页数据修改

anderx vor 7 Jahren
Ursprung
Commit
8841e4762d

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

@@ -70,6 +70,7 @@ public interface JtBusinessService {
 	int updateProjectSetTop(String id);
 	void addJtCollectSearch(JtBusinessProject jtBusinessProject);
 	void updateJtCollectSearch(String id);
+	List<JtBusinessCategoryBo> getHomeIndex(Integer module, Integer isHome);
 	
 	
 	

+ 7 - 0
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -236,6 +236,7 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		category.setSummary(jtBusinessCategory.getSummary());
 		category.setPcIndex(jtBusinessCategory.getPcIndex());
 		category.setAppIndex(jtBusinessCategory.getAppIndex());
+		category.setHomeIndex(jtBusinessCategory.getHomeIndex());
 		jtBusinessCategoryMapper.updateByPrimaryKeySelective(category);
 		//是否修改了模块类别
 		boolean moduleChange = null != jtBusinessCategory.getModule() ? !jtBusinessCategory.getModule().equals(jtBusinessCategory.getNextModule()) : false;
@@ -516,6 +517,12 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		if(collectFlag)jtCollectSearchMapper.deleteByrowId(id);
 		
 	}
+
+	@Override
+	public List<JtBusinessCategoryBo> getHomeIndex(Integer module, Integer isHome) {
+		
+		return jtBusinessCategoryMapper.getHomeIndex(module,isHome);
+	}
 	
 
 }

+ 3 - 2
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -742,7 +742,7 @@ public class WebpageController extends BaseController {
 //		String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
 		modelview.setViewName("/portal/index");
 
-		List<JtBusinessCategoryBo> patentCategory = jtBusinessService.getCategoryBoList(1);
+		List<JtBusinessCategoryBo> patentCategory = jtBusinessService.getHomeIndex(1,1);
 		patentCategory = patentCategory.subList(0, Math.min(6, patentCategory.size()));
 		modelview.addObject("patentCategory", patentCategory);
 		List<JtBusinessProject> jtBusinessProjects = (List<JtBusinessProject>) jtBusinessService
@@ -759,7 +759,8 @@ public class WebpageController extends BaseController {
 			}
 				
 			
-		}
+		}
+		
 		modelview.addObject("projects", jtBusinessProjects);
 		List<PolicyResult> policies = (List<PolicyResult>) policyService
 				.searchPolicy("", 2, null, null, "web_index", 1, 3, null).getList();

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

@@ -101,5 +101,7 @@ public interface JtBusinessCategoryMapper {
 	
 	List<JtBusinessCategory> getCategoryByName(JtBusinessCategory category);
 	List<JtBusinessCategory> getCategoryByModel(JtBusinessCategory category);
+
+	List<JtBusinessCategoryBo> getHomeIndex(Integer module, Integer isHome);
     
 }

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

@@ -19,6 +19,7 @@
     <result column="module" jdbcType="INTEGER" property="module" />
     <result column="pc_index" jdbcType="INTEGER" property="pcIndex" />
     <result column="app_index" jdbcType="INTEGER" property="appIndex" />
+    <result column="home_index" jdbcType="INTEGER" property="homeIndex" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -94,7 +95,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Jul 17 09:14:43 CST 2018.
     -->
-    id, name, summary, number, create_time, super_id, img_url, layer, sort, module, pc_index, app_index
+    id, name, summary, number, create_time, super_id, img_url, layer, sort, module, pc_index, app_index,home_index
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.JtBusinessCategoryExample" resultMap="BaseResultMap">
     <!--
@@ -205,6 +206,9 @@
       <if test="appIndex != null">
         app_index,
       </if>
+      <if test="homeIndex != null">
+        home_index,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -243,6 +247,9 @@
       <if test="appIndex != null">
         #{appIndex,jdbcType=INTEGER},
       </if>
+      <if test="homeIndex != null">
+        #{homeIndex,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.JtBusinessCategoryExample" resultType="java.lang.Long">
@@ -369,6 +376,9 @@
       <if test="appIndex != null">
         app_index = #{appIndex,jdbcType=INTEGER},
       </if>
+      <if test="homeIndex != null">
+        home_index = #{homeIndex,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -607,4 +617,17 @@ and layer=#{0}
     limit #{sort,jdbcType=INTEGER} 
     </if>
   </select>
+  <select id="getHomeIndex" resultType="com.goafanti.business.bo.JtBusinessCategoryBo">
+  	  select 
+    name as topLevel,
+    id as topLevelId,
+    img_url as topImg,
+    summary
+    from jt_business_category
+    where layer=2
+    and module=#{0}
+    and home_index=#{1}
+  </select>
+  
+  
 </mapper>

+ 15 - 4
src/main/java/com/goafanti/common/model/JtBusinessCategory.java

@@ -54,6 +54,11 @@ public class JtBusinessCategory {
 	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
 	 */
 	private Integer module;
+	private String oldSuperId; //修改前的上级id
+	private Integer nextModule; //修改后的模块
+	private Integer pcIndex;// 模块发布到pc首页
+	private Integer appIndex;// 模块发布到app首页
+	private Integer homeIndex;// 模块发布到app首页
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_business_category.id
@@ -235,8 +240,7 @@ public class JtBusinessCategory {
 		this.module = module;
 	}
 	
-	private String oldSuperId; //修改前的上级id
-	private Integer nextModule; //修改后的模块
+
 
 	public String getOldSuperId() {
 		return oldSuperId;
@@ -254,8 +258,7 @@ public class JtBusinessCategory {
 		this.nextModule = nextModule;
 	}
 	
-    private Integer pcIndex;// 模块发布到pc首页
-    private Integer appIndex;// 模块发布到app首页
+  
 
 	public Integer getPcIndex() {
 		return pcIndex;
@@ -272,4 +275,12 @@ public class JtBusinessCategory {
 	public void setAppIndex(Integer appIndex) {
 		this.appIndex = appIndex;
 	}
+
+	public Integer getHomeIndex() {
+		return homeIndex;
+	}
+
+	public void setHomeIndex(Integer homeIndex) {
+		this.homeIndex = homeIndex;
+	}
 }

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/index.html

@@ -124,7 +124,7 @@
 				</div>
 				<div class="apply_right">
 					<div th:each="p0,pcStatus:${patentCategory}">
-						<a th:href="'/portal/service/patentList?topId='+${p0.topLevelId}">
+						<a th:href="'/portal/service/patentList?secondId='+${p0.topLevelId}">
 							<img th:src="${portalHost+'/img/indedImg/inded20.jpg'}" alt="" th:if="${pcStatus.index}==0"/>
 							<img th:src="${portalHost+'/img/indedImg/inded21.jpg'}" alt="" th:if="${pcStatus.index}==1"/>
 							<img th:src="${portalHost+'/img/indedImg/inded22.jpg'}" alt="" th:if="${pcStatus.index}==2"/>