fix【资源库】 修复一些bug
This commit is contained in:
parent
15bab4fe0a
commit
54c2216c1a
|
@ -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.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||||
import static com.microservices.dms.constant.BlockChainFunConstants.*;
|
import static com.microservices.dms.constant.BlockChainFunConstants.*;
|
||||||
|
import static com.microservices.dms.utils.DateUtil.formatLocalDateTimePlusH;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -327,7 +328,18 @@ public class BlockChainService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo) {
|
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数据入链
|
//定时任务,将commit数据入链
|
||||||
|
@ -370,11 +382,15 @@ public class BlockChainService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo) {
|
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) {
|
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) {
|
public List<Map> userDataList(BlockchainListQueryVo queryVo) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TalentReferralService {
|
||||||
// 获取项目贡献者数量
|
// 获取项目贡献者数量
|
||||||
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list", "total_count");
|
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) {
|
} catch (ServiceException e) {
|
||||||
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
||||||
|
@ -116,6 +116,7 @@ public class TalentReferralService {
|
||||||
IssuesVo vo = new IssuesVo();
|
IssuesVo vo = new IssuesVo();
|
||||||
vo.setProjectId(projectId);
|
vo.setProjectId(projectId);
|
||||||
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED, ReferralConstant.ISSUE_RESOLVED));
|
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED, ReferralConstant.ISSUE_RESOLVED));
|
||||||
|
vo.setIssueClassify("issue");
|
||||||
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
||||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||||
// 计算与解决issue的相似度, 标题+描述
|
// 计算与解决issue的相似度, 标题+描述
|
||||||
|
|
|
@ -13,4 +13,5 @@ public class IssuesVo {
|
||||||
private Long statusId;
|
private Long statusId;
|
||||||
private List<Long> statusIds;
|
private List<Long> statusIds;
|
||||||
private Long num;
|
private Long num;
|
||||||
|
private String issueClassify;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,4 +112,12 @@ public class DateUtil {
|
||||||
LocalDateTime s = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
LocalDateTime s = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
return Date.from(s.plusHours(plusHours).atZone(ZoneId.systemDefault()).toInstant());
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,8 +401,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="indexProjectStatistic" resultType="java.util.Map">
|
<select id="indexProjectStatistic" resultType="java.util.Map">
|
||||||
select COUNT(*) as projectAchievementCount,
|
select COUNT(*) as projectAchievementCount,
|
||||||
IFNULL(SUM(attachment_count), 0) as attachmentCount,
|
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(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(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
|
from achievements
|
||||||
where source = '1' and status='1'
|
where source = '1' and status='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -161,6 +161,7 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
|
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by erl.sort_no
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">
|
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null ">and id = #{id}</if>
|
<if test="id != null ">and id = #{id}</if>
|
||||||
<if test="projectId != null ">and project_id = #{projectId}</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
|
<if test="statusIds != null and statusIds.size() > 0">and status_id in
|
||||||
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
|
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
|
|
Loading…
Reference in New Issue