anderx лет назад: 8
Родитель
Сommit
6d459c43bc

+ 54 - 0
src/main/java/com/goafanti/achievement/bo/AchievementRecommended.java

@@ -0,0 +1,54 @@
+package com.goafanti.achievement.bo;
+
+public class AchievementRecommended {
+	/**成果ID*/
+	private String id;
+	/**成果名称*/
+	private String name;
+	/**成果图片*/
+	private String introduction;
+	/**成果详情*/
+	private String technicalPictureUrl;
+	/**应用领域1*/
+	private String fieldA;
+	/**应用领域2*/
+	private String fieldB;
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getIntroduction() {
+		return introduction;
+	}
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+	
+	public String getFieldA() {
+		return fieldA;
+	}
+	public void setFieldA(String fieldA) {
+		this.fieldA = fieldA;
+	}
+	public String getFieldB() {
+		return fieldB;
+	}
+	public void setFieldB(String fieldB) {
+		this.fieldB = fieldB;
+	}
+	public String getTechnicalPictureUrl() {
+		return technicalPictureUrl;
+	}
+	public void setTechnicalPictureUrl(String technicalPictureUrl) {
+		this.technicalPictureUrl = technicalPictureUrl;
+	}
+	
+}

+ 1 - 0
src/main/java/com/goafanti/achievement/service/AchievementPublishPageService.java

@@ -20,6 +20,7 @@ public class AchievementPublishPageService {
 		List<PublishPageBo> l=new ArrayList<>();
 		l.add(new PublishPageBo("W01","主页"));
 		l.add(new PublishPageBo("W02","科技成果"));
+		l.add(new PublishPageBo("W03","知产"));
 		return l;
 	}
 	

+ 42 - 0
src/main/java/com/goafanti/app/bo/AppHomePage.java

@@ -0,0 +1,42 @@
+package com.goafanti.app.bo;
+
+import java.util.List;
+import java.util.Map;
+
+public class AppHomePage {
+	/** 首页轮播图 **/
+	private List<String> homeImg;
+	/** 标题 **/
+	private  List<TitleBo>  title ;
+	/** 知产 **/
+	private  List<HomeAchievemend>  achievemend ;
+	/** 广告**/
+	private List<AdvertisingBo> advertising;
+	
+	public List<String> getHomeImg() {
+		return homeImg;
+	}
+	public void setHomeImg(List<String> homeImg) {
+		this.homeImg = homeImg;
+	}
+	public  List<TitleBo> getTitle() {
+		return title;
+	}
+	public void setTitle( List<TitleBo> title) {
+		this.title = title;
+	}
+	public List<HomeAchievemend> getAchievemend() {
+		return achievemend;
+	}
+	public void setAchievemend(List<HomeAchievemend> achievemend) {
+		this.achievemend = achievemend;
+	}
+	public List<AdvertisingBo> getAdvertising() {
+		return advertising;
+	}
+	public void setAdvertising(List<AdvertisingBo> advertising) {
+		this.advertising = advertising;
+	}
+	
+	
+	}

+ 33 - 0
src/main/java/com/goafanti/app/bo/HomeAchievemend.java

@@ -0,0 +1,33 @@
+package com.goafanti.app.bo;
+
+
+
+public class HomeAchievemend {
+	/** 成果ID **/
+	private String id;
+	/** 成果名字 **/
+	private  String  name ;
+	/** 成果图片 **/
+	private  String  img ;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getImg() {
+		return img;
+	}
+	public void setImg(String img) {
+		this.img = img;
+	}
+	
+	
+}

+ 22 - 0
src/main/java/com/goafanti/app/bo/HomeImages.java

@@ -0,0 +1,22 @@
+package com.goafanti.app.bo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HomeImages {
+	public String imager1="/tmp/1.png";
+	
+	public String imager2="/tmp/2.png";
+	
+	public String imager3="/tmp/3.png";
+	
+	private List<String> imagers=new ArrayList<>();
+	
+	public  List<String> getImagers() {
+		imagers.add(imager1);
+		imagers.add(imager2);
+		imagers.add(imager3);
+		return imagers;
+	}
+	
+}

+ 16 - 0
src/main/java/com/goafanti/app/bo/Title.java

@@ -0,0 +1,16 @@
+package com.goafanti.app.bo;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Title {
+	private List<TitleBo> list=new ArrayList<TitleBo>();
+		
+	public  List<TitleBo> getTitle() {
+		list.add(new TitleBo("买成果","www.baidu.com"));
+		list.add(new TitleBo("买需求","www.baidu.com"));
+		list.add(new TitleBo("找专家","www.baidu.com"));
+		return list;
+	}
+}

+ 27 - 0
src/main/java/com/goafanti/app/bo/TitleBo.java

@@ -0,0 +1,27 @@
+package com.goafanti.app.bo;
+
+public class TitleBo {
+	/**标题名字*/
+	private String titlename;
+	/**标题图片*/
+	private String titleUrl;
+	
+	TitleBo(String titlename,String titleUrl){
+		this.titlename=titlename;
+		this.titleUrl=titleUrl;
+	}
+	
+	public String getTitlename() {
+		return titlename;
+	}
+	public void setTitlename(String titlename) {
+		this.titlename = titlename;
+	}
+	public String getTitleUrl() {
+		return titleUrl;
+	}
+	public void setTitleUrl(String titleUrl) {
+		this.titleUrl = titleUrl;
+	}
+	
+}

+ 41 - 0
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -0,0 +1,41 @@
+package com.goafanti.app.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.app.service.AppHomePageService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+
+@RestController
+@RequestMapping(path = "open/app/home")
+public class OpenAppHomeController extends BaseApiController{
+	@Resource
+	private AppHomePageService	appHomePageService;
+	
+	
+	/**App首页轮播图、导航、知产*/
+	@RequestMapping(value = "/getHomePageData", method = RequestMethod.GET)
+	public Result getHomePageData(){
+		Result res = new Result();
+		res.setData(appHomePageService.getAppHomePage());
+		return res;
+	}
+	
+	/**技淘推荐*/
+	@RequestMapping(value = "/getHomeRecommended", method = RequestMethod.GET)
+	public Result getHomeRecommended(Integer type){
+		Result res = new Result();
+		if (null==type||type>3||type<0) {
+			 res.getError().add(buildError( "类型错误", "类型错误"));
+	            return res;
+		}
+		res.setData(appHomePageService.getHomeRecommended(type));
+		return res;
+	}
+	
+	
+}

+ 18 - 0
src/main/java/com/goafanti/app/service/AppHomePageService.java

@@ -0,0 +1,18 @@
+package com.goafanti.app.service;
+
+
+
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+import com.goafanti.app.bo.AppHomePage;
+
+
+@Service
+public interface AppHomePageService {
+	
+	public AppHomePage getAppHomePage();
+
+	public List<?> getHomeRecommended(Integer type);
+}

+ 63 - 0
src/main/java/com/goafanti/app/service/impl/AppHomePageServiceImpl.java

@@ -0,0 +1,63 @@
+package com.goafanti.app.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.goafanti.app.bo.AppHomePage;
+import com.goafanti.app.bo.HomeAchievemend;
+import com.goafanti.app.bo.HomeImages;
+import com.goafanti.app.bo.Title;
+import com.goafanti.app.service.AppHomePageService;
+import com.goafanti.common.dao.AchievementMapper;
+import com.goafanti.common.dao.DemandMapper;
+import com.goafanti.common.dao.UserIdentityMapper;
+import com.goafanti.user.service.UserIdentityService;
+
+@Service
+public class AppHomePageServiceImpl implements AppHomePageService{
+	@Autowired
+	AchievementMapper	achievementMapper;
+	@Autowired
+	DemandMapper	demandMapper;
+	@Autowired
+	UserIdentityMapper	userIdentityMapper;
+	@Autowired
+	UserIdentityService userIdentityService;
+	
+
+	@Override
+	public AppHomePage getAppHomePage() {
+		AppHomePage ap=new AppHomePage();
+		ap.setHomeImg(new HomeImages().getImagers());
+		ap.setTitle(new Title().getTitle());
+		ap.setAdvertising(userIdentityService.advertising());
+		List<HomeAchievemend> h=achievementMapper.getAppHomeAchievement();
+		for (HomeAchievemend ha : h) {
+			if (null!=ha.getImg()&&ha.getImg().indexOf(",")>0) {
+				ha.setImg(ha.getImg().substring(0, ha.getImg().indexOf(",")));
+			}
+		}
+		ap.setAchievemend(h);
+		return ap;
+	}
+
+
+	@Override
+	public List<?> getHomeRecommended(Integer type) {
+		if (type==1) {
+		return achievementMapper.getAppHomeRecommended();			
+		}
+		if (type==2) {
+			return 	demandMapper.getAppHomeRecommended();
+		}
+		if (type==3) {
+			return userIdentityMapper.getAppHomeRecommended();
+		}
+		return null;
+	}
+
+	
+
+	
+}

+ 6 - 0
src/main/java/com/goafanti/common/dao/AchievementMapper.java

@@ -8,7 +8,9 @@ import com.goafanti.achievement.bo.AchievementInterestBo;
 import com.goafanti.achievement.bo.AchievementListBo;
 import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementPartnerListBo;
+import com.goafanti.achievement.bo.AchievementRecommended;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
+import com.goafanti.app.bo.HomeAchievemend;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.portal.bo.AchievementDetailBo;
 import com.goafanti.portal.bo.AchievementPortalDetailBo;
@@ -71,5 +73,9 @@ public interface AchievementMapper {
 	Integer countInterest(String achievementId);
 
 	List<AchievementInterestBo> achievementInterest(String uid);
+
+	List<HomeAchievemend> getAppHomeAchievement();
+
+	List<AchievementRecommended> getAppHomeRecommended();
 	
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -9,6 +9,7 @@ import com.goafanti.common.model.Demand;
 import com.goafanti.demand.bo.DemandInterestBo;
 import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
+import com.goafanti.demand.bo.DemandRecommended;
 import com.goafanti.portal.bo.DemandPortalDetailBo;
 import com.goafanti.portal.bo.DemandPortalSimilarListBo;
 import com.goafanti.portal.bo.DemandSearchDetailBo;
@@ -60,4 +61,6 @@ public interface DemandMapper {
 	Demand selectDemandDetail(String id);
 
 	DemandListBo selectAppByPrimaryKey(String id);
+
+	List<DemandRecommended> getAppHomeRecommended();
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/UserIdentityMapper.java

@@ -7,6 +7,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
 
 import com.goafanti.user.bo.UserIdentityBo;
+import com.goafanti.user.bo.UserIdentityRecommended;
 import com.goafanti.user.bo.UserNames;
 
 import java.util.List;
@@ -98,5 +99,7 @@ public interface UserIdentityMapper {
 	UserIdentityBo selectUserIdentityByUid(String uid);
 
 	consultantListBo selectconsultantByUid(String id);
+
+	List<UserIdentityRecommended> getAppHomeRecommended();
     
 }

+ 26 - 1
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -2133,5 +2133,30 @@
 		and  mm.effective = 1
 	</if>
   </select>
-  	
+  <select id="getAppHomeAchievement" resultType="com.goafanti.app.bo.HomeAchievemend">
+  select ap.achievement_id as id ,a.name as name ,a.technical_picture_url as img, 
+		ap.if_top,ap.top_number,ap.show_number
+		from achievement_publish ap
+		left join achievement a on ap.achievement_id=a.id
+		where ap.publish_client='1'
+		and ap.publish_page='W03'
+		order by ap.if_top,ap.top_number,ap.show_number asc
+		limit 0,4
+  </select>
+ <select id="getAppHomeRecommended" resultType="com.goafanti.achievement.bo.AchievementRecommended">
+ 	select ap.achievement_id as id,a.name,a.introduction,a.technical_picture_url as technicalpictureUrl,
+	a.field_a,a.field_b,f1.name as fieldA,f2.name as fieldB
+	from achievement_publish ap 
+	left join achievement a on ap.achievement_id = a.id
+	left join field_glossory f1 on a.field_a=f1.id
+	left join field_glossory f2 on a.field_b=f2.id
+where
+	ap.publish_client = '1'
+	and ap.publish_page = 'W03'
+order by
+	ap.if_top,
+	ap.top_number,
+	ap.show_number asc limit 0,
+	6
+</select> 	
 </mapper>

+ 14 - 0
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -2085,4 +2085,18 @@
 		and mm.effective = 1
 	</if>
   </select>
+  <select id="getAppHomeRecommended" resultType="com.goafanti.demand.bo.DemandRecommended">
+	  		select dp.demand_id as id,d.name,d.problem_des as introduction,d.picture_url as pictureUrl,
+		d.urgent_days as urgentDays,d.urgent_money as urgentMoney
+		from demand_publish dp 
+		left join demand d on dp.demand_id = d.id
+	where
+		dp.publish_client = '1'
+		and dp.publish_page = 'W01'
+	order by
+		dp.if_top,
+		dp.top_number,
+		dp.show_number asc limit 0,
+		6
+  </select>
 </mapper>

+ 14 - 0
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -1104,4 +1104,18 @@
   	where t.expert=2
   	and t.uid = #{uid,jdbcType=VARCHAR}
   </select>
+  <select id="getAppHomeRecommended" resultType="com.goafanti.user.bo.UserIdentityRecommended">
+  select
+	ep.expert_id as id, u.identify_name as name, ui.work_unit as workUnit, u.introduction as introduction,
+	u.head_portrait_url as headPortraitUrl
+from expert_publish ep
+	left join user_identity ui on ep.expert_id = ui.uid
+	left join user u on ep.expert_id = u.id
+where
+	ep.publish_client = '1'
+	and ep.publish_page = 'W01'
+order by
+	ep.if_top, ep.top_number, ep.show_number asc 
+	limit 0,6
+  </select>
 </mapper>

+ 54 - 0
src/main/java/com/goafanti/demand/bo/DemandRecommended.java

@@ -0,0 +1,54 @@
+package com.goafanti.demand.bo;
+
+public class DemandRecommended {
+	/**需求ID*/
+	private String id;
+	/**需求名称*/
+	private String name;
+	/**需求详情*/
+	private String introduction;
+	/**需求图片*/
+	private String pictureUrl;
+	/**悬赏金额*/
+	private String urgentMoney;
+	/**加急天数*/
+	private String urgentDays;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getIntroduction() {
+		return introduction;
+	}
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+	public String getUrgentMoney() {
+		return urgentMoney;
+	}
+	public void setUrgentMoney(String urgentMoney) {
+		this.urgentMoney = urgentMoney;
+	}
+	public String getUrgentDays() {
+		return urgentDays;
+	}
+	public void setUrgentDays(String urgentDays) {
+		this.urgentDays = urgentDays;
+	}
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+	
+}

+ 47 - 0
src/main/java/com/goafanti/user/bo/UserIdentityRecommended.java

@@ -0,0 +1,47 @@
+package com.goafanti.user.bo;
+
+public class UserIdentityRecommended {
+	/**专家ID*/
+	private String id;
+	/**专家名称*/
+	private String name;
+	/**专家单位*/
+	private String workUnit;
+	/**专家详情*/
+	private String introduction;
+	/**专家图片*/
+	private String headPortraitUrl;
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getWorkUnit() {
+		return workUnit;
+	}
+	public void setWorkUnit(String workUnit) {
+		this.workUnit = workUnit;
+	}
+	public String getIntroduction() {
+		return introduction;
+	}
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+	public String getHeadPortraitUrl() {
+		return headPortraitUrl;
+	}
+	public void setHeadPortraitUrl(String headPortraitUrl) {
+		this.headPortraitUrl = headPortraitUrl;
+	}
+	
+	
+	
+}