Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/test'

Conflicts:
	src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java
limin 7 anni fa
parent
commit
7ed4798e68

+ 14 - 0
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;
@@ -197,6 +198,19 @@ public class OpenAppHomeController extends BaseApiController{
 		res.setData(globalSearchService.AchievementsDemandSearchList(name,pageNo,pageSize));
 		return res;
 	}
+	
+	/**
+	 * 运用首页
+	 * @return
+	 */
+	@RequestMapping(value = "/getApplicationData" , method = RequestMethod.GET)
+	public Result getApplicationData(String apiUrl,Integer pageNo,Integer pageSize,HttpServletRequest request) {
+		Result result=new Result();
+		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

@@ -2,6 +2,8 @@ package com.goafanti.business.service;
 
 import java.util.List;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.business.bo.JtBusinessCategoryBo;
 import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.bo.JtBusinessProjectResult;
@@ -37,7 +39,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 );
 
 	
 

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

+ 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("military", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
+		map.put("government", jtBusinessProjectMapper.getProjectByTag("政府市场采购", size2));
+		map.put("international", jtBusinessProjectMapper.getProjectByTag("国际市场开发", size3));
+		map.put("taxReduction", jtBusinessProjectMapper.getProjectByTag("减税免税", size4));
+		map.put("financingLease", jtBusinessProjectMapper.getProjectByTag("融资租售", size5));
+		map.put("defenseWeapon", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
+		map.put("ownUse", 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">