feat【资源库】竞赛和创客任务:相关成果展示、专家:专家审核数据展示

This commit is contained in:
刘华中 2025-05-15 16:46:13 +08:00
parent 4d7bb9184a
commit a708082d1e
6 changed files with 142 additions and 0 deletions

View File

@ -240,6 +240,36 @@ public class AchievementsController extends BaseController {
return success(achievementsService.getRelatedAch(id,sourceId));
}
@ApiOperation(value = "获取开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetition")
public AjaxResult getRelatedAchCompetition(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchCompetition(id,sourceId));
}
@ApiOperation(value = "获取创客任务的相关成果")
@GetMapping("/getRelatedAchTask")
public AjaxResult getRelatedAchTask(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchTask(id,sourceId));
}
@ApiOperation(value = "获取专家-创客任务的相关成果")
@GetMapping("/getRelatedAchTaskOfExpert")
public AjaxResult getRelatedAchTaskOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchTaskOfExpert(expertId));
}
@ApiOperation(value = "获取专家-开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetitionOfExpert")
public AjaxResult getRelatedAchCompetitionOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchCompetitionOfExpert(expertId));
}
@ApiOperation(value = "搜索行为数据记录")
@GetMapping("/getSearchResult")
public AjaxResult getSearchResult(String achName,Long userId)

View File

@ -9,6 +9,8 @@ import com.microservices.common.datasource.annotation.Master;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
@ -140,4 +142,12 @@ public interface AchievementsMapper {
List<String> getExpertAreasByName(@Param("areaName") String areaName);
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdCompetition(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdTask(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(@Param("id")Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(@Param("id")Long id);
}

View File

@ -5,6 +5,8 @@ import java.util.Map;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
/**
@ -107,4 +109,12 @@ public interface IAchievementsService {
List<KeyValueVo> getProjectAreasByName(String areaName);
List<String> getExpertAreasByName(String areaName);
List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId);
List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id);
}

View File

@ -13,7 +13,9 @@ import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
import com.microservices.dms.resourceLibrary.domain.Clicker;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.Searcher;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
@ -454,6 +456,54 @@ public class AchievementsServiceImpl implements IAchievementsService {
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdCompetition(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdTask(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id) {
return achievementsMapper.getRelatedAchTaskOfExpert(id);
}
@Override
public List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id) {
return achievementsMapper.getRelatedAchCompetitionOfExpert(id);
}
/**
* 根据查询内容调用搜索行为接口
*

View File

@ -122,6 +122,8 @@ public class TaskResourceLibraryService {
public int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
taskResourceLibrary.setUpdateTime(DateUtils.getNowDate());
taskResourceLibrary.setUpdateBy(SecurityUtils.getUsername());
return taskResourceLibraryMapper.updateTaskResourceLibrary(taskResourceLibrary);
}

View File

@ -568,6 +568,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where project_id = (select project_id from project_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdCompetition" resultType="java.lang.Long">
select id
from competition_resource_library
where open_competition_id = (select open_competition_id from competition_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdTask" resultType="java.lang.Long">
select id
from task_resource_library
where task_id = (select task_id from task_resource_library where id = #{sourceId})
</select>
<select id="getDistinctYear" resultType="String">
select distinct DATE_FORMAT(create_time, '%Y')
from achievements
@ -597,6 +607,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
order by DATE_FORMAT(create_time, '%m-%d')
</select>
<select id="getRelatedAchTaskOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary">
select *
from task_resource_library erl
join
(select container_id
from task_expert
where container_type = 1
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.task_id = tmp.container_id
</select>
<select id="getRelatedAchCompetitionOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary">
select *
from competition_resource_library erl
join
(select container_id
from task_expert
where container_type = 2
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.open_competition_id = tmp.container_id
</select>
<select id="selectAchievementsByName" resultType="Long">
select id
from achievements