Преглед изворни кода

APP运用首页数据开发

anderx пре 7 година
родитељ
комит
31f21b009a

+ 3 - 4
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -19,6 +19,7 @@ import com.goafanti.comment.service.CommentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.service.GlobalSearchService;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.demand.service.DemandService;
@@ -205,10 +206,8 @@ public class OpenAppHomeController extends BaseApiController{
 	@RequestMapping(value = "/getApplicationData" , method = RequestMethod.GET)
 	public Result getApplicationData(String apiUrl,Integer pageNo,Integer pageSize,HttpServletRequest request) {
 		Result result=new Result();
-		if (null==pageNo)pageNo=1;
-		if (null==pageSize)pageSize=3;
-		Map<String, Object> map=new HashMap<>();
-		
+		Map<String, Object> map=jtTagService.getApplicationData(3,1,3,3,3,1,2);
+		map.put("technologyProject", jtBusinessService.getCategoryByModule(5,2));
 		result.setData(map);
 		return result;
 	}

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

@@ -3,6 +3,8 @@ package com.goafanti.business.service;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.business.bo.JtBusinessCategoryBo;
 import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.bo.JtBusinessProjectResult;
@@ -38,7 +40,7 @@ public interface JtBusinessService {
 	 * @param module
 	 * @return
 	 */
-	List<JtBusinessCategory> getCategoryByModule(Integer module);
+	List<JtBusinessCategory> getCategoryByModule(Integer module,Integer layer);
 	
 	/**
 	 * 查看模块项目

+ 4 - 0
src/main/java/com/goafanti/business/service/JtTagService.java

@@ -1,5 +1,7 @@
 package com.goafanti.business.service;
 
+import java.util.Map;
+
 import com.goafanti.business.bo.JtTagBo;
 import com.goafanti.common.model.JtTag;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -15,6 +17,8 @@ public interface JtTagService {
 	JtTag detailJtTag(JtTag a);
 
 	Pagination<JtTagBo> selectListJtTag(JtTag a, Integer pageNo, Integer pageSize);
+	
+	Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 );
 
 	
 

+ 4 - 2
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -450,8 +450,8 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	}
 
 	@Override
-	public List<JtBusinessCategory> getCategoryByModule(Integer module) {
-		return jtBusinessCategoryMapper.getCategoryByModule(module);
+	public List<JtBusinessCategory> getCategoryByModule(Integer module,Integer layer) {
+		return jtBusinessCategoryMapper.getCategoryByModule(module, layer);
 	}
 	
 	@Override
@@ -532,6 +532,8 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		
 		return jtBusinessCategoryMapper.getHomeIndex(module,isHome);
 	}
+
+	
 	
 
 }

+ 15 - 0
src/main/java/com/goafanti/business/service/impl/JtTagServiceImpl.java

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
 
 import com.goafanti.business.bo.JtTagBo;
 import com.goafanti.business.service.JtTagService;
+import com.goafanti.common.dao.JtBusinessProjectMapper;
 import com.goafanti.common.dao.JtTagMapper;
 import com.goafanti.common.model.JtTag;
 import com.goafanti.common.utils.StringUtils;
@@ -20,6 +21,8 @@ import com.goafanti.core.mybatis.page.Pagination;
 public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements JtTagService {
 	@Resource
 	private JtTagMapper	jtTagMapper;
+	@Resource
+	private JtBusinessProjectMapper jtBusinessProjectMapper;
 	@Override
 	public int addTag(JtTag a) {
 		a.setId(UUID.randomUUID().toString());
@@ -48,4 +51,16 @@ public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements J
 		return (Pagination<JtTagBo>)findPage("selectJtTagList", "selectJtTagCount", params, pageNo, pageSize);
 	}
 
+	@Override
+	public Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ) {
+		Map<String, Object> map=new HashMap<>();
+		map.put("JGSC", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
+		map.put("ZFSC", jtBusinessProjectMapper.getProjectByTag("政府市场采购", size2));
+		map.put("GJSC", jtBusinessProjectMapper.getProjectByTag("国际市场开发", size3));
+		map.put("JSMS", jtBusinessProjectMapper.getProjectByTag("减税免税", size4));
+		map.put("RZZS", jtBusinessProjectMapper.getProjectByTag("融资租售", size5));
+		map.put("GFLQ", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
+		map.put("TSJY", jtBusinessProjectMapper.getProjectByTag("他山己用", size7));
+		return map;
+	}
 }

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

@@ -95,7 +95,7 @@ public interface JtBusinessCategoryMapper {
     
     Integer updateNumberPrefix(JtBusinessCategory jtBusinessCategory);
     
-    List<JtBusinessCategory> getCategoryByModule(Integer module);
+    List<JtBusinessCategory> getCategoryByModule(@Param("module")Integer module,@Param("layer")Integer layer);
 
 	JtBusinessCategory selectFirstLevel(String id, Integer module, String superId,@Param("type")Integer type);
 	

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

@@ -557,7 +557,11 @@ and layer=#{0}
     <!-- 获得所有指定模块的业务 -->
     <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
+    from jt_business_category where module = #{module,jdbcType=INTEGER}
+    <if test="layer !=null and layer != '' ">
+    and layer=#{layer,jdbcType=INTEGER}
+    </if> 
+    order by layer,sort
     </select>
     
     <select id="selectFirstLevel" resultMap="BaseResultMap">