Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev
This commit is contained in:
commit
4044add373
|
@ -86,6 +86,13 @@ public class AchievementsController extends BaseController {
|
|||
return toAjax(achievementsService.deleteAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除成果数据")
|
||||
@DeleteMapping("/deleteById")
|
||||
public AjaxResult deleteById(Long id) {
|
||||
return toAjax(achievementsService.deleteAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
|
@ -228,6 +235,14 @@ public class AchievementsController extends BaseController {
|
|||
return success(achievementsService.getAreaStatistic(areaKey));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据领域获取领域详情")
|
||||
@GetMapping("/getAreaDetail")
|
||||
public AjaxResult getAreaDetail(String areaKey,Long kyxm)
|
||||
{
|
||||
return success(achievementsService.getAreaDetail(areaKey,kyxm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开源项目的相关成果
|
||||
*/
|
||||
|
|
|
@ -179,6 +179,8 @@ public class Achievements extends BaseEntity {
|
|||
private Long clickSum;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
private Long dockSum;
|
||||
private String filedDesc;
|
||||
private Float hotRank;
|
||||
private Long attachmentCount;
|
||||
private Integer isExpertAudit;
|
||||
|
@ -196,6 +198,22 @@ public class Achievements extends BaseEntity {
|
|||
this.dockingUserInfo = dockingUserInfo;
|
||||
}
|
||||
|
||||
public String getFiledDesc() {
|
||||
return filedDesc;
|
||||
}
|
||||
|
||||
public void setFiledDesc(String filedDesc) {
|
||||
this.filedDesc = filedDesc;
|
||||
}
|
||||
|
||||
public Long getDockSum() {
|
||||
return dockSum;
|
||||
}
|
||||
|
||||
public void setDockSum(Long dockSum) {
|
||||
this.dockSum = dockSum;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
}
|
||||
|
|
|
@ -158,4 +158,6 @@ public interface AchievementsMapper {
|
|||
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<Map<String, Object>> getDockingUserInfo(@Param("id") Long id);
|
||||
|
||||
List<Achievements> selectAchievementsByArea(AchQueryVo achQueryVo);
|
||||
}
|
||||
|
|
|
@ -117,4 +117,6 @@ public interface IAchievementsService {
|
|||
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id);
|
||||
|
||||
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id);
|
||||
|
||||
List<Achievements> getAreaDetail(String areaKey, Long kyxm);
|
||||
}
|
||||
|
|
|
@ -59,9 +59,11 @@ public class MemoDashboardService {
|
|||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getAddMemoStatistic() {
|
||||
return memoResourceLibraryMapper.getAddMemoStatistic();
|
||||
Date[] currentYear = DateUtil.getLast12Months();
|
||||
return memoResourceLibraryMapper.getAddMemoStatistic(currentYear[0],currentYear[1]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 本年帖子热度top5(论坛评论、点击、点赞)
|
||||
* @return
|
||||
|
|
|
@ -548,4 +548,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
public List<String> getExpertAreasByName(String areaName) {
|
||||
return achievementsMapper.getExpertAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Achievements> getAreaDetail(String areaKey, Long kyxm) {
|
||||
AchQueryVo achQueryVo = new AchQueryVo();
|
||||
achQueryVo.setAreaQuery(areaKey);
|
||||
if(kyxm >0) {
|
||||
achQueryVo.setSource("1");
|
||||
}
|
||||
return achievementsMapper.selectAchievementsByArea(achQueryVo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
|
|||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.PropertyValues;
|
||||
|
||||
/**
|
||||
* 专家资源库Mapper接口
|
||||
|
@ -118,7 +119,7 @@ public interface ExpertResourceLibraryMapper
|
|||
|
||||
List<KeyValueVo> getForumSectionStatistic();
|
||||
|
||||
List<KeyValueVo> getAddMemoStatistic();
|
||||
// List<KeyValueVo> getAddMemoStatistic();
|
||||
|
||||
List<MemoTotalVo> getTop5Memos();
|
||||
|
||||
|
@ -127,4 +128,7 @@ public interface ExpertResourceLibraryMapper
|
|||
ExpertAttachmentVo getExpertInfoById(@Param("expertId") Long expertId);
|
||||
|
||||
Map<String, Object> getAttachmentInfo(@Param("id") Long id);
|
||||
|
||||
List<KeyValueVo> getAddMemoStatistic(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
}
|
||||
|
|
|
@ -733,4 +733,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where u.enterprise_certification='1') t
|
||||
order by t.created_at
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectAchievementsByArea" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||
<if test="source == '' or source == null">
|
||||
select a.id, IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
|
||||
c.name as "field1Name",u.login as "userLogin",
|
||||
IFNULL(u.nickname,a.owner_name) as "userNickName",
|
||||
ue.gender as "gender",c.remark as "filedDesc",
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
|
||||
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
|
||||
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
|
||||
from achievements a
|
||||
left join users u on a.owner_name = u.login
|
||||
left join user_extensions ue on u.id = ue.user_id
|
||||
left join categories c on a.field_1 = c.id
|
||||
<where>
|
||||
and a.status='1'
|
||||
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
|
||||
<if test="source != null and source != ''"> and a.source = #{source}</if>
|
||||
<if test='areaQuery != null and areaQuery != "" '>
|
||||
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</if>
|
||||
<if test='source=="1"'>
|
||||
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
|
||||
c.name as "field1Name",u.login as "userLogin",
|
||||
IFNULL(u.nickname,a.owner_name) as "userNickName",
|
||||
ue.gender as "gender",c.remark as "filedDesc",
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
|
||||
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
|
||||
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
|
||||
from achievements a
|
||||
left join users u on a.owner_name = u.login
|
||||
left join user_extensions ue on u.id = ue.user_id
|
||||
left join project_categories c on a.field_1 = c.id
|
||||
<where>
|
||||
and a.status='1'
|
||||
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
|
||||
<if test="source != null and source != ''"> and a.source = #{source}</if>
|
||||
<if test='areaQuery != null and areaQuery != "" '>
|
||||
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
|
@ -510,15 +510,17 @@
|
|||
|
||||
<select id="getAddMemoStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select a.currentMonth as "name", a.tag_id as "key", sum(a.countTag) as "value"
|
||||
from (select DATE_FORMAT(published_at, '%m') as "currentMonth", tag_id, count(1) as "countTag"
|
||||
from (select DATE_FORMAT(published_at, '%Y-%m') as "currentMonth", tag_id, count(1) as "countTag"
|
||||
from memos
|
||||
where DATE_FORMAT(published_at, '%Y') = YEAR (NOW()) and destroy_status is null and hidden=0 and published_at is not null
|
||||
group by DATE_FORMAT(published_at, '%m'), tag_id
|
||||
where destroy_status is null and hidden=0 and published_at is not null
|
||||
and published_at >= #{s} and published_at <= #{e}
|
||||
group by DATE_FORMAT(published_at, '%Y-%m'), tag_id
|
||||
) a
|
||||
group by a.currentMonth, a.tag_id
|
||||
order by a.tag_id, a.currentMonth asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getTop5Memos" resultType="com.microservices.dms.achievementLibrary.domain.MemoTotalVo">
|
||||
select id as "id",subject as "subject",published_at as "publishedAt",viewed_count as "viewedCount",praises_count as "praisesCount",replies_count as "repliesCount",(viewed_count+praises_count+replies_count) as "behavioreSum"
|
||||
from memos where destroy_status is null and hidden=0 and published_at is not null and DATE_FORMAT(published_at, '%Y') = YEAR (NOW())
|
||||
|
|
Loading…
Reference in New Issue