Quellcode durchsuchen

Merge branch 'master' of https://git.coding.net/aft/AFT.git

albertshaw vor 8 Jahren
Ursprung
Commit
4eb2f55b26
22 geänderte Dateien mit 541 neuen und 61 gelöschten Zeilen
  1. 10 6
      schema/201707012-lecture.sql
  2. 2 2
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 97 23
      src/main/java/com/goafanti/admin/controller/AdminLectureApiController.java
  4. 2 2
      src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java
  5. 1 1
      src/main/java/com/goafanti/cognizance/service/OrgStandardService.java
  6. 1 1
      src/main/java/com/goafanti/cognizance/service/impl/OrgAnnualReportServiceImpl.java
  7. 5 1
      src/main/java/com/goafanti/cognizance/service/impl/OrgStandardServiceImpl.java
  8. 9 0
      src/main/java/com/goafanti/common/dao/LectureMapper.java
  9. 53 0
      src/main/java/com/goafanti/common/enums/LectureDynamicType.java
  10. 53 0
      src/main/java/com/goafanti/common/enums/LectureHotType.java
  11. 79 7
      src/main/java/com/goafanti/common/mapper/LectureMapper.xml
  12. 6 0
      src/main/java/com/goafanti/common/mapper/OrgStandardMapper.xml
  13. 12 5
      src/main/java/com/goafanti/common/mapper/TechWebsiteMapper.xml
  14. 62 0
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  15. 26 0
      src/main/java/com/goafanti/common/model/Lecture.java
  16. 26 0
      src/main/java/com/goafanti/lecture/bo/InputLecture.java
  17. 8 0
      src/main/java/com/goafanti/lecture/service/LectureService.java
  18. 20 0
      src/main/java/com/goafanti/lecture/service/impl/LectureServiceImpl.java
  19. 11 0
      src/main/java/com/goafanti/portal/controller/PortalStarController.java
  20. 5 0
      src/main/java/com/goafanti/user/bo/StarAndExpertListBo.java
  21. 4 0
      src/main/java/com/goafanti/user/service/UserService.java
  22. 49 13
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

+ 10 - 6
schema/201707012-lecture.sql

@@ -1,12 +1,16 @@
 CREATE TABLE `lecture` (
-  `id` VARCHAR(36) NOT NULL,
-  `uid` VARCHAR(36) NOT NULL COMMENT '开展讲座人ID',
-  `lecture_time` TIMESTAMP NOT NULL COMMENT '讲座开展时间',
+  `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
+  `uid` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '开展讲座人ID',
+  `lecture_time` VARCHAR(45) NOT NULL COMMENT '讲座开展时间',
   `create_time` TIMESTAMP NULL COMMENT '记录创建时间',
   `last_update_time` TIMESTAMP NULL COMMENT '记录最后更新时间',
-  `name` VARCHAR(45) NOT NULL COMMENT '名称',
-  `summary` VARCHAR(128) NULL COMMENT '简介',
+  `name` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '名称',
+  `summary` VARCHAR(128) CHARACTER SET 'utf8mb4' NULL COMMENT '简介',
   `deleted_sign` INT(1) NOT NULL DEFAULT 0 COMMENT '删除标记',
+  `lecture_url` VARCHAR(255) NULL COMMENT '展示图',
+  `hot` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在大咖说页面展示(0--不展示,1--展示)',
+  `dynamic` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在科技明星页面展示活动动态(0--不展示,1--展示)',
   PRIMARY KEY (`id`))
 ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
-COMMENT = '科技讲堂';
+COMMENT = '科技讲堂';
+

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -838,7 +838,7 @@ public class AdminApiController extends CertifyApiController {
 	 * 企业参与国家标准或行业标准制定情况明细列表
 	 */
 	@RequestMapping(value = "/standard", method = RequestMethod.POST)
-	public Result standard(String uid, String standardName, String standardNumber, Integer standardLevel,
+	public Result standard(Integer year, String uid, String standardName, String standardNumber, Integer standardLevel,
 			Integer participateWay, String pageNo, String pageSize) {
 		Result res = new Result();
 		if (StringUtils.isBlank(uid)) {
@@ -857,7 +857,7 @@ public class AdminApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay, pNo,
+		res.setData(orgStandardService.listOrgStandard(year, standardName, standardNumber, standardLevel, participateWay, pNo,
 				pSize, uid));
 		return res;
 	}

+ 97 - 23
src/main/java/com/goafanti/admin/controller/AdminLectureApiController.java

@@ -18,10 +18,13 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.LectureDynamicType;
+import com.goafanti.common.enums.LectureHotType;
 import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.model.Lecture;
 import com.goafanti.lecture.bo.InputLecture;
 import com.goafanti.lecture.service.LectureService;
+import com.goafanti.user.service.UserService;
 
 /**
  * 科技讲堂
@@ -30,7 +33,54 @@ import com.goafanti.lecture.service.LectureService;
 @RequestMapping(value = "/api/admin/lecture")
 public class AdminLectureApiController extends BaseApiController {
 	@Resource
-	private LectureService lectureService;
+	private LectureService			lectureService;
+	@Resource
+	private UserService				userService;
+
+	private static final Integer	HOT_MAX_NUM		= 4;
+
+	private static final Integer	DYNAMIC_MAX_NUM	= 9;
+
+	/**
+	 * 大咖说页面展示列表
+	 */
+	@RequestMapping(value = "/hotList", method = RequestMethod.GET)
+	public Result hotList() {
+		Result res = new Result();
+		res.setData(lectureService.listHot());
+		return res;
+	}
+	
+	/**
+	 * 科技明星页面展示列表
+	 */
+	@RequestMapping(value = "/dynamic", method = RequestMethod.GET)
+	public Result dynamic(){
+		Result res = new Result();
+		res.setData(lectureService.listDynamic());
+		return res;
+	}
+
+	/**
+	 * 专家及明星列表
+	 */
+	@RequestMapping(value = "/starAndExpertList", method = RequestMethod.GET)
+	public Result starAndExpertList(Integer number, String engagedField, String username, String professionalTitle,
+			String workUnit, String pageNo, String pageSize) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(
+				userService.listStarAndExpert(number, engagedField, username, professionalTitle, workUnit, pNo, pSize));
+		return res;
+	}
 
 	/**
 	 * 新增
@@ -44,20 +94,10 @@ public class AdminLectureApiController extends BaseApiController {
 			return res;
 		}
 
-		if (StringUtils.isBlank(il.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展人ID"));
+		if (!disposeLecture(res, il, lectureTimeFormattedDate).getError().isEmpty()) {
 			return res;
 		}
 
-		if (StringUtils.isBlank(il.getName())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂名称"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(lectureTimeFormattedDate)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展时间"));
-			return res;
-		}
 		Lecture l = new Lecture();
 		BeanUtils.copyProperties(il, l);
 		lectureService.save(l, lectureTimeFormattedDate);
@@ -81,20 +121,10 @@ public class AdminLectureApiController extends BaseApiController {
 			return res;
 		}
 
-		if (StringUtils.isBlank(il.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展人ID"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(il.getName())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂名称"));
+		if (!disposeLecture(res, il, lectureTimeFormattedDate).getError().isEmpty()) {
 			return res;
 		}
 
-		if (StringUtils.isBlank(lectureTimeFormattedDate)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展时间"));
-			return res;
-		}
 		Lecture l = new Lecture();
 		BeanUtils.copyProperties(il, l);
 		lectureService.update(l, lectureTimeFormattedDate);
@@ -153,4 +183,48 @@ public class AdminLectureApiController extends BaseApiController {
 		}
 		return res;
 	}
+
+	private Result disposeLecture(Result res, InputLecture il, String lectureTimeFormattedDate) {
+		if (StringUtils.isBlank(il.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展人ID"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(il.getName())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂名称"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(lectureTimeFormattedDate)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "讲堂开展时间"));
+			return res;
+		}
+
+		if (null == il.getHot()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "是否展示在大咖说页面标记"));
+			return res;
+		}
+
+		if (null == il.getDynamic()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "是否展示在科技明星页面标记"));
+			return res;
+		}
+
+		if (LectureDynamicType.DYNAMIC.getCode().equals(il.getDynamic())) {
+			Integer dynamicNum = lectureService.countDynamicNum();
+			if (null != dynamicNum && DYNAMIC_MAX_NUM == dynamicNum) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "展示在科技明星页面数量"));
+				return res;
+			}
+		}
+
+		if (LectureHotType.HOT.getCode().equals(il.getHot())) {
+			Integer hotNum = lectureService.countHotNum();
+			if (null != hotNum && HOT_MAX_NUM == hotNum) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "展示在大咖说页面数量"));
+				return res;
+			}
+		}
+		return res;
+	}
 }

+ 2 - 2
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -1485,7 +1485,7 @@ public class CognizanceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/standard", method = RequestMethod.POST)
-	public Result standard(String standardName, String standardNumber, Integer standardLevel, Integer participateWay,
+	public Result standard(Integer year, String standardName, String standardNumber, Integer standardLevel, Integer participateWay,
 			String pageNo, String pageSize) {
 		Result res = new Result();
 
@@ -1501,7 +1501,7 @@ public class CognizanceApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay, pNo,
+		res.setData(orgStandardService.listOrgStandard(year, standardName, standardNumber, standardLevel, participateWay, pNo,
 				pSize, TokenManager.getUserId()));
 		return res;
 	}

+ 1 - 1
src/main/java/com/goafanti/cognizance/service/OrgStandardService.java

@@ -11,7 +11,7 @@ public interface OrgStandardService {
 
 	int updateByPrimaryKeySelective(OrgStandard orgStandard);
 
-	Pagination<OrgStandard> listOrgStandard(String standardName, String standardNumber, Integer standardLevel,
+	Pagination<OrgStandard> listOrgStandard(Integer year, String standardName, String standardNumber, Integer standardLevel,
 			Integer participateWay, Integer pNo, Integer pSize, String userId);
 
 	int delete(String id);

+ 1 - 1
src/main/java/com/goafanti/cognizance/service/impl/OrgAnnualReportServiceImpl.java

@@ -122,7 +122,7 @@ public class OrgAnnualReportServiceImpl extends BaseMybatisDao<OrgAnnualReportMa
 			report.setLocationArea(m.getLocationArea());
 			report.setListed(m.getListed().toString());
 			if (null != m.getListedDate()) {
-				report.setListedDate(DateFormatUtils.format(m.getListedDate(), AFTConstants.YYYYMMDDHHMMSS));
+				report.setListedDate(DateFormatUtils.format(m.getListedDate(), AFTConstants.YYYYMMDD));
 			}
 			report.setListedType(m.getListedType().toString());
 			report.setStockCode(m.getStockCode());

+ 5 - 1
src/main/java/com/goafanti/cognizance/service/impl/OrgStandardServiceImpl.java

@@ -32,10 +32,14 @@ public class OrgStandardServiceImpl extends BaseMybatisDao<OrgStandardMapper> im
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<OrgStandard> listOrgStandard(String standardName, String standardNumber, Integer standardLevel,
+	public Pagination<OrgStandard> listOrgStandard(Integer year, String standardName, String standardNumber, Integer standardLevel,
 			Integer participateWay, Integer pageNo, Integer pageSize, String uid) {
 		Map<String, Object> params = new HashMap<>();
 		
+		if (null != year){
+			params.put("year", year);
+		}
+		
 		if (!StringUtils.isBlank(uid)){
 			params.put("uid", uid);
 		}

+ 9 - 0
src/main/java/com/goafanti/common/dao/LectureMapper.java

@@ -3,6 +3,7 @@ package com.goafanti.common.dao;
 import java.util.List;
 
 import com.goafanti.common.model.Lecture;
+import com.goafanti.lecture.bo.LectureListBo;
 
 public interface LectureMapper {
     int deleteByPrimaryKey(String id);
@@ -18,4 +19,12 @@ public interface LectureMapper {
     int updateByPrimaryKey(Lecture record);
 
 	int batchDeleteByPrimaryKey(List<String> id);
+
+	Integer countDynamicNum();
+
+	Integer countHotNum();
+
+	LectureListBo listHot();
+
+	LectureListBo listDynamic();
 }

+ 53 - 0
src/main/java/com/goafanti/common/enums/LectureDynamicType.java

@@ -0,0 +1,53 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum LectureDynamicType {
+	UNDYNAMIC(0, "科技明星页面不展示"), DYNAMIC(1, "科技明星页面展示"), OTHER(2, "其他");
+
+	private LectureDynamicType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, LectureDynamicType> status = new HashMap<Integer, LectureDynamicType>();
+
+	static {
+		for (LectureDynamicType value : LectureDynamicType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static LectureDynamicType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static LectureDynamicType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 53 - 0
src/main/java/com/goafanti/common/enums/LectureHotType.java

@@ -0,0 +1,53 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum LectureHotType {
+	UNHOT(0, "大咖说页面不展示"), HOT(1, "大咖说页面展示"), OTHER(2, "其他");
+
+	private LectureHotType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, LectureHotType> status = new HashMap<Integer, LectureHotType>();
+
+	static {
+		for (LectureHotType value : LectureHotType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static LectureHotType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static LectureHotType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 79 - 7
src/main/java/com/goafanti/common/mapper/LectureMapper.xml

@@ -11,9 +11,12 @@
     <result column="summary" property="summary" jdbcType="VARCHAR" />
     <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
     <result column="lecture_url" property="lectureUrl" jdbcType="VARCHAR" />
+    <result column="hot" property="hot" jdbcType="INTEGER" />
+    <result column="dynamic" property="dynamic" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
-    id, uid, lecture_time, create_time, last_update_time, name, summary, deleted_sign, lecture_url
+    id, uid, lecture_time, create_time, last_update_time, name, summary, deleted_sign, lecture_url,
+    hot, dynamic
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
@@ -28,10 +31,11 @@
   <insert id="insert" parameterType="com.goafanti.common.model.Lecture" >
     insert into lecture (id, uid, lecture_time, 
       create_time, last_update_time, name, 
-      summary, deleted_sign, lecture_url)
+      summary, deleted_sign, lecture_url, hot, dynamic)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{lectureTime,jdbcType=TIMESTAMP}, 
       #{createTime,jdbcType=TIMESTAMP}, #{lastUpdateTime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, 
-      #{summary,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{lectureUrl,jdbcType=VARCHAR})
+      #{summary,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{lectureUrl,jdbcType=VARCHAR},
+      #{hot,jdbcType=INTEGER}, #{dynamic,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Lecture" >
     insert into lecture
@@ -60,9 +64,15 @@
       <if test="deletedSign != null" >
         deleted_sign,
       </if>
-       <if test="lectureUrl != null" >
+      <if test="lectureUrl != null" >
         lecture_url,
       </if>
+      <if test="hot != null" >
+        hot,
+      </if>
+      <if test="dynamic != null" >
+        dynamic,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
@@ -89,9 +99,15 @@
       <if test="deletedSign != null" >
         #{deletedSign,jdbcType=INTEGER},
       </if>
-       <if test="lectureUrl != null" >
+      <if test="lectureUrl != null" >
         #{lectureUrl,jdbcType=VARCHAR},
       </if>
+      <if test="hot != null" >
+        #{hot,jdbcType=INTEGER},
+      </if>
+      <if test="dynamic != null" >
+        #{dynamic,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Lecture" >
@@ -118,9 +134,15 @@
       <if test="deletedSign != null" >
         deleted_sign = #{deletedSign,jdbcType=INTEGER},
       </if>
-       <if test="lectureUrl != null" >
+      <if test="lectureUrl != null" >
         lecture_url = #{lectureUrl,jdbcType=VARCHAR},
       </if>
+      <if test="hot != null" >
+        hot = #{hot,jdbcType=INTEGER},
+      </if>
+      <if test="dynamic != null" >
+        dynamic = #{dynamic,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -133,7 +155,9 @@
       name = #{name,jdbcType=VARCHAR},
       summary = #{summary,jdbcType=VARCHAR},
       deleted_sign = #{deletedSign,jdbcType=INTEGER},
-      lecture_url = #{lectureUrl,jdbcType=VARCHAR}
+      lecture_url = #{lectureUrl,jdbcType=VARCHAR},
+      hot = #{hot,jdbcType=INTEGER},
+      dynamic = #{dynamic,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   
@@ -203,4 +227,52 @@
 	  	 and l.lecture_time <![CDATA[ < ]]> #{endL,jdbcType=TIMESTAMP}
 	  	</if>
   </select>
+  
+  <select id="countHotNum" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from lecture
+  	where hot = 1
+  	and deleted_sign = 0
+  </select>
+  
+   <select id="countDynamicNum" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from lecture
+  	where dynamic = 1
+  	and deleted_sign = 0
+  </select>
+  
+  <select id="listHot" resultType="com.goafanti.lecture.bo.LectureListBo">
+  		select 
+	  		l.id,
+	  		l.uid,
+	  		l.name,
+	  		l.lecture_time as lectureTime,
+	  		l.summary,
+	  		l.lecture_url as lectureUrl,
+	  		ui.username 
+	  	from lecture l
+	  	left join  user_identity ui on ui.uid = l.uid
+	  	where 
+	  		l.deleted_sign = 0
+	  	and l.hot = 1
+  </select>
+  
+   <select id="listDynamic" resultType="com.goafanti.lecture.bo.LectureListBo">
+  		select 
+	  		l.id,
+	  		l.uid,
+	  		l.name,
+	  		l.lecture_time as lectureTime,
+	  		l.summary,
+	  		l.lecture_url as lectureUrl,
+	  		ui.username 
+	  	from lecture l
+	  	left join  user_identity ui on ui.uid = l.uid
+	  	where 
+	  		l.deleted_sign = 0
+	  	and l.dynamic = 1
+  </select>
 </mapper>

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

@@ -166,6 +166,9 @@
     <if test="uid != null">
 	    and  uid = #{uid,jdbcType=VARCHAR}
 	</if>
+	<if test="year != null">
+	 	and  year = #{year,jdbcType=INTEGER}
+	</if>
     <if test="standardName != null">
     	and  standard_name = #{standardName,jdbcType=VARCHAR}
     </if>
@@ -192,6 +195,9 @@
     <if test="uid != null">
 	    and  uid = #{uid,jdbcType=VARCHAR}
 	</if>
+	<if test="year != null">
+	 	and  year = #{year,jdbcType=INTEGER}
+	</if>
     <if test="standardName != null">
     	and  standard_name = #{standardName,jdbcType=VARCHAR}
     </if>

+ 12 - 5
src/main/java/com/goafanti/common/mapper/TechWebsiteMapper.xml

@@ -134,11 +134,18 @@
   </select>
   
    <select id="findTechWebsiteListByPage" resultType="com.goafanti.techproject.bo.TechWebsiteListBo" parameterType="java.lang.String" >
-   select w.id, w.uid, i.unit_name as unitName, i.licence_province as province, 
-		w.department, w.website, w.account_number as accountNumber,
+   select 
+   		w.id, 
+   		w.uid, 
+   		i.unit_name as unitName, 
+   		i.licence_province as province, 
+		w.department, 
+		w.website, 
+		w.account_number as accountNumber,
 		w.password
 		from tech_website w 
-	LEFT JOIN organization_identity i on w.uid = i.uid where w.deleted_sign = 0 
+	LEFT JOIN organization_identity i on w.uid = i.uid 
+	where w.deleted_sign = 0 
     <if test="province != null">
     	and i.licence_province = #{province,jdbcType=INTEGER}
     </if>
@@ -159,8 +166,8 @@
     <if test="province != null">
     	and i.licence_province = #{province,jdbcType=INTEGER}
     </if>
-    <if test="uid != null" >
-    	and w.uid = #{uid,jdbcType=VARCHAR}
+   <if test="unitName != null" >
+    	and i.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')  
     </if>
   </select>
   

+ 62 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -860,4 +860,66 @@
   		and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
   	</if>
   </select>
+  
+  <select id="findStarAndExpertListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarAndExpertListBo">
+  	select 
+  		u.id as uid,
+  		u.number,
+  		ui.username,
+  		uc.engaged_field as engagedField,
+  		uc.professional_title as professionalTitle,
+  		uc.work_unit as workUnit,
+  		adc.achievement_count as achievementNum
+  	from user u
+  	left join user_identity ui on ui.uid = u.id
+  	left join user_career uc on uc.uid = u.id
+  	left join achievement_demand_count adc on adc.uid = u.id
+  	where 
+  		ui.celebrity = 1 or ui.expert = 1
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="engagedField != null">
+  		and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="username != null">
+  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="professionalTitle != null">
+  		and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="workUnit != null">
+  		and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
+  	</if>
+  	ORDER BY adc.achievement_count DESC
+	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  	
+  </select>
+  
+  <select id="findStarAndExpertCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from user u
+  	left join user_identity ui on ui.uid = u.id
+  	left join user_career uc on uc.uid = u.id
+  	where 
+  		ui.celebrity = 1 or ui.expert = 1
+  	<if test="number != null">
+  		and u.number = #{number,jdbcType=INTEGER}
+  	</if>
+  	<if test="engagedField != null">
+  		and uc.engaged_field like CONCAT(#{engagedField,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="username != null">
+  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="professionalTitle != null">
+  		and uc.professional_title like CONCAT('%',#{professionalTitle,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="workUnit != null">
+  		and uc.work_unit like CONCAT('%',#{workUnit,jdbcType=VARCHAR},'%')
+  	</if>
+  </select>
 </mapper>

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

@@ -49,6 +49,16 @@ public class Lecture {
 	 * 展示图URL
 	 */
 	private String	lectureUrl;
+	
+	/**
+	 * 是否在大咖页面展示
+	 */
+	private Integer	hot;
+	
+	/**
+	 * 是否在科技明星动态展示
+	 */
+	private Integer	dynamic;
 
 	public String getId() {
 		return id;
@@ -125,6 +135,22 @@ public class Lecture {
 		this.lectureUrl = lectureUrl;
 	}
 
+	public Integer getHot() {
+		return hot;
+	}
+
+	public void setHot(Integer hot) {
+		this.hot = hot;
+	}
+
+	public Integer getDynamic() {
+		return dynamic;
+	}
+
+	public void setDynamic(Integer dynamic) {
+		this.dynamic = dynamic;
+	}
+
 	public String getLectureTimeFormattedDate() {
 		if (this.lectureTime == null) {
 			return null;

+ 26 - 0
src/main/java/com/goafanti/lecture/bo/InputLecture.java

@@ -1,5 +1,7 @@
 package com.goafanti.lecture.bo;
 
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 import javax.validation.constraints.Size;
 
 import com.goafanti.common.constant.ErrorConstants;
@@ -19,6 +21,14 @@ public class InputLecture {
 
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	lectureUrl;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	hot;
+	
+	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	dynamic;
 
 	public String getId() {
 		return id;
@@ -60,4 +70,20 @@ public class InputLecture {
 		this.lectureUrl = lectureUrl;
 	}
 
+	public Integer getHot() {
+		return hot;
+	}
+
+	public void setHot(Integer hot) {
+		this.hot = hot;
+	}
+
+	public Integer getDynamic() {
+		return dynamic;
+	}
+
+	public void setDynamic(Integer dynamic) {
+		this.dynamic = dynamic;
+	}
+
 }

+ 8 - 0
src/main/java/com/goafanti/lecture/service/LectureService.java

@@ -17,4 +17,12 @@ public interface LectureService {
 	Pagination<LectureListBo> listLecture(String uid, String username, String name, String startLectureTime, String endLectureTime,
 			Integer pNo, Integer pSize);
 
+	Integer countDynamicNum();
+
+	Integer countHotNum();
+
+	LectureListBo listHot();
+
+	LectureListBo listDynamic();
+
 }

+ 20 - 0
src/main/java/com/goafanti/lecture/service/impl/LectureServiceImpl.java

@@ -95,4 +95,24 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 				pageSize);
 	}
 
+	@Override
+	public Integer countDynamicNum() {
+		return lectureMapper.countDynamicNum();
+	}
+
+	@Override
+	public Integer countHotNum() {
+		return lectureMapper.countHotNum();
+	}
+
+	@Override
+	public LectureListBo listHot() {
+		return lectureMapper.listHot();
+	}
+
+	@Override
+	public LectureListBo listDynamic() {
+		return lectureMapper.listDynamic();
+	}
+
 }

+ 11 - 0
src/main/java/com/goafanti/portal/controller/PortalStarController.java

@@ -0,0 +1,11 @@
+package com.goafanti.portal.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.controller.BaseApiController;
+@RestController
+@RequestMapping(value = "/portal/star")
+public class PortalStarController extends BaseApiController{
+	
+}

+ 5 - 0
src/main/java/com/goafanti/user/bo/StarAndExpertListBo.java

@@ -0,0 +1,5 @@
+package com.goafanti.user.bo;
+
+public class StarAndExpertListBo extends StarListBo {
+
+}

+ 4 - 0
src/main/java/com/goafanti/user/service/UserService.java

@@ -8,6 +8,7 @@ import com.goafanti.common.model.User;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.OrgListBo;
 import com.goafanti.user.bo.OrgUnitNames;
+import com.goafanti.user.bo.StarAndExpertListBo;
 import com.goafanti.user.bo.StarListBo;
 import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserListBo;
@@ -61,4 +62,7 @@ public interface UserService {
 	Pagination<StarListBo> listStar(Integer number, String engagedField, String username, String professionalTitle, String workUnit,
 			Integer pNo, Integer pSize);
 
+	Pagination<StarAndExpertListBo> listStarAndExpert(Integer number, String engagedField, String username, String professionalTitle,
+			String workUnit, Integer pNo, Integer pSize);
+
 }

+ 49 - 13
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -31,6 +31,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.bo.OrgListBo;
 import com.goafanti.user.bo.OrgPartnerDetailBo;
 import com.goafanti.user.bo.OrgUnitNames;
+import com.goafanti.user.bo.StarAndExpertListBo;
 import com.goafanti.user.bo.StarListBo;
 import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserListBo;
@@ -438,27 +439,63 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	public Pagination<StarListBo> listStar(Integer number, String engagedField, String username,
 			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
-		
-		if (null != number){
+
+		if (null != number) {
 			params.put("number", number);
 		}
-		
-		if (StringUtils.isNotBlank(engagedField)){
+
+		if (StringUtils.isNotBlank(engagedField)) {
 			params.put("engagedField", engagedField);
 		}
-		
-		if (StringUtils.isNotBlank(username)){
+
+		if (StringUtils.isNotBlank(username)) {
 			params.put("username", username);
 		}
-		
-		if (StringUtils.isNotBlank(professionalTitle)){
+
+		if (StringUtils.isNotBlank(professionalTitle)) {
 			params.put("professionalTitle", professionalTitle);
 		}
-		
-		if (StringUtils.isNotBlank(workUnit)){
+
+		if (StringUtils.isNotBlank(workUnit)) {
 			params.put("workUnit", workUnit);
 		}
-		
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<StarListBo>) findPage("findStarListByPage", "findStarCount", params, pNo, pSize);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<StarAndExpertListBo> listStarAndExpert(Integer number, String engagedField, String username,
+			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (null != number) {
+			params.put("number", number);
+		}
+
+		if (StringUtils.isNotBlank(engagedField)) {
+			params.put("engagedField", engagedField);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("username", username);
+		}
+
+		if (StringUtils.isNotBlank(professionalTitle)) {
+			params.put("professionalTitle", professionalTitle);
+		}
+
+		if (StringUtils.isNotBlank(workUnit)) {
+			params.put("workUnit", workUnit);
+		}
+
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -466,8 +503,7 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<StarListBo>) findPage("findStarListByPage", "findStarCount", params,
-				pNo, pSize);
+		return (Pagination<StarAndExpertListBo>) findPage("findStarAndExpertListByPage", "findStarAndExpertCount", params, pNo, pSize);
 	}
 
 }