Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

174 changed files with 504 additions and 8669 deletions

View File

@ -1,36 +0,0 @@
## 系统模块
~~~
com.microservices
├── microservices-ui // 前端框架
├── microservices-gateway // 网关模块
├── microservices-auth // 认证中心
├── microservices-api // 接口模块
│ └── microservices-api-system // 系统接口
├── microservices-common // 通用模块
│ └── microservices-common-async // 异步线程池配置
│ └── microservices-common-core // 核心模块
│ └── microservices-common-datascope // 权限范围
│ └── microservices-common-datasource // 多数据源
│ └── microservices-common-httpClient // http调用
│ └── microservices-common-log // 日志记录
│ └── microservices-common-redis // 缓存服务
│ └── microservices-common-seata // seata分布式事务
│ └── microservices-common-security // 安全模块
│ └── microservices-common-swagger // 系统接口
├── microservices-modules // 业务模块
│ └── microservices-cms // 内容管理模块
│ └── microservices-dms // 数据管理体系模块
│ └── microservices-dss // 数据统计系统模块
│ └── microservices-file // 文件服务
│ └── microservices-gen // 代码生成
│ └── microservices-job // 定时任务
│ └── microservices-pms // 项目管理系统模块
│ └── microservices-system // 系统模块
│ └── microservices-wiki // Wiki模块
│ └── microservices-zone // 特色专区系统模块
├── microservices-visual // 图形化管理模块
│ └── microservices-visual-monitor // 监控中心
├──pom.xml // 公共依赖
~~~

View File

@ -7,9 +7,9 @@ import com.microservices.system.api.domain.SysLogininfor;
import com.microservices.system.api.domain.SysOperLog;
import com.microservices.system.api.factory.RemoteLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
/**
* 日志服务
@ -38,20 +38,4 @@ public interface RemoteLogService
*/
@PostMapping("/logininfor")
public R<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 获取操作日志列表
*
* @param title 日志标题
* @param operUrl 操作地址
* @param status 操作状态
* @param topN 获取最新N条
* @return 操作日志列表
*/
@GetMapping("/operlog/latest")
R<List<SysOperLog>> getLatestOperLogList(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "operUrl", required = false) String operUrl,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "topN") Integer topN,
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

View File

@ -9,8 +9,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 日志服务降级处理
*
@ -38,12 +36,6 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
{
return null;
}
@Override
public R<List<SysOperLog>> getLatestOperLogList(String title, String operUrl, Integer status, Integer topN, String source)
{
return R.fail("获取最新操作日志失败:" + throwable.getMessage());
}
};
}

View File

@ -26,8 +26,6 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
@ -267,9 +265,4 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
cal.add(Calendar.DATE, -7 * times);
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, cal.getTime());
}
public static long dateTimeToUnix(Date date) {
// date.getTime() 返回当前 Date 对象表示的毫秒数除以 1000 后得到以秒为单位的时间戳 10 位时间戳
return date.getTime() / 1000;
}
}

View File

@ -1,125 +0,0 @@
package com.microservices.dms.achievementLibrary.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.system.api.domain.SysDictData;
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.AchievementDictData;
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
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-05-23
*/
@Api(tags = "数据管理体系-成果字典管理")
@RestController
@RequestMapping("/achDict")
public class AchievementDictDataController extends BaseController
{
@Autowired
private IAchievementDictDataService achievementDictDataService;
/**
* 查询成果相关字典列表
*/
@GetMapping("/list")
public TableDataInfo list(AchievementDictData achievementDictData)
{
startPage();
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
return getDataTable(list);
}
/**
* 导出成果相关字典列表
*/
@Log(title = "成果相关字典", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AchievementDictData achievementDictData)
{
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
ExcelUtil<AchievementDictData> util = new ExcelUtil<AchievementDictData>(AchievementDictData.class);
util.exportExcel(response, list, "成果相关字典数据");
}
/**
* 获取成果相关字典详细信息
*/
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable("dictCode") Long dictCode)
{
return success(achievementDictDataService.selectAchievementDictDataByDictCode(dictCode));
}
/**
* 新增成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AchievementDictData achievementDictData)
{
return toAjax(achievementDictDataService.insertAchievementDictData(achievementDictData));
}
/**
* 修改成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AchievementDictData achievementDictData)
{
return toAjax(achievementDictDataService.updateAchievementDictData(achievementDictData));
}
/**
* 删除成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
return toAjax(achievementDictDataService.deleteAchievementDictDataByDictCodes(dictCodes));
}
/**
* 根据字典类型查询字典数据信息
*/
@ApiOperation("根据成果字典分类查询成果值")
@GetMapping(value = "/getDictDateByType")
public AjaxResult getDictDateByType(String dictType)
{
List<KeyValueVo> data = achievementDictDataService.selectDictDataByType(dictType);
return success(data);
}
@ApiOperation("根据成果字典分类")
@GetMapping(value = "/getDictTypes")
public AjaxResult getDictTypes()
{
List<String> data = achievementDictDataService.getDictTypes();
return success(data);
}
}

View File

@ -86,13 +86,6 @@ public class AchievementsController extends BaseController {
return toAjax(achievementsService.deleteAchievementsByIds(ids));
}
@ApiOperation("删除成果数据")
@DeleteMapping("/deleteById")
public AjaxResult deleteById(Long id) {
return toAjax(achievementsService.deleteAchievementsById(id));
}
/**
* 获取精选成果
*
@ -217,17 +210,8 @@ public class AchievementsController extends BaseController {
}
@ApiOperation("根据成果ID获取近7日成果点击数量折线图")
@GetMapping("/get7AddClickById")
public AjaxResult get7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Achievements")
String clickType) {
return success(achievementsService.get7AddClickById(id,clickType));
}
@ApiOperation("根据专家id获取近7日成果点击数量折线图")
@GetMapping("/getExpert7AddClickById")
public AjaxResult getExpert7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Experts")
String clickType) {
return success(achievementsService.get7AddClickById(id,clickType));
public AjaxResult get7AddClickById(String id) {
return success(achievementsService.get7AddClickById(id));
}
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
@ -235,31 +219,16 @@ public class AchievementsController extends BaseController {
public AjaxResult getActDataStatisticById(Long id) {
return success(achievementsService.getActDataStatisticById(id));
}
@ApiOperation("根据领域来源、领域分类名称,获取领域相关数据")
@GetMapping("/getAllAreas")
public AjaxResult getAllAreas(String areaName) {
return success(achievementsService.getAllAreas(areaName));
}
@ApiOperation("根据领域,将成果数据进行分类")
/**
* 根据领域将成果数据进行分类
*
*/
@GetMapping("/getAreaStatistic")
public AjaxResult getAreaStatistic(String areaKey)
{
return success(achievementsService.getAreaStatistic(areaKey));
}
@ApiOperation("根据领域获取领域详情")
@GetMapping("/getAreaDetail")
public AjaxResult getAreaDetail(String areaKey,String kyxmSum,String source)
{
return success(achievementsService.getAreaDetail(areaKey,kyxmSum,source));
}
/**
* 获取开源项目的相关成果
*/
@ -270,41 +239,10 @@ public class AchievementsController extends BaseController {
return success(achievementsService.getRelatedAch(id,sourceId));
}
@ApiOperation(value = "获取开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetition")
public AjaxResult getRelatedAchCompetition(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchCompetition(id,sourceId));
}
@ApiOperation(value = "获取创客任务的相关成果")
@GetMapping("/getRelatedAchTask")
public AjaxResult getRelatedAchTask(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchTask(id,sourceId));
}
@ApiOperation(value = "获取专家-创客任务的相关成果")
@GetMapping("/getRelatedAchTaskOfExpert")
public AjaxResult getRelatedAchTaskOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchTaskOfExpert(expertId));
}
@ApiOperation(value = "获取专家-开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetitionOfExpert")
public AjaxResult getRelatedAchCompetitionOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchCompetitionOfExpert(expertId));
}
@ApiOperation(value = "搜索行为数据记录")
@GetMapping("/getSearchResult")
public AjaxResult getSearchResult(String achName,Long userId)
{
return success(achievementsService.getSearchResult(achName,userId));
}
}

View File

@ -1,116 +0,0 @@
package com.microservices.dms.achievementLibrary.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.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import com.microservices.dms.achievementLibrary.service.BlockChainService;
import com.microservices.dms.achievementLibrary.service.InBlockchainDataServiceImpl;
import com.microservices.dms.common.vo.UserCreateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/blockChain")
@Api(tags = "数据管理体系-数据产权子系统")
public class BlockChainController extends BaseController {
@Autowired
private BlockChainService blockChainService;
@Autowired
private InBlockchainDataServiceImpl inBlockchainDataService;
@GetMapping("/projectTokenList")
@ApiOperation(value = "项目token列表")
public TableDataInfo projectTokenList(String projectName) {
startPage();
List<TokenListVo> list = blockChainService.projectTokenList(projectName);
return getDataTable(list);
}
@GetMapping("/projectTokenDistribute")
@ApiOperation(value = "项目token分配、点击token分配按钮弹出框展示相关数据项目名称、分配token、被分配人")
public AjaxResult projectTokenDistribute(InLinkProjectVo projectVo) {
return blockChainService.projectTokenDistribute(projectVo);
}
@GetMapping("/issueDataList")
@ApiOperation(value = "入链issue列表")
public TableDataInfo issueDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.issueDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/commitDataList")
@ApiOperation(value = "入链commit列表")
public TableDataInfo commitDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.commitDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/prDataList")
@ApiOperation(value = "入链PR列表")
public TableDataInfo prDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.prDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/userDataList")
@ApiOperation(value = "入链user列表")
public TableDataInfo userDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map> list = blockChainService.userDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/userList")
@ApiOperation(value = "用户列表列表")
public TableDataInfo userList(UserVo userVo) {
startPage();
List<UserVo> list = blockChainService.userList(userVo);
return getDataTable(list);
}
@GetMapping("/InBlockchainDataList")
@ApiOperation(value = "查询区块链数据入链列表")
public TableDataInfo list(InBlockchainData inBlockchainData) {
startPage();
List<InBlockchainData> list = inBlockchainDataService.selectInBlockchainDataList(inBlockchainData);
return getDataTable(list);
}
@ApiOperation("提供入链项目信息查询")
@GetMapping("/queryBlockInfo")
public AjaxResult queryBlockInfo (String type,String typeId) {
return blockChainService.queryBlockInfo(type,typeId);
}
@ApiOperation("根据项目id获取用户对应的token")
@GetMapping("/getUserTokenByProjectId")
public AjaxResult getUserTokenByProjectId (String type,String userName,String tokenName) {
return blockChainService.getUserTokenByProjectId(type,userName,tokenName);
}
@ApiOperation("获取用户对应的所有项目token")
@GetMapping("/getUserAllProjectToken")
public AjaxResult getUserAllProjectToken (String userName) {
return blockChainService.getUserAllProjectToken(userName);
}
}

View File

@ -1,51 +0,0 @@
package com.microservices.dms.achievementLibrary.controller;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.dms.achievementLibrary.service.BlockChainService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/blockFisco")
@Api(tags = "数据管理体系-数据产权入链交易")
public class BlockFiscoController {
@Autowired
private BlockChainService blockChainService;
@GetMapping("/getTransactionByHash")
@ApiOperation(value = "通过交易哈希获取交易详情")
public AjaxResult getTransactionByHash(String txHash) {
return AjaxResult.success(blockChainService.getTransactionByHash(txHash));
}
@ApiOperation(value = "交易哈希获取交易回执")
@GetMapping("/getTransactionReceipt")
public AjaxResult getTransactionReceipt(String txHash) {
return AjaxResult.success(blockChainService.getTransactionReceipt(txHash));
}
@ApiOperation(value = "获取最新区块号")
@GetMapping("/blockNumber")
public AjaxResult getBlockNumber() {
return AjaxResult.success(blockChainService.getBlockNumber());
}
@ApiOperation(value = "获取区块链总交易数")
@GetMapping("/getTotalTransactionCount")
public AjaxResult getTotalTransactionCount() {
return AjaxResult.success(blockChainService.getTotalTransactionCount());
}
}

View File

@ -37,7 +37,7 @@ public class ExpertDashboardController {
}
@GetMapping(value = "getExpertAduit")
@ApiOperation(value = "专家评审作品数排序")
@ApiOperation(value = "近一年专家评审作品数")
public AjaxResult getExpertAduit() {
return AjaxResult.success(expertDashboardService.getExpertAduit());
}

View File

@ -36,25 +36,25 @@ public class MemoDashboardController {
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
}
@GetMapping(value = "getForumSectionStatistic")
@GetMapping(value = "getForumSectionStatistic(")
@ApiOperation(value = "帖子分类")
public AjaxResult getForumSectionStatistic() {
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
}
@GetMapping(value = "getAddMemoStatistic")
@GetMapping(value = "getAddMemoStatistic(")
@ApiOperation(value = "近一年新增帖子数")
public AjaxResult getAddMemoStatistic() {
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
}
@GetMapping(value = "getTop5Memos")
@GetMapping(value = "getTop5Memos(")
@ApiOperation(value = "年度帖子热度top5")
public AjaxResult getTop5Memos() {
return AjaxResult.success(memoDashboardService.getTop5Memos());
}
@GetMapping(value = "get7DayPaise")
@GetMapping(value = "get7DayPaise(")
@ApiOperation(value = "近7日帖子点赞数")
public AjaxResult get7DayPaise() {
return AjaxResult.success(memoDashboardService.get7DayPaise());

View File

@ -43,17 +43,6 @@ public class SchoolEnterpriseAchievementsController extends BaseController
return getDataTable(list);
}
/**
* 查询校企成果列表
*/
@GetMapping("/listFront")
public TableDataInfo listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
{
startPage();
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.listFront(schoolEnterpriseAchievements);
return getDataTable(list);
}
/**
* 导出校企成果列表
*/

View File

@ -1,15 +0,0 @@
package com.microservices.dms.achievementLibrary.domain;
import lombok.Data;
import java.util.List;
@Data
public class AchDetailVo {
private List<Achievements> achievementsList;
private long clickSum;
private long dockSum;
private long favoriteSum;
private long watcherSum;
private String remark;
}

View File

@ -6,7 +6,6 @@ public class AchQueryVo {
private String source;//来源
private String achievementName;//名称
private Long userId;
private String showAchievementName;
public String getAreaQuery() {
return areaQuery;
}
@ -30,20 +29,4 @@ public class AchQueryVo {
public void setAchievementName(String achievementName) {
this.achievementName = achievementName;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -9,7 +9,6 @@ public class AchRelatedVo {
private String source;
private Long sourceId;
private String achRelateName;
private String showAchievementName;
public Long getId() {
return id;
@ -74,12 +73,4 @@ public class AchRelatedVo {
public void setAchRelateName(String achRelateName) {
this.achRelateName = achRelateName;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -1,112 +0,0 @@
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_dict_data
*
* @author microservices
* @date 2025-05-23
*/
public class AchievementDictData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 字典编码 */
private Long dictCode;
/** 字典排序 */
@Excel(name = "字典排序")
private Integer dictSort;
/** 字典标签 */
@Excel(name = "字典标签")
private String dictLabel;
/** 字典键值 */
@Excel(name = "字典键值")
private String dictValue;
/** 字典类型 */
@Excel(name = "字典类型")
private String dictType;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public void setDictCode(Long dictCode)
{
this.dictCode = dictCode;
}
public Long getDictCode()
{
return dictCode;
}
public void setDictSort(Integer dictSort)
{
this.dictSort = dictSort;
}
public Integer getDictSort()
{
return dictSort;
}
public void setDictLabel(String dictLabel)
{
this.dictLabel = dictLabel;
}
public String getDictLabel()
{
return dictLabel;
}
public void setDictValue(String dictValue)
{
this.dictValue = dictValue;
}
public String getDictValue()
{
return dictValue;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getDictType()
{
return dictType;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dictCode", getDictCode())
.append("dictSort", getDictSort())
.append("dictLabel", getDictLabel())
.append("dictValue", getDictValue())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -2,7 +2,6 @@ package com.microservices.dms.achievementLibrary.domain;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
@ -30,10 +29,6 @@ public class Achievements extends BaseEntity {
*/
@Excel(name = "成果名称")
private String achievementName;
/**
* 成果展示名称
*/
private String showAchievementName;
/**
* 成果领域1
@ -176,18 +171,9 @@ public class Achievements extends BaseEntity {
@Excel(name = "成果附件")
private String attachments;
//成果小类
private String ext1;
//成果状态
private String ext2;
//成果团队名称
private String ext3;
private Long clickSum;
private Long watcherSum;
private Long favoriteSum;
private Long dockSum;
private String filedDesc;
private Float hotRank;
private Long attachmentCount;
private Integer isExpertAudit;
@ -195,63 +181,6 @@ public class Achievements extends BaseEntity {
private String userNickName;
public String gender;
private String userLogin;
private List<Map<String,Object>> dockingUserInfo;
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
public List<Map<String, Object>> getDockingUserInfo() {
return dockingUserInfo;
}
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
this.dockingUserInfo = dockingUserInfo;
}
public String getFiledDesc() {
return filedDesc;
}
public void setFiledDesc(String filedDesc) {
this.filedDesc = filedDesc;
}
public Long getDockSum() {
return dockSum;
}
public void setDockSum(Long dockSum) {
this.dockSum = dockSum;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
public String getUserImg() {
return userImg;
@ -551,4 +480,38 @@ public class Achievements extends BaseEntity {
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();
}
}

View File

@ -15,15 +15,6 @@ public class AreaStatisticVo {
private Long kfjsSum;
//校企成果汇总
private Long xqcgSum;
private String source;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getAreaName() {
return areaName;

View File

@ -1,12 +0,0 @@
package com.microservices.dms.achievementLibrary.domain;
import lombok.Data;
@Data
public class BlockchainListQueryVo {
private String projectName;
private String issueName;
private String prName;
private String userName;
private Long userId;
}

View File

@ -1,95 +0,0 @@
package com.microservices.dms.achievementLibrary.domain;
public class HotAchVo {
private int watcher;
private int faviter;
private int total;
private String gender;
private String name;
private String showAchievementName;
private Long id;
private String userNickName;
private String userName;
private String userImg;
public String getUserImg() {
return userImg;
}
public void setUserImg(String userImg) {
this.userImg = userImg;
}
public int getWatcher() {
return watcher;
}
public void setWatcher(int watcher) {
this.watcher = watcher;
}
public int getFaviter() {
return faviter;
}
public void setFaviter(int faviter) {
this.faviter = faviter;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserNickName() {
return userNickName;
}
public void setUserNickName(String userNickName) {
this.userNickName = userNickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -1,7 +1,6 @@
package com.microservices.dms.achievementLibrary.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -146,8 +145,8 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
/**
* 成果审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date reviewDate;
/**
@ -168,46 +167,6 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
@Excel(name = "成果附件")
private String attachments;
private Integer achievementStatus;
//成果小类型
private String achievementLittleType;
//成果状态
private String achievementCurStatus;
//团队名称
private String teamName;
private List<AchievementTeam> teamList;
public List<AchievementTeam> getTeamList() {
return teamList;
}
public void setTeamList(List<AchievementTeam> teamList) {
this.teamList = teamList;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getAchievementLittleType() {
return achievementLittleType;
}
public void setAchievementLittleType(String achievementLittleType) {
this.achievementLittleType = achievementLittleType;
}
public String getAchievementCurStatus() {
return achievementCurStatus;
}
public void setAchievementCurStatus(String achievementCurStatus) {
this.achievementCurStatus = achievementCurStatus;
}
public Integer getAchievementStatus() {
return achievementStatus;

View File

@ -1,24 +0,0 @@
package com.microservices.dms.achievementLibrary.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class TokenListVo {
private Long id; // 项目ID
private String name; // 项目名称
private String userId;//用户id
private Long totalToken; // 项目总Token
private String createBy; // 创建人
private Long issueToken;//issueToken
private Long currentToken; // 当前Token
private String repositoryName; // 仓库名称
private Long repositoryId; // 仓库名称
private Long applyToken;//已分配token
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdOn; // 项目创建时间
private Long ableApplyToken;//责任人可分配token
}

View File

@ -1,81 +0,0 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
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;
/**
* 区块链数据入链对象 in_blockchain_data
*
* @author microservices
* @date 2025-05-27
*/
public class InBlockchainData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 数据类型pr、issue、commit */
@Excel(name = "数据类型pr、issue、commit")
private String type;
/** 关联类型的唯一标识符 */
@Excel(name = "关联类型的唯一标识符")
private String typeId;
/** 交易哈希值 */
@Excel(name = "交易哈希值")
private String txHash;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setTypeId(String typeId)
{
this.typeId = typeId;
}
public String getTypeId()
{
return typeId;
}
public void setTxHash(String txHash)
{
this.txHash = txHash;
}
public String getTxHash()
{
return txHash;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("type", getType())
.append("typeId", getTypeId())
.append("txHash", getTxHash())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.toString();
}
}

View File

@ -1,35 +0,0 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
import java.io.Serializable;
public class InLinkProjectVo implements Serializable {
private Long amount;
private String projectId;
private String userId;
public Long getAmount() {
return this.amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}

View File

@ -1,152 +0,0 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
import java.math.BigDecimal;
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;
/**
* 用户/项目转账信息记录对象 user_project_transfer_records
*
* @author microservices
* @date 2025-05-27
*/
public class UserProjectTransferRecords extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 唯一标识每条记录 */
private Long id;
/** 付款方ID */
@Excel(name = "付款方ID")
private String payerId;
/** 项目ID */
@Excel(name = "项目ID")
private String projectId;
/** 转账金额,支持高精度数值 */
@Excel(name = "转账金额,支持高精度数值")
private BigDecimal token;
/** 收款方ID */
@Excel(name = "收款方ID")
private String payeeId;
/** 交易哈希值,确保每一笔交易唯一 */
@Excel(name = "交易哈希值,确保每一笔交易唯一")
private String txHash;
/** 转账类型project、user */
@Excel(name = "转账类型project、user")
private String type;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String reserve1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String reserve2;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPayerId(String payerId)
{
this.payerId = payerId;
}
public String getPayerId()
{
return payerId;
}
public void setProjectId(String projectId)
{
this.projectId = projectId;
}
public String getProjectId()
{
return projectId;
}
public void setToken(BigDecimal token)
{
this.token = token;
}
public BigDecimal getToken()
{
return token;
}
public void setPayeeId(String payeeId)
{
this.payeeId = payeeId;
}
public String getPayeeId()
{
return payeeId;
}
public void setTxHash(String txHash)
{
this.txHash = txHash;
}
public String getTxHash()
{
return txHash;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setReserve1(String reserve1)
{
this.reserve1 = reserve1;
}
public String getReserve1()
{
return reserve1;
}
public void setReserve2(String reserve2)
{
this.reserve2 = reserve2;
}
public String getReserve2()
{
return reserve2;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("payerId", getPayerId())
.append("projectId", getProjectId())
.append("token", getToken())
.append("payeeId", getPayeeId())
.append("txHash", getTxHash())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("type", getType())
.append("reserve1", getReserve1())
.append("reserve2", getReserve2())
.toString();
}
}

View File

@ -1,22 +0,0 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
public class UserVo {
private Long id;
private String nickname;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
}

View File

@ -1,74 +0,0 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 成果相关字典Mapper接口
*
* @author microservices
* @date 2025-05-23
*/
@Mapper
@Slave
public interface AchievementDictDataMapper
{
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典集合
*/
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int insertAchievementDictData(AchievementDictData achievementDictData);
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int updateAchievementDictData(AchievementDictData achievementDictData);
/**
* 删除成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
public int deleteAchievementDictDataByDictCode(Long dictCode);
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的数据主键集合
* @return 结果
*/
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType);
int selectDictDataByLabel(@Param("label") String label,@Param("type") String type);
List<String> getDictTypes();
}

View File

@ -66,6 +66,4 @@ public interface AchievementTeamMapper
public int deleteAchievementTeamByIds(Long[] ids);
void deleteAchievementTeamByAId(@Param("aid") Long aid);
List<AchievementTeam> selectAchievementTeamByAchId(@Param("achId") Long achId);
}

View File

@ -1,18 +1,18 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.*;
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.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;
/**
* 成果Mapper接口
@ -91,7 +91,7 @@ public interface AchievementsMapper {
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
List<HotAchVo> getHotAchievement();
List<Map<String, String>> getHotAchievement();
Map<String, Long> indexProjectStatistic();
@ -115,7 +115,7 @@ public interface AchievementsMapper {
List<Map<String, Object>> getAchievementType();
List<KeyValueVo> getAchievementActData(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActData();
List<Map<String, Object>> getAchievementDomain();
@ -125,7 +125,7 @@ public interface AchievementsMapper {
List<Long> getAllId();
List<AreaStatisticVo> getAreaStatistic(@Param("source")String source,@Param("areaKey") String areaKey);
List<AreaStatisticVo> getAreaStatistic(@Param("areaKey") String areaKey);
List<AchRelatedVo> getRelatedAch(@Param("id")Long id, @Param("sourceId") List<Long> sourceId, @Param("paramYear")String paramYear);
@ -140,35 +140,4 @@ public interface AchievementsMapper {
List<String> getExpertAreasByName(@Param("areaName") String areaName);
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdCompetition(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdTask(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(@Param("id")Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(@Param("id")Long id);
List<KeyValVo<String,Long>> getAchievementAddYearlyData(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataW(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataC(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataD(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
List<Map<String, Object>> getDockingUserInfo(@Param("id") Long id);
List<Achievements> selectAchievementsByArea(AchQueryVo achQueryVo);
List<KeyValVo<String, Long>> getExperts(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAllAreas(@Param("areaName") String areaName);
void updateRelationAchievements(@Param("source") String source,@Param("sourceId") Long sourceId);
List<Map<String, Object>> getDockingUserInfoList(@Param("id") Long id);
String getField1RemarkByParam(@Param("source")String source,@Param("areaKey") String areaKey);
}

View File

@ -1,82 +0,0 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import java.util.Map;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.common.vo.CommitCreateVo;
import com.microservices.dms.common.vo.CommitResultVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 区块链数据入链Mapper接口
*
* @author microservices
* @date 2025-05-27
*/
@Mapper
@Slave
public interface InBlockchainDataMapper
{
/**
* 查询区块链数据入链
*
* @param id 区块链数据入链主键
* @return 区块链数据入链
*/
public InBlockchainData selectInBlockchainDataById(Long id);
/**
* 查询区块链数据入链列表
*
* @param inBlockchainData 区块链数据入链
* @return 区块链数据入链集合
*/
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData);
/**
* 新增区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int insertInBlockchainData(InBlockchainData inBlockchainData);
/**
* 修改区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int updateInBlockchainData(InBlockchainData inBlockchainData);
/**
* 删除区块链数据入链
*
* @param id 区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataById(Long id);
/**
* 批量删除区块链数据入链
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInBlockchainDataByIds(Long[] ids);
List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo);
List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo);
List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo);
List<String> getNeedToBlockCommitList();
List<CommitResultVo> getCommitListById(@Param("projectId") String projectId);
}

View File

@ -1,73 +0,0 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import java.util.Map;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户/项目转账信息记录Mapper接口
*
* @author microservices
* @date 2025-05-27
*/
@Mapper
@Slave
public interface UserProjectTransferRecordsMapper
{
/**
* 查询用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 用户/项目转账信息记录
*/
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id);
/**
* 查询用户/项目转账信息记录列表
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 用户/项目转账信息记录集合
*/
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords);
/**
* 新增用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
/**
* 修改用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
/**
* 删除用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsById(Long id);
/**
* 批量删除用户/项目转账信息记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteUserProjectTransferRecordsByIds(Long[] ids);
List<Map> userDataList(BlockchainListQueryVo queryVo);
List<UserVo> userList(UserVo userVo);
}

View File

@ -1,6 +1,5 @@
package com.microservices.dms.achievementLibrary.service;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
@ -21,17 +20,14 @@ public class BigScreenStatisticService {
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
public Map<String, Object> getAchievementTopStatistic(String source) {
//获取本周近7天)的数据
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.getDateStrMMDD(days[0], days[1]);
//获取上周7-14天前的数据
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 {
@ -62,99 +58,18 @@ public class BigScreenStatisticService {
return achievementsMapper.getAchievementType();
}
public List<Map<String,Object>> getAchievementActData() {
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> wlist = achievementsMapper.getAchievementActDataW(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> clist = achievementsMapper.getAchievementActDataC(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> dlist = achievementsMapper.getAchievementActDataD(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> flist = achievementsMapper.getAchievementActDataF(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
List<KeyValueVo> wres = new ArrayList<>();
List<KeyValueVo> cres = new ArrayList<>();
List<KeyValueVo> dres = new ArrayList<>();
List<KeyValueVo> fres = new ArrayList<>();
for (String s : dateStr) {
Long a = wlist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("关注");
wres.add(k1);
}
for (String s : dateStr) {
Long a = clist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("浏览");
cres.add(k1);
}
for (String s : dateStr) {
Long a = dlist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("下载");
dres.add(k1);
}
for (String s : dateStr) {
Long a = flist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("收藏");
fres.add(k1);
}
List<Map<String, Object>> r = new ArrayList<>();
Map<String, Object> w = new HashMap<>();
w.put("key", "关注");
w.put("value", wres);
Map<String, Object> c = new HashMap<>();
c.put("key","浏览");
c.put("value", cres);
Map<String, Object> d = new HashMap<>();
d.put("key","下载");
d.put("value", dres);
Map<String, Object> f = new HashMap<>();
f.put("key", "收藏");
f.put("value", fres);
r.add(w);
r.add(c);
r.add(d);
r.add(f);
return r;
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 Object getAchievementAddYearly() {
Date[] currentYear = DateUtil.getLast12Months();
Map<String, Long> m = achievementsMapper.getAchievementAddYearlyData(currentYear[0],currentYear[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrYYYYMM(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<Map<String, Object>> getAchievementAddYearly() {
return achievementsMapper.getAchievementAddYearly();
}
public List<Map<String, Object>> getAchievementHotRank() {
@ -186,13 +101,12 @@ public class BigScreenStatisticService {
return competitionResourceLibraryMapper.getCompetitionHot();
}
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
Date[] currentYear = DateUtil.getLast12Months();
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.getDateStrYYYYMM(currentYear[0], currentYear[1]);
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);
@ -205,11 +119,12 @@ public class BigScreenStatisticService {
}
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
Date[] currentYear = DateUtil.getLast12Months();
Date[] currentYear = DateUtil.getCurrentYear();
Date[] YearEndOfCur = DateUtil.getCurrentYearEndOf(LocalDate.now());
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(currentYear[0],currentYear[1])
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(YearEndOfCur[0],YearEndOfCur[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
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);

View File

@ -1,595 +0,0 @@
package com.microservices.dms.achievementLibrary.service;
import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.httpClient.service.HttpAPIService;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
import com.microservices.dms.common.vo.*;
import com.microservices.dms.referral.mapper.TalentReferralMapper;
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
import com.microservices.dms.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
//import org.fisco.bcos.sdk.client.Client;
//import org.fisco.bcos.sdk.client.protocol.request.Transaction;
//import org.fisco.bcos.sdk.client.protocol.response.BcosTransaction;
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 java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static com.microservices.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
import static com.microservices.dms.constant.BlockChainFunConstants.*;
import static com.microservices.dms.utils.DateUtil.formatLocalDateTimePlusH;
@Service
@Slf4j
public class BlockChainService {
@Autowired
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
@Value("${gitlink.fiscobcosUrl:localhost}")
public String fiscobcosUrl;
@Autowired
private HttpAPIService httpAPIService;
@Autowired
private InBlockchainDataMapper inBlockchainDataMapper;
@Autowired
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
@Autowired
private TalentReferralMapper talentReferralMapper;
public List<TokenListVo> projectTokenList(String projectName) {
List<TokenListVo> list = projectResourceLibraryMapper.selectProjectInfos(projectName);
for (TokenListVo v : list) {
JSONObject param = queryProjectInfo(v);
if(param != null) {
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
v.setIssueToken(issueTokenSum);
long totalToken = Long.parseLong(param.getString("total_supply"));//总token
v.setTotalToken(totalToken);
//根据创建人login获取对应的用户id
String userName = v.getUserId();
//根据创建人项目Id,获取创建人拥有token
String tokenName = param.getString("token_name");
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
v.setApplyToken(applyToken);
v.setCurrentToken(totalToken - applyToken);
}
v.setCreatedOn(DateUtil.plusHours(v.getCreatedOn(), 8));
}
return list;
}
public Long getUserBlanaceProjectId(String type,String userName,String tokenName) {
JSONObject params = new JSONObject();
if(type.equals(USER_SINGLE_INFO)){
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", tokenName);
params.put("username", userName);
}else if(type.equals(USER_ALL_INFO)){
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
}
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return Long.parseLong(rsp.getString("balance"));
}
return -1L;
}
private JSONObject queryProjectInfo(TokenListVo v) {
JSONObject param = new JSONObject();
param.put(REQUEST_TYPE, QUERY_REPO);
param.put("token_name", String.valueOf(v.getId()));
JSONObject jsonObject = queryFiscobcos(param);
if (jsonObject != null) {
return jsonObject;
}
return null;
}
private JSONObject queryFiscobcos(JSONObject param) {
try {
// Map<String,String> p = convertParams(param);
// JSONObject from = JSONObject.from(p);
JSONObject reps = httpAPIService.doPost(fiscobcosUrl, param);
// if (result.getCode() != 200) {
// return null;
// }
// JSONObject reps = JSONObject.parseObject(result.getContent());
if (reps.containsKey(RESP_STATUS) && reps.getString(RESP_STATUS).equals("0")) {
return reps;
}
} catch (Exception e) {
log.error("区块链接口请求失败", e);
return null;
}
return null;
}
private Map<String, String> convertParams(JSONObject param) {
Set<String> keys = param.keySet();
Map<String, String> r = new HashMap<>();
// 遍历 key 集合并获取对应的 value
for (String key : keys) {
Object o = param.get(key);
if (o != null) {
if (o instanceof String || o instanceof Integer || o instanceof Long || o instanceof BigDecimal || o instanceof Double) {
r.put(key, param.getString(key));
} else if (o instanceof LocalDateTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String format = formatter.format(LocalDateTime.parse(o.toString(), formatter));
r.put(key, format);
} else if (o instanceof Date) {
String s = DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, (Date) o);
r.put(key, s);
} else if (o instanceof List || o instanceof Map) {
String jsonString = JSONObject.toJSONString(o);
r.put(key, jsonString);
}else {
r.put(key, o.toString());
}
}else {
r.put(key, null);
}
}
return r;
}
public AjaxResult projectTokenDistribute(InLinkProjectVo vo) {
//根据项目ID获取用户ID
//根据项目id获取项目创建人
String userId = projectResourceLibraryMapper.getProjectUserIdById(vo.getProjectId());
validTokenCount(vo.getProjectId(), vo.getAmount(),userId);
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
params.put("token_name", vo.getProjectId());
params.put("amount", vo.getAmount());
params.put("payee", vo.getUserId());
params.put("payer", userId);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4将3入链成功的数据存入表 用户/项目转账信息记录表 type:project payer_idusername)
if (StringUtils.isNotEmpty(txHash)) {
UserProjectTransferRecords records = new UserProjectTransferRecords();
records.setPayerId(params.getString("payer"));//转账人
records.setPayeeId(params.getString("payee"));//收款人
records.setProjectId(vo.getProjectId());
records.setToken(BigDecimal.valueOf(vo.getAmount()));
records.setType("projectApply");//项目分配
records.setCreateTime(DateUtils.getNowDate());
records.setTxHash(txHash);
records.setCreateBy(SecurityUtils.getUsername());
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
}
return AjaxResult.success();
}
return AjaxResult.error();
}
public AjaxResult userCreate(UserCreateVo userCreateVo) {
//根据项目id获取项目创建人
String userId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayee());//收款人ID
userCreateVo.setPayee(userId);
String payerId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayer());//转账人ID
userCreateVo.setPayer(payerId);
//转账人token充足
validUserTokenCount(userCreateVo);
//进行转账
JSONObject params = JSONObject.from(userCreateVo);
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 将2入链成功的数据新增到用户/项目转账信息记录表 type:user payer_idpayer)
if (StringUtils.isNotEmpty(txHash)) {
UserProjectTransferRecords records = new UserProjectTransferRecords();
records.setPayerId(params.getString("payer"));
records.setPayeeId(params.getString("payee"));
records.setProjectId(params.getString("token_name"));
records.setToken(params.getBigDecimal("amount"));
records.setType("userTransfer");//用户转账
records.setTxHash(txHash);
records.setCreateTime(DateUtils.getNowDate());
records.setCreateBy(SecurityUtils.getUsername());
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
return AjaxResult.success(rsp);
}
}
return AjaxResult.error();
}
//判断用户当前项目剩余token是否还支持分配
private void validUserTokenCount(UserCreateVo userCreateVo) {
//现根据用户id,以及项目名称查询对应用户拥有的token
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", userCreateVo.getToken_name());
params.put("username", userCreateVo.getPayer());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if(rsp != null) {
long curToken = Long.parseLong(rsp.getString("balance"));
Long amount = userCreateVo.getAmount();
if (curToken <amount) {
throw new ServiceException("token数量不足");
}
}
}
//判断项目剩余token是否还支持分配
private void validTokenCount(String tokenName, Long amount,String userName) {
TokenListVo v = new TokenListVo();
if(StringUtils.isEmpty(tokenName)) {
throw new ServiceException("项目ID不能为空");
}
v.setId(Long.parseLong(Optional.ofNullable(tokenName).orElse("-1")));
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
v.setIssueToken(issueTokenSum);
//根据创建人项目Id,获取创建人拥有token
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
v.setApplyToken(applyToken);
long curToken = applyToken - issueTokenSum;
if (curToken < amount) {
throw new ServiceException("token数量不足");
}
}
private Long queryTotalToken(TokenListVo v) {
if(v.getName().equals("区块链测试")){
System.out.println("zzz");
}
JSONObject param = new JSONObject();
param.put(REQUEST_TYPE, QUERY_REPO);
param.put("token_name", String.valueOf(v.getId()));
JSONObject jsonObject = queryFiscobcos(param);
if (jsonObject != null) {
return jsonObject.getLong("total_supply");
}
return -1L;
}
public AjaxResult prCreate(PrCreateVo prCreateVo) {
Map<String, Object> res = projectResourceLibraryMapper.selectPrInfo(prCreateVo.getPr_id());
if (res != null) {
JSONObject params = JSONObject.from(res);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
params.put("updated_at", DataUtilsStr());
params.put("pull_request_number", params.getLong("pull_request_number"));
params.put(REQUEST_TYPE, CREATE_PR);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
//将对应的token todo
// insert to db 新增表pr入链关联id,type,type_id,tx_hash,create_time (type:pr,type_id:"pull_request_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("pr");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(prCreateVo.getPr_id());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
private String DataUtilsStr() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(DateUtils.getNowDate());
}
public AjaxResult issueCreateUpdate(IssueCreateVo issueCreateVo) {
Map<String, Object> res = projectResourceLibraryMapper.selectIssueInfo(issueCreateVo.getIssue_id());
if (res != null) {
JSONObject params = JSONObject.from(res);
params.put(REQUEST_TYPE, CREATE_UPDATE_ISSUE);
params.put("updated_at", DataUtilsStr());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("issue");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(issueCreateVo.getIssue_id());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
public List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.issueDataList(queryVo);
handleForgeDate(maps);
return maps;
}
private void handleForgeDate(List<Map<String, Object>> maps){
for (Map<String, Object> m : maps) {
LocalDateTime updatedAt = (LocalDateTime) m.get("updated_at");
LocalDateTime createdAt = (LocalDateTime) m.get("created_at");
m.put("updated_at",formatLocalDateTimePlusH(updatedAt,8));
m.put("created_at",formatLocalDateTimePlusH(createdAt,8));
if (m.containsKey("committer_time")) {
LocalDateTime committer_time = (LocalDateTime) m.get("committer_time");
m.put("committer_time",formatLocalDateTimePlusH(committer_time,8));
}
}
}
//定时任务将commit数据入链
// @Scheduled(cron = "${cron.commitPushBlock}")
public void commitPushBlock() {
//先查询需要入链的数据
List<String> commitIdList = inBlockchainDataMapper.getNeedToBlockCommitList();
if(commitIdList!=null && commitIdList.size()>0) {
//遍历数据入区块链
for(String commitId : commitIdList) {
CommitCreateVo commitCreateVo = new CommitCreateVo();
commitCreateVo.setCommit_id(commitId);
commitCreate(commitCreateVo);
}
}
}
public AjaxResult commitCreate(CommitCreateVo commitCreateVo) {
List<CommitResultVo> CommitCreateVoList = new ArrayList<>();
if(StringUtils.isEmpty(commitCreateVo.getCommit_id())) {
String projectId = commitCreateVo.getProject_id();
if (StringUtils.isNotEmpty(projectId)) {
CommitCreateVoList = inBlockchainDataMapper.getCommitListById(projectId);
}
}else{
CommitResultVo resultVo = new CommitResultVo();
resultVo.setCommitId(commitCreateVo.getCommit_id());
resultVo.setCommitDiff(commitCreateVo.getCommit_diff());
CommitCreateVoList.add(resultVo);
}
if(CommitCreateVoList!=null && CommitCreateVoList.size()>0) {
for(CommitResultVo commit : CommitCreateVoList) {
commitDataTnBlock(commit);
}
}
return AjaxResult.success();
}
private AjaxResult commitDataTnBlock(CommitResultVo commitCreateVo) {
String commitId = commitCreateVo.getCommitId();
//根据项目id,查询对应的需要入链的commit
Map<String, Object> res = projectResourceLibraryMapper.selectCommitInfo(commitId,commitCreateVo.getCommitDiff());
JSONObject params = JSONObject.from(res);
params.put(REQUEST_TYPE, CREATE_COMMIT);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("commit");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(commitId);
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
return AjaxResult.error();
}
public List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.commitDataList(queryVo);
handleForgeDate(maps);
return maps;
}
public List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.prDataList(queryVo);
handleForgeDate(maps);
return maps;
}
//产权转让
public List<Map> userDataList(BlockchainListQueryVo queryVo) {
Long gitlinkUserId = SecurityUtils.getGitlinkUserId();
Map<String, Object> stringObjectMap = Optional.ofNullable(talentReferralMapper.selectUsersById(gitlinkUserId)).orElse(new HashMap<>());
if (!Objects.equals(stringObjectMap.get("admin"), "1")) {
queryVo.setUserId(gitlinkUserId);
}
return userProjectTransferRecordsMapper.userDataList(queryVo);
}
public List<UserVo> userList(UserVo userVo) {
return userProjectTransferRecordsMapper.userList(userVo);
}
public AjaxResult projectCreate(ProjectCreateVo projectCreateVo) {
//先根据项目id(token_name)判断项目是否存在存在才入链
String tokenName = projectCreateVo.getToken_name();
int num = talentReferralMapper.selectProjectById(tokenName);
if(num>0) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, CREATE_REPO);
params.put("owner", projectCreateVo.getOwner());
params.put("token_name", projectCreateVo.getToken_name());
// params.put("cur_supply", projectCreateVo.getCur_supply());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
params.put("total_supply", projectCreateVo.getTotal_supply());
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("project");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(projectCreateVo.getToken_name());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
public AjaxResult queryBlockInfo(String type,String typeId) {
JSONObject params = paramsQuery(type,typeId);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
private JSONObject paramsQuery(String type, String typeId) {
JSONObject params = new JSONObject();
if(type.equals(PROJECT_INFO)){
params.put(REQUEST_TYPE, QUERY_REPO);
params.put("token_name", typeId);
}else if(type.equals(COMMIT_INTO)){
params.put(REQUEST_TYPE, QUERY_COMMIT);
params.put("commit_hash", typeId);
}else if(type.equals(PR_LATEST_INFO)){
params.put(REQUEST_TYPE, QUERY_PR_LATEST);
params.put("pull_request_id", typeId);
}else if(type.equals(PR_ALL_INFO)){
params.put(REQUEST_TYPE, QUERY_PR_ALL);
params.put("pull_request_id", typeId);
}else if(type.equals(ISSUE_LATEST_INFO)){
params.put(REQUEST_TYPE, QUERY_ISSUE_LATEST);
params.put("issue_id", typeId);
}else if(type.equals(ISSUE_ALL_INFO)){
params.put(REQUEST_TYPE, QUERY_ISSUE_ALL);
params.put("issue_id", typeId);
}
return params;
}
public AjaxResult getTransactionByHash(String txHash) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TRANSACTION_BYHASH);
params.put("tx_hash", txHash);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getTransactionReceipt(String txHash) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TRANSACTION_RECEIPT);
params.put("tx_hash", txHash);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getTotalTransactionCount() {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TOTAL_TRANSACTION_COUNTT);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getBlockNumber() {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_BLOCK_NUM);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
public AjaxResult getUserTokenByProjectId(String type,String userName,String tokenName) {
JSONObject params = new JSONObject();
if(type.equals(USER_SINGLE_INFO)){
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", tokenName);
params.put("username", userName);
}else if(type.equals(USER_ALL_INFO)){
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
}
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
//
public AjaxResult getUserAllProjectToken(String userName) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
}

View File

@ -1,67 +0,0 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.apache.ibatis.annotations.Param;
/**
* 成果相关字典Service接口
*
* @author microservices
* @date 2025-05-23
*/
public interface IAchievementDictDataService
{
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典集合
*/
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int insertAchievementDictData(AchievementDictData achievementDictData);
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int updateAchievementDictData(AchievementDictData achievementDictData);
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的成果相关字典主键集合
* @return 结果
*/
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
/**
* 删除成果相关字典信息
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
public int deleteAchievementDictDataByDictCode(Long dictCode);
List<KeyValueVo> selectDictDataByType(String dictType);
List<String> getDictTypes();
}

View File

@ -5,8 +5,6 @@ import java.util.Map;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
/**
@ -78,7 +76,7 @@ public interface IAchievementsService {
Map<String, Object> getUerActionData();
List<HotAchVo> getHotAchievement();
List<Map<String, String>> getHotAchievement();
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
@ -96,7 +94,7 @@ public interface IAchievementsService {
AchievementBehaviorSumVo getActDataStatisticById(Long id);
List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType);
List<KeyValVo<String, Long>> get7AddClickById(String id);
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
@ -109,19 +107,4 @@ public interface IAchievementsService {
List<KeyValueVo> getProjectAreasByName(String areaName);
List<String> getExpertAreasByName(String areaName);
List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId);
List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id);
AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source);
List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo);
List<KeyValueVo> getAllAreas(String areaName);
}

View File

@ -60,6 +60,4 @@ public interface ISchoolEnterpriseAchievementsService
public int deleteSchoolEnterpriseAchievementsById(Long id);
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
}

View File

@ -1,95 +0,0 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
/**
* 区块链数据入链Service业务层处理
*
* @author microservices
* @date 2025-05-27
*/
@Service
public class InBlockchainDataServiceImpl
{
@Autowired
private InBlockchainDataMapper inBlockchainDataMapper;
/**
* 查询区块链数据入链
*
* @param id 区块链数据入链主键
* @return 区块链数据入链
*/
public InBlockchainData selectInBlockchainDataById(Long id)
{
return inBlockchainDataMapper.selectInBlockchainDataById(id);
}
/**
* 查询区块链数据入链列表
*
* @param inBlockchainData 区块链数据入链
* @return 区块链数据入链
*/
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData)
{
return inBlockchainDataMapper.selectInBlockchainDataList(inBlockchainData);
}
/**
* 新增区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int insertInBlockchainData(InBlockchainData inBlockchainData)
{
inBlockchainData.setCreateTime(DateUtils.getNowDate());
return inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
}
/**
* 修改区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int updateInBlockchainData(InBlockchainData inBlockchainData)
{
return inBlockchainDataMapper.updateInBlockchainData(inBlockchainData);
}
/**
* 批量删除区块链数据入链
*
* @param ids 需要删除的区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataByIds(Long[] ids)
{
return inBlockchainDataMapper.deleteInBlockchainDataByIds(ids);
}
/**
* 删除区块链数据入链信息
*
* @param id 区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataById(Long id)
{
return inBlockchainDataMapper.deleteInBlockchainDataById(id);
}
}

View File

@ -1,6 +1,5 @@
package com.microservices.dms.achievementLibrary.service;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
@ -34,7 +33,7 @@ public class MemoDashboardService {
* 原创非原创
* @return
*/
public List<KeyValueVo> getIsOriginalStatistic() {
public KeyValueVo getIsOriginalStatistic() {
return memoResourceLibraryMapper.getIsOriginalStatistic();
}
@ -59,11 +58,9 @@ public class MemoDashboardService {
* @return
*/
public List<KeyValueVo> getAddMemoStatistic() {
Date[] currentYear = DateUtil.getLast12Months();
return memoResourceLibraryMapper.getAddMemoStatistic(currentYear[0],currentYear[1]);
return memoResourceLibraryMapper.getAddMemoStatistic();
}
/**
* 本年帖子热度top5论坛评论点击点赞
* @return
@ -77,7 +74,7 @@ public class MemoDashboardService {
* @return
*/
public List<KeyValVo<String, Long>> get7DayPaise() {
Date[] days = DateUtil.getDays(0, 6);
Date[] days = DateUtil.getDays(1, 7);
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));

View File

@ -1,88 +0,0 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
/**
* 用户/项目转账信息记录Service业务层处理
*
* @author microservices
* @date 2025-05-27
*/
@Service
public class UserProjectTransferRecordsServiceImpl
{
@Autowired
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
/**
* 查询用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 用户/项目转账信息记录
*/
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id)
{
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsById(id);
}
/**
* 查询用户/项目转账信息记录列表
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 用户/项目转账信息记录
*/
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords)
{
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsList(userProjectTransferRecords);
}
/**
* 新增用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
{
userProjectTransferRecords.setCreateTime(DateUtils.getNowDate());
return userProjectTransferRecordsMapper.insertUserProjectTransferRecords(userProjectTransferRecords);
}
/**
* 修改用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
{
return userProjectTransferRecordsMapper.updateUserProjectTransferRecords(userProjectTransferRecords);
}
/**
* 批量删除用户/项目转账信息记录
*
* @param ids 需要删除的用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsByIds(Long[] ids)
{
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsByIds(ids);
}
/**
* 删除用户/项目转账信息记录信息
*
* @param id 用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsById(Long id)
{
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsById(id);
}
}

View File

@ -1,116 +0,0 @@
package com.microservices.dms.achievementLibrary.service.impl;
import java.util.Collections;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.AchievementDictDataMapper;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
/**
* 成果相关字典Service业务层处理
*
* @author microservices
* @date 2025-05-23
*/
@Service
public class AchievementDictDataServiceImpl implements IAchievementDictDataService
{
@Autowired
private AchievementDictDataMapper achievementDictDataMapper;
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
@Override
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode)
{
return achievementDictDataMapper.selectAchievementDictDataByDictCode(dictCode);
}
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典
*/
@Override
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData)
{
return achievementDictDataMapper.selectAchievementDictDataList(achievementDictData);
}
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
@Override
public int insertAchievementDictData(AchievementDictData achievementDictData)
{
//判断字典是否存在存在则不管不存在则新增
String label = achievementDictData.getDictLabel();
String type = achievementDictData.getDictType();
int num = achievementDictDataMapper.selectDictDataByLabel(label,type);
if (num > 0){
return 0;
}else{
achievementDictData.setCreateTime(DateUtils.getNowDate());
return achievementDictDataMapper.insertAchievementDictData(achievementDictData);
}
}
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
@Override
public int updateAchievementDictData(AchievementDictData achievementDictData)
{
achievementDictData.setUpdateTime(DateUtils.getNowDate());
return achievementDictDataMapper.updateAchievementDictData(achievementDictData);
}
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的成果相关字典主键
* @return 结果
*/
@Override
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes)
{
return achievementDictDataMapper.deleteAchievementDictDataByDictCodes(dictCodes);
}
/**
* 删除成果相关字典信息
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
@Override
public int deleteAchievementDictDataByDictCode(Long dictCode)
{
return achievementDictDataMapper.deleteAchievementDictDataByDictCode(dictCode);
}
@Override
public List<KeyValueVo> selectDictDataByType(String dictType) {
return achievementDictDataMapper.selectDictDataByType(dictType);
}
@Override
public List<String> getDictTypes() {
return achievementDictDataMapper.getDictTypes();
}
}

View File

@ -5,28 +5,20 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.common.httpClient.service.HttpAPIService;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
import com.microservices.dms.resourceLibrary.domain.Clicker;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.Searcher;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
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 lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.K;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
@ -34,7 +26,6 @@ import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
import static com.microservices.dms.constant.BlockChainFunConstants.QUERY_REPO;
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
/**
@ -44,7 +35,6 @@ import static com.microservices.dms.utils.UrlUtil.getUrlPath;
* @date 2025-04-02
*/
@Service
@Slf4j
public class AchievementsServiceImpl implements IAchievementsService {
@Autowired
private AchievementsMapper achievementsMapper;
@ -55,6 +45,8 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Autowired
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
@Autowired
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
@Autowired
private IBehaviorImageService behaviorImageService;
@ -68,6 +60,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Value("${http.gatewayUrl}")
public String gatewayUrl;
/**
* 查询成果
*
@ -77,25 +70,20 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public Achievements selectAchievementsById(Long id) {
Achievements a = achievementsMapper.selectAchievementsById(id);
if (StringUtils.isNotNull(a)) {
if(StringUtils.isNotNull(a)){
String gender = a.getGender();
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
if (StringUtils.isNotEmpty(a.getField1())) {
if(StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
}
}
a.setUserImg(img);
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
}
return a;
}
@ -111,15 +99,13 @@ public class AchievementsServiceImpl implements IAchievementsService {
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
for (Achievements a : list) {
String gender = a.getGender();
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
//根据id获取领域名称
if (StringUtils.isNotEmpty(a.getField1())) {
if(StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
@ -127,10 +113,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
//拼接对接的用户信息
List<Map<String,Object>> dockingUserInfo = achievementsMapper.getDockingUserInfoList(a.getId());
a.setDockingUserInfo(dockingUserInfo);
}
return list;
}
@ -192,14 +174,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
*/
@Override
public int deleteAchievementsById(Long id) {
//根据id获取数据仓库该数据信息
Achievements achievements = achievementsMapper.selectAchievementsById(id);
if(achievements != null){
String source = achievements.getSource();
if(StringUtils.isNotEmpty(source)) {
achievementsMapper.updateRelationAchievements(source,achievements.getSourceId());
}
}
return achievementsMapper.deleteAchievementsById(id);
}
@ -209,26 +183,25 @@ public class AchievementsServiceImpl implements IAchievementsService {
return aStr;
}
List<Map<String, String>> list = JSON.parseObject(aStr, new TypeReference<List<Map<String, String>>>() {
});
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);
concatUrl(list,gitLinkUrl);
}
if (Objects.equals(source, "2")) {
concatUrl(list, markerSpaceUrl);
concatUrl(list,markerSpaceUrl);
}
if (Objects.equals(source, "4")) {
concatUrl(list, gatewayUrl);
concatUrl(list,gatewayUrl);
}
return JSON.toJSONString(list);
}
private void concatUrl(List<Map<String, String>> list, String url) {
for (Map<String, String> map : list) {
for (Map<String,String> map : list) {
String v = map.getOrDefault("v", "");
String urlPath = getUrlPath(v);
map.put("v", url + urlPath);
@ -258,15 +231,13 @@ public class AchievementsServiceImpl implements IAchievementsService {
//遍历成果数据获取对应成果的点击数
for (Achievements a : list) {
String gender = a.getGender();
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
//根据id获取领域名称
if (StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
if(StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
@ -310,21 +281,8 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
@Override
public List<HotAchVo> getHotAchievement() {
//根据查询条件获取所有的成果数据
List<HotAchVo> resultList = achievementsMapper.getHotAchievement();
//遍历成果数据获取对应成果的点击数
for (HotAchVo a : resultList) {
String gender = a.getGender();
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
}
return resultList;
public List<Map<String, String>> getHotAchievement() {
return achievementsMapper.getHotAchievement();
}
@Override
@ -346,24 +304,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
return res;
}
@Override
public List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo) {
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> w = achievementsMapper.getExperts(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;
}
@Override
public Map<String, Long> indexProjectStatistic() {
Map<String, Long> res = achievementsMapper.indexProjectStatistic();
@ -373,7 +313,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public Map<String, Object> indexTaskStatistic() {
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount2();
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount();
res.put("convertedTaskAmount", convertedTaskAmount);
return res;
}
@ -427,13 +367,10 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
@Override
public List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType) {
public List<KeyValVo<String, Long>> get7AddClickById(String id) {
if (StringUtils.isEmpty(clickType)) {
clickType = "Achievements";
}
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], clickType, id)
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]);
@ -470,19 +407,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public List<AreaStatisticVo> getAreaStatistic(String areaKey) {
List<AreaStatisticVo> areaStatisticVoList = new ArrayList<>();
if(StringUtils.isNotEmpty(areaKey)) {
//根据逗号进行分割
String[] res =areaKey.split(",");
for (String s : res) {
String[] ss = s.split("_");
List<AreaStatisticVo> tmpList = achievementsMapper.getAreaStatistic(ss[1],ss[0]);
areaStatisticVoList.addAll(tmpList);
}
return areaStatisticVoList;
}else{
return achievementsMapper.getAreaStatistic(null,areaKey);
}
return achievementsMapper.getAreaStatistic(areaKey);
}
@Override
@ -504,55 +429,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdCompetition(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdTask(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id) {
return achievementsMapper.getRelatedAchTaskOfExpert(id);
}
@Override
public List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id) {
return achievementsMapper.getRelatedAchCompetitionOfExpert(id);
}
/**
* 根据查询内容调用搜索行为接口
*
@ -590,37 +466,4 @@ public class AchievementsServiceImpl implements IAchievementsService {
public List<String> getExpertAreasByName(String areaName) {
return achievementsMapper.getExpertAreasByName(areaName);
}
@Override
public AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source) {
AchDetailVo achDetailVo = new AchDetailVo();
AchQueryVo achQueryVo = new AchQueryVo();
achQueryVo.setAreaQuery(areaKey);
achQueryVo.setSource(source);
//根据kye,和source,查询领域描述
String remark = achievementsMapper.getField1RemarkByParam(source,areaKey);
achDetailVo.setRemark(remark);
List<Achievements> achievementsList = achievementsMapper.selectAchievementsByArea(achQueryVo);
if(achievementsList!=null && achievementsList.size()>0) {
achDetailVo.setAchievementsList(achievementsList);
long clickSum = achievementsList.stream().mapToLong(Achievements::getClickSum).sum();
achDetailVo.setClickSum(clickSum);
long dockSum = achievementsList.stream().mapToLong(Achievements::getDockSum).sum();
achDetailVo.setDockSum(dockSum);
long favoriteSum = achievementsList.stream().mapToLong(Achievements::getFavoriteSum).sum();
achDetailVo.setFavoriteSum(favoriteSum);
long watcherSum = achievementsList.stream().mapToLong(Achievements::getWatcherSum).sum();
achDetailVo.setWatcherSum(watcherSum);
}
return achDetailVo;
}
@Override
public List<KeyValueVo> getAllAreas(String areaName) {
List<KeyValueVo> resultVal = achievementsMapper.getAllAreas(areaName);
return resultVal;
}
}

View File

@ -1,13 +1,14 @@
package com.microservices.dms.achievementLibrary.service.impl;
import java.util.*;
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.core.utils.StringUtils;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
@ -48,15 +49,7 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
@Override
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
{
SchoolEnterpriseAchievements sAchievements = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
if(StringUtils.isNotNull(sAchievements)){
Long achId = sAchievements.getId();
List<AchievementTeam> teamList = achievementTeamMapper.selectAchievementTeamByAchId(achId);
if(StringUtils.isNotNull(teamList) && teamList.size() > 0){
sAchievements.setTeamList(teamList);
}
}
return sAchievements;
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
}
/**
@ -81,16 +74,6 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
return list;
}
@Override
public List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
String username = loginUser.getUsername();
schoolEnterpriseAchievements.setCreateBy(username);
}
return selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
}
/**
* 新增校企成果
*
@ -120,13 +103,6 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
{
schoolEnterpriseAchievements.setUpdateTime(DateUtils.getNowDate());
String status = schoolEnterpriseAchievements.getStatus();
if(StringUtils.isNotEmpty(status)){
schoolEnterpriseAchievements.setReviewDate(DateUtils.getNowDate());
if (SecurityUtils.getLoginUser() != null) {
schoolEnterpriseAchievements.setReviewer(SecurityUtils.getLoginUser().getUsername());
}
}
return schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
}

View File

@ -116,8 +116,9 @@ public class BehaviorImageController extends BaseController {
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
return getDataTable(list);
}
@ApiOperation("/根据用户ID,获取用户对应的成果汇总")
/**
* 根据用户ID,获取用户对应的成果汇总
*/
@GetMapping(value = "/getUserTypeStatistic")
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
{
@ -170,12 +171,4 @@ public class BehaviorImageController extends BaseController {
{
return AjaxResult.success(behaviorImageService.getActivityStatistic());
}
@GetMapping(value = "/getUserBehaviorSum")
@ApiOperation("获取用户的所有关注、点赞数")
public AjaxResult getUserBehaviorSum(Long userId)
{
return AjaxResult.success(behaviorImageService.getUserBehaviorSum(userId));
}
}

View File

@ -11,16 +11,6 @@ public class AchievementBehaviorSumVo {
private Long favoriteSum;
//下载量
private Long downloadSum;
//成果用户对接
private Long userDockingSum;
public Long getUserDockingSum() {
return userDockingSum;
}
public void setUserDockingSum(Long userDockingSum) {
this.userDockingSum = userDockingSum;
}
public Long getClickSum() {
return clickSum;

View File

@ -1,36 +0,0 @@
package com.microservices.dms.behaviorImage.domain;
import lombok.Data;
public class ActivityUserTotal {
//活跃用户
private Long totalUser;
//活跃用户专家数
private Long totalExpert;
//活跃用户实名认证
private Long authTotal;
public Long getTotalUser() {
return totalUser;
}
public void setTotalUser(Long totalUser) {
this.totalUser = totalUser;
}
public Long getTotalExpert() {
return totalExpert;
}
public void setTotalExpert(Long totalExpert) {
this.totalExpert = totalExpert;
}
public Long getAuthTotal() {
return authTotal;
}
public void setAuthTotal(Long authTotal) {
this.authTotal = authTotal;
}
}

View File

@ -2,7 +2,10 @@ 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.*;
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;
@ -95,9 +98,5 @@ public interface BehaviorImageMapper {
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
ActivityUserTotal getActivityStatistic();
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
UserTypeTotalVo getUserBehaviorSum(@Param("userId")Long userId);
List<KeyValueVo> getActivityStatistic();
}

View File

@ -75,7 +75,5 @@ public interface IBehaviorImageService {
UserExpertTotalVo getUserExpertStatistic(Long userId);
ActivityUserTotal getActivityStatistic();
UserTypeTotalVo getUserBehaviorSum(Long userId);
List<KeyValueVo> getActivityStatistic();
}

View File

@ -309,7 +309,7 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
}
@Override
public ActivityUserTotal getActivityStatistic() {
public List<KeyValueVo> getActivityStatistic() {
return behaviorImageMapper.getActivityStatistic();
}
@ -318,30 +318,19 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
* @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;
// }
@Override
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryListAll(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;
}
@Override
public UserTypeTotalVo getUserBehaviorSum(Long userId) {
return behaviorImageMapper.getUserBehaviorSum(userId);
}
}

View File

@ -4,25 +4,17 @@ 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.BlockChainService;
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
import com.microservices.dms.common.vo.*;
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.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@ -40,9 +32,6 @@ public class OpenController extends BaseController {
@Autowired
private IExpertResourceLibraryService expertResourceLibraryService;
@Autowired
private BlockChainService blockChainService;
/**
* 获取精选成果
*
@ -125,11 +114,6 @@ public class OpenController extends BaseController {
return success(achievementsService.get7DayAdd(achQueryVo));
}
@ApiOperation("七日新增专家")
@GetMapping("/achievements/get7DayAddExpert")
public AjaxResult get7DayAddExport(AchQueryVo achQueryVo) {
return success(achievementsService.get7DayAddExport(achQueryVo));
}
@ApiOperation("首页项目统计")
@GetMapping("/achievements/indexProjectStatistic")
@ -173,51 +157,4 @@ public class OpenController extends BaseController {
return getDataTable(list);
}
@GetMapping("/downloadAch")
@ApiOperation("成果征集信息下载")
public ResponseEntity<Resource> downloadAch() throws IOException {
String fileName = "红山开源优秀科研成果信息征集.zip";
Resource resource = new ClassPathResource(fileName);
if (!resource.exists()) {
throw new RuntimeException("文件不存在: " + fileName);
}
String encodedFileName = URLEncoder.encode(fileName, String.valueOf(StandardCharsets.UTF_8))
.replace("+", "%20");
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename*=UTF-8''" + encodedFileName)
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(resource);
}
// @ApiOperation("提供给开源项目那边新建项目并且use_blockchain='1'的项目数据")
// @PostMapping("/blockChain/projectCreate")
// public AjaxResult projectCreate (@RequestBody ProjectCreateVo projectCreateVo) {
// return blockChainService.projectCreate(projectCreateVo);
// }
@ApiOperation("提供给开源项目那边新建issue、更新issue时调用调用方法时传入相关数据(项目入链并且悬赏金额不为空的issue数据才调用封装方法)")
@PostMapping("/blockChain/issueCreateUpdate")
public AjaxResult issueCreateUpdate (@RequestBody IssueCreateVo issueCreateVo) {
return blockChainService.issueCreateUpdate(issueCreateVo);
}
@ApiOperation("提供给开源项目那边提交commit调用调用方法时传入相关数据(入链项目提交commit才调用)")
@PostMapping("/blockChain/commitCreate")
public AjaxResult commitCreate(@RequestBody CommitCreateVo commitCreateVo) {
return blockChainService.commitCreate(commitCreateVo);
}
@ApiOperation("提供给开源项目那边新建pr时调用调用方法时传入相关数据(入链项目pr_合并代码才调用))")
@PostMapping("/blockChain/prCreate")
public AjaxResult prCreate(@RequestBody PrCreateVo prCreateVo) {
return blockChainService.prCreate(prCreateVo);
}
@ApiOperation("封装方法userCreate入链项目2519用户1向用户2转帐10个金币")
@PostMapping("/blockChain/userCreate")
public AjaxResult userCreate(@RequestBody UserCreateVo userCreateVo) {
return blockChainService.userCreate(userCreateVo);
}
}

View File

@ -1,12 +0,0 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class CommitCreateVo {
private String commit_id;
private String project_id;
private String commit_diff;
}

View File

@ -1,10 +0,0 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class CommitResultVo {
private String commitId;
private String commitDiff;
}

View File

@ -1,14 +0,0 @@
package com.microservices.dms.common.vo;
public class IssueCreateVo {
public String getIssue_id() {
return issue_id;
}
public void setIssue_id(String issue_id) {
this.issue_id = issue_id;
}
private String issue_id;
}

View File

@ -1,137 +0,0 @@
package com.microservices.dms.common.vo;
import lombok.Data;
public class PrCreateQueryVo {
private String merge_user;
private String target_branch;
private String created_at;
private String title;
private String pull_request_id;
private String content;
private String source_branch;
private String reponame;
private String updated_at;
private String repo_id;
private Long pull_request_number;
private String action;
private String username;
public String getMerge_user() {
return merge_user;
}
public void setMerge_user(String merge_user) {
this.merge_user = merge_user;
}
public String getTarget_branch() {
return target_branch;
}
public void setTarget_branch(String target_branch) {
this.target_branch = target_branch;
}
public String getCreated_at() {
return created_at;
}
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPull_request_id() {
return pull_request_id;
}
public void setPull_request_id(String pull_request_id) {
this.pull_request_id = pull_request_id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getSource_branch() {
return source_branch;
}
public void setSource_branch(String source_branch) {
this.source_branch = source_branch;
}
public String getReponame() {
return reponame;
}
public void setReponame(String reponame) {
this.reponame = reponame;
}
public String getUpdated_at() {
return updated_at;
}
public void setUpdated_at(String updated_at) {
this.updated_at = updated_at;
}
public String getRepo_id() {
return repo_id;
}
public void setRepo_id(String repo_id) {
this.repo_id = repo_id;
}
public Long getPull_request_number() {
return pull_request_number;
}
public void setPull_request_number(Long pull_request_number) {
this.pull_request_number = pull_request_number;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}

View File

@ -1,13 +0,0 @@
package com.microservices.dms.common.vo;
public class PrCreateVo {
private String pr_id;
public String getPr_id() {
return pr_id;
}
public void setPr_id(String pr_id) {
this.pr_id = pr_id;
}
}

View File

@ -1,11 +0,0 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class ProjectCreateVo {
private String owner;//项目创建者nickname
private String token_name;//项目id
private Long cur_supply;//项目创建者的初始token
private Long total_supply;
}

View File

@ -1,64 +0,0 @@
package com.microservices.dms.common.vo;
public class UserCreateVo {
private String payee;
private Long amount;
private String token_name;
private String payer;
private String actionType;
private String typeId;
public String getPayee() {
return this.payee;
}
public void setPayee(String payee) {
this.payee = payee;
}
public Long getAmount() {
return this.amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getToken_name() {
return this.token_name;
}
public void setToken_name(String token_name) {
this.token_name = token_name;
}
public String getPayer() {
return this.payer;
}
public void setPayer(String payer) {
this.payer = payer;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
}

View File

@ -1,50 +0,0 @@
package com.microservices.dms.constant;
/**
* 区块链方法常量
*/
public class BlockChainFunConstants {
public static final String CREATE_REPO = "create repo"; //项目入链
public static final String QUERY_REPO = "query repo basic info"; //项目入链信息查询
public static final String USER_SINGLE_REPO = "query user balance of single repo"; //单个项目某个用户token
public static final String USER_ALL_REPOS = "query user balance of all repos"; //某个用户所有项目token
public static final String CREATE_COMMIT = "upload commit info"; //Commit新增入链
public static final String QUERY_COMMIT = "query commit info"; //Commit入链信息查询
public static final String CREATE_PR = "upload pull request info"; //Pr新增入链
public static final String QUERY_PR_LATEST = "query pull request latest info"; //单个pr入链所有信息
public static final String QUERY_PR_ALL = "query pull request all info"; //单个pr最后一次入链信息
public static final String CREATE_UPDATE_ISSUE = "upload issue info"; //Issue新增修改入链
public static final String QUERY_ISSUE_LATEST = "query issue latest info"; //单个Issue最后一次入链信息
public static final String QUERY_ISSUE_ALL = "query issue all info"; //单个Issue入链所有信息
public static final String ADD_USER_BALANCE = "add user balance"; //项目分配token用户token新增
public static final String MINUS_USER_BALANCE = "minus user balance"; //项目分配token-用户token减少
public static final String LOCK_USER_BALANCE = "lock user balance"; //用户转账token-将自己token分配给本项目中的其他用户
public static final String TRANSFER_AMOUNT = "transfer amount";
public static final String REQUEST_TYPE = "request-type";
public static final String TX_HASH = "tx_hash";
public static final String RESP_STATUS = "status";
public static final String GET_BLOCK_NUM = "getBlockNum";
public static final String GET_TOTAL_TRANSACTION_COUNTT = "getTotalTransactionCountT";
public static final String GET_TRANSACTION_BYHASH = "getTransactionByHash";
public static final String GET_TRANSACTION_RECEIPT = "getTransactionReceipt";
public static final String PROJECT_INFO = "projectInfo";
public static final String COMMIT_INTO = "commitInfo";
public static final String PR_LATEST_INFO = "prLatestInfo";
public static final String PR_ALL_INFO = "prAllInfo";
public static final String ISSUE_LATEST_INFO = "issueLatestInfo";
public static final String ISSUE_ALL_INFO = "issueAllInfo";
public static final String USER_SINGLE_INFO = "userSingleInfo";
public static final String USER_ALL_INFO = "userAllInfo";
}

View File

@ -2,8 +2,7 @@ package com.microservices.dms.constant;
public class TaskConstant {
private TaskConstant() {
}
private TaskConstant() {}
public static final String TASK_TYPE_WATCHERS = "MakerTask";
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
@ -23,16 +22,4 @@ public class TaskConstant {
public static final String EXPERTS = "Experts";
public static final String ACHIEVEMENTS = "Achievements";
// task status dict
public static final int DRAFT_STATUS = 0; //草稿状态
public static final int TO_BE_REVIEWED_STATUS = 1; //待审核状态
public static final int REFUSED_STATUS = 2; //已拒绝状态
public static final int TASK_PAPER_COLLECTING_STATUS = 3; //成果征集中状态
public static final int TASK_PAPER_CHOOSING_STATUS = 4; //成果评选中状态
public static final int TASK_RESULT_PROOF_STATUS = 5; //公示中状态
public static final int TASK_SIGNING_STATUS = 6; //协议签定中状态
public static final int TASK_PAYING_STATUS = 7; //支付中状态
public static final int TASK_COMPLETE_STATUS = 8; //任务完成状态
public static final int TASK_TO_BE_REPAIRED_STATUS = 9; //待修缮状态
}

View File

@ -4,17 +4,13 @@ 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.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
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;
@Data
@Api(tags = "数据管理体系-推荐接口")
@Api(tags = "数据管理体系-人才推荐接口")
@RestController
@RequestMapping("/talentReferral")
@RequiredArgsConstructor
@ -25,33 +21,12 @@ public class TalentReferralController {
@GetMapping("/issueTalentReferral")
@ApiOperation(value = "疑修人才推荐")
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
return AjaxResult.success(talentReferralService.doIssueTalentReferral(issueId, 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.doPRTalentReferral(prId, projectId));
return AjaxResult.success(talentReferralService.PRTalentReferral(prId, projectId));
}
@GetMapping("/taskAchievementTalentReferral")
@ApiOperation(value = "任务成果推荐")
public AjaxResult taskAchievementTalentReferral(@RequestParam("taskId") Long taskId) {
return AjaxResult.success(talentReferralService.taskAchievementTalentReferral(taskId));
}
@GetMapping("/taskExpertTalentReferral")
@ApiOperation(value = "任务专家推荐")
public AjaxResult taskExpertTalentReferral(@RequestParam("taskId") Long taskId) {
return AjaxResult.success(talentReferralService.taskExpertTalentReferral(taskId));
}
@GetMapping("/competitionExpertTalentReferral")
@ApiOperation(value = "竞赛专家推荐")
public AjaxResult competitionExpertTalentReferral(@RequestParam("competitionId") Long competitionId) {
return AjaxResult.success(talentReferralService.competitionExpertTalentReferral(competitionId));
}
}

View File

@ -1,14 +1,12 @@
package com.microservices.dms.referral.mapper;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.referral.vo.*;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
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;
import java.util.Map;
@Mapper
@Slave
@ -29,22 +27,4 @@ public interface TalentReferralMapper {
String selectRepositoriesUrl(@Param("id") Long id);
Long selectIdByLogin(@Param("login") String login);
List<TaskVo> selectTaskByStatus(@Param("statusIds") List<Integer> statusIds);
Map<String, Object> selectUsersById(@Param("id") Long id);
TaskVo selectTaskById(@Param("id") Long id);
List<ExpertVo> selectExpertsBy(ExpertVo expertVo);
List<KeyValVo<Long,String>> allTaskWithExpertIds(@Param("type") String type);
TaskVo selectCompetitionById(Long competitionId);
List<TaskVo> selectCompetitionIdByStatus();
PrInfoVo selectPRInfoById(@Param("id") Integer id);
int selectProjectById(@Param("tokenName") String tokenName);
}

View File

@ -2,17 +2,14 @@ package com.microservices.dms.referral.service;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.google.common.collect.Lists;
import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
import com.microservices.dms.constant.ReferralConstant;
import com.microservices.dms.constant.TaskConstant;
import com.microservices.dms.referral.mapper.TalentReferralMapper;
import com.microservices.dms.referral.vo.*;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
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;
@ -24,8 +21,6 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import static com.microservices.dms.constant.TaskConstant.*;
/**
* 人才推荐服务
*/
@ -38,17 +33,15 @@ public class TalentReferralService {
@Autowired
private DmsRequestHelper dmsRequestHelper;
@Autowired
private AchievementsMapper achievementsMapper;
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");
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list","total_count");
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
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());
@ -59,9 +52,10 @@ public class TalentReferralService {
public Set<Long> getCollaborators(String projectFullName) {
try {
// 获取项目成员者数量
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.QUERY_USER_FROM_PROJECT(projectFullName), "members", "total_count");
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());
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());
@ -93,14 +87,6 @@ public class TalentReferralService {
return collaborators;
}
public List<Map<String, Object>> doIssueTalentReferral(Long issueId, Long projectId) {
List<Map.Entry<Long, Double>> entries = issueTalentReferral(projectId, issueId);
return entries.stream().limit(3).map(s -> {
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
return mm;
}).collect(Collectors.toList());
}
public List<Map.Entry<Long, Double>> issueTalentReferral(Long projectId, Long issueId) {
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
@ -110,13 +96,12 @@ public class TalentReferralService {
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
if (!curIssueAssigners.isEmpty()) {
// return new ArrayList<>();
return new ArrayList<>();
}
IssuesVo vo = new IssuesVo();
vo.setProjectId(projectId);
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED, ReferralConstant.ISSUE_RESOLVED));
vo.setIssueClassify("issue");
vo.setStatusIds(Collections.singletonList(ReferralConstant.ISSUE_CLOSED));
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
Map<Long, Double> userFractionMap = new HashMap<>();
// 计算与解决issue的相似度 标题+描述
@ -153,41 +138,37 @@ public class TalentReferralService {
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").stream()
.filter(e -> StringUtils.isNotBlank(e.getAssignUserLogin())).collect(Collectors.toList());
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11");
for (IssueDto pr : prs) {
PrInfoVo curPrInfoVo = talentReferralMapper.selectPRInfoById(pr.getPullRequestId());
//关闭PR的对比
for (IssueDto dto : closedPullRequests) {
String reviewer = dto.getAssignUserLogin();
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;
});
//标题content匹配
PrInfoVo prInfoVo = talentReferralMapper.selectPRInfoById(dto.getPullRequestId());
double subjectFraction = SimilarityService.sentence(curPrInfoVo.getTitle(), prInfoVo.getTitle());
double descFraction = SimilarityService.text(curPrInfoVo.getContent(), prInfoVo.getContent());
//这个数据可以缓存下来
userNameFractionMap.merge(dto.getAssignUserLogin(), (subjectFraction + descFraction) * 40.0D, Double::sum);
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, 30.0D, Double::sum);
userNameFractionMap.merge(k, 60.0D, Double::sum);
}
});
}
// 计算每个负责人关闭的 PR数量
closedPullRequests.stream().map(IssueDto::getAssignUserLogin).forEach(s -> userNameFractionMap.merge(s, 30.0D, Double::sum));
closedPullRequests.stream().map(IssueDto::getReviewers).flatMap(List::stream)
.forEach(s -> userNameFractionMap.merge(s, 40.0D, Double::sum));
}
userNameFractionMap.forEach((k, v) -> {
@ -229,7 +210,7 @@ public class TalentReferralService {
}
try {
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "files", "file_nums");
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());
@ -237,179 +218,25 @@ public class TalentReferralService {
return new HashSet<>();
}
public List<Map<String, Object>> doPRTalentReferral(Long prId, Long projectId) {
List<Map.Entry<Long, Double>> entries = PRTalentReferral(projectId, prId);
return entries.stream().limit(3).map(s -> {
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
return mm;
}).collect(Collectors.toList());
}
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId) {
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
openPullRequests = openPullRequests.stream().filter(e -> StringUtils.isEmpty(e.getAssignUserLogin())).collect(Collectors.toList());
openPullRequests = openPullRequests.stream().filter(e -> e.getReviewers().isEmpty())
.collect(Collectors.toList());
if (prId != null) {
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getPullRequestId()), prId)).collect(Collectors.toList());
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, null, openPullRequests);
return PRTalentReferral(projectId, prId, openPullRequests);
}
//定时统计
public void projectsStatistic() {
public void projectsStatistic(){
}
/**
* 1先查找任务状态为成果征集中成果评选中的数据新增存储到数据表中
* 2获取系统中的任务领域和数据仓库中的领域是一样 50%
* 3根据1中任务标题和任务正文 与数据仓库中名称和简介详情比较 取前10获取对比计算分值大于0的结果
* 4将2和3的结果相加取前5个成果进行推荐
*/
public List<Achievements> taskAchievementTalentReferral(Long taskId) {
TaskVo task = talentReferralMapper.selectTaskById(taskId);
Achievements tCond = new Achievements();
// tCond.setSourceId(taskId);
tCond.setSource("2");
tCond.setStatus("1");
List<Achievements> taskAchievements = achievementsMapper.selectAchievementsList(tCond);
List<Achievements> result;
List<Long> trTaskIds = doTaskTalentReferral(task, taskAchievements);
result = trTaskIds.stream().map(s -> taskAchievements.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(5).collect(Collectors.toList());
return result;
}
private List<Long> doTaskTalentReferral(TaskVo task, List<Achievements> taskVos) {
Long taskDomain = task.getCategoryId();
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
for (Achievements t1 : taskVos) {
if (Objects.equals(String.valueOf(taskDomain), t1.getField1())) {
step1Map.put(t1.getId(), 50.0D);
}
double subjectFraction = SimilarityService.sentence(task.getName(), t1.getAchievementName());
double descFraction = SimilarityService.text(t1.getSummary(), task.getDescription());
step2Map.put(t1.getId(), (subjectFraction + descFraction) * 50.0D);
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
step2Map.keySet().removeIf(step -> Double.compare(step2Map.get(step), 0.0D) <= 0.0D);
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
/**
* 创客任务评审专家推荐
* 1先查找创客任务状态未结束并且已加入评审的数据新增存储到数据表中
* 2技术匹配度系统中专家领域 任务是一样的领域 20%
* 3根据1中任务标题和任务描述 与专家简介进行比较 匹配结果分数取前1030%
* 4根据1中任务标题和任务描述 与已完成的任务标题与任务描述比较匹配结果分数取前3 前3个竞赛中对应的专家 分数*50%
*/
public Object taskExpertTalentReferral(Long taskId) {
TaskVo task = talentReferralMapper.selectTaskById(taskId);
List<KeyValueVo> categories = achievementsMapper.getAreasByName(null);
List<TaskVo> completedTasks = talentReferralMapper.selectTaskByStatus(Lists.newArrayList(TASK_COMPLETE_STATUS,TASK_PAPER_CHOOSING_STATUS,TASK_RESULT_PROOF_STATUS,TASK_SIGNING_STATUS,TASK_PAYING_STATUS));
List<ExpertVo> allExperts = talentReferralMapper.selectExpertsBy(new ExpertVo());
List<Long> expertIds = doTaskExpertTalentReferral(task, categories, completedTasks, allExperts);
return expertIds.stream().map(s -> allExperts.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(3).collect(Collectors.toList());
}
private List<Long> doTaskExpertTalentReferral(TaskVo task, List<KeyValueVo> categories, List<TaskVo> completedTasks, List<ExpertVo> allExperts) {
Map<Long, String> v2k = categories.stream().collect(Collectors.toMap(KeyValueVo::getValue, KeyValueVo::getKey, (o, n) -> n));
String taskDomain = v2k.get(task.getCategoryId());
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
for (ExpertVo t1 : allExperts) {
if (Objects.equals(taskDomain, t1.getReviewAreaOne())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
if (Objects.equals(taskDomain, t1.getReviewAreaTwo())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
if (Objects.equals(taskDomain, t1.getReviewAreaThree())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
}
List<KeyValVo<Long, String>> allTaskWithExpertIds = talentReferralMapper.allTaskWithExpertIds("1");
Map<Long, String> t2e = allTaskWithExpertIds.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV, (o, n) -> n));
for (TaskVo t2 : completedTasks) {
double subjectFraction = SimilarityService.sentence(task.getName(), t2.getName());
double descFraction = SimilarityService.text(t2.getDescription(), task.getDescription());
String[] split = t2e.getOrDefault(t2.getId(), "").split(",");
for (String s : split) {
if (StringUtils.isNotBlank(s)) {
step2Map.put(Long.parseLong(s), (subjectFraction + descFraction) * 50.0D);
}
}
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
/**
* 开源竞赛评审专家推荐
* 1先查找开放竞赛状态未结束并且已提交评审的数据新增存储到数据表中
* 2技术匹配度系统中专家领域 竞赛是一样的领域 20%
* 3根据1中竞赛标题和竞赛描述 与专家简介进行比较 匹配结果分数取前1030%
* 4根据1中竞赛标题和竞赛描述 与已完成的竞赛标题与竞赛描述比较匹配结果分数取前3 前3个竞赛中对应的专家*50%
*/
public Object competitionExpertTalentReferral(Long competitionId) {
TaskVo task = talentReferralMapper.selectCompetitionById(competitionId);
List<KeyValueVo> categories = new ArrayList<>();
List<TaskVo> completedTasks = talentReferralMapper.selectCompetitionIdByStatus();
List<ExpertVo> allExperts = talentReferralMapper.selectExpertsBy(new ExpertVo());
List<Long> expertIds = doCompetitionExpertTalentReferral(task, categories, completedTasks, allExperts);
return expertIds.stream().map(s -> allExperts.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(3).collect(Collectors.toList());
}
private List<Long> doCompetitionExpertTalentReferral(TaskVo task, List<KeyValueVo> categories, List<TaskVo> completedTasks, List<ExpertVo> allExperts) {
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
List<KeyValVo<Long, String>> allTaskWithExpertIds = talentReferralMapper.allTaskWithExpertIds("2");
Map<Long, String> t2e = allTaskWithExpertIds.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV, (o, n) -> n));
for (TaskVo t2 : completedTasks) {
double subjectFraction = SimilarityService.sentence(task.getName(), t2.getName());
double descFraction = SimilarityService.text(t2.getDescription(), task.getDescription());
String[] split = t2e.getOrDefault(t2.getId(), "").split(",");
for (String s : split) {
if (StringUtils.isNotBlank(s)) {
step2Map.put(Long.parseLong(s), (subjectFraction + descFraction) * 100.0D);
}
}
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
}

View File

@ -1,15 +0,0 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class ExpertVo {
Long id;
Long userId;
String expertName;
String nickname;
String reviewAreaOne;
String reviewAreaTwo;
String reviewAreaThree;
Integer status;
}

View File

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

View File

@ -1,10 +0,0 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class PrInfoVo {
private Long id;
private String title;
private String content;
}

View File

@ -1,13 +0,0 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class TaskVo {
private Long id;
private Long taskId;
private String name;
private String description;
private Long categoryId;
private String identifier;
}

View File

@ -21,7 +21,7 @@ public class CollectUserActDataController {
@PostMapping("/addClicker")
@ApiImplicitParams({
@ApiImplicitParam(name = "clickType", value = "点击类型(任务makerSpaceTask、竞赛CompetitionInfo、项目Project、成果Achievements、专家Experts,校企schoolEnterprise,成果用户对接userDocking)", paramType = "query", dataTypeClass = String.class),
@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)

View File

@ -6,7 +6,6 @@ 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.resourceLibrary.domain.ExpertResourceLibrary;
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
import io.swagger.annotations.Api;
@ -139,5 +138,4 @@ public class ExpertResourceLibraryController extends BaseController
public AjaxResult getActDataStatisticById(Long id) {
return success(expertResourceLibraryService.getActDataStatisticById(id));
}
}

View File

@ -33,7 +33,7 @@ public class CompetitionResourceLibrary extends BaseEntity {
*/
private String competitionField;
/**
* 竞赛状态 status: 0 未上架 1上架
* 竞赛状态 0进行中 1已结束
*/
private String competitionStatus;
/**

View File

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

View File

@ -14,7 +14,6 @@ import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;
/**
* 专家资源库Mapper接口
@ -113,13 +112,13 @@ public interface ExpertResourceLibraryMapper
List<KeyValueVo> getMemoAduit();
List<KeyValueVo> getIsOriginalStatistic();
KeyValueVo getIsOriginalStatistic();
List<KeyValueVo> getMemoTotalByYear();
List<KeyValueVo> getForumSectionStatistic();
// List<KeyValueVo> getAddMemoStatistic();
List<KeyValueVo> getAddMemoStatistic();
List<MemoTotalVo> getTop5Memos();
@ -128,8 +127,4 @@ public interface ExpertResourceLibraryMapper
ExpertAttachmentVo getExpertInfoById(@Param("expertId") Long expertId);
Map<String, Object> getAttachmentInfo(@Param("id") Long id);
List<KeyValueVo> getAddMemoStatistic(@Param("s") Date s, @Param("e") Date e);
List<KeyValVo<String, String>> getAttachments(@Param("fullFileIds") String fullFileIds);
}

View File

@ -1,8 +1,6 @@
package com.microservices.dms.resourceLibrary.mapper;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.common.vo.PrCreateQueryVo;
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
@ -11,7 +9,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
@Slave
@ -54,20 +51,4 @@ public interface ProjectResourceLibraryMapper {
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
String getProjectDomainNameByKey(@Param("projectDomain") String projectDomain );
List<TokenListVo> selectProjectInfos(@Param("name") String projectName);
Long sumProjectIssueToken(@Param("id") Long id);
Map<String, Object> selectCommitInfo(@Param("commitId") String commitId,@Param("commitDiff") String commitDiff);
Map<String, Object> selectPrInfo(@Param("prId") String prId);
Map<String, Object> selectIssueInfo(@Param("issueId") String issueId);
String getProjectUserIdById(@Param("tokenName")String tokenName);
Long getUsedApplyToken(@Param("tokenName")String tokenName,@Param("userName") String userName);
String getUserIdBYLogin(@Param("userId")String userId);
}

View File

@ -108,6 +108,4 @@ public interface TaskResourceLibraryMapper {
int delFavorite(Favorite favorite);
int delWatcher(Watcher watcher);
double getConvertedTaskAmount2();
}

View File

@ -10,7 +10,6 @@ import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
import com.microservices.dms.utils.DateUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -72,7 +71,6 @@ public class CompetitionResourceLibraryService {
a.setV(String.format(PROJECT_DOWNLOAD_API, gitLinkUrl, v));
}
l.setAttachmentList(attachments);
l.setSubmissionTime(DateUtil.plusHours(l.getSubmissionTime(), 8));
}
}
return list;

View File

@ -83,7 +83,7 @@ public class ProjectResourceLibraryService {
if (v.startsWith("http")) {
String urlPath = getUrlPath(v);
if (StringUtils.isNotEmpty(urlPath)) {
if (urlPath.startsWith("/api")) {
if (urlPath.startsWith("/")) {
a.setV(gitLinkUrl + urlPath);
}else {
a.setV(gitLinkUrl +"/api"+ urlPath);

View File

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

View File

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

View File

@ -42,20 +42,6 @@ public class DateUtil {
};
}
public static Date[] getLast12Months() {
LocalDate endDate = LocalDate.now();
LocalDate startDate = endDate.minusMonths(11);
LocalDateTime startDateTime = LocalDateTime.of(startDate.getYear(),startDate.getMonth(),1,0,0,0);
LocalDateTime endDateTime = endDate.atTime(23, 59, 59);
return new Date[]{
Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()),
Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())
};
}
public static Date[] getCurrentYearEndOf(LocalDate endDate) {
Year year = Year.now();
@ -82,19 +68,6 @@ public class DateUtil {
.collect(Collectors.toList());
}
public static List<String> getDateStrYYYYMM(Date start, Date end) {
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
String pattern = "yyyy-MM";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
return LongStream.range(0, s.until(e).getMonths() + 1)
.mapToObj(s::plusMonths)
.map(formatter::format)
.collect(Collectors.toList());
}
public static List<String> getDateStrYYYYMMDD(Date start, Date end) {
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
@ -112,28 +85,4 @@ public class DateUtil {
LocalDateTime s = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
return Date.from(s.plusHours(plusHours).atZone(ZoneId.systemDefault()).toInstant());
}
public static String formatLocalDateTimePlusH(LocalDateTime dateTime,long h) {
if (dateTime == null) {return null;}
LocalDateTime localDateTime8 = dateTime.plusHours(h);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return formatter.format(localDateTime8);
}
public Date addHoursToDate(Date date, int hours) {
if (date == null) {return null;}
// 转换为LocalDateTime
LocalDateTime localDateTime = date.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
// 增加小时
localDateTime = localDateTime.plusHours(hours);
// 转回Date
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
}
}

View File

@ -46,7 +46,7 @@ public class DmsRequestHelper extends GitLinkRequestHelper {
int pageNum = 1;
// 循环分页获取gitlink组织下所有成员
while (!isAllData) {
JSONObject result = doGet(GET_LIST_BY_PAGES(url, pageNum, 50)
JSONObject result = doGet(GitLinkRequestUrl.GET_LIST_BY_PAGES(url, pageNum, 50)
);
allList.addAll(result.getList(listKey, tClass));
long total = result.getLong("search_count");
@ -84,7 +84,7 @@ public class DmsRequestHelper extends GitLinkRequestHelper {
public static GitLinkRequestUrl GET_LIST_BY_PAGES(String url, Integer page, Integer limit) {
String p = url.contains("?")? "%s&page=%s&limit=%s": "%s?page=%s&limit=%s";
String p = url.contains("?")? "&page=%d&limit=%d": "%s?page=%d&limit=%d";
return getAdminGitLinkRequestUrl(String.format(p, url, page, limit));
}

View File

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.microservices.dms.achievementLibrary.mapper.AchievementDictDataMapper">
<resultMap type="AchievementDictData" id="AchievementDictDataResult">
<result property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAchievementDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, update_by, update_time, remark from achievement_dict_data
</sql>
<select id="selectAchievementDictDataList" parameterType="AchievementDictData" resultMap="AchievementDictDataResult">
<include refid="selectAchievementDictDataVo"/>
<where>
<if test="dictSort != null "> and dict_sort = #{dictSort}</if>
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
<if test="dictValue != null and dictValue != ''"> and dict_value = #{dictValue}</if>
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectAchievementDictDataByDictCode" parameterType="Long" resultMap="AchievementDictDataResult">
<include refid="selectAchievementDictDataVo"/>
where dict_code = #{dictCode}
</select>
<insert id="insertAchievementDictData" parameterType="AchievementDictData" useGeneratedKeys="true" keyProperty="dictCode">
insert into achievement_dict_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dictSort != null">dict_sort,</if>
<if test="dictLabel != null">dict_label,</if>
<if test="dictValue != null">dict_value,</if>
<if test="dictType != null">dict_type,</if>
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dictSort != null">#{dictSort},</if>
<if test="dictLabel != null">#{dictLabel},</if>
<if test="dictValue != null">#{dictValue},</if>
<if test="dictType != null">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAchievementDictData" parameterType="AchievementDictData">
update achievement_dict_data
<trim prefix="SET" suffixOverrides=",">
<if test="dictSort != null">dict_sort = #{dictSort},</if>
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
<if test="dictValue != null">dict_value = #{dictValue},</if>
<if test="dictType != null">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where dict_code = #{dictCode}
</update>
<delete id="deleteAchievementDictDataByDictCode" parameterType="Long">
delete from achievement_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteAchievementDictDataByDictCodes" parameterType="String">
delete from achievement_dict_data where dict_code in
<foreach item="dictCode" collection="array" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<select id="selectDictDataByType" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select dict_code as "key",dict_label as "name" from achievement_dict_data where dict_type = #{dictType}
</select>
<select id="selectDictDataByLabel" resultType="int">
select count(1) from achievement_dict_data where dict_type = #{type} and dict_label = #{label}
</select>
<select id="getDictTypes" resultType="String">
select distinct dict_type from achievement_dict_data
</select>
</mapper>

View File

@ -125,9 +125,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from achievement_team
where achievement_id = #{aid}
</delete>
<select id="selectAchievementTeamByAchId" resultMap="AchievementTeamResult">
<include refid="selectAchievementTeamVo"/>
where achievement_id = #{achId}
</select>
</mapper>

View File

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Achievements" id="AchievementsResult">
<result property="id" column="id" />
<result property="showAchievementName" column="showAchievementName" />
<result property="achievementName" column="achievement_name" />
<result property="field1" column="field_1" />
<result property="field2" column="field_2" />
@ -38,22 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="attachmentCount" column="attachment_count" />
<result property="isExpertAudit" column="is_expert_audit" />
<result property="hotRank" column="hot_rank" />
<result property="ext1" column="ext1" />
<result property="ext2" column="ext2" />
<result property="ext3" column="ext3" />
</resultMap>
<sql id="selectAchievementsVo">
select id, IFNULL(show_ach_name,achievement_name) as "showAchievementName", achievement_name,hot_rank, field_1, field_2, field_3,
attachment_count,is_expert_audit,achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address,
is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images,
attachments, create_by, create_time, update_by, update_time,ext1,ext2,ext3 from achievements
select id, achievement_name,hot_rank, field_1, field_2, field_3, attachment_count,is_expert_audit,achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address, is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, update_by, update_time from achievements
</sql>
<select id="selectAchievementsList" parameterType="Achievements" resultMap="AchievementsResult">
<include refid="selectAchievementsVo"/>
<where>
<if test="showAchievementName != null and showAchievementName != ''"> and show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
@ -81,12 +73,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hotRank != null and hotRank != ''"> and hot_rank = #{hotRank}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
order by create_time desc
</select>
<select id="selectAchievementsById" parameterType="Long" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName",a.achievement_name,a.hot_rank,a.field_1,a.field_2,a.field_3,a.attachment_count,
a.is_expert_audit,a.achievement_type,a.source,a.source_id,a.ext1,a.ext2,a.ext3
select a.id,a.achievement_name,a.hot_rank,a.field_1,a.field_2,a.field_3,a.attachment_count,a.is_expert_audit,a.achievement_type,a.source,a.source_id
,u.login as "userLogin",IFNULL(u.nickname,owner_name) as "userNickName",ue.gender as "gender",
a.source_link,a.tags,a.summary,a.publishing_unit,a.address,a.is_featured,a.contact_person,a.contact_number,a.owner_id,a.owner_name, a.status,a.details,
a.reviewer,a.review_date,a.review_comments, a.images,a.attachments,a.create_by,a.create_time,a.update_by,a.update_time
@ -107,7 +97,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertAchievements" parameterType="Achievements" useGeneratedKeys="true" keyProperty="id">
insert into achievements
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="showAchievementName != null">show_ach_name,</if>
<if test="achievementName != null">achievement_name,</if>
<if test="field1 != null">field_1,</if>
<if test="field2 != null">field_2,</if>
@ -139,12 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">attachment_count,</if>
<if test="isExpertAudit != null">is_expert_audit,</if>
<if test="hotRank != null">hot_rank,</if>
<if test="ext1 != null">ext1,</if>
<if test="ext2 != null">ext2,</if>
<if test="ext3 != null">ext3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="showAchievementName != null">#{showAchievementName},</if>
<if test="achievementName != null">#{achievementName},</if>
<if test="field1 != null">#{field1},</if>
<if test="field2 != null">#{field2},</if>
@ -176,16 +161,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">#{attachmentCount},</if>
<if test="isExpertAudit != null">#{isExpertAudit},</if>
<if test="hotRank != null">#{hotRank},</if>
<if test="ext1 != null">#{ext1},</if>
<if test="ext2 != null">#{ext2},</if>
<if test="ext3 != null">#{ext3},</if>
</trim>
</insert>
<update id="updateAchievements" parameterType="Achievements">
update achievements
<trim prefix="SET" suffixOverrides=",">
<if test="showAchievementName != null">show_ach_name = #{showAchievementName},</if>
<if test="achievementName != null">achievement_name = #{achievementName},</if>
<if test="field1 != null">field_1 = #{field1},</if>
<if test="field2 != null">field_2 = #{field2},</if>
@ -217,9 +198,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">attachment_count = #{attachmentCount},</if>
<if test="isExpertAudit != null">is_expert_audit = #{isExpertAudit},</if>
<if test="hotRank != null">hot_rank = #{hotRank},</if>
<if test="ext3 != null">ext3 = #{ext3},</if>
<if test="ext2 != null">ext2 = #{ext2},</if>
<if test="ext1 != null">ext1 = #{ext1},</if>
</trim>
where id = #{id}
</update>
@ -236,7 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="getChoiceImport" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
select id,IFNULL(show_ach_name,achievement_name) as "showAchievementName",achievement_name,images,field_1,field_2,field_3,summary,source,source_id
select id, achievement_name,images,field_1,field_2,field_3,source,source_id
from achievements
where is_featured ='1'
order by update_time desc
@ -246,50 +224,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select sum(1) as "value",source as "key"
from achievements
where status='1'
group by source
</select>
<select id="getTjByAreas" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select r.name as "name",count(1) as "value" from (
select c.name,a.source, a.field_1,c.remark
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.status='1' and a.field_1 is not null and a.field_1 !=""
union all
select c.name, a.source, a.field_1, c.remark
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.status='1' and a.field_1 is not null and a.field_1 !=""
)r
group by r.name
order by count(1) desc
select c.id as "key", c.name as "name", f.value as "value"
from (select a.domain_value as "name", sum(a.countResult) as "value"
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
from achievements
group by field_1
union all
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
from achievements
group by field_2
union all
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
from achievements
group by field_3) a
group by a.domain_value
order by sum(a.countResult) desc) f
right join categories c on c.id = f.name
limit 0,5
</select>
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
<if test="source == '' or source == null">
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName",a.achievement_name,a.summary,a.create_time,a.owner_name,a.tags,a.field_1,a.field_2,a.field_3,a.source,a.source_id,
u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
select a.id, a.achievement_name,a.summary,a.create_time,a.owner_name,a.tags,a.field_1,a.field_2,a.field_3,a.source,a.source_id,
u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = id) as favoriteSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
</where>
order by a.create_time desc
</if>
<if test='source=="1"'>
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
from achievements a
@ -297,9 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join user_extensions ue on u.id = ue.user_id
left join project_categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
@ -308,10 +280,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc
</if>
<if test='source=="2" or source=="3" or source=="4" '>
select a.id, IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
from achievements a
@ -319,9 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join user_extensions ue on u.id = ue.user_id
left join categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
@ -338,43 +306,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getaWatcher" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from watchers w
inner join achievements a on w.watchable_id = a.id
from watchers
where created_at &gt;= #{s}
and created_at &lt;= #{e}
and watchable_type = #{t}
and a.status='1'
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getFavorite" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from favorites f
inner join achievements a on f.favorite_id = a.id
from favorites
where created_at &gt;= #{s}
and created_at &lt;= #{e}
and favorite_type = #{t}
and a.status='1'
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getHotAchievement" resultType="com.microservices.dms.achievementLibrary.domain.HotAchVo">
select t.show_ach_name as "showAchievementName",t.achievement_name as name, t.w as watcher, t.f as faviter, (t.w + t.f) as total, t.id as `id`,t.owner_name
as userName,t.gender,t.userNickName
<select id="getHotAchievement" resultType="java.util.Map">
select t.achievement_name as name, t.w as watcher, t.f as faviter, (t.w + t.f) as total, t.id as `id`,t.owner_name
as userName
from (select a.achievement_name,
IFNULL(a.show_ach_name,a.achievement_name) as "show_ach_name",
a.id,a.owner_name,
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as f,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as w
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
where a.status = '1'
) as t
from achievements a) as t
order by (f+w) desc
limit 0,3
</select>
@ -384,17 +341,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from achievements
where create_time &gt;= #{s}
and create_time &lt;= #{e}
and source = #{t} and status='1'
group by DATE_FORMAT(create_time, '%m-%d')
order by DATE_FORMAT(create_time, '%m-%d')
</select>
<select id="getExperts" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(create_time, '%m-%d') as 'k', count(*) as 'v'
from expert_resource_library
where create_time &gt;= #{s}
and create_time &lt;= #{e} and status='1'
and source = #{t}
group by DATE_FORMAT(create_time, '%m-%d')
order by DATE_FORMAT(create_time, '%m-%d')
</select>
@ -402,37 +349,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="indexProjectStatistic" resultType="java.util.Map">
select COUNT(*) as projectAchievementCount,
IFNULL(SUM(attachment_count), 0) as attachmentCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1' and a.status='1') as clickCount,
(select count(distinct a.source_id) from achievements a join project_resource_library prl on a.source_id = prl.id where a.source='1' and a.status='1') as projectCount
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1') as clickCount,
(select COUNT(distinct project_id) from project_resource_library) as projectCount
from achievements
where source = '1' and status='1'
where source = '1'
</select>
<select id="indexTaskStatistic" resultType="java.util.Map">
select (select count(distinct trl.task_id) from achievements a join task_resource_library trl on a.source_id = trl.id where a.source='2' and a.status=1) as taskCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='2' and a.status=1) as clickCount,
select (select count(distinct trl.task_id) from achievements a join task_resource_library trl on a.source_id = trl.id where a.source='2') as taskCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='2') as clickCount,
COUNT(*) as expertAuditCount
from achievements
where source = '2' and status=1
where source = '2'
</select>
<select id="indexCompetitionStatistic" resultType="java.util.Map">
select COUNT(*) as CompetitionCountAchievementCount,
(select COUNT(distinct crl.open_competition_id) from achievements a join competition_resource_library crl
on a.source_id = crl.id where source = '3' and a.is_expert_audit = 1 and a.status='1') as expertAuditCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3' and a.status='1') as clickCount,
(select COUNT(distinct open_competition_id) from competition_resource_library crl inner join achievements a on a.source_id=crl.id where a.status='1') as CompetitionCount
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3') as clickCount,
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCount
from achievements
where source = '3' and status='1'
where source = '3'
</select>
<select id="indexSchoolEnterpriseStatistic" resultType="java.lang.Long">
select COUNT(*)
from achievements a
where source = #{s}
and a.status = '1'
<if test="t != null and t != ''">
and tags = #{t}
</if>
and tags = #{t}
</select>
<select id="getAreasByName" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
@ -463,7 +406,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
union all
select review_area_one as "domainName" from experts
)a
where a.domainName is not null and a.domainName !=""
</select>
<select id="getActDataStatisticById"
@ -490,11 +432,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
select b.watchSum, d.favoriteSum,c.userDockingSum
select b.watchSum, d.favoriteSum
from (
(select count(1) as watchSum from watchers where watchable_type = 'Achievements' and watchable_id = #{id} and user_id=#{userId}) b,
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d,
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d
)
</select>
@ -502,7 +443,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(*)
from achievements
<where>
<if test="t != null and t != ''">and `source` = #{t}</if>
<if test="source != null and source != ''">and `source` = #{source}</if>
<if test="s != null">and create_time &gt;= #{s}</if>
<if test="e != null">and create_time &lt;= #{e}</if>
</where>
@ -517,37 +458,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAchievementType" resultType="java.util.Map">
select achievement_type as 'k', count(*) as 'v'
from achievements where achievement_type is not null
from achievements
group by achievement_type
</select>
<select id="getAchievementActData" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select * from (
select '关注' as `key`, DATE_FORMAT(created_at, '%m-%d') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
select 'w' as `key`, DATE_FORMAT(created_at, '%Y') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
union all
select '浏览' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from clickers where click_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
select 'c' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from clickers where click_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
union all
select '下载' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from downloads where download_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
select 'd' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from downloads where download_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
union all
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d'))t
select 'f' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y'))t
order by t.name
</select>
<select id="getAchievementDomain" resultType="java.util.Map">
select r.name as "name",count(1) as "value" from (
select
c.name,a.source, a.field_1,c.remark
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.field_1 is not null and a.field_1 !=""
union all
select
c.name, a.source, a.field_1, c.remark
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.field_1 is not null and a.field_1 !=""
)r
group by r.name
select c.id as "key", c.name as "name", f.value as "value"
from (select a.domain_value as "name", sum(a.countResult) as "value"
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
from achievements
group by field_1
union all
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
from achievements
group by field_2
union all
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
from achievements
group by field_3) a
group by a.domain_value
order by sum(a.countResult) desc) f
right join categories c on c.id = f.name
</select>
<select id="getAchievementAddYearly" resultType="java.util.Map">
@ -557,7 +501,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by DATE_FORMAT(create_time, '%Y')
</select>
<select id="getAchievementHotRank" resultType="java.util.Map">
select IFNULL(show_ach_name,achievement_name) as name, create_time as reelaseTime, hot_rank from achievements
select achievement_name as name, create_time as reelaseTime, hot_rank from achievements
order by hot_rank desc
</select>
@ -566,117 +510,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
<if test="source == '' or source == null">
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
z.source as "source",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum"
from (
select
r.name,
r.field_1,
r.remark,
r.sorceType as "source",
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select
t.name,t.source,count(1) as "tmp",t.field_1,t.remark,t.sorceType
from (
select c.name,a.source, a.field_1,c.remark,"1" as sorceType
from achievements a
left join project_categories c on a.field_1 = c.id where a.source='1' and c.name is not null
union all
select c.name, a.source, a.field_1, c.remark,"2" as sorceType
from achievements a
left join categories c on a.field_1 = c.id where a.source in ('2','3','4') and c.name is not null
)t
where t.field_1 is not null and t.field_1 !=""
group by t.name, t.source, t.field_1, t.remark,t.sorceType
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark, z.source
</if>
<if test='source=="1"'>
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum",
"1" as source
from (
select
r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select c.name,a.source, a.field_1,c.remark,count(1) as "tmp"
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.field_1 is not null and a.field_1 !=""
group by c.name, a.source, a.field_1, c.remark
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
</if>
<if test='source=="2" or source=="3" or source=="4" '>
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum",
"2" as source
from (
select
r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select c.name, a.source, a.field_1, c.remark,count(1) as tmp
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.field_1 is not null and a.field_1 !=""
group by c.name, a.source, a.field_1, c.remark
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
</if>
select z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum"
from (select r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark
from achievements a
inner join categories c on a.field_1 = c.id
group by c.name, a.source, a.field_1, c.remark) r) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
</select>
<select id="getAllSourceId" resultType="java.lang.Long">
@ -685,16 +542,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where project_id = (select project_id from project_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdCompetition" resultType="java.lang.Long">
select id
from competition_resource_library
where open_competition_id = (select open_competition_id from competition_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdTask" resultType="java.lang.Long">
select id
from task_resource_library
where task_id = (select task_id from task_resource_library where id = #{sourceId})
</select>
<select id="getDistinctYear" resultType="String">
select distinct DATE_FORMAT(create_time, '%Y')
from achievements
@ -714,7 +561,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
source as "source",
source_id as "sourceId" ,
achievement_name as "achRelateName",
show_ach_name as "showAchievementName",
#{paramYear} as resultYear
from achievements
where source_id in
@ -724,36 +570,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
order by DATE_FORMAT(create_time, '%m-%d')
</select>
<select id="getRelatedAchTaskOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary">
select *
from task_resource_library erl
join
(select container_id
from task_expert
where container_type = 1
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.task_id = tmp.container_id
</select>
<select id="getRelatedAchCompetitionOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary">
select *
from competition_resource_library erl
join
(select container_id
from task_expert
where container_type = 2
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.open_competition_id = tmp.container_id
</select>
<select id="selectAchievementsByName" resultType="Long">
select id
from achievements
@ -784,148 +600,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.id=#{id}
</if>
</select>
<select id="getField1RemarkByParam" resultType="String">
<if test='source != null and source == "1"'>
select remark from project_categories where id=#{areaKey}
</if>
<if test='source != null and source == "2"'>
select remark from categories where id =#{areaKey}
</if>
</select>
<select id="getAchievementAddYearlyData" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(create_time, '%Y-%m') as 'k', count(*) as 'v'
from achievements
where create_time &gt;= #{s}
and create_time &lt;= #{e}
group by DATE_FORMAT(create_time, '%Y-%m')
order by DATE_FORMAT(create_time, '%Y-%m')
</select>
<select id="getAchievementActDataW"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '关注' as `key`, DATE_FORMAT(created_at, '%m-%d') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataC"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '浏览' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from clickers where click_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataD"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '下载' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from downloads where download_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataF"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getDockingUserInfo" resultType="java.util.Map">
select * from (
select u.id,u.login,u.nickname,p.name as "lastname,",u.phone,u.company_name,u.mail,p.card as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from users u
inner join entities e on u.id = e.user_id
inner join personalities p on e.id = p.entity_id
inner join (select created_at, user_id from clickers where click_id = #{id} and click_type ='userDocking' ) c on u.id = c.user_id
where u.authentication='1'
union all
select u.id,u.login,u.nickname,u.lastname,u.phone,en.name as "company_name",u.mail,en.credit_code as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from users u
inner join entities e on u.id = e.user_id
inner join enterprises en on e.id = en.entity_id
inner join (select created_at,user_id from clickers where click_id = #{id} and click_type ='userDocking') c on u.id = c.user_id
where u.enterprise_certification='1') t
order by t.created_at
</select>
<select id="selectAchievementsByArea" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
<if test='source=="2"'>
select a.id, IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",c.remark as "filedDesc",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
left join categories c on a.field_1 = c.id
<where>
and a.status='1' and a.source !='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
</if>
</where>
order by a.create_time desc
</if>
<if test='source=="1"'>
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",c.remark as "filedDesc",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
left join project_categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
</if>
</where>
order by create_time desc
</if>
</select>
<select id="getAllAreas" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select r.name as "name",GROUP_CONCAT( r.source SEPARATOR ',') as "result"
from (
select name,CONCAT(id, '_', '2')as source from categories
union all
select name,CONCAT(id, '_', '1') as source from project_categories
)r
<where>
<if test="areaName != null and areaName != ''">and r.name = #{areaName}</if></where>
GROUP BY r.name
</select>
<update id="updateRelationAchievements">
<if test='source != null and source == "1"'>
update project_resource_library set is_transferred_to_achievement='0' ,transfer_date=null where id = #{sourceId}
</if>
<if test='source != null and source == "2"'>
update task_resource_library set is_transferred_to_results_library='0' ,transfer_to_results_date=null where id = #{sourceId}
</if>
<if test='source != null and source == "3"'>
update competition_resource_library set is_transferred_to_result_library='0' ,transferred_to_result_library_time=null where id = #{sourceId}
</if>
<if test='source != null and source == "4"'>
update school_enterprise_achievements set status=null ,review_comments=null,review_date=null,reviewer=null where id = #{sourceId}
</if>
</update>
<select id="getDockingUserInfoList" resultType="java.util.Map">
select u.id,u.login,u.nickname,p.name as "lastname,",u.phone,u.company_name,u.mail,p.card as "idNumber",e.entity_type,DATE_FORMAT(ck.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from clickers ck
inner join users u on ck.user_id = u.id
left join entities e on u.id = e.user_id
left join personalities p on e.id = p.entity_id
where click_type='userDocking' and click_id = #{id}
</select>
</mapper>

View File

@ -139,42 +139,21 @@
</where>
</select>
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary" parameterType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication as "isAuth",
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
( SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
(SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
from users u) res
where (res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0)
<if test="userName != null and userName != ''"> and res.userName like concat('%', #{userName}, '%')</if>
</select>
<select id="getrelatedProjectCount" resultType="long">
select sum(r.pCount) from (
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = #{userId}
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = 1
union all
SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != #{userId} AND `members`.`user_id` = #{userId}
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != 1 AND `members`.`user_id` = 1
union all
SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = #{userId}
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = 1
)r
</select>
@ -307,32 +286,13 @@
)t group by t.resultType
</select>
<select id="getActivityStatistic" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserTotal">
select count(1) as "totalUser",sum(r.isExpert) as "totalExpert",sum(r.enterprise_certification+r.authentication) as "authTotal" from (
select res.userId,res.loginName,res.userName,res.isExpert,res.authentication,res.enterprise_certification,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication,u.enterprise_certification,
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
( SELECT count(1) as "pCount"
FROM `projects` INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
(SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
from users u) res
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0 )r
</select>
<select id="getUserBehaviorSum" resultType="com.microservices.dms.behaviorImage.domain.UserTypeTotalVo">
select
(select count(1) as "resultCount" from watchers where user_id = u.id ) as "watchSum",
(select count(1) as "resultCount" from favorites where user_id = u.id ) as "favoriteSum",
(select count(1) as "resultCount" from praise_treads where user_id = u.id ) as "praiseSum"
from users u
where u.id = #{userId}
<select id="getActivityStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select 'totalUser' as `key`, count(1) as " value" from users
union all
select'authTotal' as `key`,sum(u.authentication) as "value" from users u
union all
select 'totalexpert' as `key`, count(1) as " value"from users u
inner join experts e on u.id = e.user_id
where e.is_delete='0' and e.status = 1
</select>
</mapper>

View File

@ -130,7 +130,7 @@
ci.status as competition_status,
cu.works_name as competition_submission_name,
cu.created_at as submission_time,
IFNULL(cu.leader,us.nickname) as submitter,
cu.leader as submitter,
submission_type,
cu.org_name as submitting_unit,
IFNULL(crl.submission_summary,cu.sub_item) as submission_summary,
@ -151,7 +151,6 @@
ci.is_expert_audit
from competition_infos ci
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
inner join users us on cu.user_id=us.id
left join competition_resource_library crl on crl.competition_user_id = cu.id
<where>
<if test="openCompetitionId != null ">and open_competition_id = #{openCompetitionId}</if>
@ -190,7 +189,7 @@
<if test="image != null and image != ''">and image = #{image}</if>
<if test="attachment != null and attachment != ''">and attachment = #{attachment}</if>
</where>
order by is_transferred_to_result_library,create_time desc,submission_time desc
order by is_transferred_to_result_library
</select>
<select id="selectCompetitionResourceLibraryById" parameterType="Long" resultMap="CompetitionResourceLibraryResult">
@ -254,9 +253,9 @@
</select>
<select id="getCompetitionTransferCount" resultType="java.lang.Long">
select count(1) from competition_users cu
inner join competition_infos ci on cu.competition_info_id = ci.id
inner join attachments at on cu.id=at.container_id
select COUNT(*)
from achievements
where source = '3'
</select>
<select id="getCompetitionNeedAuditCount" resultType="java.lang.Long">
@ -275,32 +274,31 @@
select t.title as name, achievementCount, enrollCount, paperCount, t.id as `id`,(achievementCount+enrollCount+paperCount) as total
from (select c.title,
c.id,
c.updated_at,
(select count(*) from achievements a where source='3' and a.source_id = c.id ) as achievementCount,
(select count(*) from competition_users cu where cu.competition_info_id = c.id) as enrollCount,
(select count(*) from (select * from competition_users) cu inner join attachments on container_type = 'CompetitionUser' and container_id=cu.id where cu.competition_info_id=c.id) as paperCount
from competition_infos c ) as t
order by total desc,updated_at desc
order by total desc
limit 0,10
</select>
<select id="getCompetitionYearlyPaperAdd"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%Y-%m') as 'k', count(*) as 'v'
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from competition_infos
where created_at &gt;= #{s}
and created_at &lt;= #{e}
group by DATE_FORMAT(created_at, '%Y-%m')
order by DATE_FORMAT(created_at, '%Y-%m')
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getCompetitionYearlyFinish"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(upload_date, '%Y-%m') as 'k', count(*) as 'v'
select DATE_FORMAT(upload_date, '%m-%d') as 'k', count(*) as 'v'
from competition_infos
where upload_date &gt;= #{s}
and upload_date &lt;= #{e}
group by DATE_FORMAT(upload_date, '%Y-%m')
order by DATE_FORMAT(upload_date, '%Y-%m')
group by DATE_FORMAT(upload_date, '%m-%d')
order by DATE_FORMAT(upload_date, '%m-%d')
</select>
<insert id="insertCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary" useGeneratedKeys="true"

View File

@ -72,16 +72,15 @@
<select id="selectExpertResourceLibraryList" parameterType="ExpertResourceLibrary"
resultType="com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary">
select * from ( select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from,
u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
u.nickname as "userNickName",ue.gender as "gender",
e.id_number,images, attachments,
e.major, e.workplace, e.phone,
CONCAT_WS(',',resume, title_certificate,academic_achievements,honors) AS fullFileIds,
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
expert_domain,u.authentication as expertAuth,
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
erl.create_time,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount,
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount,
erl.update_by, erl.update_time,erl.sort_no
from experts e
inner join users u on e.user_id = u.id
@ -122,7 +121,7 @@
<select id="selectExpertResourceLibraryList2" parameterType="ExpertResourceLibrary"
resultMap="ExpertResourceLibraryResult">
select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from, e.id_number,
e.major, e.workplace, e.phone,u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
e.major, e.workplace, e.phone,
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
expert_domain,images, attachments,
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
@ -132,12 +131,8 @@
(select count(*) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = erl.id) as watcherSum,
(select count(*) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = erl.id) as favoriteSum,
erl.update_by, erl.update_time,erl.sort_no
from expert_resource_library erl
left join experts e on e.id = erl.expert_id
left join users u on e.user_id = u.id
left join user_extensions ue on u.id = ue.user_id
from expert_resource_library erl left join experts e on e.id = erl.expert_id
<where>
and erl.status ='1'
<if test="userId != null ">and user_id = #{userId}</if>
<if test="expertName != null and expertName != ''">and erl.expert_name like concat('%', #{expertName}, '%')
</if>
@ -163,7 +158,6 @@
</if>
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
</where>
order by erl.sort_no
</select>
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">
@ -185,15 +179,15 @@
<select id="competitionAuditCount" resultType="java.lang.Long">
select IFNULL(SUM(competitionAuditCount), 0)
from (select COUNT(distinct container_id) as competitionAuditCount
from task_expert te
join experts e on e.id = te.expert_id and te.container_type = 2 and te.`status` in (1, 2)) tmp
from (select (select COUNT(distinct container_id)
from task_expert
where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
from experts e) tmp
</select>
<select id="taskAuditCount" resultType="java.lang.Long">
select IFNULL(SUM(taskAuditCount), 0)
from (select COUNT(distinct container_id) as taskAuditCount
from task_expert te
join experts e on e.id = te.expert_id and te.container_type = 1 and te.`status` in (1, 2)) tmp
from (select (select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount
from experts e) tmp
</select>
<select id="auditCompetitionAuditExpertCount" resultType="java.lang.Long">
select count(*)
@ -373,12 +367,12 @@
select b.expertTotal as "total", d.expertAuth as "value"
from (
(select count(1) as "expertTotal" from experts where is_delete = '0' and status = 1) b,
(select count(1) as "expertAuth"
from experts e
inner join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1
and (u.authentication = true or u.enterprise_certification='1')) d
(select count(1) as "expertAuth"
from experts e
inner join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1
and u.authentication = true) d
)
</select>
@ -421,8 +415,6 @@
and review_area_three is not null
and review_area_three != '') a
group by a.domain_value
order by count(a.domain_value) desc
limit 0,9
</select>
<select id="getExpertAduit" resultType="com.microservices.dms.achievementLibrary.domain.ExpertTotallVo">
@ -430,15 +422,19 @@
tmp.taskAuditCount as "taskAuditSum",
tmp.competitionAuditCount as "competitionAuditSum",
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
from (select e.expert_name,e.created_on,
from (select e.expert_name,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
(select COUNT(distinct container_id)
from task_expert
where expert_id = e.id
and container_type = 2 and `status` in (1,2)) as competitionAuditCount
from experts e
left join users u on e.user_id = u.id
inner join users u on e.user_id = u.id
left join expert_resource_library erl on e.id = erl.user_id
where e.is_delete = '0'
and e.status = 1) tmp
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc,tmp.created_on desc
limit 0,12
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
limit 0,9
</select>
@ -455,11 +451,10 @@
</select>
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
select b.watchSum, d.favoriteSum,c.userDockingSum
select b.watchSum, d.favoriteSum
from (
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id} and user_id=#{userId}) b,
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d,
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d
)
</select>
@ -499,31 +494,28 @@
<select id="getForumSectionStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select a.ancestry as "key", fs.title as "name", a.tmp as "value"
from (
select IFNULL(f.ancestry, m.forum_section_id) as"ancestry",count(1) as "tmp" from memos m
inner join forum_sections f on m.forum_section_id = f.id
where m.destroy_status is null
and m.hidden = 0
and m.published_at is not null
group by IFNULL(f.ancestry, m.forum_section_id)
) a
left join forum_sections fs on fs.id = a.ancestry
from (select f.ancestry, count(1) as "tmp"
from memos m
left join forum_sections f on m.forum_section_id = f.id
where m.destroy_status is null
and m.hidden = 0
and m.published_at is not null
group by f.ancestry) a
left join forum_sections fs on fs.id = a.ancestry
ORDER BY a.ancestry DESC
</select>
<select id="getAddMemoStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select a.currentMonth as "name", a.tag_id as "key", sum(a.countTag) as "value"
from (select DATE_FORMAT(published_at, '%Y-%m') as "currentMonth", tag_id, count(1) as "countTag"
from memos
where destroy_status is null and hidden=0 and published_at is not null
and published_at &gt;= #{s} and published_at &lt;= #{e}
group by DATE_FORMAT(published_at, '%Y-%m'), tag_id
) a
from (select DATE_FORMAT(published_at, '%m') as "currentMonth", tag_id, count(1) as "countTag"
from memos
where DATE_FORMAT(published_at, '%Y') = YEAR (NOW()) and destroy_status is null and hidden=0 and published_at is not null
group by DATE_FORMAT(published_at, '%m'), tag_id
) a
group by a.currentMonth, a.tag_id
order by a.tag_id, a.currentMonth asc
</select>
<select id="getTop5Memos" resultType="com.microservices.dms.achievementLibrary.domain.MemoTotalVo">
select id as "id",subject as "subject",published_at as "publishedAt",viewed_count as "viewedCount",praises_count as "praisesCount",replies_count as "repliesCount",(viewed_count+praises_count+replies_count) as "behavioreSum"
from memos where destroy_status is null and hidden=0 and published_at is not null and DATE_FORMAT(published_at, '%Y') = YEAR (NOW())
@ -532,13 +524,13 @@
</select>
<select id="get7DayPaise" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
select DATE_FORMAT(created_at, '%Y-%m-%d') as 'k', count(*) as 'v'
from praise_treads
where praise_tread_object_type='Memo'
and created_at &gt;= #{s}
and created_at &lt;= #{e}
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
group by DATE_FORMAT(created_at, '%Y-%m-%d')
order by DATE_FORMAT(created_at, '%Y-%m-%d')
</select>
<select id="getExpertInfoById" resultType="com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo">
@ -550,9 +542,4 @@
<select id="getAttachmentInfo" resultType="java.util.Map">
select file_name,id,unique_file_name from busi_attachments where id = #{id} limit 1
</select>
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select id as v, file_name as k from busi_attachments where FIND_IN_SET (id,#{fullFileIds})
</select>
</mapper>

View File

@ -1,169 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper">
<resultMap type="InBlockchainData" id="InBlockchainDataResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="typeId" column="type_id" />
<result property="txHash" column="tx_hash" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
</resultMap>
<sql id="selectInBlockchainDataVo">
select id, type, type_id, tx_hash, create_time, create_by from in_blockchain_data
</sql>
<select id="selectInBlockchainDataList" parameterType="InBlockchainData" resultMap="InBlockchainDataResult">
<include refid="selectInBlockchainDataVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="typeId != null and typeId != ''"> and type_id = #{typeId}</if>
<if test="txHash != null and txHash != ''"> and tx_hash = #{txHash}</if>
</where>
</select>
<select id="selectInBlockchainDataById" parameterType="Long" resultMap="InBlockchainDataResult">
<include refid="selectInBlockchainDataVo"/>
where id = #{id}
</select>
<select id="issueDataList" resultType="java.util.Map">
select i.id as "issue_id",
i.project_issues_index as "issue_number",
i.status_id as "action",
it.name as "issueStatusName",
i.subject as "title",
i.subject as "issueName",
i.project_id,
r.id as "repo_id",
p.name as "projectName",
r.identifier as "reponame",
i.created_on as "created_at",
i.updated_on as "updated_at",
i.description as "content",
i.author_id as "author_id",
i.blockchain_token_num as "blockchain_token_num",
(select IFNULL(NULLIF(nickname,'') ,login) from users where id = i.author_id) as "createBy",
i.due_date,
(select GROUP_CONCAT(assigner_id SEPARATOR ', ')
from issue_assigners
where issue_id = i.id) as "ownername"
from issues i
inner join issue_statuses it on i.status_id = it.id
inner join projects p on i.project_id = p.id
inner join repositories r on p.id = r.project_id
where p.use_blockchain='1' and i.project_issues_index is not null
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
<if test="issueName != null and issueName != ''">and i.subject like concat('%', #{issueName}, '%')</if>
</select>
<select id="commitDataList" resultType="java.util.Map">
select cl.commit_id as "commit_id",
re.id as "repo_id",
cl.user_id as "committer",
(select IFNULL(NULLIF(nickname, ''),login) from users where id = cl.user_id) as "createBy",
cl.project_id,p.name as "project_name",
cl.message as "content",
cl.created_at as "committer_time",
cl.message as "content",
re.user_id as "author",
ibd.tx_hash as "commitHash",
cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
inner join repositories re on p.id = re.project_id
inner join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1'
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
order by ibd.create_time desc,cl.created_at desc
</select>
<select id="prDataList" resultType="java.util.Map">
select pr.id as "pull_request_id",
pr.gitea_number as "pull_request_number",
pr.status as "prStatus",
pr.project_id,
source.id as "repo_id",
source.url as "reponame",
pr.user_id as "username",
pr.title as "title",
pr.body as "content",
pr.head "source_branch",
pr.base as "target_branch",
target.id as "target_repo_id",
pr.created_at,
pr.updated_at,p.name as "projectName",(select IFNULL(NULLIF(nickname, ''),login) from users where id = pr.user_id) as "createBy"
from pull_requests pr
inner join projects p on pr.project_id = p.id
inner join repositories source on p.id = source.project_id
left join repositories target on pr.fork_project_id = target.project_id
where p.use_blockchain = '1'
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
<if test="prName != null and prName != ''">and pr.title like concat('%', #{prName}, '%')</if>
</select>
<insert id="insertInBlockchainData" parameterType="InBlockchainData" useGeneratedKeys="true" keyProperty="id">
insert into in_blockchain_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null and type != ''">type,</if>
<if test="typeId != null and typeId != ''">type_id,</if>
<if test="txHash != null and txHash != ''">tx_hash,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null and type != ''">#{type},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="txHash != null and txHash != ''">#{txHash},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
</trim>
</insert>
<update id="updateInBlockchainData" parameterType="InBlockchainData">
update in_blockchain_data
<trim prefix="SET" suffixOverrides=",">
<if test="type != null and type != ''">type = #{type},</if>
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
<if test="txHash != null and txHash != ''">tx_hash = #{txHash},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInBlockchainDataById" parameterType="Long">
delete from in_blockchain_data where id = #{id}
</delete>
<delete id="deleteInBlockchainDataByIds" parameterType="String">
delete from in_blockchain_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getNeedToBlockCommitList" resultType="String">
select
cl.commit_id as "commit_id"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join repositories re on cl.repository_id = re.id
left join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1' and ibd.tx_hash is null
</select>
<select id="getCommitListById" resultType="com.microservices.dms.common.vo.CommitResultVo">
select
cl.commit_id as "commit_id",cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1' and ibd.tx_hash is null and p.id = #{projectId}
</select>
</mapper>

View File

@ -216,7 +216,7 @@
<if test="attachments != null and attachments != ''">and attachments = #{attachments}</if>
<if test="projectDomain != null and projectDomain != ''">and project_domain = #{projectDomain}</if>
</where>
order by is_transferred_to_achievement,create_time desc,release_date desc
order by is_transferred_to_achievement
</select>
<select id="selectProjectResourceLibraryById" parameterType="Long" resultMap="ProjectResourceLibraryResult">
@ -369,96 +369,4 @@
select name from project_categories where id=#{projectDomain}
</select>
<select id="selectProjectInfos" resultType="com.microservices.dms.achievementLibrary.domain.TokenListVo">
select p.id, p.name, created_on createdOn, r.identifier repositoryName, r.id as repositoryId,p.user_id as "userId",
(select IFNULL(NULLIF(nickname,''),login) from users where id = p.user_id) as createBy
from projects p
join repositories r on p.id = r.project_id
where p.use_blockchain = 1
<if test="name != null and name != ''">and p.name like concat('%', #{name}, '%')</if>
</select>
<select id="sumProjectIssueToken" resultType="java.lang.Long">
select IFNULL(sum(i.blockchain_token_num),0)
from issues i
inner join projects p on i.project_id = p.id
where p.id=#{id}
</select>
<select id="selectCommitInfo" resultType="java.util.Map">
select cl.commit_id as "commit_hash",
cl.repository_id as "repo_id",
cl.user_id as "committer",
cl.project_id,
cl.message as "content",
cl.created_at as "committer_time",
cl.message as "content",
re.user_id as "author",
'' as "committer_time",
cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join repositories re on cl.repository_id = re.id
where p.use_blockchain = '1'
and cl.commit_id = #{commitId} and cl.ref = #{commitDiff}
</select>
<select id="selectPrInfo" resultType="java.util.Map">
select pr.id as "pull_request_id",
pr.gitea_number as "pull_request_number",
pr.status as "action",
source.id as "repo_id",
source.url as "reponame",
pr.user_id as "username",
pr.title as "title",
pr.body as "content",
pr.head "source_branch",
pr.base as "target_branch",
pr.issue_id as "issue_id",
target.id as "target_repo_id",
pr.created_at,
pr.updated_at,
'' as "merge_user"
from pull_requests pr
inner join projects p on pr.project_id = p.id
inner join repositories source on p.id = source.project_id
left join repositories target on pr.fork_project_id = target.project_id
where p.use_blockchain = '1'
and pr.id = #{prId}
</select>
<select id="selectIssueInfo" resultType="java.util.Map">
select i.id as "issue_id",
i.status_id as "action",
i.subject as "title",
i.project_id,
r.id as "repo_id",
r.identifier as "reponame",
i.created_on as "created_at",
i.updated_on as "updated_at",
i.description as "content",
i.author_id as "username",
i.due_date,
(select GROUP_CONCAT(assigner_id SEPARATOR ', ')
from issue_assigners
where issue_id = i.id) as "ownername"
from issues i
inner join projects p on i.project_id = p.id
inner join repositories r on p.id = r.project_id
where p.use_blockchain='1' and i.id = #{issueId}
</select>
<select id="getProjectUserIdById" resultType="String">
select u.id from projects p
inner join users u on p.user_id=u.id
where p.id = #{tokenName}
</select>
<select id="getUsedApplyToken" resultType="Long">
select IFNULL(sum(token),0) as "totalSum" from user_project_transfer_records where project_id =#{tokenName} and payee_id !=#{userName}
</select>
<select id="getUserIdBYLogin" resultType="String">
select id from users where login=#{userId}
</select>
</mapper>

View File

@ -35,17 +35,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="achievementStatus" column="achievement_status" />
<result property="achievementLittleType" column="achievement_little_type" />
<result property="achievementCurStatus" column="achievement_cur_status" />
<result property="teamName" column="team_name" />
</resultMap>
<sql id="selectSchoolEnterpriseAchievementsVo">
select id, achievement_name, achievement_status,field_1, field_2, field_3,
achievement_type, source, source_id, source_link, tags, summary, publishing_unit,
address, is_featured, contact_person, contact_number, owner_id, owner_name, status, achievement_little_type,
details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, achievement_cur_status,team_name,
update_by, update_time from school_enterprise_achievements
select id, achievement_name, achievement_status,field_1, field_2, field_3, achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address, is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, update_by, update_time from school_enterprise_achievements
</sql>
<select id="selectSchoolEnterpriseAchievementsList" parameterType="SchoolEnterpriseAchievements" resultMap="SchoolEnterpriseAchievementsResult">
@ -77,11 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="images != null and images != ''"> and images = #{images}</if>
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="achievementCurStatus != null and achievementCurStatus != ''"> and achievement_cur_status = #{achievementCurStatus}</if>
<if test="achievementLittleType != null and achievementLittleType != ''"> and achievement_little_type = #{achievementLittleType}</if>
<if test="teamName != null and teamName != ''"> and team_name = #{teamName}</if>
</where>
order by status desc,create_time desc
</select>
<select id="selectSchoolEnterpriseAchievementsById" parameterType="Long" resultMap="SchoolEnterpriseAchievementsResult">
@ -116,9 +105,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
<if test="images != null and images != ''"> and images = #{images}</if>
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
<if test="achievementCurStatus != null and achievementCurStatus != ''"> and achievement_cur_status = #{achievementCurStatus}</if>
<if test="achievementLittleType != null and achievementLittleType != ''"> and achievement_little_type = #{achievementLittleType}</if>
<if test="teamName != null and teamName != ''"> and team_name = #{teamName}</if>
</where>
</select>
@ -154,9 +140,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="achievementStatus != null">achievement_status,</if>
<if test="achievementCurStatus != null">achievement_cur_status,</if>
<if test="achievementLittleType != null">achievement_little_type,</if>
<if test="teamName != null">team_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="achievementName != null">#{achievementName},</if>
@ -188,9 +171,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="achievementStatus != null">#{achievementStatus},</if>
<if test="achievementCurStatus != null">#{achievementCurStatus},</if>
<if test="achievementLittleType != null">#{achievementLittleType},</if>
<if test="teamName != null">#{teamName},</if>
</trim>
</insert>
@ -226,9 +206,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="achievementStatus != null">achievement_status = #{achievementStatus},</if>
<if test="achievementCurStatus != null">achievement_cur_status = #{achievementCurStatus},</if>
<if test="achievementLittleType != null">achievement_little_type = #{achievementLittleType},</if>
<if test="teamName != null">team_name = #{teamName},</if>
</trim>
where id = #{id}
</update>

View File

@ -4,12 +4,11 @@
<mapper namespace="com.microservices.dms.referral.mapper.TalentReferralMapper">
<select id="selectIssuesCondition" resultType="com.microservices.dms.referral.vo.IssuesVo">
select id,project_id,`subject`,description,status_id from issues
select project_id,`subject`,description,status_id from issues
<where>
<if test="id != null ">and id = #{id}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="subject != null and subject != ''">and `subject` = #{subject}</if>
<if test="issueClassify != null and issueClassify != ''">and `issue_classify` = #{issueClassify}</if>
<if test="subject != null ">and `subject` = #{subject}</if>
<if test="statusIds != null and statusIds.size() > 0">and status_id in
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
#{item}
@ -67,63 +66,5 @@
select id from users where login = #{login} limit 1
</select>
<select id="selectTaskByStatus" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id,td.task_id, name, status, category_id, description
from tasks t
join task_details td on t.id = td.task_id
where status in
<foreach collection="statusIds" item="item" close=")" index="idx" open="(" separator=",">
#{item}
</foreach>
</select>
<select id="selectUsersById" resultType="java.util.Map">
select id,login,nickname,admin from users where id = #{id}
</select>
<select id="selectTaskById" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id,td.task_id, name, status, category_id, description
from tasks t
join task_details td on t.id = td.task_id
where t.id =#{id}
</select>
<select id="selectExpertsBy" resultType="com.microservices.dms.referral.vo.ExpertVo">
select id,
user_id,
review_area_one,
review_area_two,
review_area_three,
(select IFNULL(nickname,login) from users u where u.id = e.user_id) as nickname,
expert_name
from experts e
where is_delete = 0 and status = 1
</select>
<select id="allTaskWithExpertIds" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select container_id as 'k', group_concat(expert_id) as v from task_expert where container_type = #{type}
group by container_id
</select>
<select id="selectCompetitionById" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id, title as name, status, description
from competition_infos t
where t.id =#{id}
</select>
<select id="selectCompetitionIdByStatus" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id, title as name, status, description,identifier
from competition_infos t
where upload_date &lt; now()
</select>
<select id="selectPRInfoById" resultType="com.microservices.dms.referral.vo.PrInfoVo">
select pr.id,pr.title as "title",pr.body as "content"
from pull_requests pr
where pr.id= #{id}
</select>
<select id="selectProjectById" resultType="int">
select count(1) from projects where id = #{tokenName}
</select>
</mapper>

View File

@ -42,12 +42,10 @@
</trim>
</insert>
<select id="countClicker" resultType="java.lang.Long">
select count(*) from clickers c
inner join achievements a ON a.id = c.click_id
select count(*) from clickers c inner join achievements a ON a.id = c.click_id
<where>
and a.status='1'
<if test="null != clickType and '' != clickType">
and c.click_type = #{clickType}
c.click_type = #{clickType}
</if>
and a.source='4'
</where>
@ -502,7 +500,7 @@
<if test="imageUrl != null and imageUrl != ''">and image_url = #{imageUrl}</if>
<if test="attachmentUrl != null and attachmentUrl != ''">and attachment_url = #{attachmentUrl}</if>
</where>
order by is_transferred_to_results_library,create_time desc,submission_date desc
order by is_transferred_to_results_library
</select>
<select id="selectTaskResourceLibraryById" parameterType="Long" resultMap="TaskResourceLibraryResult">
@ -524,22 +522,11 @@
</select>
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
select IFNULL(SUM(bounty), 0)
from (select distinct t.id, t.bounty
from tasks t
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
where is_transferred_to_results_library = 1) tmp
</select>
<select id="getConvertedTaskAmount2" resultType="java.lang.Double">
select IFNULL(SUM(bounty), 0)
from (select distinct t.id, t.bounty
from tasks t
join (select task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
join achievements a on a.source_id = task_resource_library.id and a.source='2' and a.status= '1'
where is_transferred_to_results_library = 1) tmp
select IFNULL(sum(t.bounty), 0)
from tasks t
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
where is_transferred_to_results_library = 1
</select>
<select id="getConvertedTasksCount" resultType="java.lang.Long">

View File

@ -1,141 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper">
<resultMap type="UserProjectTransferRecords" id="UserProjectTransferRecordsResult">
<result property="id" column="id"/>
<result property="payerId" column="payer_id"/>
<result property="projectId" column="project_id"/>
<result property="token" column="token"/>
<result property="payeeId" column="payee_id"/>
<result property="txHash" column="tx_hash"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="type" column="type"/>
<result property="reserve1" column="reserve_1"/>
<result property="reserve2" column="reserve_2"/>
</resultMap>
<sql id="selectUserProjectTransferRecordsVo">
select id,
payer_id,
project_id,
token,
payee_id,
tx_hash,
create_time,
create_by,
type,
reserve_1,
reserve_2
from user_project_transfer_records
</sql>
<select id="selectUserProjectTransferRecordsList" parameterType="UserProjectTransferRecords"
resultMap="UserProjectTransferRecordsResult">
<include refid="selectUserProjectTransferRecordsVo"/>
<where>
<if test="payerId != null and payerId != ''">and payer_id = #{payerId}</if>
<if test="projectId != null and projectId != ''">and project_id = #{projectId}</if>
<if test="token != null ">and token = #{token}</if>
<if test="payeeId != null and payeeId != ''">and payee_id = #{payeeId}</if>
<if test="txHash != null and txHash != ''">and tx_hash = #{txHash}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="reserve1 != null and reserve1 != ''">and reserve_1 = #{reserve1}</if>
<if test="reserve2 != null and reserve2 != ''">and reserve_2 = #{reserve2}</if>
</where>
</select>
<select id="selectUserProjectTransferRecordsById" parameterType="Long" resultMap="UserProjectTransferRecordsResult">
<include refid="selectUserProjectTransferRecordsVo"/>
where id = #{id}
</select>
<select id="userDataList" resultType="java.util.Map">
select * from ( select p.name projectName,payer_id,payee_id,uptr.token,uptr.tx_hash,uptr.type,
(select IFNULL(lastname,login) from users where id = uptr.payer_id) as "payerName" ,
(select IFNULL(lastname,login) from users where id = uptr.payee_id) as "payeeName"
from user_project_transfer_records uptr join projects p on uptr.project_id = p.id)tmp
<where>
<if test="projectName != null and projectName != ''">and tmp.projectName like concat('%', #{projectName}, '%')
</if>
<if test="userName != null and userName != ''">and (tmp.payerName like concat('%', #{userName}, '%') OR
tmp.payeeName like concat('%', #{userName}, '%'))
</if>
<if test="userId != null ">and (tmp.payer_id = #{userId} OR
tmp.payee_id = #{userId})
</if>
</where>
</select>
<select id="userList" resultType="com.microservices.dms.achievementLibrary.domain.blockchain.UserVo">
select * from (select id,IFNULL(nickname,login) as "nickname" from users where status=1) tmp
<where>
<if test="nickname != null and nickname != ''">
and tmp.nickname like concat('%', #{nickname}, '%'))
</if>
</where>
</select>
<insert id="insertUserProjectTransferRecords" parameterType="UserProjectTransferRecords" useGeneratedKeys="true"
keyProperty="id">
insert into user_project_transfer_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="payerId != null and payerId != ''">payer_id,</if>
<if test="projectId != null and projectId != ''">project_id,</if>
<if test="token != null">token,</if>
<if test="payeeId != null and payeeId != ''">payee_id,</if>
<if test="txHash != null and txHash != ''">tx_hash,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="type != null">type,</if>
<if test="reserve1 != null">reserve_1,</if>
<if test="reserve2 != null">reserve_2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payerId != null and payerId != ''">#{payerId},</if>
<if test="projectId != null and projectId != ''">#{projectId},</if>
<if test="token != null">#{token},</if>
<if test="payeeId != null and payeeId != ''">#{payeeId},</if>
<if test="txHash != null and txHash != ''">#{txHash},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="type != null">#{type},</if>
<if test="reserve1 != null">#{reserve1},</if>
<if test="reserve2 != null">#{reserve2},</if>
</trim>
</insert>
<update id="updateUserProjectTransferRecords" parameterType="UserProjectTransferRecords">
update user_project_transfer_records
<trim prefix="SET" suffixOverrides=",">
<if test="payerId != null and payerId != ''">payer_id = #{payerId},</if>
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
<if test="token != null">token = #{token},</if>
<if test="payeeId != null and payeeId != ''">payee_id = #{payeeId},</if>
<if test="txHash != null and txHash != ''">tx_hash = #{txHash},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="type != null">type = #{type},</if>
<if test="reserve1 != null">reserve_1 = #{reserve1},</if>
<if test="reserve2 != null">reserve_2 = #{reserve2},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserProjectTransferRecordsById" parameterType="Long">
delete
from user_project_transfer_records
where id = #{id}
</delete>
<delete id="deleteUserProjectTransferRecordsByIds" parameterType="String">
delete from user_project_transfer_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -12,7 +12,7 @@ public class MakerSpaceTotalDataVo {
private int totalApplicants;
private float currentTotalAwardAmount;
private int currentTotalAwardAmount;
private float paidAwardAmount;

View File

@ -17,7 +17,7 @@ public interface TasksMapper{
int getTotalApplicantCount();
float getCurrentTotalAwardAmount();
int getCurrentTotalAwardAmount();
List<Object> getTaskPublishedCountsByYear();

View File

@ -40,7 +40,7 @@ public class TasksServiceImpl implements ITasksService {
MakerSpaceTotalDataVo makerSpaceTotalDataVo = new MakerSpaceTotalDataVo();
makerSpaceTotalDataVo.setTotalTasks(tasksMapper.getTotalTaskCount());
makerSpaceTotalDataVo.setTotalApplicants(tasksMapper.getTotalApplicantCount());
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount() /10000L);
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount()/10000);
makerSpaceTotalDataVo.setPaidAwardAmount(tasksMapper.getPaidAwardAmount()/10000);
makerSpaceTotalDataVo.setTotalVisits(tasksMapper.getTotalVisits());
makerSpaceTotalDataVo.setTaskPublishedCountsByYear(tasksMapper.getTaskPublishedCountsByYear());

View File

@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from papers
where is_delete = 0 and parent_id = 0
</select>
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Float">
select COALESCE(SUM(bounty), 0)
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Integer">
select sum(bounty)
from tasks
where is_delete = 0 and `status` between 3 and 8
</select>

View File

@ -142,7 +142,7 @@ public class CommonController extends BaseController {
@ApiOperation("通用上传请求")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件实体", paramType = "form", dataType = "_file"),
@ApiImplicitParam(name = "type", value = "文件类型zone-identifier专区下支持文件标识的附件dms资源库cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件gitlinkgitlink附件", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "文件类型zone-identifier专区下支持文件标识的附件cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件gitlinkgitlink附件", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "hierarchy", value = "层级结构eg: pms项目管理中{enterpriseIdentifier}/products,{enterpriseIdentifier}/projects,{enterpriseIdentifier}/docs/{projectId}", paramType = "query", dataType = "String")
})
public AjaxResult uploadFile(@RequestPart("file") MultipartFile file, String type, String hierarchy) {
@ -168,7 +168,7 @@ public class CommonController extends BaseController {
@DeleteMapping("/byIdentifier/{fileIdentifier}")
@ApiOperation("通用删除请求")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "文件类型cms内容管理dms资源库resource专区资源pms项目管理pms-gitlink项目管理gitlink附件", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "type", value = "文件类型cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件", paramType = "query", dataType = "String")
})
public AjaxResult deleteFile(@PathVariable("fileIdentifier") String fileIdentifier, @RequestParam("type") String type) {
return toAjax(sysFileInfoService.deleteFile(fileIdentifier, type));

View File

@ -121,12 +121,6 @@
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<!-- Apache POI for Word processing -->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>5.4.0</version>-->
<!-- </dependency>-->
<!-- 自然语言处理,用于自动提取文章概要 -->
<dependency>
<groupId>com.hankcs</groupId>
@ -145,12 +139,6 @@
<version>0.4.8</version>
<scope>compile</scope>
</dependency>
<!-- 文件导入、导出库 -->
<!-- <dependency>-->
<!-- <groupId>com.github.ben-manes.caffeine</groupId>-->
<!-- <artifactId>Java2Word</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
</dependencies>
<build>

View File

@ -39,7 +39,6 @@ public class OpenController extends BaseController {
@GetMapping("/loginUrl")
@ApiOperation(value = "获取登录地址")
public AjaxResult loginUrl() {
logger.info("调用接口:获取登录地址");
return success(
(Object) EscapeUtil.removeExtraSlashOfUrl(gitLinkUrl + "/login")
);

View File

@ -32,7 +32,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -173,12 +172,6 @@ public class PmsDashboardController extends BaseController {
}
todoProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
JSONObject result = pmsProjectIssuesService.selectMyTodoPmsProjectIssuesList(todoProjectIssuesSearchVo);
// 判断projectList中是否存在projectAssigneeId和当前用户id相等
Long currentUserId = SecurityUtils.getGitlinkUserId();
boolean isProjectAssigner = projectList.stream()
.anyMatch(project -> currentUserId != null && currentUserId.equals(project.getProjectAssigneeId()));
result.put("isProjectAssigner", isProjectAssigner);
return success(result);
}

View File

@ -20,7 +20,7 @@ import java.util.List;
/**
* 项目管理-文档库Controller
*
*
* @author wanjia
* @date 2024-01-08
*/
@ -30,7 +30,8 @@ import java.util.List;
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
})
public class PmsDocumentController extends BaseController {
public class PmsDocumentController extends BaseController
{
@Autowired
private IPmsDocumentService pmsDocumentService;
@ -45,7 +46,8 @@ public class PmsDocumentController extends BaseController {
@ApiImplicitParam(name = "orderByColumn", value = "排序列更新时间updateTime创建时间createTime", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
})
public GenericsTableDataInfo<PmsDocumentVo> list(@Validated PmsDocumentSearchVo pmsDocumentSearchVo) {
public GenericsTableDataInfo<PmsDocumentVo> list( @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
{
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
}
@ -56,7 +58,8 @@ public class PmsDocumentController extends BaseController {
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
public void export(HttpServletResponse response, PmsDocument pmsDocument) {
public void export(HttpServletResponse response, PmsDocument pmsDocument)
{
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
util.exportExcel(response, list, "项目管理-文档库数据");
@ -68,7 +71,8 @@ public class PmsDocumentController extends BaseController {
// @RequiresPermissions("pms:document:query")
@GetMapping(value = "/{id}")
@ApiOperation(value = "获取项目管理-文档库详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId) {
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId)
{
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
}
@ -79,7 +83,8 @@ public class PmsDocumentController extends BaseController {
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation(value = "新增项目管理-文档库")
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo) {
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo)
{
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
}
@ -87,10 +92,11 @@ public class PmsDocumentController extends BaseController {
* 新增附件类型文档
*/
// @RequiresPermissions("pms:document:add")
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
@PostMapping("/fileType")
@ApiOperation(value = "新增附件类型文档")
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo) {
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo)
{
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
}
@ -101,7 +107,8 @@ public class PmsDocumentController extends BaseController {
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation(value = "修改项目管理-文档库")
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo) {
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo)
{
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
}
@ -110,13 +117,12 @@ public class PmsDocumentController extends BaseController {
*/
// @RequiresPermissions("pms:document:remove")
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@DeleteMapping("/{ids}")
@ApiOperation(value = "删除项目管理-文档库")
public AjaxResult remove(@PathVariable Long[] ids,
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId,
@ApiParam("文档名称,多个逗号分隔") @RequestParam(name = "names", required = false) String names,
@ApiParam("文件类型 1-文档目录 2-文档 3-附件 4-wiki库多个逗号分隔") @RequestParam(name = "docTypes", required = false) String docTypes) {
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId)
{
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
}
@ -125,16 +131,8 @@ public class PmsDocumentController extends BaseController {
*/
@GetMapping(value = "/optionalWikiRepoList")
@ApiOperation(value = "导入wiki时可选的仓库列表")
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo) {
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo)
{
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
}
/**
* 下载文档类型文件
*/
@GetMapping(value = "/downloadDoc/{docId}")
@ApiOperation(value = "下载文档类型文件")
public void downloadDoc(@PathVariable String enterpriseIdentifier, @PathVariable Long docId, HttpServletResponse response) {
pmsDocumentService.downloadDoc(response, enterpriseIdentifier, docId);
}
}

View File

@ -23,7 +23,7 @@ public class PmsDocumentUpdateVo
/** 文档名称 */
@ApiModelProperty(value = "文档名称")
@Size(min = 1, max = 101)
@Size(min = 1, max = 50)
private String name;
/** 文档内容 */

Some files were not shown because too many files have changed in this diff Show More