forked from Gitlink/microservices
Merge branch 'master' of https://gitlink.org.cn/Gitlink/microservices into dev_monitoring
# Conflicts: # microservices-modules/pom.xml
This commit is contained in:
commit
78cbd4b0ee
|
|
@ -107,4 +107,24 @@ public interface RemoteFileService {
|
|||
@RequestParam("type") String type,
|
||||
@RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 通过Url下载文件到本地
|
||||
*/
|
||||
@PostMapping(value = "/common/downloadFileByUrl")
|
||||
R<String> downloadFileByUrl(
|
||||
@RequestParam("fileUrl") String fileUrl
|
||||
, @RequestParam("type") String type
|
||||
, @RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 上传本地文件到Forge
|
||||
*
|
||||
* @param fileIdentifiers 文件标识列表,逗号分隔
|
||||
* @return Forge文件标识列表
|
||||
*/
|
||||
@PostMapping(value = "/common/uploadFileToForge/{fileIdentifiers}")
|
||||
R<List<String>> uploadFileToForge(@PathVariable("fileIdentifiers") String fileIdentifiers,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.system.api;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.ServiceNameConstants;
|
||||
import com.microservices.system.api.factory.RemoteGatewayFallbackFactory;
|
||||
import feign.Response;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 网关
|
||||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "remoteGatewayService", value = ServiceNameConstants.GATEWAY_SERVICE, fallbackFactory = RemoteGatewayFallbackFactory.class)
|
||||
public interface RemoteGatewayService {
|
||||
/**
|
||||
* 登录Sentinel
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping("/sentinel/auth/login")
|
||||
Response loginSentinel(@RequestParam("username") String username, @RequestParam("password") String password);
|
||||
|
||||
/**
|
||||
* 登录Nacos
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping(value = "/nacos/v1/auth/users/login", consumes = {"application/x-www-form-urlencoded"})
|
||||
Response loginNacos(Map<String, ?> formParams);
|
||||
|
||||
/**
|
||||
* 登录Portainer
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping("/portainer/api/auth")
|
||||
Response loginPortainer(@RequestBody JSONObject loginBody);
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ import com.microservices.common.core.constant.SecurityConstants;
|
|||
import com.microservices.common.core.constant.ServiceNameConstants;
|
||||
import com.microservices.common.core.domain.R;
|
||||
import com.microservices.system.api.domain.SysDept;
|
||||
import com.microservices.system.api.factory.RemoteCmsFallbackFactory;
|
||||
import com.microservices.system.api.factory.RemoteZoneFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@FeignClient(contextId = "remoteZoneService", value = ServiceNameConstants.ZONE_SERVICE, fallbackFactory = RemoteCmsFallbackFactory.class)
|
||||
@FeignClient(contextId = "remoteZoneService", value = ServiceNameConstants.ZONE_SERVICE, fallbackFactory = RemoteZoneFallbackFactory.class)
|
||||
public interface RemoteZoneService {
|
||||
/**
|
||||
* 新增组织时自动创建特色专区
|
||||
|
|
|
|||
|
|
@ -70,6 +70,16 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
public R<String> packagedFile(HashMap<String, String> packagedStructure, String zipFileName, String type, String hierarchy, String source) {
|
||||
return R.fail("打包文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> downloadFileByUrl(String fileUrl, String type, String hierarchy, String source) {
|
||||
return R.fail("通过Url下载文件到本地失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<String>> uploadFileToForge(String fileIdentifiers, String source) {
|
||||
return R.fail("上传本地文件到Forge失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.system.api.factory;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.system.api.RemoteGatewayService;
|
||||
import feign.Response;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@Component
|
||||
public class RemoteGatewayFallbackFactory implements FallbackFactory<RemoteGatewayService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteGatewayFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteGatewayService create(Throwable throwable) {
|
||||
log.error("网关服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteGatewayService() {
|
||||
|
||||
@Override
|
||||
public Response loginSentinel(String password, String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response loginNacos(Map<String, ?> formParams) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response loginPortainer(JSONObject loginBody) {
|
||||
System.out.println(throwable.getMessage());
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -5,3 +5,4 @@ com.microservices.system.api.factory.RemoteFileFallbackFactory
|
|||
com.microservices.system.api.factory.RemoteCmsFallbackFactory
|
||||
com.microservices.system.api.factory.RemoteZoneFallbackFactory
|
||||
com.microservices.system.api.factory.RemotePmsFallbackFactory
|
||||
com.microservices.system.api.factory.RemoteGatewayFallbackFactory
|
||||
|
|
|
|||
|
|
@ -202,20 +202,36 @@ public class CacheConstants {
|
|||
/**
|
||||
* Gitlink组织开通企业是否完成 Key前缀
|
||||
*/
|
||||
public final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
private final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
|
||||
public static String getGitlinkOrgIdOpenEnterpriseKey(Long gitlinkOrgId) {
|
||||
return GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY + gitlinkOrgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sentinel Token缓存Key
|
||||
*/
|
||||
public final static String SENTINEL_TOKEN = "sentinel_token";
|
||||
|
||||
|
||||
/**
|
||||
* Nacos Token缓存Key
|
||||
*/
|
||||
public static final String NACOS_TOKEN = "nacos_token";
|
||||
|
||||
/**
|
||||
* Portainer Token缓存Key
|
||||
*/
|
||||
public static final String PORTAINER_TOKEN = "portainer_token";
|
||||
|
||||
/**
|
||||
* 专区项目Gitlink信息 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
private final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
/**
|
||||
* 专区下项目分数排序 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
private final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
|
||||
public static String getZoneProjectGitlinkInfo(Long gitlinkProjectId) {
|
||||
return ZONE_PROJECT_GITLINK_INFO + gitlinkProjectId;
|
||||
|
|
@ -229,6 +245,15 @@ public class CacheConstants {
|
|||
return ZONE_PROJECT_SORT_BY_SCORE + "*:" + zoneId + ":*";
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件打包是否完成(0:代表未完成;1:代表已完成;-1:代表打包失败,需要重新打包)
|
||||
*/
|
||||
private final static String PACKAGE_FILE_IS_FINISH = "packageFileIsFinish:";
|
||||
|
||||
public static String getPackageFileIsFinish(String fileIdentifier) {
|
||||
return PACKAGE_FILE_IS_FINISH + fileIdentifier;
|
||||
}
|
||||
|
||||
// 全局资源数据缓存,最近一年统计数据
|
||||
public final static String GLOBAL_RESOURCES_DATA_KEY = "GLOBAL_RESOURCES_DATA:";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.microservices.common.core.constant;
|
||||
|
||||
/**
|
||||
* 异常信息常量
|
||||
*
|
||||
* @author otto
|
||||
*/
|
||||
public class ExceptionMsgConstants {
|
||||
/**
|
||||
* 平台通用异常
|
||||
*/
|
||||
public static final String SYSTEM_EXEC_ERROR = "请求处理异常,请联系管理员处理";
|
||||
/**
|
||||
* 重试异常
|
||||
*/
|
||||
public static final String RETRY_ERROR = "请求发生异常,请重新请求";
|
||||
}
|
||||
|
|
@ -32,4 +32,8 @@ public class ServiceNameConstants {
|
|||
* 项目管理模块的serviceid
|
||||
*/
|
||||
public static final String PMS_SERVICE = "microservices-pms";
|
||||
/**
|
||||
* 网关模块的serviceid
|
||||
*/
|
||||
public static final String GATEWAY_SERVICE = "microservices-gateway";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,15 @@ public class TokenConstants {
|
|||
* GitLink令牌标识
|
||||
*/
|
||||
public static final String GitLink_Token_Key = "autologin_trustie=";
|
||||
/**
|
||||
* Sentinel令牌标识
|
||||
*/
|
||||
public static final String Sentinel_Token_Key = "sentinel_dashboard_cookie";
|
||||
public static final String Portainer_Token_Key = "portainer_api_key";
|
||||
/**
|
||||
* Sentinel令牌标识
|
||||
*/
|
||||
public static final String Nacos_Token_Key = "Accesstoken";
|
||||
/**
|
||||
* Cookie中令牌标识
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.microservices.common.core.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CookieUtil {
|
||||
|
||||
|
||||
public static HashMap<String, String> getCookieMap(String cookie) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (cookie != null) {
|
||||
String[] cookies = cookie.split(";");
|
||||
for (String cookieStr : cookies) {
|
||||
String[] cookieArr = cookieStr.split("=");
|
||||
String key = cookieArr[0].trim();
|
||||
String value = cookieArr[1].trim();
|
||||
map.put(key, value);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getCookieValue(String cookie, String key) {
|
||||
HashMap<String, String> map = getCookieMap(cookie);
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public static String removeCookieKey(String cookie, String key) {
|
||||
HashMap<String, String> map = getCookieMap(cookie);
|
||||
map.remove(key);
|
||||
return genCookieStr(map);
|
||||
}
|
||||
|
||||
private static String genCookieStr(HashMap<String, String> cookieMap) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String key : cookieMap.keySet()) {
|
||||
stringBuilder.append(key).append("=").append(cookieMap.get(key)).append(";");
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.microservices.common.core.utils;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
|
|
@ -29,7 +30,7 @@ public class PinYinStringUtils {
|
|||
try {
|
||||
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0);
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
} else {
|
||||
pinyinStr += newChar[i];
|
||||
|
|
@ -55,7 +56,7 @@ public class PinYinStringUtils {
|
|||
try {
|
||||
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0];
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
} else {
|
||||
pinyinStr += newChar[i];
|
||||
|
|
@ -88,8 +89,7 @@ public class PinYinStringUtils {
|
|||
}
|
||||
return result.toString();
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e1) {
|
||||
e1.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,17 +218,18 @@ public class ServletUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* 内容编码(排除斜杠)
|
||||
* 内容编码(排除斜杠并且支持重复编码)
|
||||
*
|
||||
* @param str 内容
|
||||
* @return 编码后的内容
|
||||
*/
|
||||
public static String urlEncodeExcludeSlashes(String str) {
|
||||
public static String urlEncodeExcludeSlashesApplyDuplicate(String str) {
|
||||
try {
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
String[] strings = str.split("/");
|
||||
for (String string : strings) {
|
||||
stringBuffer.append("/").append(URLEncoder.encode(string, Constants.UTF8));
|
||||
string = URLEncoder.encode(string, Constants.UTF8);
|
||||
stringBuffer.append("/").append(string);
|
||||
}
|
||||
return stringBuffer.toString().replaceAll("\\+", "%20");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
@ -236,6 +237,22 @@ public class ServletUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否经过URLEncode
|
||||
* 1. 使用URLDecoder.decode对字符串进行解码。
|
||||
* 2. 再使用URLEncoder.encode对解码后的字符串重新编码。
|
||||
* 3. 如果重新编码后的字符串与原始字符串相同,则说明原始字符串是经过URL编码的
|
||||
*
|
||||
* @param encodedString 需encode的字符串
|
||||
* @return 是否经过URLEncode
|
||||
* @throws UnsupportedEncodingException 编码异常
|
||||
*/
|
||||
public static boolean isUrlEncoded(String encodedString) throws UnsupportedEncodingException {
|
||||
String decodedString = URLDecoder.decode(encodedString, "UTF-8");
|
||||
String reencodedString = URLEncoder.encode(decodedString, "UTF-8");
|
||||
return encodedString.equalsIgnoreCase(reencodedString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容解码
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.microservices.common.core.web.domain;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -63,4 +64,12 @@ public class BaseEntity implements Serializable
|
|||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setCreateAndUpdate(String username) {
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
this.createBy = username;
|
||||
this.updateBy = username;
|
||||
this.createTime = nowDate;
|
||||
this.updateTime = nowDate;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.Constants;
|
||||
import com.microservices.common.core.constant.HttpStatus;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.httpClient.domain.CustomHttpDelete;
|
||||
import com.microservices.system.api.domain.SysFileBytes;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
|
|
@ -281,6 +282,10 @@ public class HttpAPIService {
|
|||
long length = httpEntity.getContentLength();
|
||||
if (length != 0L) {
|
||||
String result = EntityUtils.toString(httpEntity);
|
||||
if (!JSON.isValid(result)) {
|
||||
logger.error("平台接口响应格式异常,状态码:{},响应内容:{}", httpStatusCode, result);
|
||||
throw new ServiceException("平台接口响应格式异常");
|
||||
}
|
||||
Object resultObj = JSON.parse(result);
|
||||
if (resultObj instanceof JSONArray) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
package com.microservices.common.security.feign;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.codec.Encoder;
|
||||
import feign.form.FormEncoder;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* Feign 配置注册
|
||||
*
|
||||
|
|
@ -12,9 +19,20 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
public class FeignAutoConfiguration
|
||||
{
|
||||
// 这里会由容器自动注入HttpMessageConverters的对象工厂
|
||||
@Autowired
|
||||
private ObjectFactory<HttpMessageConverters> messageConverters;
|
||||
@Bean
|
||||
public RequestInterceptor requestInterceptor()
|
||||
{
|
||||
return new FeignRequestInterceptor();
|
||||
}
|
||||
|
||||
// new一个form编码器,实现支持form表单提交
|
||||
// 注意这里方法名称,也就是bean的名称是什么不重要,
|
||||
// 重要的是返回类型要是 Encoder 并且实现类必须是 FormEncoder 或者其子类
|
||||
@Bean
|
||||
public Encoder feignFormEncoder() {
|
||||
return new FormEncoder(new SpringEncoder(messageConverters));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,18 @@ package com.microservices.gateway.config;
|
|||
|
||||
import feign.codec.Decoder;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
|
||||
import org.springframework.cloud.openfeign.support.SpringDecoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
|
|
@ -25,4 +30,10 @@ public class FeignConfig {
|
|||
(new MappingJackson2HttpMessageConverter());
|
||||
return () -> httpMessageConverters;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) {
|
||||
return new HttpMessageConverters(converters.orderedStream().collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,8 @@ import com.microservices.common.core.utils.ServletUtils;
|
|||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.gateway.config.properties.IgnoreWhiteProperties;
|
||||
import com.microservices.gateway.service.ThirdPartyToolService;
|
||||
import com.microservices.gateway.utils.CustomExecutorFactory;
|
||||
import com.microservices.system.api.RemoteUserService;
|
||||
import com.microservices.system.api.domain.SysUserDeptRole;
|
||||
import com.microservices.system.api.utils.FeignUtils;
|
||||
|
|
@ -28,9 +30,8 @@ import org.springframework.web.server.ServerWebExchange;
|
|||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 网关鉴权
|
||||
|
|
@ -51,7 +52,12 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ThirdPartyToolService thirdPartyToolService;
|
||||
|
||||
ThreadPoolExecutor threadPoolExecutor = CustomExecutorFactory.threadPoolExecutor;
|
||||
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
|
|
@ -75,12 +81,16 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
}
|
||||
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
if (StringUtils.isNotEmpty(gitLinkCookie)) {
|
||||
return unauthorizedResponse(exchange, "令牌已过期或验证不正确!");
|
||||
}
|
||||
return unauthorizedResponse(exchange, "令牌不能为空");
|
||||
}
|
||||
Claims claims;
|
||||
try {
|
||||
claims = JwtUtils.parseToken(token);
|
||||
} catch (Exception e) {
|
||||
log.error("令牌解析失败:{}", e.getMessage());
|
||||
return unauthorizedResponse(exchange, "令牌格式不正确!");
|
||||
}
|
||||
if (claims == null) {
|
||||
|
|
@ -105,6 +115,11 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
ServletUtils.addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||
// 内部请求来源参数清除
|
||||
ServletUtils.removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||
|
||||
Mono<Void> thirdPartyRes = thirdPartyToolService.handleRequestForThirdPartyTools(exchange, request, mutate);
|
||||
if (thirdPartyRes != null) {
|
||||
return thirdPartyRes;
|
||||
}
|
||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +131,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
boolean hasUserIdentifyList = redisService.hasKey(redisKey);
|
||||
if (!hasUserIdentifyList) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<List<SysUserDeptRole>>> future = executorService.submit(
|
||||
Future<R<List<SysUserDeptRole>>> future = threadPoolExecutor.submit(
|
||||
() -> remoteUserService.getSysUserDeptRoleListByUserName(username, SecurityConstants.INNER));
|
||||
try {
|
||||
List<SysUserDeptRole> feignResult = FeignUtils.getReturnData(
|
||||
|
|
@ -130,7 +145,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
}
|
||||
|
||||
private String genCookieByToken(String token) {
|
||||
return String.format("%s%s;",TokenConstants.GitLink_Token_Key, token);
|
||||
return String.format("%s%s;", TokenConstants.GitLink_Token_Key, token);
|
||||
}
|
||||
|
||||
private String getGitLinkRequestCookie(ServerHttpRequest request) {
|
||||
|
|
@ -141,7 +156,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION);
|
||||
if (token != null) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<Boolean>> future = executorService.submit(
|
||||
Future<R<Boolean>> future = threadPoolExecutor.submit(
|
||||
() -> remoteUserService.checkGitLinkUserLogin(token, SecurityConstants.INNER));
|
||||
try {
|
||||
Boolean feignResult = FeignUtils.getReturnData(
|
||||
|
|
@ -194,7 +209,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
private String getGitLinkToken(String cookie) {
|
||||
if (StringUtils.isNotEmpty(cookie)) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<String>> future = executorService.submit(() -> remoteUserService
|
||||
Future<R<String>> future = threadPoolExecutor.submit(() -> remoteUserService
|
||||
.getSysUserTokenByGitLinkCookie(cookie, SecurityConstants.INNER));
|
||||
R<String> feignResult;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,218 @@
|
|||
package com.microservices.gateway.filter;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.ExceptionMsgConstants;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.filter.NettyWriteResponseFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.core.io.buffer.DataBufferFactory;
|
||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponseDecorator;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class GlobalResponseFilter implements GlobalFilter, Ordered {
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
|
||||
String lowerUrl = request.getURI().getPath().toLowerCase();
|
||||
ServerHttpResponse originalResponse = exchange.getResponse();
|
||||
DataBufferFactory bufferFactory = originalResponse.bufferFactory();
|
||||
// 当请求为Nacos时,Nacos返回的所有非JSON响应都会被自动转换为结构化的错误信息,同时将HTTP状态码设置为200,适合用于规范化微服务架构的响应格式。
|
||||
if (lowerUrl.startsWith("/nacos")) {
|
||||
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
if (status == HttpStatus.FORBIDDEN) {
|
||||
log.error("nacos鉴权异常,已清理redis中nacos token");
|
||||
// 设置新的状态码为 200
|
||||
setStatusCode(HttpStatus.OK);
|
||||
// 设置响应内容类型为 JSON
|
||||
getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
// 清理Sentinel失效token
|
||||
redisService.deleteObject(CacheConstants.NACOS_TOKEN);
|
||||
// 创建自定义的 JSON 响应内容
|
||||
String jsonBody = JSON.toJSONString(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
byte[] bytes = jsonBody.getBytes(StandardCharsets.UTF_8);
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer dataBuffer = bufferFactory.wrap(bytes);
|
||||
// 返回新的响应内容
|
||||
return super.writeWith(Mono.just(dataBuffer));
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
return;
|
||||
}
|
||||
synchronousSink.complete();
|
||||
|
||||
}).flatMap(resStr -> {
|
||||
// 保留原始状态码
|
||||
originalResponse.setStatusCode(HttpStatus.OK);
|
||||
String errMsg;
|
||||
if (!JSON.isValid(resStr)) {
|
||||
errMsg = resStr;
|
||||
} else {
|
||||
JSONObject resJson = JSONObject.parseObject(resStr);
|
||||
if (resJson.containsKey("message")) {
|
||||
errMsg = resJson.getString("message");
|
||||
} else {
|
||||
errMsg = ExceptionMsgConstants.SYSTEM_EXEC_ERROR;
|
||||
}
|
||||
}
|
||||
byte[] bytes = JSON.toJSONBytes(AjaxResult.error(errMsg));
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
if (lowerUrl.startsWith("/portainer")) {
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
}
|
||||
synchronousSink.complete();
|
||||
}).flatMap(resStr -> {
|
||||
log.error("Portainer响应处理异常,异常信息:{}", resStr);
|
||||
originalResponse.setStatusCode(HttpStatus.OK);
|
||||
byte[] bytes;
|
||||
if (JSON.isValid(resStr)) {
|
||||
JSONObject resJson = JSONObject.parseObject(resStr);
|
||||
if (resJson.containsKey("message")) {
|
||||
String message = resJson.getString("message");
|
||||
if (StringUtils.isNotBlank(message) && message.contains("A valid authorisation token is missing")) {
|
||||
log.error("Portainer鉴权异常,已清理redis中Portainer token");
|
||||
//token失效清除redis缓存
|
||||
redisService.deleteObject(CacheConstants.PORTAINER_TOKEN);
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(message));
|
||||
}
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
}
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
}
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
if (lowerUrl.startsWith("/sentinel")) {
|
||||
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
if (status == HttpStatus.UNAUTHORIZED) {
|
||||
log.error("sentinel鉴权异常,已清理redis中sentinel token");
|
||||
// 设置新的状态码为 200
|
||||
setStatusCode(HttpStatus.OK);
|
||||
// 设置响应内容类型为 JSON
|
||||
getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
// 清理Sentinel失效token
|
||||
redisService.deleteObject(CacheConstants.SENTINEL_TOKEN);
|
||||
// 创建自定义的 JSON 响应内容
|
||||
String jsonBody = JSON.toJSONString(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
byte[] bytes = jsonBody.getBytes(StandardCharsets.UTF_8);
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer dataBuffer = bufferFactory.wrap(bytes);
|
||||
// 返回新的响应内容
|
||||
return super.writeWith(Mono.just(dataBuffer));
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
}
|
||||
synchronousSink.complete();
|
||||
}).flatMap(resStr -> {
|
||||
log.error("Sentinel响应处理异常,异常信息:{}", resStr);
|
||||
byte[] bytes;
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
setStatusCode(HttpStatus.OK);
|
||||
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
return chain.filter(exchange);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
//WRITE_RESPONSE_FILTER 之前执行
|
||||
return NettyWriteResponseFilter.WRITE_RESPONSE_FILTER_ORDER - 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.microservices.gateway.handler;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -19,33 +20,27 @@ import reactor.core.publisher.Mono;
|
|||
*/
|
||||
@Order(-1)
|
||||
@Configuration
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
|
||||
{
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GatewayExceptionHandler.class);
|
||||
|
||||
@Override
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex)
|
||||
{
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
|
||||
if (exchange.getResponse().isCommitted())
|
||||
{
|
||||
if (exchange.getResponse().isCommitted()) {
|
||||
return Mono.error(ex);
|
||||
}
|
||||
|
||||
String msg;
|
||||
|
||||
if (ex instanceof NotFoundException)
|
||||
{
|
||||
if (ex instanceof NotFoundException) {
|
||||
msg = "服务未找到";
|
||||
}
|
||||
else if (ex instanceof ResponseStatusException)
|
||||
{
|
||||
} else if (ex instanceof ServiceException) {
|
||||
msg = ex.getMessage();
|
||||
} else if (ex instanceof ResponseStatusException) {
|
||||
ResponseStatusException responseStatusException = (ResponseStatusException) ex;
|
||||
msg = responseStatusException.getMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
msg = "内部服务器错误";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.microservices.gateway.service;
|
||||
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 第三方工具服务类
|
||||
*
|
||||
* @author OTTO
|
||||
*/
|
||||
public interface ThirdPartyToolService {
|
||||
|
||||
/**
|
||||
* 处理第三方工具请求
|
||||
*
|
||||
* @param exchange
|
||||
* @param request 请求
|
||||
* @param mutate 请求头获取器
|
||||
*/
|
||||
Mono<Void> handleRequestForThirdPartyTools(ServerWebExchange exchange, ServerHttpRequest request, ServerHttpRequest.Builder mutate);
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
package com.microservices.gateway.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.ExceptionMsgConstants;
|
||||
import com.microservices.common.core.constant.TokenConstants;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.CookieUtil;
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.gateway.service.ThirdPartyToolService;
|
||||
import com.microservices.gateway.utils.CustomExecutorFactory;
|
||||
import com.microservices.system.api.RemoteGatewayService;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
@Service
|
||||
public class ThirdPartyToolServiceImpl implements ThirdPartyToolService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ThirdPartyToolServiceImpl.class);
|
||||
@Value("${thirdPartyTools.nacos.auth.username:}")
|
||||
public String nacosUsername;
|
||||
@Value("${thirdPartyTools.nacos.auth.password:}")
|
||||
public String nacosPassword;
|
||||
@Value("${thirdPartyTools.sentinel.auth.username:}")
|
||||
public String sentinelUsername;
|
||||
@Value("${thirdPartyTools.sentinel.auth.password:}")
|
||||
public String sentinelPassword;
|
||||
@Value("${thirdPartyTools.portainer.auth.username:}")
|
||||
public String portainerUsername;
|
||||
@Value("${thirdPartyTools.portainer.auth.password:}")
|
||||
public String portainerPassword;
|
||||
@Value("${thirdPartyTools.portainer.endpoints:}")
|
||||
public Integer portainerEndpoints;
|
||||
ThreadPoolExecutor threadPoolExecutor = CustomExecutorFactory.threadPoolExecutor;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private RemoteGatewayService remoteGatewayService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 处理第三方工具请求
|
||||
*/
|
||||
@Override
|
||||
public Mono<Void> handleRequestForThirdPartyTools(ServerWebExchange exchange, ServerHttpRequest request, ServerHttpRequest.Builder mutate) {
|
||||
String url = request.getURI().getPath();
|
||||
String lowerUrl = url.toLowerCase();
|
||||
if (StringUtils.isEmpty(lowerUrl)) {
|
||||
return null;
|
||||
}
|
||||
// 处理Sentinel请求
|
||||
if (lowerUrl.startsWith("/sentinel")) {
|
||||
// 检查Cookie中是否携带sentinel cookie
|
||||
String cookie = request.getHeaders().getFirst(TokenConstants.Cookie);
|
||||
if (StringUtils.isNotEmpty(CookieUtil.getCookieValue(cookie, TokenConstants.Sentinel_Token_Key))) {
|
||||
cookie = CookieUtil.removeCookieKey(cookie, TokenConstants.Sentinel_Token_Key);
|
||||
}
|
||||
String sentinelCookie = null;
|
||||
if (redisService.hasKey(CacheConstants.SENTINEL_TOKEN)) {
|
||||
sentinelCookie = redisService.getCacheObject(CacheConstants.SENTINEL_TOKEN);
|
||||
} else {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Sentinel Token
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginSentinel(sentinelUsername, sentinelPassword));
|
||||
try {
|
||||
Response response = future.get(1, TimeUnit.SECONDS);
|
||||
Map<String, Collection<String>> header = response.headers();
|
||||
if (header != null && header.containsKey("set-cookie")) {
|
||||
sentinelCookie = header.get("set-cookie").iterator().next();
|
||||
//Sentinel登录状态默认30分钟失效,将Sentinel Token缓存过期时间调整为28分钟
|
||||
redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 28L, TimeUnit.MINUTES);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Sentinel Token超时");
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("获取Sentinel Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sentinelCookie)) {
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.Cookie);
|
||||
mutate.header(TokenConstants.Cookie, String.format("%s;%s;", cookie, sentinelCookie));
|
||||
} else {
|
||||
throw new ServiceException("Sentinel服务获取Token失败");
|
||||
}
|
||||
}
|
||||
// 处理Nacos请求
|
||||
if (lowerUrl.startsWith("/nacos")) {
|
||||
String nacosToken = null;
|
||||
if (redisService.hasKey(CacheConstants.NACOS_TOKEN)) {
|
||||
nacosToken = redisService.getCacheObject(CacheConstants.NACOS_TOKEN);
|
||||
} else {
|
||||
Map<String, String> nacosMap = new HashMap<>();
|
||||
nacosMap.put("username", nacosUsername);
|
||||
nacosMap.put("password", nacosPassword);
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Nacos Token
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginNacos(nacosMap));
|
||||
try {
|
||||
Response res = future.get(1, TimeUnit.SECONDS);
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(res.body().asInputStream(), writer, StandardCharsets.UTF_8.name());
|
||||
String str = writer.toString();
|
||||
if (!JSON.isValid(str)) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
JSONObject resJsonObject = JSONObject.parseObject(str);
|
||||
if (resJsonObject == null) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
nacosToken = resJsonObject.getString("accessToken");
|
||||
Long tokenTtl = resJsonObject.getLong("tokenTtl");
|
||||
if (nacosToken != null && tokenTtl != null) {
|
||||
redisService.setCacheObject(CacheConstants.NACOS_TOKEN, nacosToken, tokenTtl - 10, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Nacos Token超时");
|
||||
} catch (InterruptedException | ExecutionException | IOException | NullPointerException e) {
|
||||
log.error("获取Nacos Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(nacosToken)) {
|
||||
mutate.header(TokenConstants.Nacos_Token_Key, nacosToken);
|
||||
} else {
|
||||
throw new ServiceException("Nacos服务获取Token失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 处理portainer请求
|
||||
if (lowerUrl.startsWith("/portainer")) {
|
||||
// 处理portainer指定endpoints的问题
|
||||
if (lowerUrl.startsWith("/portainer/api/endpoints/")) {
|
||||
String regex = "^/portainer/api/endpoints/\\d+(/?.*)";
|
||||
if (Pattern.matches(regex, lowerUrl)) {
|
||||
// 替换掉endpoints
|
||||
regex = "(^/portainer/api/endpoints/)(\\d+)(/?.*)";
|
||||
Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(url);
|
||||
if (matcher.find()) {
|
||||
// 替换数字部分
|
||||
url = matcher.replaceAll(matcher.group(1) + portainerEndpoints + matcher.group(3));
|
||||
try {
|
||||
mutate.uri(new URI(url));
|
||||
} catch (URISyntaxException e) {
|
||||
log.error("替换Portainer请求中Endpoints时发生异常:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String portainerToken = null;
|
||||
String cookie = request.getHeaders().getFirst(TokenConstants.Cookie);
|
||||
if (StringUtils.isNotEmpty(CookieUtil.getCookieValue(cookie, TokenConstants.Portainer_Token_Key))) {
|
||||
cookie = CookieUtil.removeCookieKey(cookie, TokenConstants.Portainer_Token_Key);
|
||||
}
|
||||
|
||||
if (redisService.hasKey(CacheConstants.PORTAINER_TOKEN)) {
|
||||
portainerToken = redisService.getCacheObject(CacheConstants.PORTAINER_TOKEN);
|
||||
} else {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Portainer Token
|
||||
JSONObject loginPortainerBody = new JSONObject();
|
||||
loginPortainerBody.put("username", portainerUsername);
|
||||
loginPortainerBody.put("password", portainerPassword);
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginPortainer(loginPortainerBody));
|
||||
try {
|
||||
Response res = future.get(1, TimeUnit.SECONDS);
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(res.body().asInputStream(), writer, StandardCharsets.UTF_8.name());
|
||||
String str = writer.toString();
|
||||
if (!JSON.isValid(str)) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
JSONObject resJsonObject = JSONObject.parseObject(str);
|
||||
portainerToken = resJsonObject.getString("jwt");
|
||||
if (portainerToken == null) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
String[] tokenSplit = portainerToken.split("\\.");
|
||||
String tokenBodyStr = new String(Base64.getDecoder().decode(tokenSplit[1]), StandardCharsets.UTF_8);
|
||||
JSONObject tokenBody = JSONObject.parseObject(tokenBodyStr);
|
||||
Long expiration = tokenBody.getLong("exp");
|
||||
Long now = new Date().getTime() / 1000;
|
||||
|
||||
long portainerTokenTtl = expiration - now;
|
||||
if (portainerTokenTtl > 20) {
|
||||
redisService.setCacheObject(CacheConstants.PORTAINER_TOKEN, portainerToken, portainerTokenTtl - 10, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Portainer Token超时");
|
||||
} catch (InterruptedException | ExecutionException | IOException | NullPointerException e) {
|
||||
log.error("获取Portainer Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(portainerToken)) {
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.Cookie);
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.AUTHENTICATION);
|
||||
mutate.header(TokenConstants.AUTHENTICATION, TokenConstants.PREFIX + portainerToken);
|
||||
mutate.header(TokenConstants.Cookie, String.format("%s;%s;", cookie, portainerToken));
|
||||
} else {
|
||||
throw new ServiceException("Portainer服务获取Token失败");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Mono<Void> exceptionResponse(ServerWebExchange exchange, String msg, int code) {
|
||||
log.error("[第三方工具请求处理异常]请求路径:{},异常信息:{}", exchange.getRequest().getPath(), msg);
|
||||
return ServletUtils.webFluxResponseWriter(exchange.getResponse(), ExceptionMsgConstants.SYSTEM_EXEC_ERROR, code);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.microservices.gateway.utils;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.threadPool.ThreadPoolExecutorWrap;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
public class CustomExecutorFactory {
|
||||
/**
|
||||
* 创建线程池
|
||||
* 存在并发处理的情况,设置核心线程为2,设置有界队列长度为100,最大线程数为10
|
||||
* 当超出队列已满且达到最大线程数时抛出异常
|
||||
* Ncpu=CPU数量
|
||||
* Ucpu=目标CPU的使用率,0<=Ucpu<=1
|
||||
* W/C=任务等待时间与任务计算时间的比率
|
||||
* Nthreads =Ncpu*Ucpu*(1+W/C)
|
||||
*/
|
||||
public static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutorWrap(
|
||||
4
|
||||
, 10
|
||||
, 10
|
||||
, TimeUnit.SECONDS
|
||||
, new ArrayBlockingQueue<>(100)
|
||||
, Executors.defaultThreadFactory()
|
||||
, (r, executor) -> {
|
||||
throw new ServiceException("目前处理的人太多了,请稍后再试");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-modules</artifactId>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>microservices-modules-dms</artifactId>
|
||||
|
||||
<description>
|
||||
microservices-modules-dms数据管理体系模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Async -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-async</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-log</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!-- 处理访问Gitlink相关接口 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-httpClient</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.shibing624</groupId>
|
||||
<artifactId>similarity</artifactId>
|
||||
<version>1.1.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms;
|
||||
|
||||
import com.microservices.common.security.annotation.EnableCustomConfig;
|
||||
import com.microservices.common.security.annotation.EnableRyFeignClients;
|
||||
import com.microservices.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 项目管理模块
|
||||
*
|
||||
* @author otto
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class MicroservicesDmsApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MicroservicesDmsApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 数据管理体系模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成果团队Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "数据管理体系-成果团队接口")
|
||||
@RequestMapping("/achievementsTeam")
|
||||
public class AchievementTeamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAchievementTeamService achievementTeamService;
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AchievementTeam achievementTeam)
|
||||
{
|
||||
startPage();
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果团队列表
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AchievementTeam achievementTeam)
|
||||
{
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
ExcelUtil<AchievementTeam> util = new ExcelUtil<AchievementTeam>(AchievementTeam.class);
|
||||
util.exportExcel(response, list, "成果团队数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果团队详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(achievementTeamService.selectAchievementTeamById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.insertAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.updateAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(achievementTeamService.deleteAchievementTeamByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/achievements")
|
||||
@Api(tags = "数据管理体系-成果库接口")
|
||||
public class AchievementsController extends BaseController {
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Achievements achievements) {
|
||||
startPage();
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果列表
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Achievements achievements) {
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
ExcelUtil<Achievements> util = new ExcelUtil<Achievements>(Achievements.class);
|
||||
util.exportExcel(response, list, "成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(achievementsService.selectAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.insertAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.updateAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(achievementsService.deleteAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取精选成果")
|
||||
@GetMapping("/getChoiceImport")
|
||||
public AjaxResult getChoiceImport() {
|
||||
return success(achievementsService.getChoiceImport());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果来源对成果数据进行分类统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果来源对成果数据进行分类统计")
|
||||
@GetMapping("/getTjBySources")
|
||||
public AjaxResult getTjBySources() {
|
||||
return success(achievementsService.getTjBySources());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果领域对成功数据进行汇总
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果领域对成果数据进行汇总")
|
||||
@GetMapping("/getTjByAreas")
|
||||
public AjaxResult getTjByAreas() {
|
||||
return success(achievementsService.getTjByAreas());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据领域分类名称,获取领域相关数据(创客任务、开放竞赛、校企成果)
|
||||
*/
|
||||
@ApiOperation("根据领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/getAreasByName")
|
||||
public AjaxResult getAreasByName(String areaName) {
|
||||
return success(achievementsService.getAreasByName(areaName));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取项目领域")
|
||||
@GetMapping("/getProjectAreasByName")
|
||||
public AjaxResult getProjectAreasByName(String areaName) {
|
||||
return success(achievementsService.getProjectAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取专家领域")
|
||||
@GetMapping("/getExpertAreasByName")
|
||||
public AjaxResult getExpertAreasByName(String areaName) {
|
||||
return success(achievementsService.getExpertAreasByName(areaName));
|
||||
}
|
||||
|
||||
|
||||
/* 获取全部成果,根据成果名称、成果领域、成果来源进行查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取全部成果,根据成果名称、成果领域、成果来源进行查询")
|
||||
@GetMapping("/getAllResult")
|
||||
public TableDataInfo getAllResult(AchQueryVo achQueryVo) {
|
||||
startPage();
|
||||
return getDataTable(achievementsService.getAllResult(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("近七日用户行为数据")
|
||||
@GetMapping("/getUerActionData")
|
||||
public AjaxResult getUerActionData() {
|
||||
return success(achievementsService.getUerActionData());
|
||||
}
|
||||
|
||||
@ApiOperation("热门成果")
|
||||
@GetMapping("/getHotAchievement")
|
||||
public AjaxResult getHotAchievement() {
|
||||
return success(achievementsService.getHotAchievement());
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增")
|
||||
@GetMapping("/get7DayAdd")
|
||||
public AjaxResult get7DayAdd(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAdd(achQueryVo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页项目统计")
|
||||
@GetMapping("/indexProjectStatistic")
|
||||
public AjaxResult indexProjectStatistic() {
|
||||
return success(achievementsService.indexProjectStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页task统计")
|
||||
@GetMapping("/indexTaskStatistic")
|
||||
public AjaxResult indexTaskStatistic() {
|
||||
return success(achievementsService.indexTaskStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页Competition统计")
|
||||
@GetMapping("/indexCompetitionStatistic")
|
||||
public AjaxResult indexCompetitionStatistic() {
|
||||
return success(achievementsService.indexCompetitionStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页SchoolEnterprise统计")
|
||||
@GetMapping("/indexSchoolEnterpriseStatistic")
|
||||
public AjaxResult indexSchoolEnterpriseStatistic() {
|
||||
return success(achievementsService.indexSchoolEnterpriseStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页专家统计")
|
||||
@GetMapping("/indexExpertStatistic")
|
||||
public AjaxResult indexExpertStatistic() {
|
||||
return success(achievementsService.indexExpertStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据当前用户以及成果ID,获取当前成果的 是否收藏与关注状态")
|
||||
@GetMapping("/getWatchFavoriteStatusById")
|
||||
public AjaxResult getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return success(achievementsService.getWatchFavoriteStatusById(id, userId));
|
||||
}
|
||||
@ApiOperation("根据成果ID,获取近7日成果点击数量(折线图)")
|
||||
@GetMapping("/get7AddClickById")
|
||||
public AjaxResult get7AddClickById(String id) {
|
||||
return success(achievementsService.get7AddClickById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||
@GetMapping("/getActDataStatisticById")
|
||||
public AjaxResult getActDataStatisticById(Long id) {
|
||||
return success(achievementsService.getActDataStatisticById(id));
|
||||
}
|
||||
/**
|
||||
* 根据领域,将成果数据进行分类
|
||||
*
|
||||
*/
|
||||
@GetMapping("/getAreaStatistic")
|
||||
public AjaxResult getAreaStatistic(String areaKey)
|
||||
{
|
||||
return success(achievementsService.getAreaStatistic(areaKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开源项目的相关成果
|
||||
*/
|
||||
@ApiOperation(value = "获取开源项目的相关成果")
|
||||
@GetMapping("/getRelatedAch")
|
||||
public AjaxResult getRelatedAch(Long id,Long sourceId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAch(id,sourceId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "搜索行为数据记录")
|
||||
@GetMapping("/getSearchResult")
|
||||
public AjaxResult getSearchResult(String achName,Long userId)
|
||||
{
|
||||
return success(achievementsService.getSearchResult(achName,userId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.BigScreenStatisticService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-大屏统计接口")
|
||||
@RequestMapping("/bigScreenStatistic")
|
||||
public class BigScreenStatisticController {
|
||||
|
||||
private final BigScreenStatisticService bigScreenStatisticService;
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementTopStatistic")
|
||||
@ApiOperation(value = "成果任务统计顶部折线图")
|
||||
public AjaxResult getAchievementTopStatistic(String source) {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementTopStatistic(source));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDataYearly")
|
||||
@ApiOperation(value = "年度成果数据")
|
||||
public AjaxResult getAchievementDataYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDataYearly());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementType")
|
||||
@ApiOperation(value = "成果类型")
|
||||
public AjaxResult getAchievementType() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementType());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDomain")
|
||||
@ApiOperation(value = "成果领域分布")
|
||||
public AjaxResult getAchievementDomain() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDomain());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementAddYearly")
|
||||
@ApiOperation(value = "近1年新增成果数")
|
||||
public AjaxResult getAchievementAddYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementAddYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementActData")
|
||||
@ApiOperation(value = "成果行为数据展示")
|
||||
public AjaxResult getAchievementActData() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementActData());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementHotRank")
|
||||
@ApiOperation(value = "成果热度排行")
|
||||
public AjaxResult getAchievementHotRank() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementHotRank());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionTopStatistic")
|
||||
@ApiOperation(value = "competition统计顶部")
|
||||
public AjaxResult getAchievementTopStatistic() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionTopStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionStatisticYearly")
|
||||
@ApiOperation(value = "竞赛数据统计")
|
||||
public AjaxResult getCompetitionStatisticYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionStatisticYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionHot")
|
||||
@ApiOperation(value = "热门竞赛统计")
|
||||
public AjaxResult getCompetitionHot() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionHot());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyPaperAdd")
|
||||
@ApiOperation(value = "年度竞赛作品新增数")
|
||||
public AjaxResult getCompetitionYearlyPaperAdd() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyPaperAdd());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyFinish")
|
||||
@ApiOperation(value = "近1年竞赛完成情况")
|
||||
public AjaxResult getCompetitionYearlyFinish() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyFinish());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.ExpertDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-专家可视化接口")
|
||||
@RequestMapping("/expertDashboard")
|
||||
public class ExpertDashboardController {
|
||||
@Autowired
|
||||
private ExpertDashboardService expertDashboardService;
|
||||
|
||||
@GetMapping(value = "getExpertTotal")
|
||||
@ApiOperation(value = "获取专家总数")
|
||||
public AjaxResult getExpertTotal() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotal());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAuthenticationStatistic")
|
||||
@ApiOperation(value = "专家实名完成度")
|
||||
public AjaxResult getAuthenticationStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getAuthenticationStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTitleRankStatistic")
|
||||
@ApiOperation(value = "专家职称级分布")
|
||||
public AjaxResult getTitleRankStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getTitleRankStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertAduit")
|
||||
@ApiOperation(value = "近一年专家评审作品数")
|
||||
public AjaxResult getExpertAduit() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertTypeStatistic")
|
||||
@ApiOperation(value = "专家专业类别")
|
||||
public AjaxResult getExpertTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getWorkplaceTypeStatistic")
|
||||
@ApiOperation(value = "专家单位类别分布")
|
||||
public AjaxResult getWorkplaceTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getWorkplaceTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getHighestDegreeStatistic")
|
||||
@ApiOperation(value = "专家学历分布")
|
||||
public AjaxResult getHighestDegreeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getHighestDegreeStatistic());
|
||||
}
|
||||
|
||||
//7、年度专家数据统计 cretate_on
|
||||
@GetMapping(value = "getExpertTotalByYear")
|
||||
@ApiOperation(value = "年度专家数据统计")
|
||||
public AjaxResult getExpertTotalByYear() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getReviewAreasStatistic")
|
||||
@ApiOperation(value = "热门专家领域")
|
||||
public AjaxResult getReviewAreasStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getReviewAreasStatistic());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.MemoDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-社区动态可视化接口")
|
||||
@RequestMapping("/memoDashboard")
|
||||
public class MemoDashboardController {
|
||||
@Autowired
|
||||
private MemoDashboardService memoDashboardService;
|
||||
|
||||
@GetMapping(value = "getMemoAduit")
|
||||
@ApiOperation(value = "帖子审核通过率、帖子总数")
|
||||
public AjaxResult getMemoAduit() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getIsOriginalStatistic")
|
||||
@ApiOperation(value = "帖子原创、非原创")
|
||||
public AjaxResult getIsOriginalStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getIsOriginalStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getMemoTotalByYear")
|
||||
@ApiOperation(value = "年度论坛帖子总数")
|
||||
public AjaxResult getMemoTotalByYear() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getForumSectionStatistic(")
|
||||
@ApiOperation(value = "帖子分类")
|
||||
public AjaxResult getForumSectionStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAddMemoStatistic(")
|
||||
@ApiOperation(value = "近一年新增帖子数")
|
||||
public AjaxResult getAddMemoStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTop5Memos(")
|
||||
@ApiOperation(value = "年度帖子热度top5")
|
||||
public AjaxResult getTop5Memos() {
|
||||
return AjaxResult.success(memoDashboardService.getTop5Memos());
|
||||
}
|
||||
|
||||
@GetMapping(value = "get7DayPaise(")
|
||||
@ApiOperation(value = "近7日帖子点赞数")
|
||||
public AjaxResult get7DayPaise() {
|
||||
return AjaxResult.success(memoDashboardService.get7DayPaise());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校企成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Api(tags = "数据管理体系-校企成果接口")
|
||||
@RestController
|
||||
@RequestMapping("/schoolEnterpriseAchievements")
|
||||
public class SchoolEnterpriseAchievementsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISchoolEnterpriseAchievementsService schoolEnterpriseAchievementsService;
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
startPage();
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出校企成果列表
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
ExcelUtil<SchoolEnterpriseAchievements> util = new ExcelUtil<SchoolEnterpriseAchievements>(SchoolEnterpriseAchievements.class);
|
||||
util.exportExcel(response, list, "校企成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校企成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.deleteSchoolEnterpriseAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部统计
|
||||
*/
|
||||
@GetMapping("/topStatistic")
|
||||
@ApiOperation(value = "顶部统计数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags", value = "成果标签", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "成果状态", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
|
||||
Long value = schoolEnterpriseAchievementsService.topStatistic(schoolEnterpriseAchievements);
|
||||
return AjaxResult.success(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchQueryVo {
|
||||
|
||||
private String areaQuery;//领域
|
||||
private String source;//来源
|
||||
private String achievementName;//名称
|
||||
private Long userId;
|
||||
public String getAreaQuery() {
|
||||
return areaQuery;
|
||||
}
|
||||
|
||||
public void setAreaQuery(String areaQuery) {
|
||||
this.areaQuery = areaQuery;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AchRelatedResult {
|
||||
private String year;
|
||||
private List<AchRelatedVo> achRelatedVoList;
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public List<AchRelatedVo> getAchRelatedVoList() {
|
||||
return achRelatedVoList;
|
||||
}
|
||||
|
||||
public void setAchRelatedVoList(List<AchRelatedVo> achRelatedVoList) {
|
||||
this.achRelatedVoList = achRelatedVoList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchRelatedVo {
|
||||
private Long id;
|
||||
private String attachments;
|
||||
private String summary;
|
||||
private String achievementType;
|
||||
private String achMonthDay;
|
||||
private String source;
|
||||
private Long sourceId;
|
||||
private String achRelateName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchMonthDay() {
|
||||
return achMonthDay;
|
||||
}
|
||||
|
||||
public void setAchMonthDay(String achMonthDay) {
|
||||
this.achMonthDay = achMonthDay;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getAchRelateName() {
|
||||
return achRelateName;
|
||||
}
|
||||
|
||||
public void setAchRelateName(String achRelateName) {
|
||||
this.achRelateName = achRelateName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 成果团队对象 achievement_team
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class AchievementTeam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 成果ld */
|
||||
@Excel(name = "成果ld")
|
||||
private Long achievementId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String username;
|
||||
|
||||
/** 所属单位 */
|
||||
@Excel(name = "所属单位")
|
||||
private String company;
|
||||
|
||||
/** 职称 */
|
||||
@Excel(name = "职称")
|
||||
private String technicalTitle;
|
||||
|
||||
/** 专业 */
|
||||
@Excel(name = "专业")
|
||||
private String professionalTitle;
|
||||
|
||||
/** 研究方向 */
|
||||
@Excel(name = "研究方向")
|
||||
private String researchDirection;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "联系方式")
|
||||
private String phone;
|
||||
|
||||
/** 个人简介 */
|
||||
@Excel(name = "个人简介")
|
||||
private String summary;
|
||||
|
||||
/** 本项成果中主要承担工作 */
|
||||
@Excel(name = "本项成果中主要承担工作")
|
||||
private String workContent;
|
||||
|
||||
/** 是否是负责人 */
|
||||
@Excel(name = "是否是负责人")
|
||||
private String isLeader;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAchievementId(Long achievementId)
|
||||
{
|
||||
this.achievementId = achievementId;
|
||||
}
|
||||
|
||||
public Long getAchievementId()
|
||||
{
|
||||
return achievementId;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setCompany(String company)
|
||||
{
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
public void setTechnicalTitle(String technicalTitle)
|
||||
{
|
||||
this.technicalTitle = technicalTitle;
|
||||
}
|
||||
|
||||
public String getTechnicalTitle()
|
||||
{
|
||||
return technicalTitle;
|
||||
}
|
||||
public void setProfessionalTitle(String professionalTitle)
|
||||
{
|
||||
this.professionalTitle = professionalTitle;
|
||||
}
|
||||
|
||||
public String getProfessionalTitle()
|
||||
{
|
||||
return professionalTitle;
|
||||
}
|
||||
public void setResearchDirection(String researchDirection)
|
||||
{
|
||||
this.researchDirection = researchDirection;
|
||||
}
|
||||
|
||||
public String getResearchDirection()
|
||||
{
|
||||
return researchDirection;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setSummary(String summary)
|
||||
{
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return summary;
|
||||
}
|
||||
public void setWorkContent(String workContent)
|
||||
{
|
||||
this.workContent = workContent;
|
||||
}
|
||||
|
||||
public String getWorkContent()
|
||||
{
|
||||
return workContent;
|
||||
}
|
||||
public void setIsLeader(String isLeader)
|
||||
{
|
||||
this.isLeader = isLeader;
|
||||
}
|
||||
|
||||
public String getIsLeader()
|
||||
{
|
||||
return isLeader;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementId", getAchievementId())
|
||||
.append("username", getUsername())
|
||||
.append("company", getCompany())
|
||||
.append("technicalTitle", getTechnicalTitle())
|
||||
.append("professionalTitle", getProfessionalTitle())
|
||||
.append("researchDirection", getResearchDirection())
|
||||
.append("phone", getPhone())
|
||||
.append("summary", getSummary())
|
||||
.append("workContent", getWorkContent())
|
||||
.append("isLeader", getIsLeader())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,517 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 成果对象 achievementsll
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public class Achievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(name = "成果领域1")
|
||||
private String field1;
|
||||
//成果领域名称
|
||||
private String field1Name;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private Long sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(name = "成果标签")
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "成果状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "成果图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
|
||||
private Long clickSum;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
private Float hotRank;
|
||||
private Long attachmentCount;
|
||||
private Integer isExpertAudit;
|
||||
private String userImg;
|
||||
private String userNickName;
|
||||
public String gender;
|
||||
private String userLogin;
|
||||
|
||||
public String getUserImg() {
|
||||
return userImg;
|
||||
}
|
||||
|
||||
public void setUserImg(String userImg) {
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public String getUserNickName() {
|
||||
return userNickName;
|
||||
}
|
||||
|
||||
public void setUserNickName(String userNickName) {
|
||||
this.userNickName = userNickName;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getUserLogin() {
|
||||
return userLogin;
|
||||
}
|
||||
|
||||
public void setUserLogin(String userLogin) {
|
||||
this.userLogin = userLogin;
|
||||
}
|
||||
|
||||
public String getField1Name() {
|
||||
return field1Name;
|
||||
}
|
||||
|
||||
public void setField1Name(String field1Name) {
|
||||
this.field1Name = field1Name;
|
||||
}
|
||||
|
||||
public Long getWatcherSum() {
|
||||
return watcherSum;
|
||||
}
|
||||
|
||||
public void setWatcherSum(Long watcherSum) {
|
||||
this.watcherSum = watcherSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Float getHotRank() {
|
||||
return hotRank;
|
||||
}
|
||||
|
||||
public void setHotRank(Float hotRank) {
|
||||
this.hotRank = hotRank;
|
||||
}
|
||||
|
||||
public Integer getIsExpertAudit() {
|
||||
return isExpertAudit;
|
||||
}
|
||||
|
||||
public void setIsExpertAudit(Integer isExpertAudit) {
|
||||
this.isExpertAudit = isExpertAudit;
|
||||
}
|
||||
|
||||
public Long getAttachmentCount() {
|
||||
return attachmentCount;
|
||||
}
|
||||
|
||||
public void setAttachmentCount(Long attachmentCount) {
|
||||
this.attachmentCount = attachmentCount;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
private List<KeyValVo> attachmentList;
|
||||
|
||||
public List<KeyValVo> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementName", getAchievementName())
|
||||
.append("field1", getField1())
|
||||
.append("field2", getField2())
|
||||
.append("field3", getField3())
|
||||
.append("achievementType", getAchievementType())
|
||||
.append("source", getSource())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("sourceLink", getSourceLink())
|
||||
.append("tags", getTags())
|
||||
.append("summary", getSummary())
|
||||
.append("publishingUnit", getPublishingUnit())
|
||||
.append("address", getAddress())
|
||||
.append("isFeatured", getIsFeatured())
|
||||
.append("contactPerson", getContactPerson())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("ownerName", getOwnerName())
|
||||
.append("status", getStatus())
|
||||
.append("details", getDetails())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("reviewComments", getReviewComments())
|
||||
.append("images", getImages())
|
||||
.append("attachments", getAttachments())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AreaStatisticVo {
|
||||
//领域名称
|
||||
private String areaName;
|
||||
//领域key
|
||||
private String areaKey;
|
||||
//领域说明
|
||||
private String remark;
|
||||
//开源项目汇总
|
||||
private Long kyxmSum;
|
||||
//创客任务汇总
|
||||
private Long ckrwSum;
|
||||
//开放竞赛汇总
|
||||
private Long kfjsSum;
|
||||
//校企成果汇总
|
||||
private Long xqcgSum;
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaKey() {
|
||||
return areaKey;
|
||||
}
|
||||
|
||||
public void setAreaKey(String areaKey) {
|
||||
this.areaKey = areaKey;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getKyxmSum() {
|
||||
return kyxmSum;
|
||||
}
|
||||
|
||||
public void setKyxmSum(Long kyxmSum) {
|
||||
this.kyxmSum = kyxmSum;
|
||||
}
|
||||
|
||||
public Long getCkrwSum() {
|
||||
return ckrwSum;
|
||||
}
|
||||
|
||||
public void setCkrwSum(Long ckrwSum) {
|
||||
this.ckrwSum = ckrwSum;
|
||||
}
|
||||
|
||||
public Long getKfjsSum() {
|
||||
return kfjsSum;
|
||||
}
|
||||
|
||||
public void setKfjsSum(Long kfjsSum) {
|
||||
this.kfjsSum = kfjsSum;
|
||||
}
|
||||
|
||||
public Long getXqcgSum() {
|
||||
return xqcgSum;
|
||||
}
|
||||
|
||||
public void setXqcgSum(Long xqcgSum) {
|
||||
this.xqcgSum = xqcgSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AreasTjVo {
|
||||
private Long areaSum;
|
||||
private List<KeyValueVo> areaDetails;
|
||||
|
||||
public Long getAreaSum() {
|
||||
return areaSum;
|
||||
}
|
||||
|
||||
public void setAreaSum(Long areaSum) {
|
||||
this.areaSum = areaSum;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getAreaDetails() {
|
||||
return areaDetails;
|
||||
}
|
||||
|
||||
public void setAreaDetails(List<KeyValueVo> areaDetails) {
|
||||
this.areaDetails = areaDetails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class ExpertTotallVo {
|
||||
//专家名称
|
||||
private String name;
|
||||
//任务审核数
|
||||
private Long taskAuditSum;
|
||||
//竞赛审核数
|
||||
private Long competitionAuditSum;
|
||||
//总数
|
||||
private Long total;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getTaskAuditSum() {
|
||||
return taskAuditSum;
|
||||
}
|
||||
|
||||
public void setTaskAuditSum(Long taskAuditSum) {
|
||||
this.taskAuditSum = taskAuditSum;
|
||||
}
|
||||
|
||||
public Long getCompetitionAuditSum() {
|
||||
return competitionAuditSum;
|
||||
}
|
||||
|
||||
public void setCompetitionAuditSum(Long competitionAuditSum) {
|
||||
this.competitionAuditSum = competitionAuditSum;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class KeyValueVo {
|
||||
private String key;
|
||||
private String name;
|
||||
private String result;
|
||||
private Long value;
|
||||
private Long value2;
|
||||
private Long total;
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Long getValue2() {
|
||||
return value2;
|
||||
}
|
||||
|
||||
public void setValue2(Long value2) {
|
||||
this.value2 = value2;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Long getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Long value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MemoTotalVo {
|
||||
private Long id;
|
||||
private String subject;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "发布时间", hidden = true)
|
||||
private Date publishedAt;
|
||||
private Long viewedCount;
|
||||
private Long praisesCount;
|
||||
private Long repliesCount;
|
||||
private Long behavioreSum;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public Date getPublishedAt() {
|
||||
return publishedAt;
|
||||
}
|
||||
|
||||
public void setPublishedAt(Date publishedAt) {
|
||||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public Long getViewedCount() {
|
||||
return viewedCount;
|
||||
}
|
||||
|
||||
public void setViewedCount(Long viewedCount) {
|
||||
this.viewedCount = viewedCount;
|
||||
}
|
||||
|
||||
public Long getPraisesCount() {
|
||||
return praisesCount;
|
||||
}
|
||||
|
||||
public void setPraisesCount(Long praisesCount) {
|
||||
this.praisesCount = praisesCount;
|
||||
}
|
||||
|
||||
public Long getRepliesCount() {
|
||||
return repliesCount;
|
||||
}
|
||||
|
||||
public void setRepliesCount(Long repliesCount) {
|
||||
this.repliesCount = repliesCount;
|
||||
}
|
||||
|
||||
public Long getBehavioreSum() {
|
||||
return behavioreSum;
|
||||
}
|
||||
|
||||
public void setBehavioreSum(Long behavioreSum) {
|
||||
this.behavioreSum = behavioreSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 校企成果对象 school_enterprise_achievements
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public class SchoolEnterpriseAchievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(name = "成果领域1")
|
||||
private String field1;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(name = "成果标签")
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "校企成果的状态 1是通过,3是不通过")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "成果图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
private Integer achievementStatus;
|
||||
|
||||
public Integer getAchievementStatus() {
|
||||
return achievementStatus;
|
||||
}
|
||||
|
||||
public void setAchievementStatus(Integer achievementStatus) {
|
||||
this.achievementStatus = achievementStatus;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(String sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementName", getAchievementName())
|
||||
.append("field1", getField1())
|
||||
.append("field2", getField2())
|
||||
.append("field3", getField3())
|
||||
.append("achievementType", getAchievementType())
|
||||
.append("source", getSource())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("sourceLink", getSourceLink())
|
||||
.append("tags", getTags())
|
||||
.append("summary", getSummary())
|
||||
.append("publishingUnit", getPublishingUnit())
|
||||
.append("address", getAddress())
|
||||
.append("isFeatured", getIsFeatured())
|
||||
.append("contactPerson", getContactPerson())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("ownerName", getOwnerName())
|
||||
.append("status", getStatus())
|
||||
.append("details", getDetails())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("reviewComments", getReviewComments())
|
||||
.append("images", getImages())
|
||||
.append("attachments", getAttachments())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果团队Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementTeamMapper
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
|
||||
void deleteAchievementTeamByAId(@Param("aid") Long aid);
|
||||
}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
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.vo.KeyValVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementsMapper {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
@MapKey("k")
|
||||
@Master
|
||||
List<Map<String, String>> getFileInfoByIdents(@Param("idents") Set<String> idents);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> selectAchievementsByParam(AchQueryVo achQueryVo);
|
||||
|
||||
Long getAchievementClickSum(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> getaWatcher(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getFavorite(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
|
||||
|
||||
List<Map<String, String>> getHotAchievement();
|
||||
|
||||
Map<String, Long> indexProjectStatistic();
|
||||
|
||||
Map<String, Object> indexTaskStatistic();
|
||||
|
||||
Map<String, Long> indexCompetitionStatistic();
|
||||
|
||||
Long indexSchoolEnterpriseStatistic(@Param("s") String s, @Param("t") String tags);
|
||||
|
||||
List<KeyValueVo> getAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements, @Param("id") String id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(@Param("id") Long id, @Param("userId")Long userId);
|
||||
|
||||
Long countAchievementBySource(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<Map<String, Object>> getAchievementDataYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementType();
|
||||
|
||||
List<KeyValueVo> getAchievementActData();
|
||||
|
||||
List<Map<String, Object>> getAchievementDomain();
|
||||
|
||||
List<Map<String, Object>> getAchievementAddYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementHotRank();
|
||||
|
||||
List<Long> getAllId();
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(@Param("areaKey") String areaKey);
|
||||
|
||||
List<AchRelatedVo> getRelatedAch(@Param("id")Long id, @Param("sourceId") List<Long> sourceId, @Param("paramYear")String paramYear);
|
||||
|
||||
List<String> getDistinctYear(@Param("id")Long id, @Param("sourceId")List<Long> sourceId);
|
||||
|
||||
List<Long> selectAchievementsByName(@Param("achName") String achName);
|
||||
|
||||
String getField1NameByParam(@Param("source")String source, @Param("id") Long id);
|
||||
|
||||
List<KeyValueVo> getProjectAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
List<String> getExpertAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 校企成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface SchoolEnterpriseAchievementsMapper
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BigScreenStatisticService {
|
||||
|
||||
private final AchievementsMapper achievementsMapper;
|
||||
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
|
||||
|
||||
public Map<String, Object> getAchievementTopStatistic(String source) {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrYYYYMMDD(days[0], days[1]);
|
||||
Date[] lastDays = DateUtil.getDays(7, 13);
|
||||
long lastSum = Optional.ofNullable(achievementsMapper.countAchievementBySource(lastDays[0], lastDays[1], source)).orElse(0L);
|
||||
long sum = Optional.ofNullable(achievementsMapper.countAchievementBySource(null, null, source)).orElse(0L);
|
||||
long cSum = m.values().stream().mapToLong(Long::longValue).sum();
|
||||
double rate;
|
||||
if (lastSum == 0) rate = 100D;
|
||||
else {
|
||||
rate = (double) (cSum - lastSum) / lastSum;
|
||||
}
|
||||
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("list", res);
|
||||
map.put("sum", sum);
|
||||
map.put("rate", rate);
|
||||
return map;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDataYearly() {
|
||||
return achievementsMapper.getAchievementDataYearly();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementType() {
|
||||
return achievementsMapper.getAchievementType();
|
||||
}
|
||||
|
||||
public Map<String, List<KeyValueVo>> getAchievementActData() {
|
||||
List<KeyValueVo> list = achievementsMapper.getAchievementActData();
|
||||
Map<String, List<KeyValueVo>> res = list.stream().collect(Collectors.groupingBy(KeyValueVo::getKey));
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDomain() {
|
||||
return achievementsMapper.getAchievementDomain();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementAddYearly() {
|
||||
return achievementsMapper.getAchievementAddYearly();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementHotRank() {
|
||||
return achievementsMapper.getAchievementHotRank();
|
||||
}
|
||||
|
||||
public Map<String, Object> getCompetitionTopStatistic() {
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
Long finish = competitionResourceLibraryMapper.getCompetitionFinish();
|
||||
res.put("finish", finish);
|
||||
Long enroll = competitionResourceLibraryMapper.getCompetitionEnroll();
|
||||
res.put("enroll", enroll);
|
||||
Long underway = competitionResourceLibraryMapper.getCompetitionUnderway();
|
||||
res.put("underway", underway);
|
||||
Long submitCount = competitionResourceLibraryMapper.getCompetitionSubmitCount();
|
||||
res.put("submitCount", submitCount);
|
||||
Long transfer = competitionResourceLibraryMapper.getCompetitionTransferCount();
|
||||
res.put("transfer", transfer);
|
||||
Long needAudit = competitionResourceLibraryMapper.getCompetitionNeedAuditCount();
|
||||
res.put("needAudit", needAudit);
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getCompetitionStatisticYearly() {
|
||||
return competitionResourceLibraryMapper.getCompetitionStatisticYearly();
|
||||
}
|
||||
|
||||
public Object getCompetitionHot() {
|
||||
return competitionResourceLibraryMapper.getCompetitionHot();
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
|
||||
Date[] currentYear = DateUtil.getCurrentYear();
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
|
||||
Date[] currentYear = DateUtil.getCurrentYear();
|
||||
Date[] YearEndOfCur = DateUtil.getCurrentYearEndOf(LocalDate.now());
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(YearEndOfCur[0],YearEndOfCur[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.ExpertTotallVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ExpertDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
/**
|
||||
* 专家职称级分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getTitleRankStatistic() {
|
||||
return expertResourceLibraryMapper.getTitleRankStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家专业类别
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getExpertTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家学历分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getHighestDegreeStatistic() {
|
||||
return expertResourceLibraryMapper.getHighestDegreeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家单位类别分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getWorkplaceTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getWorkplaceTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专家总数
|
||||
* @return
|
||||
*/
|
||||
public Long getExpertTotal() {
|
||||
return expertResourceLibraryMapper.getExpertTotal();
|
||||
}
|
||||
/**
|
||||
* 专家实名完成度 userId users.authentication
|
||||
* @return
|
||||
*/
|
||||
public KeyValueVo getAuthenticationStatistic() {
|
||||
return expertResourceLibraryMapper.getAuthenticationStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度专家数据统计 cretate_on
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTotalByYear() {
|
||||
return expertResourceLibraryMapper.getExpertTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 热门专家领域
|
||||
* reviewAreaOne、reviewAreaTwo、reviewAreaThree
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getReviewAreasStatistic() {
|
||||
return expertResourceLibraryMapper.getReviewAreasStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年专家评审数
|
||||
* @return
|
||||
*/
|
||||
public List<ExpertTotallVo> getExpertAduit() {
|
||||
return expertResourceLibraryMapper.getExpertAduit();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
|
||||
/**
|
||||
* 成果团队Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public interface IAchievementTeamService
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public interface IAchievementsService {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
String buildFileInfoByIdents(String aStr, String source);
|
||||
|
||||
List<Achievements> selectAchievementsFrontList(Achievements achievements);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> getAllResult(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String, Object> getUerActionData();
|
||||
|
||||
List<Map<String, String>> getHotAchievement();
|
||||
|
||||
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String,Long> indexProjectStatistic();
|
||||
|
||||
Map<String,Object> indexTaskStatistic();
|
||||
|
||||
Map<String,Long> indexCompetitionStatistic();
|
||||
|
||||
Map<String,Long> indexSchoolEnterpriseStatistic();
|
||||
|
||||
Map<String,Long> indexExpertStatistic();
|
||||
|
||||
List<KeyValueVo> getAreasByName(String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(String id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(String areaKey);
|
||||
|
||||
List<AchRelatedResult> getRelatedAch(Long id, Long sourceId);
|
||||
|
||||
int getSearchResult(String achName, Long userId);
|
||||
|
||||
List<KeyValueVo> getProjectAreasByName(String areaName);
|
||||
|
||||
List<String> getExpertAreasByName(String areaName);
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
|
||||
/**
|
||||
* 校企成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MemoDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper memoResourceLibraryMapper;
|
||||
/**
|
||||
* 审核通过率
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoAduit() {
|
||||
return memoResourceLibraryMapper.getMemoAduit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 原创、非原创
|
||||
* @return
|
||||
*/
|
||||
public KeyValueVo getIsOriginalStatistic() {
|
||||
return memoResourceLibraryMapper.getIsOriginalStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度动态数据统计
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoTotalByYear() {
|
||||
return memoResourceLibraryMapper.getMemoTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据帖子类型汇总
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getForumSectionStatistic() {
|
||||
return memoResourceLibraryMapper.getForumSectionStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年新增帖子数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getAddMemoStatistic() {
|
||||
return memoResourceLibraryMapper.getAddMemoStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 本年帖子热度top5(论坛评论、点击、点赞)
|
||||
* @return
|
||||
*/
|
||||
public List<MemoTotalVo> getTop5Memos() {
|
||||
return memoResourceLibraryMapper.getTop5Memos();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近7日帖子点赞数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValVo<String, Long>> get7DayPaise() {
|
||||
Date[] days = DateUtil.getDays(1, 7);
|
||||
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
|
||||
/**
|
||||
* 成果团队Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Service
|
||||
public class AchievementTeamServiceImpl implements IAchievementTeamService
|
||||
{
|
||||
@Autowired
|
||||
private AchievementTeamMapper achievementTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public AchievementTeam selectAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamList(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setCreateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.insertAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.updateAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamByIds(Long[] ids)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,469 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
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.Searcher;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
|
||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||
|
||||
/**
|
||||
* 成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Service
|
||||
public class AchievementsServiceImpl implements IAchievementsService {
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskResourceLibraryMapper taskResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
|
||||
@Value("${markerSpaceUrl}")
|
||||
public String markerSpaceUrl;
|
||||
|
||||
@Value("${http.gitLinkUrl}")
|
||||
public String gitLinkUrl;
|
||||
|
||||
@Value("${http.gatewayUrl}")
|
||||
public String gatewayUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public Achievements selectAchievementsById(Long id) {
|
||||
Achievements a = achievementsMapper.selectAchievementsById(id);
|
||||
if(StringUtils.isNotNull(a)){
|
||||
String gender = a.getGender();
|
||||
String img = "images/avatars/User/boy.jpg";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
if(StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
a.setUserImg(img);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "images/avatars/User/boy.jpg";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
//根据id获取领域名称
|
||||
if(StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsFrontList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
a.setDetails(null);
|
||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievements(Achievements achievements) {
|
||||
achievements.setCreateTime(DateUtils.getNowDate());
|
||||
achievements.setCreateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.insertAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievements(Achievements achievements) {
|
||||
achievements.setUpdateTime(DateUtils.getNowDate());
|
||||
achievements.setUpdateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.updateAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsByIds(Long[] ids) {
|
||||
return achievementsMapper.deleteAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsById(Long id) {
|
||||
return achievementsMapper.deleteAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String buildFileInfoByIdents(String aStr, String source) {
|
||||
if (StringUtils.isEmpty(aStr) || StringUtils.isEmpty(source)) {
|
||||
return aStr;
|
||||
}
|
||||
|
||||
List<Map<String,String>> list = JSON.parseObject(aStr,new TypeReference<List<Map<String,String>>>() {});
|
||||
|
||||
if (Objects.equals(source, "1") || Objects.equals(source, "3")) {
|
||||
concatUrl(list,gitLinkUrl);
|
||||
}
|
||||
|
||||
if (Objects.equals(source, "2")) {
|
||||
concatUrl(list,markerSpaceUrl);
|
||||
}
|
||||
|
||||
if (Objects.equals(source, "4")) {
|
||||
concatUrl(list,gatewayUrl);
|
||||
}
|
||||
|
||||
return JSON.toJSONString(list);
|
||||
}
|
||||
|
||||
private void concatUrl(List<Map<String, String>> list, String url) {
|
||||
for (Map<String,String> map : list) {
|
||||
String v = map.getOrDefault("v", "");
|
||||
String urlPath = getUrlPath(v);
|
||||
map.put("v", url + urlPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> getChoiceImport() {
|
||||
return achievementsMapper.getChoiceImport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjBySources() {
|
||||
return achievementsMapper.getTjBySources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjByAreas() {
|
||||
return achievementsMapper.getTjByAreas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Achievements> getAllResult(AchQueryVo achQueryVo) {
|
||||
//根据查询条件获取所有的成果数据
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsByParam(achQueryVo);
|
||||
//遍历成果数据,获取对应成果的点击数
|
||||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "images/avatars/User/boy.jpg";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
//根据id获取领域名称
|
||||
if(StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
Long clickSum = achievementsMapper.getAchievementClickSum(a.getId());
|
||||
a.setClickSum(clickSum);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUerActionData() {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getaWatcher(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
Map<String, Long> g = achievementsMapper.getFavorite(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> wRes = new ArrayList<>();
|
||||
List<KeyValVo<String, Long>> gRes = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
Long b = g.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
KeyValVo<String, Long> k2 = new KeyValVo<>();
|
||||
k2.setK(s);
|
||||
k2.setV(b);
|
||||
|
||||
wRes.add(k1);
|
||||
gRes.add(k2);
|
||||
}
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
res.put("watcher", wRes);
|
||||
res.put("favorite", gRes);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getHotAchievement() {
|
||||
return achievementsMapper.getHotAchievement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo) {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getAchievement(days[0], days[1], achQueryVo.getSource())
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexProjectStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexProjectStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> indexTaskStatistic() {
|
||||
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
|
||||
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount();
|
||||
res.put("convertedTaskAmount", convertedTaskAmount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexCompetitionStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexCompetitionStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexSchoolEnterpriseStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long schoolEnterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "");
|
||||
res.put("schoolEnterpriseCount", schoolEnterpriseCount);
|
||||
Long schoolCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "1");
|
||||
res.put("schoolCount", schoolCount);
|
||||
Long enterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "2");
|
||||
res.put("enterpriseCount", enterpriseCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("Achievements");
|
||||
long clickCount = taskResourceLibraryMapper.countClicker(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexExpertStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long expertResourceCount = expertResourceLibraryMapper.expertResourceCount();
|
||||
res.put("expertResourceCount", expertResourceCount);
|
||||
Long auditTaskAuditExpertCount = expertResourceLibraryMapper.auditTaskAuditExpertCount();
|
||||
res.put("auditTaskAuditExpertCount", auditTaskAuditExpertCount);
|
||||
Long auditCompetitionAuditExpertCount = expertResourceLibraryMapper.auditCompetitionAuditExpertCount();
|
||||
res.put("auditCompetitionAuditExpertCount", auditCompetitionAuditExpertCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("Experts");
|
||||
long clickCount = taskResourceLibraryMapper.countClickerSimple(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getAreasByName(String areaName) {
|
||||
return achievementsMapper.getAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getActDataStatisticById(Long id) {
|
||||
return achievementsMapper.getActDataStatisticById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7AddClickById(String id) {
|
||||
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], "Achievements", id)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return achievementsMapper.getWatchFavoriteStatusById(id, userId);
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "${cron.calculateHotRank}")
|
||||
public void timingCalcHotRank() {
|
||||
List<Long> ids = achievementsMapper.getAllId();
|
||||
for (Long id : ids) {
|
||||
AchievementImageVo image = behaviorImageService.getAchievementImageById(id);
|
||||
float score = image.getScore();
|
||||
Achievements u = new Achievements();
|
||||
u.setId(id);
|
||||
u.setHotRank(score);
|
||||
achievementsMapper.updateAchievements(u);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaStatisticVo> getAreaStatistic(String areaKey) {
|
||||
return achievementsMapper.getAreaStatistic(areaKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AchRelatedResult> getRelatedAch(Long id, Long sourceId) {
|
||||
List<AchRelatedResult> relatedResultList = new ArrayList<>();
|
||||
//想根据开源项目id,获取对应的年度信息
|
||||
List<Long> allSourceId = achievementsMapper.getAllSourceId(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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据查询内容,调用搜索行为接口
|
||||
*
|
||||
* @param achName
|
||||
* @param userId
|
||||
*/
|
||||
@Override
|
||||
public int getSearchResult(String achName, Long userId) {
|
||||
int num = 0;
|
||||
if (StringUtils.isEmpty(achName)) {
|
||||
return num;
|
||||
}
|
||||
List<Long> idList = achievementsMapper.selectAchievementsByName(achName);
|
||||
if (StringUtils.isNotNull(idList)) {
|
||||
for (Long searchId : idList) {
|
||||
Searcher e = new Searcher();
|
||||
e.setCreatedAt(DateUtils.getNowDate());
|
||||
e.setUserId(userId);
|
||||
e.setSearchId(searchId);
|
||||
e.setExtInfo(achName);
|
||||
e.setSearchType("Achievements");
|
||||
num = taskResourceLibraryMapper.insertSearcher(e);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getProjectAreasByName(String areaName) {
|
||||
return achievementsMapper.getProjectAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getExpertAreasByName(String areaName) {
|
||||
return achievementsMapper.getExpertAreasByName(areaName);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import com.microservices.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
|
||||
/**
|
||||
* 校企成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
@Autowired
|
||||
private SchoolEnterpriseAchievementsMapper schoolEnterpriseAchievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private AchievementTeamMapper achievementTeamMapper;
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// if (loginUser != null){
|
||||
// String username = loginUser.getUsername();
|
||||
// schoolEnterpriseAchievements.setCreateBy(username);
|
||||
// }
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
for (SchoolEnterpriseAchievements a : list) {
|
||||
a.setImages(achievementsService.buildFileInfoByIdents(a.getImages(), "4"));
|
||||
a.setAttachments(achievementsService.buildFileInfoByIdents(a.getAttachments(), "4"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
String username = loginUser.getUsername();
|
||||
schoolEnterpriseAchievements.setCreateBy(username);
|
||||
}
|
||||
schoolEnterpriseAchievements.setCreateTime(DateUtils.getNowDate());
|
||||
schoolEnterpriseAchievementsMapper.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
return schoolEnterpriseAchievements.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
schoolEnterpriseAchievements.setUpdateTime(DateUtils.getNowDate());
|
||||
return schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
// 校企成果删除前判断数据仓库是否存在数据,存在则不允许删除该数据
|
||||
Achievements achievements = new Achievements();
|
||||
achievements.setSource("4");
|
||||
achievements.setSourceId(id);
|
||||
List<Achievements> ss = achievementsMapper.selectAchievementsList(achievements);
|
||||
if (ss != null && !ss.isEmpty()) {
|
||||
throw new ServiceException("数据仓库是否存在数据,不允许删除");
|
||||
}
|
||||
|
||||
// 校企成果被删除,对应的成员也应该一并删除
|
||||
achievementTeamMapper.deleteAchievementTeamByAId(id);
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
|
||||
return schoolEnterpriseAchievementsMapper.topStatistic(schoolEnterpriseAchievements);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package com.microservices.dms.behaviorImage.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* 成果画像Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/behaviorImage")
|
||||
@Api(tags = "数据管理体系-画像接口")
|
||||
public class BehaviorImageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
/**
|
||||
* 根据成果ID,获取对应的成果画像
|
||||
*/
|
||||
//@RequiresPermissions("dms:achievements:query")
|
||||
@ApiOperation(value = "根据成果ID,获取对应的成果画像")
|
||||
@GetMapping(value = "/achievementImage")
|
||||
public AjaxResult getAchievementImageById(Long id)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getAchievementImageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
startPage();
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出画像行为权重列表
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
ExcelUtil<BehaviorImageWeight> util = new ExcelUtil<BehaviorImageWeight>(BehaviorImageWeight.class);
|
||||
util.exportExcel(response, list, "画像行为权重数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画像行为权重详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(behaviorImageService.selectBehaviorImageWeightById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.insertBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.updateBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(behaviorImageService.deleteBehaviorImageWeightByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃用户数据
|
||||
*/
|
||||
@GetMapping(value = "/activityList")
|
||||
@ApiOperation("获取用户资源库数据")
|
||||
public TableDataInfo activityList(ActivityUserLibrary activityUserLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 根据用户ID,获取用户对应的成果汇总
|
||||
*/
|
||||
@GetMapping(value = "/getUserTypeStatistic")
|
||||
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserTypeStatistic(userId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(value = "/getUserProjectStatistic")
|
||||
@ApiOperation("/获取用户开源项目相关数据")
|
||||
public AjaxResult getUserProjectStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserProjectStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserTaskStatistic")
|
||||
@ApiOperation("/获取用户创客任务相关数据")
|
||||
public AjaxResult getUserTaskStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserTaskStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserCompStatistic")
|
||||
@ApiOperation("/获取用户开放竞赛相关数据")
|
||||
public AjaxResult getUserCompStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserCompStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserMemoStatistic")
|
||||
@ApiOperation("/获取用户论坛交流相关数据")
|
||||
public AjaxResult getUserMemoStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserMemoStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserExpertStatistic")
|
||||
@ApiOperation("/获取用户专家资源相关数据")
|
||||
public AjaxResult getUserExpertStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserExpertStatistic(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃用户相关统计数据
|
||||
*/
|
||||
@GetMapping(value = "/getActivityStatistic")
|
||||
@ApiOperation("获取用户资源库相关统计数据")
|
||||
public AjaxResult getActivityStatistic()
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getActivityStatistic());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class AchievementBehaviorSumVo {
|
||||
//点击量(浏览量)
|
||||
private Long clickSum;
|
||||
//关注量
|
||||
private Long watchSum;
|
||||
//查询量
|
||||
private Long searchSum;
|
||||
//收藏量
|
||||
private Long favoriteSum;
|
||||
//下载量
|
||||
private Long downloadSum;
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
public Long getWatchSum() {
|
||||
return watchSum;
|
||||
}
|
||||
|
||||
public void setWatchSum(Long watchSum) {
|
||||
this.watchSum = watchSum;
|
||||
}
|
||||
|
||||
public Long getSearchSum() {
|
||||
return searchSum;
|
||||
}
|
||||
|
||||
public void setSearchSum(Long searchSum) {
|
||||
this.searchSum = searchSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Long getDownloadSum() {
|
||||
return downloadSum;
|
||||
}
|
||||
|
||||
public void setDownloadSum(Long downloadSum) {
|
||||
this.downloadSum = downloadSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
/**
|
||||
* 成果画像结果
|
||||
*/
|
||||
public class AchievementImageVo {
|
||||
private Long id;
|
||||
private float score;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public float getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(float score) {
|
||||
this.score = score;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
public class ActivityUserLibrary extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
//用户id
|
||||
private Long userId;
|
||||
//登录名称
|
||||
private String loginName;
|
||||
//用户名称
|
||||
private String userName;
|
||||
//是否是专家
|
||||
private String isExpert;
|
||||
//是否已实名
|
||||
private String isAuth;
|
||||
//关注领域
|
||||
private String areasStr;
|
||||
//相关项目数
|
||||
private Long relatedProject;
|
||||
//相关任务数
|
||||
private Long relatedTask;
|
||||
//相关竞赛数
|
||||
private Long relatedCompetition;
|
||||
//相关成果数
|
||||
private Long relatedAch;
|
||||
//相关专家
|
||||
private Long relatedExpert;
|
||||
//相关论坛
|
||||
private Long relatedMemo;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getIsExpert() {
|
||||
return isExpert;
|
||||
}
|
||||
|
||||
public void setIsExpert(String isExpert) {
|
||||
this.isExpert = isExpert;
|
||||
}
|
||||
|
||||
public String getIsAuth() {
|
||||
return isAuth;
|
||||
}
|
||||
|
||||
public void setIsAuth(String isAuth) {
|
||||
this.isAuth = isAuth;
|
||||
}
|
||||
|
||||
public String getAreasStr() {
|
||||
return areasStr;
|
||||
}
|
||||
|
||||
public void setAreasStr(String areasStr) {
|
||||
this.areasStr = areasStr;
|
||||
}
|
||||
|
||||
public Long getRelatedProject() {
|
||||
return relatedProject;
|
||||
}
|
||||
|
||||
public void setRelatedProject(Long relatedProject) {
|
||||
this.relatedProject = relatedProject;
|
||||
}
|
||||
|
||||
public Long getRelatedTask() {
|
||||
return relatedTask;
|
||||
}
|
||||
|
||||
public void setRelatedTask(Long relatedTask) {
|
||||
this.relatedTask = relatedTask;
|
||||
}
|
||||
|
||||
public Long getRelatedCompetition() {
|
||||
return relatedCompetition;
|
||||
}
|
||||
|
||||
public void setRelatedCompetition(Long relatedCompetition) {
|
||||
this.relatedCompetition = relatedCompetition;
|
||||
}
|
||||
|
||||
public Long getRelatedAch() {
|
||||
return relatedAch;
|
||||
}
|
||||
|
||||
public void setRelatedAch(Long relatedAch) {
|
||||
this.relatedAch = relatedAch;
|
||||
}
|
||||
|
||||
public Long getRelatedExpert() {
|
||||
return relatedExpert;
|
||||
}
|
||||
|
||||
public void setRelatedExpert(Long relatedExpert) {
|
||||
this.relatedExpert = relatedExpert;
|
||||
}
|
||||
|
||||
public Long getRelatedMemo() {
|
||||
return relatedMemo;
|
||||
}
|
||||
|
||||
public void setRelatedMemo(Long relatedMemo) {
|
||||
this.relatedMemo = relatedMemo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class BehaviorContant {
|
||||
/**
|
||||
* 成果画像
|
||||
*/
|
||||
public final static String ACHIEVEMENTS_IMAGE = "Achievements";
|
||||
|
||||
/**
|
||||
* 点击行为
|
||||
*/
|
||||
public final static String CLICK_BEHAVIOR = "click";
|
||||
/**
|
||||
* 收藏行为
|
||||
*/
|
||||
public final static String FAVORITE_BEHAVIOR = "favorite";
|
||||
/**
|
||||
* 搜索行为
|
||||
*/
|
||||
public final static String SEARCH_BEHAVIOR = "search";
|
||||
/**
|
||||
* 关注行为
|
||||
*/
|
||||
public final static String WATCH_BEHAVIOR = "watch";
|
||||
/**
|
||||
* 附件下载行为
|
||||
*/
|
||||
public final static String FILE_DOWNLOAD_BEHAVIOR = "file_download";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 画像行为权重对象 behavior_image_weight
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class BehaviorImageWeight extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 行为编码 */
|
||||
@Excel(name = "行为编码")
|
||||
private String behaviorCode;
|
||||
|
||||
/** 画像分类 */
|
||||
@Excel(name = "画像分类")
|
||||
private String imageType;
|
||||
|
||||
/** 行为名称 */
|
||||
@Excel(name = "行为名称")
|
||||
private String behaviorName;
|
||||
|
||||
/** 行为权重 */
|
||||
@Excel(name = "行为权重")
|
||||
private String behaviorWeight;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setBehaviorCode(String behaviorCode)
|
||||
{
|
||||
this.behaviorCode = behaviorCode;
|
||||
}
|
||||
|
||||
public String getBehaviorCode()
|
||||
{
|
||||
return behaviorCode;
|
||||
}
|
||||
public void setImageType(String imageType)
|
||||
{
|
||||
this.imageType = imageType;
|
||||
}
|
||||
|
||||
public String getImageType()
|
||||
{
|
||||
return imageType;
|
||||
}
|
||||
public void setBehaviorName(String behaviorName)
|
||||
{
|
||||
this.behaviorName = behaviorName;
|
||||
}
|
||||
|
||||
public String getBehaviorName()
|
||||
{
|
||||
return behaviorName;
|
||||
}
|
||||
public void setBehaviorWeight(String behaviorWeight)
|
||||
{
|
||||
this.behaviorWeight = behaviorWeight;
|
||||
}
|
||||
|
||||
public String getBehaviorWeight()
|
||||
{
|
||||
return behaviorWeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("behaviorCode", getBehaviorCode())
|
||||
.append("imageType", getImageType())
|
||||
.append("behaviorName", getBehaviorName())
|
||||
.append("behaviorWeight", getBehaviorWeight())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserCompetitionTotalVo {
|
||||
//创建竞赛数
|
||||
private Long joinCompetitionCount;
|
||||
//关注竞赛数
|
||||
private Long watchCompetitionCount;
|
||||
//报名数
|
||||
private Long signUpCount;
|
||||
//提交作品数
|
||||
private Long submitWorkCount;
|
||||
|
||||
|
||||
public Long getJoinCompetitionCount() {
|
||||
return joinCompetitionCount;
|
||||
}
|
||||
|
||||
public void setJoinCompetitionCount(Long joinCompetitionCount) {
|
||||
this.joinCompetitionCount = joinCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getWatchCompetitionCount() {
|
||||
return watchCompetitionCount;
|
||||
}
|
||||
|
||||
public void setWatchCompetitionCount(Long watchCompetitionCount) {
|
||||
this.watchCompetitionCount = watchCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getSignUpCount() {
|
||||
return signUpCount;
|
||||
}
|
||||
|
||||
public void setSignUpCount(Long signUpCount) {
|
||||
this.signUpCount = signUpCount;
|
||||
}
|
||||
|
||||
public Long getSubmitWorkCount() {
|
||||
return submitWorkCount;
|
||||
}
|
||||
|
||||
public void setSubmitWorkCount(Long submitWorkCount) {
|
||||
this.submitWorkCount = submitWorkCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserExpertTotalVo {
|
||||
//关注专家数
|
||||
private Long watchExpertCount;
|
||||
//收藏专家数
|
||||
private Long favoriteExpertCount;
|
||||
//评审竞赛数
|
||||
private Long aduitCompetitionCount;
|
||||
//评审任务数
|
||||
private Long aduitTaskCount;
|
||||
|
||||
public Long getWatchExpertCount() {
|
||||
return watchExpertCount;
|
||||
}
|
||||
|
||||
public void setWatchExpertCount(Long watchExpertCount) {
|
||||
this.watchExpertCount = watchExpertCount;
|
||||
}
|
||||
|
||||
public Long getFavoriteExpertCount() {
|
||||
return favoriteExpertCount;
|
||||
}
|
||||
|
||||
public void setFavoriteExpertCount(Long favoriteExpertCount) {
|
||||
this.favoriteExpertCount = favoriteExpertCount;
|
||||
}
|
||||
|
||||
public Long getAduitCompetitionCount() {
|
||||
return aduitCompetitionCount;
|
||||
}
|
||||
|
||||
public void setAduitCompetitionCount(Long aduitCompetitionCount) {
|
||||
this.aduitCompetitionCount = aduitCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getAduitTaskCount() {
|
||||
return aduitTaskCount;
|
||||
}
|
||||
|
||||
public void setAduitTaskCount(Long aduitTaskCount) {
|
||||
this.aduitTaskCount = aduitTaskCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserMemoTotalVo {
|
||||
// private Long managerMemoCount;
|
||||
//参与帖子
|
||||
private Long joinMemoCount;
|
||||
//创建帖子
|
||||
private Long createMemoCount;
|
||||
//回复帖子
|
||||
private Long replayMemoCount;
|
||||
//关注帖子
|
||||
private Long watchMemoCount;
|
||||
|
||||
public Long getJoinMemoCount() {
|
||||
return joinMemoCount;
|
||||
}
|
||||
|
||||
public void setJoinMemoCount(Long joinMemoCount) {
|
||||
this.joinMemoCount = joinMemoCount;
|
||||
}
|
||||
|
||||
public Long getCreateMemoCount() {
|
||||
return createMemoCount;
|
||||
}
|
||||
|
||||
public void setCreateMemoCount(Long createMemoCount) {
|
||||
this.createMemoCount = createMemoCount;
|
||||
}
|
||||
|
||||
public Long getReplayMemoCount() {
|
||||
return replayMemoCount;
|
||||
}
|
||||
|
||||
public void setReplayMemoCount(Long replayMemoCount) {
|
||||
this.replayMemoCount = replayMemoCount;
|
||||
}
|
||||
|
||||
public Long getWatchMemoCount() {
|
||||
return watchMemoCount;
|
||||
}
|
||||
|
||||
public void setWatchMemoCount(Long watchMemoCount) {
|
||||
this.watchMemoCount = watchMemoCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserProjectTotalVo {
|
||||
//创建项目数
|
||||
private Long createProjectCount;
|
||||
//参与项目数
|
||||
private Long joinProjectCount;
|
||||
//fork项目数
|
||||
private Long forkProjectCount;
|
||||
//点赞项目数
|
||||
private Long praiseProjectCount;
|
||||
//关注项目数
|
||||
private Long watchProjectCount;
|
||||
//提交代码数
|
||||
private Long commitSum;
|
||||
//issue相关数
|
||||
private Long issueSum;
|
||||
//合并代码数
|
||||
private Long prSum;
|
||||
|
||||
public Long getCreateProjectCount() {
|
||||
return createProjectCount;
|
||||
}
|
||||
|
||||
public void setCreateProjectCount(Long createProjectCount) {
|
||||
this.createProjectCount = createProjectCount;
|
||||
}
|
||||
|
||||
public Long getJoinProjectCount() {
|
||||
return joinProjectCount;
|
||||
}
|
||||
|
||||
public void setJoinProjectCount(Long joinProjectCount) {
|
||||
this.joinProjectCount = joinProjectCount;
|
||||
}
|
||||
|
||||
public Long getForkProjectCount() {
|
||||
return forkProjectCount;
|
||||
}
|
||||
|
||||
public void setForkProjectCount(Long forkProjectCount) {
|
||||
this.forkProjectCount = forkProjectCount;
|
||||
}
|
||||
|
||||
public Long getPraiseProjectCount() {
|
||||
return praiseProjectCount;
|
||||
}
|
||||
|
||||
public void setPraiseProjectCount(Long praiseProjectCount) {
|
||||
this.praiseProjectCount = praiseProjectCount;
|
||||
}
|
||||
|
||||
public Long getWatchProjectCount() {
|
||||
return watchProjectCount;
|
||||
}
|
||||
|
||||
public void setWatchProjectCount(Long watchProjectCount) {
|
||||
this.watchProjectCount = watchProjectCount;
|
||||
}
|
||||
|
||||
public Long getCommitSum() {
|
||||
return commitSum;
|
||||
}
|
||||
|
||||
public void setCommitSum(Long commitSum) {
|
||||
this.commitSum = commitSum;
|
||||
}
|
||||
|
||||
public Long getIssueSum() {
|
||||
return issueSum;
|
||||
}
|
||||
|
||||
public void setIssueSum(Long issueSum) {
|
||||
this.issueSum = issueSum;
|
||||
}
|
||||
|
||||
public Long getPrSum() {
|
||||
return prSum;
|
||||
}
|
||||
|
||||
public void setPrSum(Long prSum) {
|
||||
this.prSum = prSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserTaskTotalVo {
|
||||
//创建任务数
|
||||
private Long createTaskCount;
|
||||
//任务交稿数
|
||||
private Long submitPapersCount;
|
||||
//关注任务数
|
||||
private Long watchTaskCount;
|
||||
//参加任务数
|
||||
private Long joinTaskCount;
|
||||
|
||||
|
||||
public Long getCreateTaskCount() {
|
||||
return createTaskCount;
|
||||
}
|
||||
|
||||
public void setCreateTaskCount(Long createTaskCount) {
|
||||
this.createTaskCount = createTaskCount;
|
||||
}
|
||||
|
||||
public Long getSubmitPapersCount() {
|
||||
return submitPapersCount;
|
||||
}
|
||||
|
||||
public void setSubmitPapersCount(Long submitPapersCount) {
|
||||
this.submitPapersCount = submitPapersCount;
|
||||
}
|
||||
|
||||
public Long getWatchTaskCount() {
|
||||
return watchTaskCount;
|
||||
}
|
||||
|
||||
public void setWatchTaskCount(Long watchTaskCount) {
|
||||
this.watchTaskCount = watchTaskCount;
|
||||
}
|
||||
|
||||
public Long getJoinTaskCount() {
|
||||
return joinTaskCount;
|
||||
}
|
||||
|
||||
public void setJoinTaskCount(Long joinTaskCount) {
|
||||
this.joinTaskCount = joinTaskCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserTypeTotalVo {
|
||||
private String resultType;
|
||||
private Long watchSum;
|
||||
private Long favoriteSum;
|
||||
private Long downloadSum;
|
||||
private Long clickSum;
|
||||
private Long searchSum;
|
||||
private Long praiseSum;
|
||||
|
||||
public String getResultType() {
|
||||
return resultType;
|
||||
}
|
||||
|
||||
public void setResultType(String resultType) {
|
||||
this.resultType = resultType;
|
||||
}
|
||||
|
||||
public Long getWatchSum() {
|
||||
return watchSum;
|
||||
}
|
||||
|
||||
public void setWatchSum(Long watchSum) {
|
||||
this.watchSum = watchSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Long getDownloadSum() {
|
||||
return downloadSum;
|
||||
}
|
||||
|
||||
public void setDownloadSum(Long downloadSum) {
|
||||
this.downloadSum = downloadSum;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
public Long getSearchSum() {
|
||||
return searchSum;
|
||||
}
|
||||
|
||||
public void setSearchSum(Long searchSum) {
|
||||
this.searchSum = searchSum;
|
||||
}
|
||||
|
||||
public Long getPraiseSum() {
|
||||
return praiseSum;
|
||||
}
|
||||
|
||||
public void setPraiseSum(Long praiseSum) {
|
||||
this.praiseSum = praiseSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.microservices.dms.behaviorImage.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.domain.UserTypeTotalVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface BehaviorImageMapper {
|
||||
AchievementBehaviorSumVo getBehaviorSumListByType();
|
||||
|
||||
List<KeyValueVo> getWeightListByType(@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFavoriteSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getSearchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getWatchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFileDownloadSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getClickSumByAchievementId(@Param("id") Long id, @Param("achievementsImage") String achievementsImage);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
|
||||
List<KeyValueVo> getUserProjecttatistic(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserTaskStatistic(@Param("userId")Long userId);
|
||||
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
Long getrelatedProjectCount(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedTaskCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserCompStatistic(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedCompetitionCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserMemoStatistic(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedMemoCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserExperttatistic(@Param("userId")Long userId);
|
||||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.microservices.dms.behaviorImage.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBehaviorImageService {
|
||||
AchievementImageVo getAchievementImageById(Long id);
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活跃用户资源库列表
|
||||
*
|
||||
* @param activityUserLibrary 活跃用户资源库
|
||||
* @return 活跃用户资源库集合
|
||||
*/
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(Long userId);
|
||||
|
||||
UserProjectTotalVo getUserProjectStatistic(Long userId);
|
||||
|
||||
UserTaskTotalVo getUserTaskStatistic(Long userId);
|
||||
|
||||
UserCompetitionTotalVo getUserCompStatistic(Long userId);
|
||||
|
||||
UserMemoTotalVo getUserMemoStatistic(Long userId);
|
||||
|
||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
package com.microservices.dms.behaviorImage.service.impl;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
import com.microservices.dms.behaviorImage.mapper.BehaviorImageMapper;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
||||
@Autowired
|
||||
private BehaviorImageMapper behaviorImageMapper;
|
||||
@Override
|
||||
public AchievementImageVo getAchievementImageById(Long id) {
|
||||
AchievementImageVo achievementImageVo = new AchievementImageVo();
|
||||
//获取所有行为汇总数据
|
||||
AchievementBehaviorSumVo achievementBehaviorSumVo = behaviorImageMapper.getBehaviorSumListByType();
|
||||
if(StringUtils.isNotNull(achievementBehaviorSumVo)) {
|
||||
float score = 0f;
|
||||
//从行为表中获取成果行为数据权限
|
||||
List<KeyValueVo> behaviorImageWeightList = behaviorImageMapper.getWeightListByType(BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
float clickResult = 0L;
|
||||
float watchResult = 0L;
|
||||
float searchResult = 0L;
|
||||
float favoriteResult = 0L;
|
||||
float fileDownloadResult = 0L;
|
||||
//简单算法
|
||||
for (KeyValueVo keyValueVo : behaviorImageWeightList) {
|
||||
String bhavior = keyValueVo.getKey();
|
||||
Long weight = keyValueVo.getValue();
|
||||
if (bhavior.equals(BehaviorContant.CLICK_BEHAVIOR)) {//点击
|
||||
//根据当前成果ID,获取成果点击行为数量
|
||||
Long clickSum = achievementBehaviorSumVo.getClickSum();
|
||||
if(StringUtils.isNotNull(clickSum) && clickSum > 0) {
|
||||
Long click = behaviorImageMapper.getClickSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(click)) {
|
||||
clickResult = click * weight / clickSum ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FAVORITE_BEHAVIOR)) {//收藏
|
||||
//根据当前成果ID,获取成果收藏行为数量
|
||||
Long favoriteSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(favoriteSum) && favoriteSum > 0) {
|
||||
Long favorite = behaviorImageMapper.getFavoriteSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(favorite)) {
|
||||
favoriteResult = favorite *weight / favoriteSum ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.SEARCH_BEHAVIOR)) {//搜索
|
||||
//根据当前成果ID,获取成果搜索行为数量
|
||||
Long searchSum = achievementBehaviorSumVo.getSearchSum();
|
||||
if(StringUtils.isNotNull(searchSum) && searchSum > 0) {
|
||||
Long search = behaviorImageMapper.getSearchSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(search)) {
|
||||
searchResult = search *weight / searchSum;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.WATCH_BEHAVIOR)) {//关注
|
||||
//根据当前成果ID,获取成果关注行为数量
|
||||
Long watchSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull( watchSum) && watchSum > 0) {
|
||||
Long watch = behaviorImageMapper.getWatchSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull( watch) ) {
|
||||
watchResult = watch *weight / watchSum;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FILE_DOWNLOAD_BEHAVIOR)) {//文件下载
|
||||
//根据当前成果ID,获取成果文件下载行为数量
|
||||
Long fileDownloadSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(fileDownloadSum) && fileDownloadSum > 0) {
|
||||
Long fileDownload = behaviorImageMapper.getFileDownloadSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(fileDownload)) {
|
||||
fileDownloadResult = fileDownload *weight / fileDownloadSum ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
score = clickResult+watchResult+searchResult+favoriteResult+fileDownloadResult;
|
||||
achievementImageVo.setScore(score);
|
||||
}
|
||||
return achievementImageVo;
|
||||
}
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setCreateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.insertBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setUpdateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.updateBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户新增分类数据统计
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<UserTypeTotalVo> getUserTypeStatistic(Long userId) {
|
||||
return behaviorImageMapper.getUserTypeStatistic(userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取开源项目相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserProjectTotalVo getUserProjectStatistic(Long userId) {
|
||||
UserProjectTotalVo userProjectTotalVo = new UserProjectTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserProjecttatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createProjectCount")) {
|
||||
userProjectTotalVo.setCreateProjectCount(result);
|
||||
}else if(temResult.getKey().equals("joinProjectCount")){
|
||||
userProjectTotalVo.setJoinProjectCount(result);
|
||||
}else if(temResult.getKey().equals("forkProjectCount")){
|
||||
userProjectTotalVo.setForkProjectCount(result);
|
||||
}else if(temResult.getKey().equals("issueSum")){
|
||||
userProjectTotalVo.setIssueSum(result);
|
||||
}else if(temResult.getKey().equals("prSum")){
|
||||
userProjectTotalVo.setPrSum(result);
|
||||
}else if(temResult.getKey().equals("commitSum")){
|
||||
userProjectTotalVo.setCommitSum(result);
|
||||
}else if(temResult.getKey().equals("watchProjectCount")){
|
||||
userProjectTotalVo.setWatchProjectCount(result);
|
||||
}else if(temResult.getKey().equals("praiseProjectCount")){
|
||||
userProjectTotalVo.setPraiseProjectCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userProjectTotalVo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取创客任务相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserTaskTotalVo getUserTaskStatistic(Long userId) {
|
||||
UserTaskTotalVo userTaskTotalVo = new UserTaskTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserTaskStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createTaskCount")) {
|
||||
userTaskTotalVo.setCreateTaskCount(result);
|
||||
}else if(temResult.getKey().equals("submitPapersCount")){
|
||||
userTaskTotalVo.setSubmitPapersCount(result);
|
||||
}else if(temResult.getKey().equals("watchTaskCount")){
|
||||
userTaskTotalVo.setWatchTaskCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userTaskTotalVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取开放竞赛相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserCompetitionTotalVo getUserCompStatistic(Long userId) {
|
||||
UserCompetitionTotalVo userCompetitionTotalVo = new UserCompetitionTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserCompStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("joinCompetitionCount")) {
|
||||
userCompetitionTotalVo.setJoinCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("watchCompetitionCount")){
|
||||
userCompetitionTotalVo.setWatchCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("signUpCount")){
|
||||
userCompetitionTotalVo.setSignUpCount(result);
|
||||
}else if(temResult.getKey().equals("submitWorkCount")){
|
||||
userCompetitionTotalVo.setSubmitWorkCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userCompetitionTotalVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID, 获取用户论坛交流相关数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserMemoTotalVo getUserMemoStatistic(Long userId) {
|
||||
UserMemoTotalVo userMemoTotalVo = new UserMemoTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserMemoStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createMemoCount")) {
|
||||
userMemoTotalVo.setCreateMemoCount(result);
|
||||
}else if(temResult.getKey().equals("replayMemoCount")){
|
||||
userMemoTotalVo.setReplayMemoCount(result);
|
||||
}else if(temResult.getKey().equals("watchMemoCount")){
|
||||
userMemoTotalVo.setWatchMemoCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userMemoTotalVo;
|
||||
}
|
||||
/**
|
||||
* 根据用户ID, 获取用户专家资源相关数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserExpertTotalVo getUserExpertStatistic(Long userId) {
|
||||
UserExpertTotalVo userExpertTotalVo = new UserExpertTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserExperttatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("watchExpertCount")) {
|
||||
userExpertTotalVo.setWatchExpertCount(result);
|
||||
}else if(temResult.getKey().equals("favoriteExpertCount")){
|
||||
userExpertTotalVo.setFavoriteExpertCount(result);
|
||||
}else if(temResult.getKey().equals("aduitCompetitionCount")){
|
||||
userExpertTotalVo.setAduitCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("aduitTaskCount")){
|
||||
userExpertTotalVo.setAduitTaskCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userExpertTotalVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getActivityStatistic() {
|
||||
return behaviorImageMapper.getActivityStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户资源库
|
||||
* @param activityUserLibrary 活跃用户资源库
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
|
||||
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryList(activityUserLibrary);
|
||||
for (ActivityUserLibrary a : list) {
|
||||
Long relatedProject= behaviorImageMapper.getrelatedProjectCount(a.getUserId());
|
||||
a.setRelatedProject(relatedProject);
|
||||
Long relatedTask= behaviorImageMapper.getrelatedTaskCount(a.getUserId());
|
||||
a.setRelatedTask(relatedTask);
|
||||
Long relatedCompetition= behaviorImageMapper.getrelatedCompetitionCount(a.getUserId());
|
||||
a.setRelatedCompetition(relatedCompetition);
|
||||
Long relatedMemo= behaviorImageMapper.getrelatedMemoCount(a.getUserId());
|
||||
a.setRelatedMemo(relatedMemo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
package com.microservices.dms.common.controller;
|
||||
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "数据管理体系-公开接口")
|
||||
@RequestMapping("/open")
|
||||
@RefreshScope
|
||||
public class OpenController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
@Autowired
|
||||
private IExpertResourceLibraryService expertResourceLibraryService;
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取精选成果")
|
||||
@GetMapping("/achievements/getChoiceImport")
|
||||
public AjaxResult getChoiceImport() {
|
||||
return success(achievementsService.getChoiceImport());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果来源对成果数据进行分类统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果来源对成果数据进行分类统计")
|
||||
@GetMapping("/achievements/getTjBySources")
|
||||
public AjaxResult getTjBySources() {
|
||||
return success(achievementsService.getTjBySources());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果领域对成功数据进行汇总
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果领域对成果数据进行汇总")
|
||||
@GetMapping("/achievements/getTjByAreas")
|
||||
public AjaxResult getTjByAreas() {
|
||||
return success(achievementsService.getTjByAreas());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据领域分类名称,获取领域相关数据
|
||||
*/
|
||||
@ApiOperation("根据领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/achievements/getAreasByName")
|
||||
public AjaxResult getAreasByName(String areaName) {
|
||||
return success(achievementsService.getAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取项目领域")
|
||||
@GetMapping("/achievements/getProjectAreasByName")
|
||||
public AjaxResult getProjectAreasByName(String areaName) {
|
||||
return success(achievementsService.getProjectAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取专家领域")
|
||||
@GetMapping("/achievements/getExpertAreasByName")
|
||||
public AjaxResult getExpertAreasByName(String areaName) {
|
||||
return success(achievementsService.getExpertAreasByName(areaName));
|
||||
}
|
||||
|
||||
/* 获取全部成果,根据成果名称、成果领域、成果来源进行查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取全部成果,根据成果名称、成果领域、成果来源进行查询")
|
||||
@GetMapping("/achievements/getAllResult")
|
||||
public TableDataInfo getAllResult(AchQueryVo achQueryVo) {
|
||||
startPage();
|
||||
return getDataTable(achievementsService.getAllResult(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("近七日用户行为数据")
|
||||
@GetMapping("/achievements/getUerActionData")
|
||||
public AjaxResult getUerActionData() {
|
||||
return success(achievementsService.getUerActionData());
|
||||
}
|
||||
|
||||
@ApiOperation("热门成果")
|
||||
@GetMapping("/achievements/getHotAchievement")
|
||||
public AjaxResult getHotAchievement() {
|
||||
return success(achievementsService.getHotAchievement());
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增")
|
||||
@GetMapping("/achievements/get7DayAdd")
|
||||
public AjaxResult get7DayAdd(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAdd(achQueryVo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页项目统计")
|
||||
@GetMapping("/achievements/indexProjectStatistic")
|
||||
public AjaxResult indexProjectStatistic() {
|
||||
return success(achievementsService.indexProjectStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页task统计")
|
||||
@GetMapping("/achievements/indexTaskStatistic")
|
||||
public AjaxResult indexTaskStatistic() {
|
||||
return success(achievementsService.indexTaskStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页Competition统计")
|
||||
@GetMapping("/achievements/indexCompetitionStatistic")
|
||||
public AjaxResult indexCompetitionStatistic() {
|
||||
return success(achievementsService.indexCompetitionStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页SchoolEnterprise统计")
|
||||
@GetMapping("/achievements/indexSchoolEnterpriseStatistic")
|
||||
public AjaxResult indexSchoolEnterpriseStatistic() {
|
||||
return success(achievementsService.indexSchoolEnterpriseStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页专家统计")
|
||||
@GetMapping("/achievements/indexExpertStatistic")
|
||||
public AjaxResult indexExpertStatistic() {
|
||||
return success(achievementsService.indexExpertStatistic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/expertResourceLibrary/listFront")
|
||||
public TableDataInfo listFront(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList2(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class DmsConstants {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class ReferralConstant {
|
||||
|
||||
public static final Long ISSUE_CLOSED = 5L;
|
||||
public static final Long ISSUE_RESOLVED = 3L;
|
||||
public static final Long ISSUE_RESOLVING = 2L;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class TaskConstant {
|
||||
|
||||
private TaskConstant() {}
|
||||
|
||||
public static final String TASK_TYPE_WATCHERS = "MakerTask";
|
||||
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
|
||||
public static final String TASK_TYPE_PAPERS = "";
|
||||
public static final String TASK_TYPE_OTHER = "makerSpaceTask";
|
||||
|
||||
public static final String COMPETITION_TYPE_WATCHERS = "CompetitionInfo";
|
||||
public static final String COMPETITION_TYPE_CLICK = "CompetitionInfo";
|
||||
public static final String COMPETITION_TYPE_DOWNLOAD = "CompetitionOpusDownload";
|
||||
|
||||
|
||||
public static final String PROJECT_DOWNLOAD_API = "%s/api/attachments/%s";
|
||||
public static final String MARKER_SPACE_DOWNLOAD_API_BY_NAME = "%s/busiAttachments/downloadAttachment/%s";
|
||||
public static final String MARKER_SPACE_DOWNLOAD_API_BY_ID = "%s/busiAttachments/download/%s";
|
||||
|
||||
//favorites
|
||||
public static final String EXPERTS = "Experts";
|
||||
public static final String ACHIEVEMENTS = "Achievements";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.referral.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.referral.service.TalentReferralService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "数据管理体系-人才推荐接口")
|
||||
@RestController
|
||||
@RequestMapping("/talentReferral")
|
||||
@RequiredArgsConstructor
|
||||
public class TalentReferralController {
|
||||
|
||||
private final TalentReferralService talentReferralService;
|
||||
|
||||
@GetMapping("/issueTalentReferral")
|
||||
@ApiOperation(value = "疑修人才推荐")
|
||||
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
|
||||
return AjaxResult.success(talentReferralService.issueTalentReferral(issueId, projectId));
|
||||
}
|
||||
|
||||
@GetMapping("/pullRequestTalentReferral")
|
||||
@ApiOperation(value = "PR人才推荐")
|
||||
public AjaxResult pullRequestTalentReferral(@RequestParam("prId") Long prId, @RequestParam("projectId") Long projectId) {
|
||||
return AjaxResult.success(talentReferralService.PRTalentReferral(prId, projectId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.microservices.dms.referral.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface TalentReferralMapper {
|
||||
|
||||
List<IssuesVo> selectIssuesCondition(IssuesVo issuesVo);
|
||||
|
||||
List<IssuesVo> countIssuesAssigner(@Param("projectId") Long projectId);
|
||||
|
||||
List<PullRequestVo> countPRUser(@Param("projectId") Long projectId);
|
||||
|
||||
IssuesVo selectIssuesById(@Param("id") Long id);
|
||||
|
||||
PullRequestVo selectPRById(@Param("id") Long id);
|
||||
|
||||
List<Long> selectIssuesAssigners(@Param("issueId") Long issueId);
|
||||
|
||||
String selectRepositoriesUrl(@Param("id") Long id);
|
||||
|
||||
Long selectIdByLogin(@Param("login") String login);
|
||||
}
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
package com.microservices.dms.referral.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.dms.constant.ReferralConstant;
|
||||
import com.microservices.dms.referral.mapper.TalentReferralMapper;
|
||||
import com.microservices.dms.referral.vo.IssueDto;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
||||
import com.microservices.dms.utils.DmsGitLinkRequestUrl;
|
||||
import com.microservices.dms.utils.DmsRequestHelper;
|
||||
import com.microservices.dms.utils.SimilarityService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人才推荐服务
|
||||
*/
|
||||
@Service
|
||||
public class TalentReferralService {
|
||||
|
||||
@Autowired
|
||||
private TalentReferralMapper talentReferralMapper;
|
||||
|
||||
@Autowired
|
||||
private DmsRequestHelper dmsRequestHelper;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TalentReferralService.class);
|
||||
|
||||
public Set<Long> getContributors(String projectFullName) {
|
||||
try {
|
||||
// 获取项目贡献者数量
|
||||
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());
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
public Set<Long> getCollaborators(String projectFullName) {
|
||||
try {
|
||||
// 获取项目成员者数量
|
||||
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.QUERY_USER_FROM_PROJECT(projectFullName), "members","total_count");
|
||||
|
||||
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());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
public String getRepoName(Long projectId) {
|
||||
// 获取仓库的fullName,用来查询贡献者
|
||||
String s = talentReferralMapper.selectRepositoriesUrl(projectId);
|
||||
return StringUtils.isNotEmpty(s) ? s : "";
|
||||
}
|
||||
|
||||
public Set<Long> getContributorsByProjectId(Long projectId) {
|
||||
Set<Long> contributors = new HashSet<>();
|
||||
String repoName = getRepoName(projectId);
|
||||
if (StringUtils.isNotBlank(repoName)) {
|
||||
contributors.addAll(getContributors(repoName));
|
||||
}
|
||||
return contributors;
|
||||
}
|
||||
|
||||
public Set<Long> getCollaboratorsByProjectId(Long projectId) {
|
||||
Set<Long> collaborators = new HashSet<>();
|
||||
String repoName = getRepoName(projectId);
|
||||
if (StringUtils.isNotBlank(repoName)) {
|
||||
collaborators.addAll(getCollaborators(repoName));
|
||||
}
|
||||
return collaborators;
|
||||
}
|
||||
|
||||
public List<Map.Entry<Long, Double>> issueTalentReferral(Long projectId, Long issueId) {
|
||||
|
||||
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
|
||||
if (curIssue == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
|
||||
if (!curIssueAssigners.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
IssuesVo vo = new IssuesVo();
|
||||
vo.setProjectId(projectId);
|
||||
vo.setStatusIds(Collections.singletonList(ReferralConstant.ISSUE_CLOSED));
|
||||
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||
// 计算与解决issue的相似度, 标题+描述
|
||||
for (IssuesVo v : issuesVos) {
|
||||
String subject = v.getSubject();
|
||||
String description = v.getDescription();
|
||||
double subjectFraction = SimilarityService.sentence(subject, curIssue.getSubject());
|
||||
double descFraction = SimilarityService.text(description, curIssue.getDescription());
|
||||
//这个数据可以缓存下来
|
||||
List<Long> assigners = talentReferralMapper.selectIssuesAssigners(v.getId());
|
||||
for (Long assigner : assigners) {
|
||||
userFractionMap.merge(assigner, (subjectFraction + descFraction) * 60.0D, Double::sum);
|
||||
}
|
||||
}
|
||||
|
||||
// 计算每个负责人关闭的issues数量
|
||||
List<IssuesVo> assIs = talentReferralMapper.countIssuesAssigner(projectId);
|
||||
for (IssuesVo a : assIs) {
|
||||
userFractionMap.merge(a.getId(), a.getNum() * 40.0D, Double::sum);
|
||||
}
|
||||
|
||||
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(userFractionMap.entrySet());
|
||||
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
|
||||
|
||||
Set<Long> contributors = getContributorsByProjectId(projectId);
|
||||
if (!contributors.isEmpty() && !entryList.isEmpty()) {
|
||||
entryList.removeIf(s -> !contributors.contains(s.getKey()));
|
||||
}
|
||||
return entryList;
|
||||
}
|
||||
|
||||
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId, List<IssueDto> prs) {
|
||||
|
||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||
Map<String, Double> userNameFractionMap = new HashMap<>();
|
||||
Map<String, Set<String>> PRFilesMap = new HashMap<>();
|
||||
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11");
|
||||
|
||||
for (IssueDto pr : prs) {
|
||||
//关闭PR的对比
|
||||
for (IssueDto dto : closedPullRequests) {
|
||||
List<String> reviewers = dto.getReviewers();
|
||||
for (String reviewer : reviewers) {
|
||||
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
|
||||
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
|
||||
HashSet<String> set = new HashSet<>();
|
||||
set.addAll(a);
|
||||
set.addAll(b);
|
||||
return set;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> curPrFiles = getPRFiles(projectId, pr.getPullRequestNumber());
|
||||
for (String curPrFile : curPrFiles) {
|
||||
PRFilesMap.forEach((k, v) -> {
|
||||
if (v.contains(curPrFile)) {
|
||||
userNameFractionMap.merge(k, 60.0D, Double::sum);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 计算每个负责人关闭的 PR数量
|
||||
closedPullRequests.stream().map(IssueDto::getReviewers).flatMap(List::stream)
|
||||
.forEach(s -> userNameFractionMap.merge(s, 40.0D, Double::sum));
|
||||
|
||||
|
||||
}
|
||||
|
||||
userNameFractionMap.forEach((k, v) -> {
|
||||
Long id = talentReferralMapper.selectIdByLogin(k);
|
||||
userFractionMap.put(id, v);
|
||||
});
|
||||
|
||||
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(userFractionMap.entrySet());
|
||||
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
|
||||
|
||||
//必须是项目成员
|
||||
Set<Long> collaborators = getCollaboratorsByProjectId(projectId);
|
||||
if (!collaborators.isEmpty() && !entryList.isEmpty()) {
|
||||
entryList.removeIf(s -> !collaborators.contains(s.getKey()));
|
||||
}
|
||||
|
||||
return entryList;
|
||||
}
|
||||
|
||||
public List<IssueDto> getPullRequests(Long projectId, String statusType) {
|
||||
|
||||
String projectFullName = getRepoName(projectId);
|
||||
if (StringUtils.isEmpty(projectFullName)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
try {
|
||||
return dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PULL_REQUEST(projectFullName, statusType), "issues", IssueDto.class);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取PR失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public Set<String> getPRFiles(Long projectId, int PRNum) {
|
||||
String projectFullName = getRepoName(projectId);
|
||||
if (StringUtils.isEmpty(projectFullName)) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
try {
|
||||
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "issues", "files");
|
||||
return allDataByPage.stream().map(o -> (JSONObject) o).map(o -> (String) o.get("filename")).collect(Collectors.toSet());
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取PR文件失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
|
||||
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId) {
|
||||
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
|
||||
openPullRequests = openPullRequests.stream().filter(e -> e.getReviewers().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (prId != null) {
|
||||
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getId()), prId))
|
||||
.filter(e -> e.getReviewers().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
||||
}
|
||||
|
||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
||||
}
|
||||
|
||||
//定时统计
|
||||
public void projectsStatistic(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
@Data
|
||||
public class IssueDto {
|
||||
|
||||
@JsonProperty("pull_request_id")
|
||||
private int pullRequestId;
|
||||
@JsonProperty("pull_request_number")
|
||||
private int pullRequestNumber;
|
||||
@JsonProperty("pull_request_status")
|
||||
private int pullRequestStatus;
|
||||
@JsonProperty("pull_request_head")
|
||||
private String pullRequestHead;
|
||||
@JsonProperty("pull_request_base")
|
||||
private String pullRequestBase;
|
||||
@JsonProperty("pull_request_staus")
|
||||
private String pullRequestStaus;
|
||||
@JsonProperty("is_original")
|
||||
private boolean isOriginal;
|
||||
@JsonProperty("fork_project_id")
|
||||
private String forkProjectId;
|
||||
@JsonProperty("fork_project_identifier")
|
||||
private String forkProjectIdentifier;
|
||||
@JsonProperty("fork_project_user")
|
||||
private String forkProjectUser;
|
||||
@JsonProperty("fork_project_user_name")
|
||||
private String forkProjectUserName;
|
||||
private List<String> reviewers;
|
||||
private int id;
|
||||
private String name;
|
||||
@JsonProperty("pr_time")
|
||||
private String prTime;
|
||||
@JsonProperty("assign_user_name")
|
||||
private String assignUserName;
|
||||
@JsonProperty("assign_user_login")
|
||||
private String assignUserLogin;
|
||||
@JsonProperty("author_name")
|
||||
private String authorName;
|
||||
@JsonProperty("author_login")
|
||||
private String authorLogin;
|
||||
@JsonProperty("avatar_url")
|
||||
private String avatarUrl;
|
||||
private String priority;
|
||||
private String version;
|
||||
@JsonProperty("journals_count")
|
||||
private int journalsCount;
|
||||
@JsonProperty("issue_tags")
|
||||
private String issueTags;
|
||||
@JsonProperty("attached_issues")
|
||||
private List<String> attachedIssues;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class IssuesVo {
|
||||
private Long id;
|
||||
private Long projectId;
|
||||
private String subject;
|
||||
private String description;
|
||||
private Long statusId;
|
||||
private List<Long> statusIds;
|
||||
private Long num;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PullRequestVo {
|
||||
private Long id;
|
||||
private Long projectId;
|
||||
private Long userId;
|
||||
private Long giteaNumber;
|
||||
private String title;
|
||||
private String description;
|
||||
private Long statusId;
|
||||
private List<Long> statusIds;
|
||||
private Long num;
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.resourceLibrary.domain.*;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "数据管理体系-用户行为信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/collectUserActData")
|
||||
@RequiredArgsConstructor
|
||||
public class CollectUserActDataController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
|
||||
@PostMapping("/addClicker")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
@ApiOperation(value = "记录点击次数")
|
||||
public AjaxResult addTaskClick(@RequestBody Clicker clicker) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addClick(clicker));
|
||||
}
|
||||
|
||||
@PostMapping("/addDownloader")
|
||||
@ApiOperation(value = "记录下载次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "downloadType", value = "下载类型(任务:makerSpaceTask、竞赛作品:CompetitionOpusDownload、成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "downloadId", value = "下载对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addDownloader(@RequestBody Downloader downloader) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addDownloader(downloader));
|
||||
}
|
||||
|
||||
@PostMapping("/addSearcher")
|
||||
@ApiOperation(value = "记录搜索次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "searchType", value = "搜索类型(任务:makerSpaceTask、项目:Project、竞赛:CompetitionInfo)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "searchId", value = "搜索对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addSearcher(@RequestBody Searcher searcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addSearcher(searcher));
|
||||
}
|
||||
|
||||
@PostMapping("/addSearcher2")
|
||||
@ApiOperation(value = "记录搜索次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "searchType", value = "搜索类型(任务:makerSpaceTask、项目:Project、竞赛:CompetitionInfo)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "searchIds", value = "搜索对象ID,多个,分隔", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addSearcher2(@RequestBody Searcher searcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addSearcher2(searcher));
|
||||
}
|
||||
|
||||
@PostMapping("/addFavorite")
|
||||
@ApiOperation(value = "记录收藏次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "收藏类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addFavorite(@RequestBody Favorite favorite) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addFavorite(favorite));
|
||||
}
|
||||
|
||||
@PostMapping("/addWatcher")
|
||||
@ApiOperation(value = "记录关注次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "关注类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addFavorite(@RequestBody Watcher watcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addWatcher(watcher));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delFavorite")
|
||||
@ApiOperation(value = "删除收藏次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "收藏类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult delFavorite(Favorite favorite) {
|
||||
return AjaxResult.success(taskResourceLibraryService.delFavorite(favorite));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delWatcher")
|
||||
@ApiOperation(value = "删除关注次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "关注类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult delWatcher(Watcher watcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.delWatcher(watcher));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
|
||||
import com.microservices.dms.resourceLibrary.service.CompetitionResourceLibraryService;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
import static com.microservices.common.core.web.domain.AjaxResult.success;
|
||||
|
||||
@Api(tags = "数据管理体系-竞赛资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/competitionResourceLibrary")
|
||||
@RequiredArgsConstructor
|
||||
public class CompetitionResourceLibraryController extends BaseController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
private final CompetitionResourceLibraryService competitionResourceLibraryService;
|
||||
|
||||
@GetMapping("/selectRegisterCondition")
|
||||
@ApiOperation(value = "查询用户报名")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectRegisterCondition(UserActionDataVo taskJournals) {
|
||||
startPage();
|
||||
List<UserActionDataVo> userActionDataVos = competitionResourceLibraryService.selectRegisterCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/selectOpusCondition")
|
||||
@ApiOperation(value = "查询用户作品")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "status", value = "状态3", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectOpusCondition(UserActionDataVo taskJournals) {
|
||||
startPage();
|
||||
List<UserActionDataVo> userActionDataVos = competitionResourceLibraryService.selectOpusCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/selectCompetitionListCondition")
|
||||
@ApiOperation(value = "查询竞赛作品列表")
|
||||
public GenericsTableDataInfo<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo taskJournals) {
|
||||
startPage();
|
||||
List<CompetitionListVo> userActionDataVos = competitionResourceLibraryService.selectCompetitionListCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
startPage();
|
||||
List<CompetitionResourceLibrary> list = competitionResourceLibraryService.selectCompetitionResourceLibraryList(competitionResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
List<CompetitionResourceLibrary> list = competitionResourceLibraryService.selectCompetitionResourceLibraryList(competitionResourceLibrary);
|
||||
ExcelUtil<CompetitionResourceLibrary> util = new ExcelUtil<CompetitionResourceLibrary>(CompetitionResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(competitionResourceLibraryService.selectCompetitionResourceLibraryById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
return success(competitionResourceLibraryService.insertCompetitionResourceLibrary(competitionResourceLibrary));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
return success(competitionResourceLibraryService.updateCompetitionResourceLibrary(competitionResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return success(competitionResourceLibraryService.deleteCompetitionResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回开放竞赛总数
|
||||
*
|
||||
* @return 开放竞赛总数
|
||||
*/
|
||||
@ApiOperation(value = "返回开放竞赛总数")
|
||||
@GetMapping(value = "/getTotalOpenCompetitions")
|
||||
public AjaxResult getTotalOpenCompetitions() {
|
||||
// 这里替换成你的实际逻辑,例如从数据库查询
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalOpenCompetitions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛转换成果数
|
||||
*
|
||||
* @return 竞赛转换成果数
|
||||
*/
|
||||
@ApiOperation(value = "返回竞赛转换成果数")
|
||||
@GetMapping(value = "/getTotalCompetitionAchievements")
|
||||
public AjaxResult getTotalCompetitionAchievements() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalCompetitionAchievements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛提交作品数
|
||||
*
|
||||
* @return 竞赛提交作品数
|
||||
*/
|
||||
@ApiOperation(value = "返回竞赛提交作品数")
|
||||
@GetMapping(value = "/getTotalCompetitionSubmissions")
|
||||
public AjaxResult getTotalCompetitionSubmissions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalCompetitionSubmissions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回已结束竞赛数
|
||||
*
|
||||
* @return 已结束竞赛数
|
||||
*/
|
||||
@ApiOperation(value = "返回已结束竞赛数")
|
||||
@GetMapping(value = "/getTotalFinishedCompetitions")
|
||||
public AjaxResult getTotalFinishedCompetitions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalFinishedCompetitions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回需评审竞赛数
|
||||
*
|
||||
* @return 需评审竞赛数
|
||||
*/
|
||||
@ApiOperation(value = "需评审竞赛数")
|
||||
@GetMapping(value = "/getReviewCompetitionCount")
|
||||
public AjaxResult getReviewCompetitionCount() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getReviewCompetitionCount());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 专家资源库Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
@Api(tags = "数据管理体系-优质专家库")
|
||||
@RestController
|
||||
@RequestMapping("/expertResourceLibrary")
|
||||
public class ExpertResourceLibraryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IExpertResourceLibraryService expertResourceLibraryService;
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/listFront")
|
||||
public TableDataInfo listFront(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList2(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出专家资源库列表
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList(expertResourceLibrary);
|
||||
ExcelUtil<ExpertResourceLibrary> util = new ExcelUtil<ExpertResourceLibrary>(ExpertResourceLibrary.class);
|
||||
util.exportExcel(response, list, "专家资源库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专家资源库详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(expertResourceLibraryService.selectExpertResourceLibraryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.insertExpertResourceLibrary(expertResourceLibrary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.updateExpertResourceLibrary(expertResourceLibrary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.deleteExpertResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "评审专家数")
|
||||
@GetMapping("/auditExpertCount")
|
||||
public AjaxResult auditExpertCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.auditExpertCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "竞赛评审数")
|
||||
@GetMapping("/competitionAuditCount")
|
||||
public AjaxResult competitionAuditCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.competitionAuditCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "任务评审数")
|
||||
@GetMapping("/taskAuditCount")
|
||||
public AjaxResult taskAuditCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.taskAuditCount());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据当前用户以及专家ID,获取当前专家的 是否收藏与关注状态")
|
||||
@GetMapping("/getWatchFavoriteStatusById")
|
||||
public AjaxResult getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return success(expertResourceLibraryService.getWatchFavoriteStatusById(id, userId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据成果ID,获取专家的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||
@GetMapping("/getActDataStatisticById")
|
||||
public AjaxResult getActDataStatisticById(Long id) {
|
||||
return success(expertResourceLibraryService.getActDataStatisticById(id));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.ProjectResourceLibraryService;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "数据管理体系-项目资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/projectResourceLibrary/")
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectResourceLibraryController extends BaseController {
|
||||
|
||||
private final ProjectResourceLibraryService projectResourceLibraryService;
|
||||
|
||||
@GetMapping("selectSearcherCondition")
|
||||
@ApiOperation(value = "查询用户搜索")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(Project)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectSearcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectSearchCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectCodeCommitCondition")
|
||||
@ApiOperation(value = "查询用户提交")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectCodeCommitCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectCodeCommitCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectForkCondition")
|
||||
@ApiOperation(value = "查询用户Fork")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectForkCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectForkCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectIssueCondition")
|
||||
@ApiOperation(value = "查询用户Issue")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectIssueCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectIssueCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPRCondition")
|
||||
@ApiOperation(value = "查询用户PR")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPRCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectPRCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPraisesCondition")
|
||||
@ApiOperation(value = "查询用户点赞")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(Project)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPraisesCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectPraisesCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectProjectListCondition")
|
||||
@ApiOperation(value = "查询项目统计列表")
|
||||
public GenericsTableDataInfo<ProjectListVo> selectProjectListCondition(ProjectListVo projectListVo) {
|
||||
PageUtils.startPage();
|
||||
List<ProjectListVo> userActionDataVos = projectResourceLibraryService.selectProjectListCondition(projectListVo);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询项目资源库-列表")
|
||||
@GetMapping(value = "/list")
|
||||
public TableDataInfo list(ProjectResourceLibrary projectResourceLibrary) {
|
||||
startPage();
|
||||
List<ProjectResourceLibrary> list = projectResourceLibraryService.selectProjectResourceLibraryList(projectResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProjectResourceLibrary projectResourceLibrary) {
|
||||
List<ProjectResourceLibrary> list = projectResourceLibraryService.selectProjectResourceLibraryList(projectResourceLibrary);
|
||||
ExcelUtil<ProjectResourceLibrary> util = new ExcelUtil<ProjectResourceLibrary>(ProjectResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(projectResourceLibraryService.selectProjectResourceLibraryById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProjectResourceLibrary projectResourceLibrary) {
|
||||
return AjaxResult.success(projectResourceLibraryService.insertProjectResourceLibrary(projectResourceLibrary));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProjectResourceLibrary projectResourceLibrary) {
|
||||
return AjaxResult.success(projectResourceLibraryService.updateProjectResourceLibrary(projectResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return AjaxResult.success(projectResourceLibraryService.deleteProjectResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "项目转换成果数")
|
||||
@GetMapping(value = "/getTotalConversionCount")
|
||||
public AjaxResult getTotalConversionCount() {
|
||||
return success(projectResourceLibraryService.getTotalConversionCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目公开数")
|
||||
@GetMapping(value = "/getPublicProjectCount")
|
||||
public AjaxResult getPublicProjectCount() {
|
||||
return success(projectResourceLibraryService.getPublicProjectCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目发布版本数")
|
||||
@GetMapping(value = "/getTotalReleaseCount")
|
||||
public AjaxResult getTotalReleaseCount() {
|
||||
return success(projectResourceLibraryService.getTotalReleaseCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目总数")
|
||||
@GetMapping(value = "/getTotalProjectCount")
|
||||
public AjaxResult getTotalProjectCount() {
|
||||
return success(projectResourceLibraryService.getTotalProjectCount());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "数据管理体系-任务资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/taskResourceLibrary")
|
||||
@RequiredArgsConstructor
|
||||
public class TaskResourceLibraryController extends BaseController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
|
||||
|
||||
@GetMapping("/selectTaskJournalsCondition")
|
||||
@ApiOperation(value = "查询用户评论")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectTaskJournalsCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectTaskJournalsCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectClickerCondition")
|
||||
@ApiOperation(value = "查询用户点击")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectClickerCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectClickerCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectDownloaderCondition")
|
||||
@ApiOperation(value = "查询用户下载")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectDownloaderCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectDownloaderCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectVisitCondition")
|
||||
@ApiOperation(value = "查询用户点击")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectVisitCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectVisitCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPapersCondition")
|
||||
@ApiOperation(value = "查询用户交稿")
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPapersCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectPapersCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectWatcherCondition")
|
||||
@ApiOperation(value = "查询用户关注")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:MakerTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectWatcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectWatcherCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectSearcherCondition")
|
||||
@ApiOperation(value = "查询用户搜索")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectSearcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectSearcherCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectTaskListCondition")
|
||||
@ApiOperation(value = "查询任务列表")
|
||||
public GenericsTableDataInfo<TaskListVo> selectTaskListCondition(TaskListVo taskListVo) {
|
||||
PageUtils.startPage();
|
||||
List<TaskListVo> userActionDataVos = taskResourceLibraryService.selectTaskListCondition(taskListVo);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TaskResourceLibrary taskResourceLibrary) {
|
||||
startPage();
|
||||
List<TaskResourceLibrary> list = taskResourceLibraryService.selectTaskResourceLibraryList(taskResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TaskResourceLibrary taskResourceLibrary) {
|
||||
List<TaskResourceLibrary> list = taskResourceLibraryService.selectTaskResourceLibraryList(taskResourceLibrary);
|
||||
ExcelUtil<TaskResourceLibrary> util = new ExcelUtil<TaskResourceLibrary>(TaskResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(taskResourceLibraryService.selectTaskResourceLibraryById(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TaskResourceLibrary taskResourceLibrary) {
|
||||
return AjaxResult.success(taskResourceLibraryService.insertTaskResourceLibrary(taskResourceLibrary));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TaskResourceLibrary taskResourceLibrary) {
|
||||
return AjaxResult.success(taskResourceLibraryService.updateTaskResourceLibrary(taskResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return AjaxResult.success(taskResourceLibraryService.deleteTaskResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getTotalTasks")
|
||||
@ApiOperation(value = "获取任务总数")
|
||||
public AjaxResult getTotalTasks() {
|
||||
return success(taskResourceLibraryService.getTotalTasks());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getConvertedTaskAmount")
|
||||
@ApiOperation(value = "获取转换成果任务金额")
|
||||
public AjaxResult getConvertedTaskAmount() {
|
||||
return success(taskResourceLibraryService.getConvertedTaskAmount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getConvertedTasksCount")
|
||||
@ApiOperation(value = "获取任务转换成果数")
|
||||
public AjaxResult getConvertedTasksCount() {
|
||||
return success(taskResourceLibraryService.getConvertedTasksCount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getTaskAmount")
|
||||
@ApiOperation(value = "获取任务金额")
|
||||
public AjaxResult getTaskAmount() {
|
||||
return success(taskResourceLibraryService.getTaskAmount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getReviewTaskCount")
|
||||
@ApiOperation(value = "需评审任务数")
|
||||
public AjaxResult getReviewTaskCount() {
|
||||
return success(taskResourceLibraryService.getReviewTaskCount());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Clicker{
|
||||
private Long id;
|
||||
private String clickType;
|
||||
private Long clickId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,297 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* @author microservices
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
public class CompetitionResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 开放竞赛ID
|
||||
*/
|
||||
private Long openCompetitionId;
|
||||
/**
|
||||
* 开放竞赛名称
|
||||
*/
|
||||
private String openCompetitionName;
|
||||
/**
|
||||
* 开放竞赛创建者
|
||||
*/
|
||||
private Long competitionUserId;
|
||||
/**
|
||||
* 竞赛领域
|
||||
*/
|
||||
private String competitionField;
|
||||
/**
|
||||
* 竞赛状态 0进行中 1已结束
|
||||
*/
|
||||
private String competitionStatus;
|
||||
/**
|
||||
* 竞赛提交名称
|
||||
*/
|
||||
private String competitionSubmissionName;
|
||||
/**
|
||||
* 作品提交时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date submissionTime;
|
||||
/**
|
||||
* 提交者
|
||||
*/
|
||||
private String submitter;
|
||||
/**
|
||||
* 提交类型
|
||||
*/
|
||||
private String submissionType;
|
||||
/**
|
||||
* 提交单位
|
||||
*/
|
||||
private String submittingUnit;
|
||||
/**
|
||||
* 竞赛提交摘要
|
||||
*/
|
||||
private String submissionSummary;
|
||||
/**
|
||||
* 竞赛提交详情
|
||||
*/
|
||||
private String submissionDetails;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactPerson;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
/**
|
||||
* 是否已转入成果库 0否 1是
|
||||
*/
|
||||
private Integer isTransferredToResultLibrary;
|
||||
/**
|
||||
* 转入成果库时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferredToResultLibraryTime;
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
private Integer isFeaturedResult;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 专家审核
|
||||
*/
|
||||
private Integer isExpertAudit;
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String attachment;
|
||||
private String leader;
|
||||
private String identifier;
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(String identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public String getLeader() {
|
||||
return leader;
|
||||
}
|
||||
|
||||
public void setLeader(String leader) {
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
|
||||
|
||||
public Integer getIsExpertAudit() {
|
||||
return isExpertAudit;
|
||||
}
|
||||
|
||||
public void setIsExpertAudit(Integer isExpertAudit) {
|
||||
this.isExpertAudit = isExpertAudit;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setOpenCompetitionId(Long openCompetitionId) {
|
||||
this.openCompetitionId = openCompetitionId;
|
||||
}
|
||||
|
||||
public Long getOpenCompetitionId() {
|
||||
return openCompetitionId;
|
||||
}
|
||||
|
||||
public void setOpenCompetitionName(String openCompetitionName) {
|
||||
this.openCompetitionName = openCompetitionName;
|
||||
}
|
||||
|
||||
public String getOpenCompetitionName() {
|
||||
return openCompetitionName;
|
||||
}
|
||||
|
||||
public void setCompetitionUserId(Long competitionUserId) {
|
||||
this.competitionUserId = competitionUserId;
|
||||
}
|
||||
|
||||
public Long getCompetitionUserId() {
|
||||
return competitionUserId;
|
||||
}
|
||||
|
||||
public void setCompetitionField(String competitionField) {
|
||||
this.competitionField = competitionField;
|
||||
}
|
||||
|
||||
public String getCompetitionField() {
|
||||
return competitionField;
|
||||
}
|
||||
|
||||
public void setCompetitionStatus(String competitionStatus) {
|
||||
this.competitionStatus = competitionStatus;
|
||||
}
|
||||
|
||||
public String getCompetitionStatus() {
|
||||
return competitionStatus;
|
||||
}
|
||||
|
||||
public void setCompetitionSubmissionName(String competitionSubmissionName) {
|
||||
this.competitionSubmissionName = competitionSubmissionName;
|
||||
}
|
||||
|
||||
public String getCompetitionSubmissionName() {
|
||||
return competitionSubmissionName;
|
||||
}
|
||||
|
||||
public void setSubmissionTime(Date submissionTime) {
|
||||
this.submissionTime = submissionTime;
|
||||
}
|
||||
|
||||
public Date getSubmissionTime() {
|
||||
return submissionTime;
|
||||
}
|
||||
|
||||
public void setSubmitter(String submitter) {
|
||||
this.submitter = submitter;
|
||||
}
|
||||
|
||||
public String getSubmitter() {
|
||||
return submitter;
|
||||
}
|
||||
|
||||
public void setSubmissionType(String submissionType) {
|
||||
this.submissionType = submissionType;
|
||||
}
|
||||
|
||||
public String getSubmissionType() {
|
||||
return submissionType;
|
||||
}
|
||||
|
||||
public void setSubmittingUnit(String submittingUnit) {
|
||||
this.submittingUnit = submittingUnit;
|
||||
}
|
||||
|
||||
public String getSubmittingUnit() {
|
||||
return submittingUnit;
|
||||
}
|
||||
|
||||
public void setSubmissionSummary(String submissionSummary) {
|
||||
this.submissionSummary = submissionSummary;
|
||||
}
|
||||
|
||||
public String getSubmissionSummary() {
|
||||
return submissionSummary;
|
||||
}
|
||||
|
||||
public void setSubmissionDetails(String submissionDetails) {
|
||||
this.submissionDetails = submissionDetails;
|
||||
}
|
||||
|
||||
public String getSubmissionDetails() {
|
||||
return submissionDetails;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToResultLibrary(Integer isTransferredToResultLibrary) {
|
||||
this.isTransferredToResultLibrary = isTransferredToResultLibrary;
|
||||
}
|
||||
|
||||
public Integer getIsTransferredToResultLibrary() {
|
||||
return isTransferredToResultLibrary;
|
||||
}
|
||||
|
||||
public void setTransferredToResultLibraryTime(Date transferredToResultLibraryTime) {
|
||||
this.transferredToResultLibraryTime = transferredToResultLibraryTime;
|
||||
}
|
||||
|
||||
public Date getTransferredToResultLibraryTime() {
|
||||
return transferredToResultLibraryTime;
|
||||
}
|
||||
|
||||
public void setIsFeaturedResult(Integer isFeaturedResult) {
|
||||
this.isFeaturedResult = isFeaturedResult;
|
||||
}
|
||||
|
||||
public Integer getIsFeaturedResult() {
|
||||
return isFeaturedResult;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setAttachment(String attachment) {
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
public String getAttachment() {
|
||||
return attachment;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Downloader {
|
||||
private Long id;
|
||||
private String downloadType;
|
||||
private Long downloadId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
|
@ -0,0 +1,372 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 专家资源库对象 expert_resource_library
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
public class ExpertResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long expertId;
|
||||
private Long id;
|
||||
//专家ID
|
||||
private Long userId;
|
||||
//专家名称
|
||||
private String expertName;
|
||||
//最高学历
|
||||
private String highestDegree;
|
||||
//毕业院校
|
||||
private String graduatedFrom;
|
||||
//身份证
|
||||
private String idNumber;
|
||||
|
||||
private String major;
|
||||
//工作单位
|
||||
private String workplace;
|
||||
//电话
|
||||
private String phone;
|
||||
|
||||
private String workplaceType;
|
||||
//邮箱
|
||||
private String expertEmail;
|
||||
//专家简介
|
||||
private String expertSummary;
|
||||
//专家详情
|
||||
private String expertDetail;
|
||||
|
||||
private String professionalTitle;
|
||||
|
||||
private String expertType;
|
||||
//专家领域
|
||||
private String expertDomain;
|
||||
|
||||
private String titleRank;
|
||||
|
||||
private Long status;
|
||||
//评审领域1
|
||||
private String reviewAreaOne;
|
||||
//评审领域2
|
||||
private String reviewAreaTwo;
|
||||
//评审领域3
|
||||
private String reviewAreaThree;
|
||||
//领域查询条件
|
||||
private String areaQuery;
|
||||
|
||||
private Integer isDelete;
|
||||
|
||||
private Long expertAuth;
|
||||
|
||||
private Integer sortNo;
|
||||
|
||||
private Long taskAuditCount;
|
||||
|
||||
private Long competitionAuditCount;
|
||||
|
||||
private String images;
|
||||
private String attachments;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
|
||||
private String userImg;
|
||||
private String userNickName;
|
||||
private String otherAttachments;
|
||||
|
||||
public String getOtherAttachments() {
|
||||
return otherAttachments;
|
||||
}
|
||||
|
||||
public void setOtherAttachments(String otherAttachments) {
|
||||
this.otherAttachments = otherAttachments;
|
||||
}
|
||||
|
||||
public String getUserImg() {
|
||||
return userImg;
|
||||
}
|
||||
|
||||
public void setUserImg(String userImg) {
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public String getUserNickName() {
|
||||
return userNickName;
|
||||
}
|
||||
|
||||
public void setUserNickName(String userNickName) {
|
||||
this.userNickName = userNickName;
|
||||
}
|
||||
|
||||
public String getAreaQuery() {
|
||||
return areaQuery;
|
||||
}
|
||||
|
||||
public void setAreaQuery(String areaQuery) {
|
||||
this.areaQuery = areaQuery;
|
||||
}
|
||||
|
||||
public Long getWatcherSum() {
|
||||
return watcherSum;
|
||||
}
|
||||
|
||||
public void setWatcherSum(Long watcherSum) {
|
||||
this.watcherSum = watcherSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public Long getExpertAuth() {
|
||||
return expertAuth;
|
||||
}
|
||||
|
||||
public void setExpertAuth(Long expertAuth) {
|
||||
this.expertAuth = expertAuth;
|
||||
}
|
||||
|
||||
public Long getTaskAuditCount() {
|
||||
return taskAuditCount;
|
||||
}
|
||||
|
||||
public void setTaskAuditCount(Long taskAuditCount) {
|
||||
this.taskAuditCount = taskAuditCount;
|
||||
}
|
||||
|
||||
public Long getCompetitionAuditCount() {
|
||||
return competitionAuditCount;
|
||||
}
|
||||
|
||||
public void setCompetitionAuditCount(Long competitionAuditCount) {
|
||||
this.competitionAuditCount = competitionAuditCount;
|
||||
}
|
||||
|
||||
public String gender;
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Integer getSortNo() {
|
||||
return sortNo;
|
||||
}
|
||||
|
||||
public void setSortNo(Integer sortNo) {
|
||||
this.sortNo = sortNo;
|
||||
}
|
||||
|
||||
public Long getExpertId() {
|
||||
return expertId;
|
||||
}
|
||||
|
||||
public void setExpertId(Long expertId) {
|
||||
this.expertId = expertId;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setExpertName(String expertName) {
|
||||
this.expertName = expertName;
|
||||
}
|
||||
|
||||
public String getExpertName() {
|
||||
return expertName;
|
||||
}
|
||||
|
||||
public void setHighestDegree(String highestDegree) {
|
||||
this.highestDegree = highestDegree;
|
||||
}
|
||||
|
||||
public String getHighestDegree() {
|
||||
return highestDegree;
|
||||
}
|
||||
|
||||
public void setGraduatedFrom(String graduatedFrom) {
|
||||
this.graduatedFrom = graduatedFrom;
|
||||
}
|
||||
|
||||
public String getGraduatedFrom() {
|
||||
return graduatedFrom;
|
||||
}
|
||||
|
||||
public void setIdNumber(String idNumber) {
|
||||
this.idNumber = idNumber;
|
||||
}
|
||||
|
||||
public String getIdNumber() {
|
||||
return idNumber;
|
||||
}
|
||||
|
||||
public void setMajor(String major) {
|
||||
this.major = major;
|
||||
}
|
||||
|
||||
public String getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
public void setWorkplace(String workplace) {
|
||||
this.workplace = workplace;
|
||||
}
|
||||
|
||||
public String getWorkplace() {
|
||||
return workplace;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setWorkplaceType(String workplaceType) {
|
||||
this.workplaceType = workplaceType;
|
||||
}
|
||||
|
||||
public String getWorkplaceType() {
|
||||
return workplaceType;
|
||||
}
|
||||
|
||||
public void setExpertEmail(String expertEmail) {
|
||||
this.expertEmail = expertEmail;
|
||||
}
|
||||
|
||||
public String getExpertEmail() {
|
||||
return expertEmail;
|
||||
}
|
||||
|
||||
public void setExpertSummary(String expertSummary) {
|
||||
this.expertSummary = expertSummary;
|
||||
}
|
||||
|
||||
public String getExpertSummary() {
|
||||
return expertSummary;
|
||||
}
|
||||
|
||||
public void setExpertDetail(String expertDetail) {
|
||||
this.expertDetail = expertDetail;
|
||||
}
|
||||
|
||||
public String getExpertDetail() {
|
||||
return expertDetail;
|
||||
}
|
||||
|
||||
public void setProfessionalTitle(String professionalTitle) {
|
||||
this.professionalTitle = professionalTitle;
|
||||
}
|
||||
|
||||
public String getProfessionalTitle() {
|
||||
return professionalTitle;
|
||||
}
|
||||
|
||||
public void setExpertType(String expertType) {
|
||||
this.expertType = expertType;
|
||||
}
|
||||
|
||||
public String getExpertType() {
|
||||
return expertType;
|
||||
}
|
||||
|
||||
public void setExpertDomain(String expertDomain) {
|
||||
this.expertDomain = expertDomain;
|
||||
}
|
||||
|
||||
public String getExpertDomain() {
|
||||
return expertDomain;
|
||||
}
|
||||
|
||||
public void setTitleRank(String titleRank) {
|
||||
this.titleRank = titleRank;
|
||||
}
|
||||
|
||||
public String getTitleRank() {
|
||||
return titleRank;
|
||||
}
|
||||
|
||||
public void setStatus(Long status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setReviewAreaOne(String reviewAreaOne) {
|
||||
this.reviewAreaOne = reviewAreaOne;
|
||||
}
|
||||
|
||||
public String getReviewAreaOne() {
|
||||
return reviewAreaOne;
|
||||
}
|
||||
|
||||
public void setReviewAreaTwo(String reviewAreaTwo) {
|
||||
this.reviewAreaTwo = reviewAreaTwo;
|
||||
}
|
||||
|
||||
public String getReviewAreaTwo() {
|
||||
return reviewAreaTwo;
|
||||
}
|
||||
|
||||
public void setReviewAreaThree(String reviewAreaThree) {
|
||||
this.reviewAreaThree = reviewAreaThree;
|
||||
}
|
||||
|
||||
public String getReviewAreaThree() {
|
||||
return reviewAreaThree;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Favorite {
|
||||
private Long id;
|
||||
private String favoriteType;
|
||||
private Long favoriteId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,268 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 对象 project_resource_library
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-07
|
||||
*/
|
||||
public class ProjectResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id;
|
||||
//项目资源名称
|
||||
private String projectName;
|
||||
//项目领域
|
||||
private String projectDomain;
|
||||
//项目领域名称
|
||||
private String projectDomainName;
|
||||
//
|
||||
private String identifier;
|
||||
private String userIdentifier;
|
||||
//开源项目ID
|
||||
private Long projectId;
|
||||
//仓库ID
|
||||
private Long repositoryId;
|
||||
//版本Id
|
||||
private Long versionReleasesId;
|
||||
//项目是否已公开
|
||||
private Long isPublic;
|
||||
//发版名称
|
||||
private String releaseName;
|
||||
//发版时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date releaseDate;
|
||||
//发版人
|
||||
private String releasePerson;
|
||||
//发版类型
|
||||
private String releaseType;
|
||||
//发版单位
|
||||
private String releaseUnit;
|
||||
//发版摘要
|
||||
private String releaseSummary;
|
||||
//发版详情
|
||||
private String releaseDetails;
|
||||
//联系人
|
||||
private String contactPerson;
|
||||
//联系时间
|
||||
private String contactPhone;
|
||||
//是否已转入成果库
|
||||
private Long isTransferredToAchievement;
|
||||
//转入成果库时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferDate;
|
||||
//是否精选成果
|
||||
private Long isSelectedAchievement;
|
||||
//图片
|
||||
private String images;
|
||||
//附件
|
||||
private String attachments;
|
||||
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
|
||||
|
||||
public String getUserIdentifier() {
|
||||
return userIdentifier;
|
||||
}
|
||||
|
||||
public void setUserIdentifier(String userIdentifier) {
|
||||
this.userIdentifier = userIdentifier;
|
||||
}
|
||||
|
||||
public String getProjectDomain() {
|
||||
return projectDomain;
|
||||
}
|
||||
|
||||
public void setProjectDomain(String projectDomain) {
|
||||
this.projectDomain = projectDomain;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(String identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setRepositoryId(Long repositoryId) {
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
|
||||
public Long getRepositoryId() {
|
||||
return repositoryId;
|
||||
}
|
||||
|
||||
public void setVersionReleasesId(Long versionReleasesId) {
|
||||
this.versionReleasesId = versionReleasesId;
|
||||
}
|
||||
|
||||
public Long getVersionReleasesId() {
|
||||
return versionReleasesId;
|
||||
}
|
||||
|
||||
public void setIsPublic(Long isPublic) {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
|
||||
public Long getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setReleaseName(String releaseName) {
|
||||
this.releaseName = releaseName;
|
||||
}
|
||||
|
||||
public String getReleaseName() {
|
||||
return releaseName;
|
||||
}
|
||||
|
||||
public void setReleaseDate(Date releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
public Date getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleasePerson(String releasePerson) {
|
||||
this.releasePerson = releasePerson;
|
||||
}
|
||||
|
||||
public String getReleasePerson() {
|
||||
return releasePerson;
|
||||
}
|
||||
|
||||
public void setReleaseType(String releaseType) {
|
||||
this.releaseType = releaseType;
|
||||
}
|
||||
|
||||
public String getReleaseType() {
|
||||
return releaseType;
|
||||
}
|
||||
|
||||
public void setReleaseUnit(String releaseUnit) {
|
||||
this.releaseUnit = releaseUnit;
|
||||
}
|
||||
|
||||
public String getReleaseUnit() {
|
||||
return releaseUnit;
|
||||
}
|
||||
|
||||
public void setReleaseSummary(String releaseSummary) {
|
||||
this.releaseSummary = releaseSummary;
|
||||
}
|
||||
|
||||
public String getReleaseSummary() {
|
||||
return releaseSummary;
|
||||
}
|
||||
|
||||
public void setReleaseDetails(String releaseDetails) {
|
||||
this.releaseDetails = releaseDetails;
|
||||
}
|
||||
|
||||
public String getReleaseDetails() {
|
||||
return releaseDetails;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToAchievement(Long isTransferredToAchievement) {
|
||||
this.isTransferredToAchievement = isTransferredToAchievement;
|
||||
}
|
||||
|
||||
public Long getIsTransferredToAchievement() {
|
||||
return isTransferredToAchievement;
|
||||
}
|
||||
|
||||
public void setTransferDate(Date transferDate) {
|
||||
this.transferDate = transferDate;
|
||||
}
|
||||
|
||||
public Date getTransferDate() {
|
||||
return transferDate;
|
||||
}
|
||||
|
||||
public void setIsSelectedAchievement(Long isSelectedAchievement) {
|
||||
this.isSelectedAchievement = isSelectedAchievement;
|
||||
}
|
||||
|
||||
public Long getIsSelectedAchievement() {
|
||||
return isSelectedAchievement;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public String getProjectDomainName() {
|
||||
return projectDomainName;
|
||||
}
|
||||
|
||||
public void setProjectDomainName(String projectDomainName) {
|
||||
this.projectDomainName = projectDomainName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Searcher {
|
||||
private Long id;
|
||||
private String searchType;
|
||||
private Long searchId;
|
||||
private String searchIds;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
|
@ -0,0 +1,268 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author microservices
|
||||
* @date 2025-04-08
|
||||
*/
|
||||
public class TaskResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//
|
||||
private Long id;
|
||||
//创客任务ID
|
||||
private Long taskId;
|
||||
//
|
||||
private Long paperId;
|
||||
//创客任务名称
|
||||
private String taskName;
|
||||
//任务领域
|
||||
private String taskDomain;
|
||||
//创客任务金额
|
||||
private BigDecimal taskAmount;
|
||||
//胜出交稿名称
|
||||
private String submissionName;
|
||||
//交稿时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date submissionDate;
|
||||
//交稿人
|
||||
private String submitterName;
|
||||
//交稿类型
|
||||
private String submissionType;
|
||||
//交稿单位
|
||||
private String submissionOrganization;
|
||||
//交稿摘要
|
||||
private String submissionSummary;
|
||||
//交稿详情
|
||||
private String releaseDetails;
|
||||
//联系人
|
||||
private String contactName;
|
||||
//联系电话
|
||||
private String contactPhone;
|
||||
//是否已转入成果库
|
||||
private Long isTransferredToResultsLibrary;
|
||||
//转入成果库时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferToResultsDate;
|
||||
//是否精选成果 0否 1是
|
||||
private Long isSelectedResult;
|
||||
//图片
|
||||
private String imageUrl;
|
||||
//附件
|
||||
private String attachmentUrl;
|
||||
private List<KeyValVo<String, String>> attachmentList;
|
||||
//专家审核
|
||||
private Integer expertReview;
|
||||
|
||||
public Integer getExpertReview() {
|
||||
return expertReview;
|
||||
}
|
||||
|
||||
public void setExpertReview(Integer expertReview) {
|
||||
this.expertReview = expertReview;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setPaperId(Long paperId) {
|
||||
this.paperId = paperId;
|
||||
}
|
||||
|
||||
public Long getPaperId() {
|
||||
return paperId;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskDomain(String taskDomain) {
|
||||
this.taskDomain = taskDomain;
|
||||
}
|
||||
|
||||
public String getTaskDomain() {
|
||||
return taskDomain;
|
||||
}
|
||||
|
||||
public void setTaskAmount(BigDecimal taskAmount) {
|
||||
this.taskAmount = taskAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaskAmount() {
|
||||
return taskAmount;
|
||||
}
|
||||
|
||||
public void setSubmissionName(String submissionName) {
|
||||
this.submissionName = submissionName;
|
||||
}
|
||||
|
||||
public String getSubmissionName() {
|
||||
return submissionName;
|
||||
}
|
||||
|
||||
public void setSubmissionDate(Date submissionDate) {
|
||||
this.submissionDate = submissionDate;
|
||||
}
|
||||
|
||||
public Date getSubmissionDate() {
|
||||
return submissionDate;
|
||||
}
|
||||
|
||||
public void setSubmitterName(String submitterName) {
|
||||
this.submitterName = submitterName;
|
||||
}
|
||||
|
||||
public String getSubmitterName() {
|
||||
return submitterName;
|
||||
}
|
||||
|
||||
public void setSubmissionType(String submissionType) {
|
||||
this.submissionType = submissionType;
|
||||
}
|
||||
|
||||
public String getSubmissionType() {
|
||||
return submissionType;
|
||||
}
|
||||
|
||||
public void setSubmissionOrganization(String submissionOrganization) {
|
||||
this.submissionOrganization = submissionOrganization;
|
||||
}
|
||||
|
||||
public String getSubmissionOrganization() {
|
||||
return submissionOrganization;
|
||||
}
|
||||
|
||||
public void setSubmissionSummary(String submissionSummary) {
|
||||
this.submissionSummary = submissionSummary;
|
||||
}
|
||||
|
||||
public String getSubmissionSummary() {
|
||||
return submissionSummary;
|
||||
}
|
||||
|
||||
public void setReleaseDetails(String releaseDetails) {
|
||||
this.releaseDetails = releaseDetails;
|
||||
}
|
||||
|
||||
public String getReleaseDetails() {
|
||||
return releaseDetails;
|
||||
}
|
||||
|
||||
public void setContactName(String contactName) {
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getContactName() {
|
||||
return contactName;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToResultsLibrary(Long isTransferredToResultsLibrary) {
|
||||
this.isTransferredToResultsLibrary = isTransferredToResultsLibrary;
|
||||
}
|
||||
|
||||
public Long getIsTransferredToResultsLibrary() {
|
||||
return isTransferredToResultsLibrary;
|
||||
}
|
||||
|
||||
public void setTransferToResultsDate(Date transferToResultsDate) {
|
||||
this.transferToResultsDate = transferToResultsDate;
|
||||
}
|
||||
|
||||
public Date getTransferToResultsDate() {
|
||||
return transferToResultsDate;
|
||||
}
|
||||
|
||||
public void setIsSelectedResult(Long isSelectedResult) {
|
||||
this.isSelectedResult = isSelectedResult;
|
||||
}
|
||||
|
||||
public Long getIsSelectedResult() {
|
||||
return isSelectedResult;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setAttachmentUrl(String attachmentUrl) {
|
||||
this.attachmentUrl = attachmentUrl;
|
||||
}
|
||||
|
||||
public String getAttachmentUrl() {
|
||||
return attachmentUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("paperId", getPaperId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("taskDomain", getTaskDomain())
|
||||
.append("taskAmount", getTaskAmount())
|
||||
.append("submissionName", getSubmissionName())
|
||||
.append("submissionDate", getSubmissionDate())
|
||||
.append("submitterName", getSubmitterName())
|
||||
.append("submissionType", getSubmissionType())
|
||||
.append("submissionOrganization", getSubmissionOrganization())
|
||||
.append("submissionSummary", getSubmissionSummary())
|
||||
.append("releaseDetails", getReleaseDetails())
|
||||
.append("contactName", getContactName())
|
||||
.append("contactPhone", getContactPhone())
|
||||
.append("isTransferredToResultsLibrary", getIsTransferredToResultsLibrary())
|
||||
.append("transferToResultsDate", getTransferToResultsDate())
|
||||
.append("isSelectedResult", getIsSelectedResult())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("attachmentUrl", getAttachmentUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Watcher {
|
||||
private Long id;
|
||||
private String watchableType;
|
||||
private Long watchableId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CompetitionListVo {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String categoryName;
|
||||
private Long status;
|
||||
private Long totalTaskDays;
|
||||
|
||||
private Long visits;
|
||||
private Long watchersCount;
|
||||
private Long registrationsCount;
|
||||
private Long opusCount;
|
||||
private Long opusDownloadCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
|
||||
public class ExpertAttachmentVo {
|
||||
private Long expertId;
|
||||
private Long academicAchievementsAttachments;
|
||||
private Long honorsAttachments;
|
||||
private Long resumeAttachments;
|
||||
private Long titleCertificateAttachments;
|
||||
|
||||
public Long getExpertId() {
|
||||
return expertId;
|
||||
}
|
||||
|
||||
public void setExpertId(Long expertId) {
|
||||
this.expertId = expertId;
|
||||
}
|
||||
|
||||
public Long getAcademicAchievementsAttachments() {
|
||||
return academicAchievementsAttachments;
|
||||
}
|
||||
|
||||
public void setAcademicAchievementsAttachments(Long academicAchievementsAttachments) {
|
||||
this.academicAchievementsAttachments = academicAchievementsAttachments;
|
||||
}
|
||||
|
||||
public Long getHonorsAttachments() {
|
||||
return honorsAttachments;
|
||||
}
|
||||
|
||||
public void setHonorsAttachments(Long honorsAttachments) {
|
||||
this.honorsAttachments = honorsAttachments;
|
||||
}
|
||||
|
||||
public Long getResumeAttachments() {
|
||||
return resumeAttachments;
|
||||
}
|
||||
|
||||
public void setResumeAttachments(Long resumeAttachments) {
|
||||
this.resumeAttachments = resumeAttachments;
|
||||
}
|
||||
|
||||
public Long getTitleCertificateAttachments() {
|
||||
return titleCertificateAttachments;
|
||||
}
|
||||
|
||||
public void setTitleCertificateAttachments(Long titleCertificateAttachments) {
|
||||
this.titleCertificateAttachments = titleCertificateAttachments;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
public class KeyValVo<K, V> {
|
||||
private K k;
|
||||
private V v;
|
||||
|
||||
// 默认构造函数
|
||||
public KeyValVo() {}
|
||||
|
||||
// 带参构造函数
|
||||
public KeyValVo(K k, V v) {
|
||||
this.k = k;
|
||||
this.v = v;
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
public K getK() {
|
||||
return k;
|
||||
}
|
||||
|
||||
public void setK(K k) {
|
||||
this.k = k;
|
||||
}
|
||||
|
||||
public V getV() {
|
||||
return v;
|
||||
}
|
||||
|
||||
public void setV(V v) {
|
||||
this.v = v;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ProjectListVo {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createdOn;
|
||||
private Long versionReleasesCount;
|
||||
private String projectLanguages;
|
||||
private String projectCategories;
|
||||
private Long categoryId;
|
||||
private Long praisesCount;
|
||||
private Long watchersCount;
|
||||
private Long forkedCount;
|
||||
private Long issuesCount;
|
||||
private Long pullRequestsCount;
|
||||
private Long commitsCount;
|
||||
private Long licenseId;
|
||||
private Long membersCount;
|
||||
private Long membersMonthAddCount;
|
||||
private Long projectSearchCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TaskListVo {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String categoryName;
|
||||
private Long categoryId;
|
||||
private BigDecimal bounty;
|
||||
private Long totalTaskDays;
|
||||
|
||||
private Long taskClickCount;
|
||||
private Long taskWatcherCount;
|
||||
private Long taskPapersCount;
|
||||
private Long taskJournalCount;
|
||||
private Long taskSearchCount;
|
||||
private Long taskDownloadCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class UserActionDataVo {
|
||||
private Long id;
|
||||
private String itemType;
|
||||
private Long itemId;
|
||||
private String itemName;
|
||||
private Long userId;
|
||||
private String userName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface CompetitionResourceLibraryMapper {
|
||||
|
||||
List<UserActionDataVo> selectRegisterCondition(UserActionDataVo clicker);
|
||||
|
||||
List<UserActionDataVo> selectOpusCondition(UserActionDataVo searcher);
|
||||
|
||||
Long countRegisterCondition(UserActionDataVo clicker);
|
||||
|
||||
Long countOpusCondition(UserActionDataVo searcher);
|
||||
|
||||
List<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo downloader);
|
||||
|
||||
CompetitionResourceLibrary selectCompetitionResourceLibraryById(Long id);
|
||||
|
||||
List<CompetitionResourceLibrary> selectCompetitionResourceLibraryList(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int insertCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int updateCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int deleteCompetitionResourceLibraryById(Long id);
|
||||
|
||||
int deleteCompetitionResourceLibraryByIds(Long[] ids);
|
||||
|
||||
List<KeyValVo<String, String>> getAttachments(@Param("id") Long id);
|
||||
|
||||
long getTotalOpenCompetitions();
|
||||
|
||||
long getTotalCompetitionAchievements();
|
||||
|
||||
long getTotalCompetitionSubmissions();
|
||||
|
||||
long getTotalFinishedCompetitions();
|
||||
|
||||
long getReviewCompetitionCount();
|
||||
|
||||
Long getCompetitionFinish();
|
||||
|
||||
Long getCompetitionEnroll();
|
||||
|
||||
Long getCompetitionUnderway();
|
||||
|
||||
Long getCompetitionSubmitCount();
|
||||
|
||||
Long getCompetitionTransferCount();
|
||||
|
||||
Long getCompetitionNeedAuditCount();
|
||||
|
||||
List<KeyValueVo> getCompetitionStatisticYearly();
|
||||
|
||||
List<Map<String,Object>> getCompetitionHot();
|
||||
|
||||
List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValVo<String, Long>> getCompetitionYearlyFinish(@Param("s") Date s, @Param("e") Date e);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue