Kaynağa Gözat

Merge remote-tracking branch 'origin/patch' into test

anderx 7 yıl önce
ebeveyn
işleme
df76afbc43

+ 48 - 2
src/main/java/com/goafanti/app/controller/AppDiscoveryController.java

@@ -9,9 +9,11 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.demand.service.DemandService;
+import com.goafanti.news.service.NewsService;
 import com.goafanti.user.service.UserIdentityService;
 
 @RestController
@@ -25,6 +27,8 @@ public class AppDiscoveryController extends BaseApiController {
 	private UserIdentityService	userIdentityService;
 	@Resource
 	private AchievementInterestService	achievementInterestService;
+	@Resource
+	private NewsService newsService;
 	
 	/**
 	 * 成果列表
@@ -84,13 +88,24 @@ public class AppDiscoveryController extends BaseApiController {
 		return res;
 	}
 	
+	
+	/**
+	 * 专家领域分类列表
+	 * 
+	 */
+	@RequestMapping(value = "/domainList", method = RequestMethod.GET)
+	public Result domainList() {
+		Result res = new Result();
+		res.setData(userIdentityService.domainList());
+		return res;
+	}
 	/**
 	 * 专家列表
 	 */
 	@RequestMapping(value = "/expertsList", method = RequestMethod.GET)
-	public Result expertsList(String industry, Integer pNo, Integer pSize) {
+	public Result expertsList(String name,String industry, Integer pNo, Integer pSize) {
 		Result res = new Result();
-		res.setData(userIdentityService.expertsList(industry,  pNo,  pSize));
+		res.setData(userIdentityService.expertsList(name,industry,  pNo,  pSize));
 		return res;
 	}
 	
@@ -104,4 +119,35 @@ public class AppDiscoveryController extends BaseApiController {
 		return res;
 	}
 	
+
+	
+	/**
+	 * 政策列表
+	 */
+	@RequestMapping(value = "/listNews", method = RequestMethod.GET)
+	public Result appListNews(String param,Integer pNo,Integer pSize) {
+		Result res = new Result();
+		if (null==pNo) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"页码","页码"));
+			return res;
+		}
+		if (null==pSize) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"页显示数","页显示数"));
+			return res;
+		}
+		res.setData(newsService.appListNews( param ,pNo, pSize));
+		return res;
+	}
+	
+	/**
+	 * 政策详情
+	 */
+	@RequestMapping(value = "/newsDetail", method = RequestMethod.GET)
+	public Result expertsDetail(long id) {
+		System.out.println("111111111111");
+		Result res = new Result();
+		res.setData(newsService.findNewsDetail( id));
+		return res;
+	}
+	
 }

+ 35 - 2
src/main/java/com/goafanti/app/controller/OpenAppDiscoveryController.java

@@ -12,6 +12,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.demand.service.DemandService;
+import com.goafanti.news.service.NewsService;
 import com.goafanti.user.service.UserIdentityService;
 
 @RestController
@@ -25,6 +26,8 @@ public class OpenAppDiscoveryController extends BaseApiController {
 	private UserIdentityService	userIdentityService;
 	@Resource
 	private AchievementInterestService	achievementInterestService;
+	@Resource
+	private NewsService newsService;
 	
 	/**
 	 * 成果列表
@@ -85,12 +88,22 @@ public class OpenAppDiscoveryController extends BaseApiController {
 	}
 	
 	/**
+	 * 专家领域分类列表
+	 * 
+	 */
+	@RequestMapping(value = "/domainList", method = RequestMethod.GET)
+	public Result domainList() {
+		Result res = new Result();
+		res.setData(userIdentityService.domainList());
+		return res;
+	}
+	/**
 	 * 专家列表
 	 */
 	@RequestMapping(value = "/expertsList", method = RequestMethod.GET)
-	public Result expertsList(String industry, Integer pNo, Integer pSize) {
+	public Result expertsList(String name,String industry, Integer pNo, Integer pSize) {
 		Result res = new Result();
-		res.setData(userIdentityService.expertsList(industry,pNo,pSize));
+		res.setData(userIdentityService.expertsList(name,industry,pNo,pSize));
 		return res;
 	}
 	
@@ -103,4 +116,24 @@ public class OpenAppDiscoveryController extends BaseApiController {
 		res.setData(userIdentityService.advertising());
 		return res;
 	}
+	/**
+	 * 政策列表
+	 */
+	@RequestMapping(value = "/listNews", method = RequestMethod.GET)
+	public Result appListNews(String param,Integer pNo,Integer pSize) {
+		Result res = new Result();
+		res.setData(newsService.appListNews( param ,pNo, pSize));
+		return res;
+		
+	}
+	
+	/**
+	 * 政策详情
+	 */
+	@RequestMapping(value = "/newsDetail", method = RequestMethod.GET)
+	public Result expertsDetail(long id) {
+		Result res = new Result();
+		res.setData(newsService.findNewsDetail( id));
+		return res;
+	}
 }

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

@@ -12,7 +12,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 
 @RestController
-@RequestMapping(path = "open/app/home")
+@RequestMapping(path = "/open/app/home")
 public class OpenAppHomeController extends BaseApiController{
 	@Resource
 	private AppHomePageService	appHomePageService;

+ 1 - 1
src/main/java/com/goafanti/app/controller/OpenAppServiceController.java

@@ -20,7 +20,7 @@ import com.goafanti.user.service.UserIdentityService;
 
 
 @RestController
-@RequestMapping(path = "open/app/service", method = RequestMethod.GET)
+@RequestMapping(path = "/open/app/service", method = RequestMethod.GET)
 public class OpenAppServiceController extends BaseApiController {
 	@Resource
 	private BusinessVarietiesService	adminVarietiesService;

+ 1 - 1
src/main/java/com/goafanti/app/controller/OpenAppUserController.java

@@ -23,7 +23,7 @@ import com.goafanti.user.service.UserInterestService;
 import com.goafanti.user.service.UserService;
 
 @RestController
-@RequestMapping(path = "open/app/user", method = RequestMethod.GET)
+@RequestMapping(path = "/open/app/user", method = RequestMethod.GET)
 public class OpenAppUserController extends BaseApiController {
 	@Resource
 	private UserService userServiceImpl;

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

@@ -21,5 +21,7 @@ public interface IndustryCategoryMapper {
     List<IndustryCategory> listByPid(Integer pid);
 
 	List<fieldGlossoryBo> selectindustryList();
+
+	List<fieldGlossoryBo> selectDomainList();
     
 }

+ 7 - 1
src/main/java/com/goafanti/common/mapper/IndustryCategoryMapper.xml

@@ -89,6 +89,12 @@
   <select id="selectindustryList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
   	SELECT id, name, pid, `level`
 	FROM aft.field_glossory
-	WHERE level=1;
+	WHERE level=1
+  </select>
+  
+  <select id="selectDomainList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
+  	SELECT id,name,pid
+	FROM aft.industry_category
+	WHERE pid=0
   </select>
 </mapper>

+ 53 - 4
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -43,7 +43,9 @@
     jmrh_flag as jmrhFlag,
     province_id as provinceId,
     audit_status as auditStatus,
-    release_status as releaseStatus
+    release_status as releaseStatus,
+    top_number as topNumber,
+    hotspot
     from news
     where id = #{id,jdbcType=BIGINT}
   </select>
@@ -55,13 +57,13 @@
     insert into news (id, create_time, edit_time, 
       title, title_img, author, 
       type, hot, source, 
-      source_url, summary, content,jmrh_flag,province_id
+      source_url, summary, content,jmrh_flag,province_id,top_number,hotspot
       )
     values (#{id,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP}, 
       #{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, 
       #{type,jdbcType=INTEGER}, #{hot,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, 
       #{sourceUrl,jdbcType=VARCHAR}, #{summary,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR},
-      #{jmrhFlag,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}
+      #{jmrhFlag,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.News">
@@ -213,7 +215,9 @@
       jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
       province_id = #{provinceId,jdbcType=INTEGER},
       audit_status = #{auditStatus,jdbcType=INTEGER},
-      release_status = #{releaseStatus,jdbcType=INTEGER}
+      release_status = #{releaseStatus,jdbcType=INTEGER},
+      top_number = #{topNumber,jdbcType=INTEGER},
+      hotspot = #{hotspot,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.News">
@@ -329,5 +333,50 @@
 	</select>
 	
 	
+	<select id="appNewsList" resultType="com.goafanti.news.bo.NewsPortalList">
+		select
+			a.id,
+			DATE_FORMAT(a.create_time,'%Y-%m-%d') as createTime,
+			a.title,
+			a.title_img as titleImg,
+			a.type,
+			a.hot,
+			a.summary,
+			a.source,
+			a.content,
+			top_number as topNumber,
+    		hotspot
+		from news a
+		left join district_glossory d on a.province_id=d.id
+		where
+		a.type != 1 and a.type != 2
+		<if test="param != null">
+			and a.title like concat('%',#{param},'%')
+			or a.source like concat('%',#{param},'%')
+			or d.name like concat('%',#{param},'%')
+		</if>	
+		order by  IF(ISNULL(top_number),1,0) ,top_number asc,
+				 IF(ISNULL(hotspot),1,0),hotspot  asc,
+				create_time desc
+		<if test="page_sql != null">
+			${page_sql}
+		</if>
+	</select>
+	
+	<select id="appNewsCount" resultType="java.lang.Integer">
+		select 
+			count(0)
+		from news a
+		left join district_glossory d on a.province_id=d.id
+		where 
+		a.type != 1 and a.type != 2
+		<if test="param != null">
+			and a.title like concat('%',#{param},'%')
+			or a.source like concat('%',#{param},'%')
+			or d.name like concat('%',#{param},'%')
+		</if>	
+	</select>
+	
+	
 	
 </mapper>

+ 3 - 1
src/main/java/com/goafanti/common/mapper/NewsMapperExt.xml

@@ -67,7 +67,9 @@
   		source,
   		summary,
   		audit_status as auditStatus,
-  		release_status as releaseStatus
+  		release_status as releaseStatus,
+  		top_number as topNumber,
+    	hotspot
   	from news
   	where 1 =1
   	<if test="auditStatus != null">

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

@@ -1045,6 +1045,9 @@
 	<if test="industry != null">
         and t.industry = #{industry,jdbcType=VARCHAR}
     </if>
+    <if test="name != null">
+        and u.nickname like concat('%',#{name},'%')
+    </if>
     <if test="page_sql!=null">
         ${page_sql}
     </if>
@@ -1061,6 +1064,9 @@
     <if test="industry != null">
         and t.industry = #{industry,jdbcType=VARCHAR}
     </if>
+    <if test="name != null">
+        and u.nickname like concat('%',#{name},'%')
+    </if>
   </select>
   
   <select id="countInterest" resultType="java.lang.Integer">

+ 26 - 0
src/main/java/com/goafanti/common/model/News.java

@@ -95,6 +95,16 @@ public class News {
 	 */
 	private Integer releaseStatus;
 	
+	/**
+	 * 置顶
+	 */
+	private Integer topNumber;
+	
+	/**
+	 * 热门
+	 */
+	private Integer hotspot;
+	
 	@JsonFormat(shape = Shape.STRING)
 	public Long getId() {
 		return id;
@@ -243,6 +253,22 @@ public class News {
 	public void setCreateTimeS(String createTimeS) {
 		CreateTimeS = createTimeS;
 	}
+
+	public Integer getTopNumber() {
+		return topNumber;
+	}
+
+	public void setTopNumber(Integer topNumber) {
+		this.topNumber = topNumber;
+	}
+
+	public Integer getHotspot() {
+		return hotspot;
+	}
+
+	public void setHotspot(Integer hotspot) {
+		this.hotspot = hotspot;
+	}
 	
 	
 }

+ 26 - 0
src/main/java/com/goafanti/news/bo/InputNews.java

@@ -55,6 +55,16 @@ public class InputNews {
 	 * 是否发布
 	 */
 	private Integer releaseStatus;
+	
+	/**
+	 * 置顶
+	 */
+	private Integer topNumber;
+	
+	/**
+	 * 热门
+	 */
+	private Integer hotspot;
 
 	public Integer getAuditStatus() {
 		return auditStatus;
@@ -168,4 +178,20 @@ public class InputNews {
 		this.provinceId = provinceId;
 	}
 
+	public Integer getTopNumber() {
+		return topNumber;
+	}
+
+	public void setTopNumber(Integer topNumber) {
+		this.topNumber = topNumber;
+	}
+
+	public Integer getHotspot() {
+		return hotspot;
+	}
+
+	public void setHotspot(Integer hotspot) {
+		this.hotspot = hotspot;
+	}
+
 }

+ 26 - 1
src/main/java/com/goafanti/news/bo/NewsPortalList.java

@@ -9,7 +9,16 @@ public class NewsPortalList extends NewsSummary {
 	
 	private String DataS;
 
-	private String source;
+	private String source;
+	/**
+	 * 置顶
+	 */
+	private Integer topNumber;
+	
+	/**
+	 * 热门
+	 */
+	private Integer hotspot;
 
 	public String getTitle() {
 		return title;
@@ -42,6 +51,22 @@ public class NewsPortalList extends NewsSummary {
 	public void setDataS(String dataS) {
 		DataS = dataS;
 	}
+
+	public Integer getTopNumber() {
+		return topNumber;
+	}
+
+	public void setTopNumber(Integer topNumber) {
+		this.topNumber = topNumber;
+	}
+
+	public Integer getHotspot() {
+		return hotspot;
+	}
+
+	public void setHotspot(Integer hotspot) {
+		this.hotspot = hotspot;
+	}
 	
 	
 

+ 14 - 0
src/main/java/com/goafanti/news/service/NewsService.java

@@ -203,5 +203,19 @@ public class NewsService extends BaseMybatisDao<NewsMapper> {
 		
 		return newsMapper.portalNewsQuestion();
 	}
+	@SuppressWarnings("unchecked")
+	public Pagination<NewsPortalList> appListNews(String param,Integer pNo,Integer pSize){
+		Map<String, Object> params=new HashMap<>();
+		if (StringUtils.isNotBlank(param)) {
+			params.put("param", param);
+		}
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<NewsPortalList>) findPage("appNewsList", "appNewsCount", params, pNo, pSize);
+	}
 	
 }

+ 3 - 1
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -42,7 +42,7 @@ public interface UserIdentityService {
 	
 	UserIdentityBo expertsDetail(String uid);
 
-	Pagination<UserIdentityBo> expertsList(String industry, Integer pNo, Integer pSize);
+	Pagination<UserIdentityBo> expertsList(String name,String industry, Integer pNo, Integer pSize);
 
 	List<fieldGlossoryBo> industryList();
 
@@ -55,5 +55,7 @@ public interface UserIdentityService {
 	 Pagination<consultantListBo> portalConsultantList(Integer pNo, Integer pSize);
 	
 	consultantListBo portalconsultantDetail(String id);
+
+	List<fieldGlossoryBo> domainList();
 	
 }

+ 10 - 1
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -335,11 +335,14 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<UserIdentityBo> expertsList(String industry, Integer pNo, Integer pSize) {
+	public Pagination<UserIdentityBo> expertsList(String name,String industry, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
 		if (StringUtils.isNotBlank(industry)) {
 			params.put("industry", industry);
 		}
+		if (StringUtils.isNotBlank(name)) {
+			params.put("name", name);
+		}
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -444,4 +447,10 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		return c;
 	}
 
+	@Override
+	public List<fieldGlossoryBo> domainList() {
+		List<fieldGlossoryBo> list=industryCategoryMapper.selectDomainList();
+		return list;
+	}
+
 }