|
|
@@ -3,6 +3,7 @@ package com.goafanti.common.controller;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -18,7 +19,6 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
import com.goafanti.achievement.service.AchievementInterestService;
|
|
|
import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.app.bo.ExpertsListBo;
|
|
|
-import com.goafanti.app.bo.consultantListBo;
|
|
|
import com.goafanti.banners.service.BannersService;
|
|
|
import com.goafanti.business.bo.JtBusinessCategoryBo;
|
|
|
import com.goafanti.business.bo.JtBusinessCategoryTree;
|
|
|
@@ -765,7 +765,7 @@ public class WebpageController extends BaseController {
|
|
|
}
|
|
|
modelview.addObject("projects", jtBusinessProjects);
|
|
|
List<PolicyResult> policies = (List<PolicyResult>) policyService
|
|
|
- .searchPolicy("", 2, null, null, "web_index", 1, 2, null).getList();
|
|
|
+ .searchPolicy("", 2, null, null, "web_index", 1, 3, null).getList();
|
|
|
for (PolicyResult p : policies) {
|
|
|
if (null != p.getTitleImg() && p.getTitleImg().contains(",")) {
|
|
|
p.setTitleImg(p.getTitleImg().substring(0, p.getTitleImg().indexOf(",")));
|
|
|
@@ -773,11 +773,11 @@ public class WebpageController extends BaseController {
|
|
|
}
|
|
|
modelview.addObject("policys", policies);//政策
|
|
|
List<News> newsList = (List<News>) newsService
|
|
|
- .listNews(0, null, null, null, null, null, null, 1, 3, "2", null, null).getList();
|
|
|
+ .listNews(0, null, null, null, null, null, null, 1, 3, "2", null, null,null).getList();
|
|
|
modelview.addObject("news", newsList);//资讯
|
|
|
//
|
|
|
List<News> subscriptions = (List<News>) newsService
|
|
|
- .listNews(99, null, null, null, null, null, null, 1, 4, "2", null, null).getList();
|
|
|
+ .listNews(99, null, null, null, null, null, null, 1, 4, "2", null, null,null).getList();
|
|
|
modelview.addObject("subscription", subscriptions);//技淘观点精选
|
|
|
|
|
|
if (subscriptions != null && subscriptions.size() > 0 && subscriptions.get(0).getSourceUrl() != null
|
|
|
@@ -1109,7 +1109,7 @@ public class WebpageController extends BaseController {
|
|
|
|
|
|
// 知产百科
|
|
|
List<News> news = (List<News>) newsService
|
|
|
- .listNews(98, null, null, null, null, null, null, 1, 4, 2 + "", null, "web_tech_service_index")
|
|
|
+ .listNews(98, null, null, null, null, null, null, 1, 4, 2 + "", null, "web_tech_service_index",null)
|
|
|
.getList();
|
|
|
for (News n : news) {
|
|
|
if (null != n.getTitleImg() && n.getTitleImg().contains(",")) {
|
|
|
@@ -1417,12 +1417,27 @@ public class WebpageController extends BaseController {
|
|
|
public Result policyAndNewsList(Policy policy, Integer pageNo, Integer pageSize){
|
|
|
Result res = new Result();
|
|
|
//如果type是null 查看政策和新闻等的数据
|
|
|
- if(null == policy.getType()){
|
|
|
+ if(null == policy.getType() || "".equals(policy.getType())){
|
|
|
res.setData(policyService.searchPolicyAndNewsList(policy, pageNo, pageSize));
|
|
|
- }else if(policy.getType() >= 0){//资讯\观点\知产 news表
|
|
|
- res.setData(newsService.listNews(policy.getType(), null, null, null, null, null, null, pageNo, pageSize, "2", null, null).getList());
|
|
|
+ }else if(policy.getType() == 0 || policy.getType() == 99 || policy.getType() == 98 ){//资讯\观点\知产 news表
|
|
|
+ Pagination<News> listNews = newsService.listNews(policy.getType(), null, null, null, null, null, null, pageNo, pageSize, "2", null, null,policy.getProvince());
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ Iterator<News> iterator = (Iterator<News>) listNews.getList().iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ News news = (News) iterator.next();
|
|
|
+ news.setType(1);
|
|
|
+ news.setHot(news.getHotspot());//是否热门处理
|
|
|
+ }
|
|
|
+ res.setData(listNews);
|
|
|
}else{//政策
|
|
|
- res.setData(policyService.searchPolicy(policy.getTitle(), 2, null, null, null, pageNo, pageSize, policy.getProvince()));
|
|
|
+ Pagination<PolicyResult> policyList = policyService.searchPolicy(policy.getTitle(), 2, null, null, null, pageNo, pageSize, policy.getProvince());
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ Iterator<PolicyResult> iterator = (Iterator<PolicyResult>) policyList.getList().iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ PolicyResult policyResult = (PolicyResult) iterator.next();
|
|
|
+ policyResult.setType(0);
|
|
|
+ }
|
|
|
+ res.setData(policyList);
|
|
|
}
|
|
|
return res;
|
|
|
}
|