bug 3353\3337\3232\3341

This commit is contained in:
13036795865 2025-06-18 17:01:48 +08:00
parent f53c9b74f4
commit 7a7e5350fb
9 changed files with 68 additions and 5 deletions

View File

@ -1,10 +1,14 @@
package com.microservices.dms.resourceLibrary.domain;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 专家资源库对象 expert_resource_library
*
@ -78,6 +82,26 @@ public class ExpertResourceLibrary extends BaseEntity {
private String userNickName;
private String otherAttachments;
private String fullFileIds;
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
public List<KeyValVo<String, String>> getAttachmentList() {
return attachmentList;
}
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
this.attachmentList = attachmentList;
}
public String getFullFileIds() {
return fullFileIds;
}
public void setFullFileIds(String fullFileIds) {
this.fullFileIds = fullFileIds;
}
public String getOtherAttachments() {
return otherAttachments;
}

View File

@ -131,4 +131,5 @@ public interface ExpertResourceLibraryMapper
List<KeyValueVo> getAddMemoStatistic(@Param("s") Date s, @Param("e") Date e);
List<KeyValVo<String, String>> getAttachments(@Param("fullFileIds") String fullFileIds);
}

View File

@ -6,6 +6,7 @@ import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,6 +18,8 @@ import java.util.List;
import java.util.Map;
import static com.microservices.dms.constant.TaskConstant.MARKER_SPACE_DOWNLOAD_API_BY_ID;
import static com.microservices.dms.constant.TaskConstant.PROJECT_DOWNLOAD_API;
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
/**
* 专家资源库Service业务层处理
@ -78,6 +81,8 @@ public class ExpertResourceLibraryServiceImpl implements IExpertResourceLibraryS
}
}
@Value("${http.gitLinkUrl}")
public String gitLinkUrl;
/**
* 查询专家资源库列表
*
@ -88,6 +93,31 @@ public class ExpertResourceLibraryServiceImpl implements IExpertResourceLibraryS
public List<ExpertResourceLibrary> selectExpertResourceLibraryList(ExpertResourceLibrary expertResourceLibrary) {
List<ExpertResourceLibrary> expertResourceLibraryList = expertResourceLibraryMapper.selectExpertResourceLibraryList(expertResourceLibrary);
for (ExpertResourceLibrary a : expertResourceLibraryList) {
//附件组装
String fullFileIds = a.getFullFileIds();
if(StringUtils.isNotEmpty(fullFileIds)){
List<KeyValVo<String, String>> attachments = expertResourceLibraryMapper.getAttachments(fullFileIds);
for (KeyValVo<String, String> f: attachments) {
String v = String.valueOf(f.getV());
if (StringUtils.isNotEmpty(v)) {
if (v.startsWith("http")) {
String urlPath = getUrlPath(v);
if (StringUtils.isNotEmpty(urlPath)) {
if (urlPath.startsWith("/api")) {
f.setV(gitLinkUrl + urlPath);
}else {
f.setV(gitLinkUrl +"/api"+ urlPath);
}
}
} else {
f.setV(String.format(MARKER_SPACE_DOWNLOAD_API_BY_ID, gitLinkUrl, v));
}
}
}
a.setAttachmentList(attachments);
a.setAttachments(JSON.toJSONString(attachments));
}
//头像组装
String gender = a.getGender();
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){

View File

@ -139,7 +139,7 @@
</where>
</select>
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary" parameterType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication as "isAuth",
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
@ -156,7 +156,8 @@
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
from users u) res
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0
where (res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0)
<if test="userName != null and userName != ''"> and res.userName like concat('%', #{userName}, '%')</if>
</select>
<select id="getrelatedProjectCount" resultType="long">

View File

@ -190,7 +190,7 @@
<if test="image != null and image != ''">and image = #{image}</if>
<if test="attachment != null and attachment != ''">and attachment = #{attachment}</if>
</where>
order by is_transferred_to_result_library
order by is_transferred_to_result_library,create_time desc
</select>
<select id="selectCompetitionResourceLibraryById" parameterType="Long" resultMap="CompetitionResourceLibraryResult">

View File

@ -75,6 +75,7 @@
u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
e.id_number,images, attachments,
e.major, e.workplace, e.phone,
CONCAT_WS(',',resume, title_certificate,academic_achievements,honors) AS fullFileIds,
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
expert_domain,u.authentication as expertAuth,
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
@ -548,4 +549,9 @@
<select id="getAttachmentInfo" resultType="java.util.Map">
select file_name,id,unique_file_name from busi_attachments where id = #{id} limit 1
</select>
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select id as v, file_name as k from busi_attachments where FIND_IN_SET (id,#{fullFileIds})
</select>
</mapper>

View File

@ -216,7 +216,7 @@
<if test="attachments != null and attachments != ''">and attachments = #{attachments}</if>
<if test="projectDomain != null and projectDomain != ''">and project_domain = #{projectDomain}</if>
</where>
order by is_transferred_to_achievement
order by is_transferred_to_achievement,create_time desc
</select>
<select id="selectProjectResourceLibraryById" parameterType="Long" resultMap="ProjectResourceLibraryResult">

View File

@ -81,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="achievementLittleType != null and achievementLittleType != ''"> and achievement_little_type = #{achievementLittleType}</if>
<if test="teamName != null and teamName != ''"> and team_name = #{teamName}</if>
</where>
order by status desc,create_time desc
</select>
<select id="selectSchoolEnterpriseAchievementsById" parameterType="Long" resultMap="SchoolEnterpriseAchievementsResult">

View File

@ -500,7 +500,7 @@
<if test="imageUrl != null and imageUrl != ''">and image_url = #{imageUrl}</if>
<if test="attachmentUrl != null and attachmentUrl != ''">and attachment_url = #{attachmentUrl}</if>
</where>
order by is_transferred_to_results_library
order by is_transferred_to_results_library,create_time desc
</select>
<select id="selectTaskResourceLibraryById" parameterType="Long" resultMap="TaskResourceLibraryResult">