Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev

This commit is contained in:
13036795865 2025-06-17 10:27:36 +08:00
commit 26f6534bc1
7 changed files with 35 additions and 7 deletions

View File

@ -37,6 +37,7 @@ import java.util.*;
import static com.microservices.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
import static com.microservices.dms.constant.BlockChainFunConstants.*;
import static com.microservices.dms.utils.DateUtil.formatLocalDateTimePlusH;
@Service
@Slf4j
@ -339,7 +340,18 @@ public class BlockChainService {
}
public List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo) {
return inBlockchainDataMapper.issueDataList(queryVo);
List<Map<String, Object>> maps = inBlockchainDataMapper.issueDataList(queryVo);
handleForgeDate(maps);
return maps;
}
private void handleForgeDate(List<Map<String, Object>> maps){
for (Map<String, Object> m : maps) {
LocalDateTime updatedAt = (LocalDateTime) m.get("updated_at");
LocalDateTime createdAt = (LocalDateTime) m.get("created_at");
m.put("updated_at",formatLocalDateTimePlusH(updatedAt,8));
m.put("created_at",formatLocalDateTimePlusH(createdAt,8));
}
}
//定时任务将commit数据入链
@ -382,11 +394,15 @@ public class BlockChainService {
}
public List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo) {
return inBlockchainDataMapper.commitDataList(queryVo);
List<Map<String, Object>> maps = inBlockchainDataMapper.commitDataList(queryVo);
handleForgeDate(maps);
return maps;
}
public List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo) {
return inBlockchainDataMapper.prDataList(queryVo);
List<Map<String, Object>> maps = inBlockchainDataMapper.prDataList(queryVo);
handleForgeDate(maps);
return maps;
}
//产权转让
public List<Map> userDataList(BlockchainListQueryVo queryVo) {

View File

@ -48,7 +48,7 @@ public class TalentReferralService {
// 获取项目贡献者数量
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list", "total_count");
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("contributions")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
} catch (ServiceException e) {
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
@ -116,6 +116,7 @@ public class TalentReferralService {
IssuesVo vo = new IssuesVo();
vo.setProjectId(projectId);
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED, ReferralConstant.ISSUE_RESOLVED));
vo.setIssueClassify("issue");
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
Map<Long, Double> userFractionMap = new HashMap<>();
// 计算与解决issue的相似度 标题+描述

View File

@ -13,4 +13,5 @@ public class IssuesVo {
private Long statusId;
private List<Long> statusIds;
private Long num;
private String issueClassify;
}

View File

@ -112,4 +112,12 @@ public class DateUtil {
LocalDateTime s = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
return Date.from(s.plusHours(plusHours).atZone(ZoneId.systemDefault()).toInstant());
}
public static String formatLocalDateTimePlusH(LocalDateTime dateTime,long h) {
if (dateTime == null) {return null;}
LocalDateTime localDateTime8 = dateTime.plusHours(h);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return formatter.format(localDateTime8);
}
}

View File

@ -401,8 +401,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="indexProjectStatistic" resultType="java.util.Map">
select COUNT(*) as projectAchievementCount,
IFNULL(SUM(attachment_count), 0) as attachmentCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1' and a.status=1) as clickCount,
(select COUNT(distinct project_id) from project_resource_library) as projectCount
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1' and a.status='1') as clickCount,
(select count(distinct a.source_id) from achievements a join project_resource_library prl on a.source_id = prl.id where a.source='1' and a.status='1') as projectCount
from achievements
where source = '1' and status='1'
</select>

View File

@ -161,6 +161,7 @@
</if>
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
</where>
order by erl.sort_no
</select>
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">

View File

@ -8,7 +8,8 @@
<where>
<if test="id != null ">and id = #{id}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="subject != null ">and `subject` = #{subject}</if>
<if test="subject != null and subject != ''">and `subject` = #{subject}</if>
<if test="issueClassify != null and issueClassify != ''">and `issue_classify` = #{issueClassify}</if>
<if test="statusIds != null and statusIds.size() > 0">and status_id in
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
#{item}