Merge pull request '【资源库-成果库】 一些改动' (#881) from liuhuazhong/microservices:feat_chievements_dev into master
This commit is contained in:
commit
1b8f1ea253
|
@ -0,0 +1,125 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -210,8 +210,9 @@ public class AchievementsController extends BaseController {
|
||||||
}
|
}
|
||||||
@ApiOperation("根据成果ID,获取近7日成果点击数量(折线图)")
|
@ApiOperation("根据成果ID,获取近7日成果点击数量(折线图)")
|
||||||
@GetMapping("/get7AddClickById")
|
@GetMapping("/get7AddClickById")
|
||||||
public AjaxResult get7AddClickById(String id) {
|
public AjaxResult get7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Achievements")
|
||||||
return success(achievementsService.get7AddClickById(id));
|
String clickType) {
|
||||||
|
return success(achievementsService.get7AddClickById(id,clickType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||||
|
@ -219,10 +220,8 @@ public class AchievementsController extends BaseController {
|
||||||
public AjaxResult getActDataStatisticById(Long id) {
|
public AjaxResult getActDataStatisticById(Long id) {
|
||||||
return success(achievementsService.getActDataStatisticById(id));
|
return success(achievementsService.getActDataStatisticById(id));
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 根据领域,将成果数据进行分类
|
@ApiOperation("根据领域,将成果数据进行分类")
|
||||||
*
|
|
||||||
*/
|
|
||||||
@GetMapping("/getAreaStatistic")
|
@GetMapping("/getAreaStatistic")
|
||||||
public AjaxResult getAreaStatistic(String areaKey)
|
public AjaxResult getAreaStatistic(String areaKey)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +238,36 @@ public class AchievementsController extends BaseController {
|
||||||
return success(achievementsService.getRelatedAch(id,sourceId));
|
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 = "搜索行为数据记录")
|
@ApiOperation(value = "搜索行为数据记录")
|
||||||
@GetMapping("/getSearchResult")
|
@GetMapping("/getSearchResult")
|
||||||
public AjaxResult getSearchResult(String achName,Long userId)
|
public AjaxResult getSearchResult(String achName,Long userId)
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.microservices.dms.achievementLibrary.controller;
|
||||||
|
|
||||||
|
import com.microservices.common.core.web.controller.BaseController;
|
||||||
|
import com.microservices.common.core.web.page.TableDataInfo;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||||
|
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/blockChain")
|
||||||
|
@Api(tags = "数据产权子系统")
|
||||||
|
public class BlockChainController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAchievementsService achievementsService;
|
||||||
|
|
||||||
|
@GetMapping("/projectTokenList")
|
||||||
|
@ApiOperation(value = "项目token列表")
|
||||||
|
public TableDataInfo projectTokenList() {
|
||||||
|
startPage();
|
||||||
|
List<TokenListVo> list = achievementsService.projectTokenList();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,7 @@ public class ExpertDashboardController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "getExpertAduit")
|
@GetMapping(value = "getExpertAduit")
|
||||||
@ApiOperation(value = "近一年专家评审作品数")
|
@ApiOperation(value = "专家评审作品数排序")
|
||||||
public AjaxResult getExpertAduit() {
|
public AjaxResult getExpertAduit() {
|
||||||
return AjaxResult.success(expertDashboardService.getExpertAduit());
|
return AjaxResult.success(expertDashboardService.getExpertAduit());
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,25 +36,25 @@ public class MemoDashboardController {
|
||||||
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
|
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "getForumSectionStatistic(")
|
@GetMapping(value = "getForumSectionStatistic")
|
||||||
@ApiOperation(value = "帖子分类")
|
@ApiOperation(value = "帖子分类")
|
||||||
public AjaxResult getForumSectionStatistic() {
|
public AjaxResult getForumSectionStatistic() {
|
||||||
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
|
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "getAddMemoStatistic(")
|
@GetMapping(value = "getAddMemoStatistic")
|
||||||
@ApiOperation(value = "近一年新增帖子数")
|
@ApiOperation(value = "近一年新增帖子数")
|
||||||
public AjaxResult getAddMemoStatistic() {
|
public AjaxResult getAddMemoStatistic() {
|
||||||
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
|
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "getTop5Memos(")
|
@GetMapping(value = "getTop5Memos")
|
||||||
@ApiOperation(value = "年度帖子热度top5")
|
@ApiOperation(value = "年度帖子热度top5")
|
||||||
public AjaxResult getTop5Memos() {
|
public AjaxResult getTop5Memos() {
|
||||||
return AjaxResult.success(memoDashboardService.getTop5Memos());
|
return AjaxResult.success(memoDashboardService.getTop5Memos());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "get7DayPaise(")
|
@GetMapping(value = "get7DayPaise")
|
||||||
@ApiOperation(value = "近7日帖子点赞数")
|
@ApiOperation(value = "近7日帖子点赞数")
|
||||||
public AjaxResult get7DayPaise() {
|
public AjaxResult get7DayPaise() {
|
||||||
return AjaxResult.success(memoDashboardService.get7DayPaise());
|
return AjaxResult.success(memoDashboardService.get7DayPaise());
|
||||||
|
|
|
@ -43,6 +43,17 @@ public class SchoolEnterpriseAchievementsController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询校企成果列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/listFront")
|
||||||
|
public TableDataInfo listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.listFront(schoolEnterpriseAchievements);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出校企成果列表
|
* 导出校企成果列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class AchQueryVo {
|
||||||
private String source;//来源
|
private String source;//来源
|
||||||
private String achievementName;//名称
|
private String achievementName;//名称
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
private String showAchievementName;
|
||||||
public String getAreaQuery() {
|
public String getAreaQuery() {
|
||||||
return areaQuery;
|
return areaQuery;
|
||||||
}
|
}
|
||||||
|
@ -29,4 +30,20 @@ public class AchQueryVo {
|
||||||
public void setAchievementName(String achievementName) {
|
public void setAchievementName(String achievementName) {
|
||||||
this.achievementName = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ public class AchRelatedVo {
|
||||||
private String source;
|
private String source;
|
||||||
private Long sourceId;
|
private Long sourceId;
|
||||||
private String achRelateName;
|
private String achRelateName;
|
||||||
|
private String showAchievementName;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -73,4 +74,12 @@ public class AchRelatedVo {
|
||||||
public void setAchRelateName(String achRelateName) {
|
public void setAchRelateName(String achRelateName) {
|
||||||
this.achRelateName = achRelateName;
|
this.achRelateName = achRelateName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getShowAchievementName() {
|
||||||
|
return showAchievementName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowAchievementName(String showAchievementName) {
|
||||||
|
this.showAchievementName = showAchievementName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.microservices.dms.achievementLibrary.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
|
@ -29,6 +30,10 @@ public class Achievements extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "成果名称")
|
@Excel(name = "成果名称")
|
||||||
private String achievementName;
|
private String achievementName;
|
||||||
|
/**
|
||||||
|
* 成果展示名称
|
||||||
|
*/
|
||||||
|
private String showAchievementName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成果领域1
|
* 成果领域1
|
||||||
|
@ -181,6 +186,23 @@ public class Achievements extends BaseEntity {
|
||||||
private String userNickName;
|
private String userNickName;
|
||||||
public String gender;
|
public String gender;
|
||||||
private String userLogin;
|
private String userLogin;
|
||||||
|
private List<Map<String,Object>> dockingUserInfo;
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getDockingUserInfo() {
|
||||||
|
return dockingUserInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
|
||||||
|
this.dockingUserInfo = dockingUserInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShowAchievementName() {
|
||||||
|
return showAchievementName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowAchievementName(String showAchievementName) {
|
||||||
|
this.showAchievementName = showAchievementName;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUserImg() {
|
public String getUserImg() {
|
||||||
return userImg;
|
return userImg;
|
||||||
|
@ -480,38 +502,4 @@ public class Achievements extends BaseEntity {
|
||||||
return attachments;
|
return attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("achievementName", getAchievementName())
|
|
||||||
.append("field1", getField1())
|
|
||||||
.append("field2", getField2())
|
|
||||||
.append("field3", getField3())
|
|
||||||
.append("achievementType", getAchievementType())
|
|
||||||
.append("source", getSource())
|
|
||||||
.append("sourceId", getSourceId())
|
|
||||||
.append("sourceLink", getSourceLink())
|
|
||||||
.append("tags", getTags())
|
|
||||||
.append("summary", getSummary())
|
|
||||||
.append("publishingUnit", getPublishingUnit())
|
|
||||||
.append("address", getAddress())
|
|
||||||
.append("isFeatured", getIsFeatured())
|
|
||||||
.append("contactPerson", getContactPerson())
|
|
||||||
.append("contactNumber", getContactNumber())
|
|
||||||
.append("ownerId", getOwnerId())
|
|
||||||
.append("ownerName", getOwnerName())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.append("details", getDetails())
|
|
||||||
.append("reviewer", getReviewer())
|
|
||||||
.append("reviewDate", getReviewDate())
|
|
||||||
.append("reviewComments", getReviewComments())
|
|
||||||
.append("images", getImages())
|
|
||||||
.append("attachments", getAttachments())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.microservices.dms.achievementLibrary.domain;
|
package com.microservices.dms.achievementLibrary.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
@ -167,6 +168,46 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
|
||||||
@Excel(name = "成果附件")
|
@Excel(name = "成果附件")
|
||||||
private String attachments;
|
private String attachments;
|
||||||
private Integer achievementStatus;
|
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() {
|
public Integer getAchievementStatus() {
|
||||||
return achievementStatus;
|
return achievementStatus;
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.microservices.dms.achievementLibrary.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TokenListVo {
|
||||||
|
|
||||||
|
private Long id; // 项目ID
|
||||||
|
private String name; // 项目名称
|
||||||
|
private Long totalToken; // 项目总Token
|
||||||
|
private String createBy; // 创建人
|
||||||
|
private Long currentToken; // 当前Token
|
||||||
|
private String repositoryName; // 仓库名称
|
||||||
|
private Long repositoryId; // 仓库名称
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Data createdOn; // 项目创建时间(以毫秒为单位)
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.microservices.dms.achievementLibrary.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
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
|
||||||
|
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();
|
||||||
|
}
|
|
@ -66,4 +66,6 @@ public interface AchievementTeamMapper
|
||||||
public int deleteAchievementTeamByIds(Long[] ids);
|
public int deleteAchievementTeamByIds(Long[] ids);
|
||||||
|
|
||||||
void deleteAchievementTeamByAId(@Param("aid") Long aid);
|
void deleteAchievementTeamByAId(@Param("aid") Long aid);
|
||||||
|
|
||||||
|
List<AchievementTeam> selectAchievementTeamByAchId(@Param("achId") Long achId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package com.microservices.dms.achievementLibrary.mapper;
|
package com.microservices.dms.achievementLibrary.mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
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.Master;
|
||||||
import com.microservices.common.datasource.annotation.Slave;
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
import com.microservices.dms.achievementLibrary.domain.*;
|
import com.microservices.dms.achievementLibrary.domain.*;
|
||||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
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 com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -91,7 +90,7 @@ public interface AchievementsMapper {
|
||||||
|
|
||||||
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
|
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
|
||||||
|
|
||||||
List<Map<String, String>> getHotAchievement();
|
List<HotAchVo> getHotAchievement();
|
||||||
|
|
||||||
Map<String, Long> indexProjectStatistic();
|
Map<String, Long> indexProjectStatistic();
|
||||||
|
|
||||||
|
@ -115,7 +114,7 @@ public interface AchievementsMapper {
|
||||||
|
|
||||||
List<Map<String, Object>> getAchievementType();
|
List<Map<String, Object>> getAchievementType();
|
||||||
|
|
||||||
List<KeyValueVo> getAchievementActData();
|
List<KeyValueVo> getAchievementActData(@Param("s") Date s, @Param("e") Date e);
|
||||||
|
|
||||||
List<Map<String, Object>> getAchievementDomain();
|
List<Map<String, Object>> getAchievementDomain();
|
||||||
|
|
||||||
|
@ -140,4 +139,23 @@ public interface AchievementsMapper {
|
||||||
List<String> getExpertAreasByName(@Param("areaName") String areaName);
|
List<String> getExpertAreasByName(@Param("areaName") String areaName);
|
||||||
|
|
||||||
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.microservices.dms.achievementLibrary.service;
|
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.domain.KeyValueVo;
|
||||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
|
@ -23,7 +24,7 @@ public class BigScreenStatisticService {
|
||||||
Date[] days = DateUtil.getDays(0, 6);
|
Date[] days = DateUtil.getDays(0, 6);
|
||||||
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
|
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
|
||||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||||
List<String> dateStr = DateUtil.getDateStrYYYYMMDD(days[0], days[1]);
|
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||||
Date[] lastDays = DateUtil.getDays(7, 13);
|
Date[] lastDays = DateUtil.getDays(7, 13);
|
||||||
long lastSum = Optional.ofNullable(achievementsMapper.countAchievementBySource(lastDays[0], lastDays[1], source)).orElse(0L);
|
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 sum = Optional.ofNullable(achievementsMapper.countAchievementBySource(null, null, source)).orElse(0L);
|
||||||
|
@ -58,18 +59,99 @@ public class BigScreenStatisticService {
|
||||||
return achievementsMapper.getAchievementType();
|
return achievementsMapper.getAchievementType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, List<KeyValueVo>> getAchievementActData() {
|
public List<Map<String,Object>> getAchievementActData() {
|
||||||
List<KeyValueVo> list = achievementsMapper.getAchievementActData();
|
Date[] days = DateUtil.getDays(0, 6);
|
||||||
Map<String, List<KeyValueVo>> res = list.stream().collect(Collectors.groupingBy(KeyValueVo::getKey));
|
Map<String, Long> wlist = achievementsMapper.getAchievementActDataW(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
|
||||||
return res;
|
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 List<Map<String, Object>> getAchievementDomain() {
|
public List<Map<String, Object>> getAchievementDomain() {
|
||||||
return achievementsMapper.getAchievementDomain();
|
return achievementsMapper.getAchievementDomain();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> getAchievementAddYearly() {
|
public Object getAchievementAddYearly() {
|
||||||
return achievementsMapper.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>> getAchievementHotRank() {
|
public List<Map<String, Object>> getAchievementHotRank() {
|
||||||
|
@ -102,11 +184,11 @@ public class BigScreenStatisticService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
|
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
|
||||||
Date[] currentYear = DateUtil.getCurrentYear();
|
Date[] currentYear = DateUtil.getLast12Months();
|
||||||
|
|
||||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
|
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
|
||||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
|
||||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||||
for (String s : dateStr) {
|
for (String s : dateStr) {
|
||||||
Long a = m.getOrDefault(s, 0L);
|
Long a = m.getOrDefault(s, 0L);
|
||||||
|
@ -119,12 +201,11 @@ public class BigScreenStatisticService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
|
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
|
||||||
Date[] currentYear = DateUtil.getCurrentYear();
|
Date[] currentYear = DateUtil.getLast12Months();
|
||||||
Date[] YearEndOfCur = DateUtil.getCurrentYearEndOf(LocalDate.now());
|
|
||||||
|
|
||||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(YearEndOfCur[0],YearEndOfCur[1])
|
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(currentYear[0],currentYear[1])
|
||||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
|
||||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||||
for (String s : dateStr) {
|
for (String s : dateStr) {
|
||||||
Long a = m.getOrDefault(s, 0L);
|
Long a = m.getOrDefault(s, 0L);
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
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();
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ import java.util.Map;
|
||||||
|
|
||||||
import com.microservices.dms.achievementLibrary.domain.*;
|
import com.microservices.dms.achievementLibrary.domain.*;
|
||||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
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 com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,7 +78,7 @@ public interface IAchievementsService {
|
||||||
|
|
||||||
Map<String, Object> getUerActionData();
|
Map<String, Object> getUerActionData();
|
||||||
|
|
||||||
List<Map<String, String>> getHotAchievement();
|
List<HotAchVo> getHotAchievement();
|
||||||
|
|
||||||
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
|
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
|
||||||
|
|
||||||
|
@ -94,7 +96,7 @@ public interface IAchievementsService {
|
||||||
|
|
||||||
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
||||||
|
|
||||||
List<KeyValVo<String, Long>> get7AddClickById(String id);
|
List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType);
|
||||||
|
|
||||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
||||||
|
|
||||||
|
@ -107,4 +109,15 @@ public interface IAchievementsService {
|
||||||
List<KeyValueVo> getProjectAreasByName(String areaName);
|
List<KeyValueVo> getProjectAreasByName(String areaName);
|
||||||
|
|
||||||
List<String> getExpertAreasByName(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);
|
||||||
|
|
||||||
|
List<TokenListVo> projectTokenList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,4 +60,6 @@ public interface ISchoolEnterpriseAchievementsService
|
||||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||||
|
|
||||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||||
|
|
||||||
|
List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.microservices.dms.achievementLibrary.service;
|
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.AchQueryVo;
|
||||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||||
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
||||||
|
@ -33,7 +34,7 @@ public class MemoDashboardService {
|
||||||
* 原创、非原创
|
* 原创、非原创
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public KeyValueVo getIsOriginalStatistic() {
|
public List<KeyValueVo> getIsOriginalStatistic() {
|
||||||
return memoResourceLibraryMapper.getIsOriginalStatistic();
|
return memoResourceLibraryMapper.getIsOriginalStatistic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ public class MemoDashboardService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<KeyValVo<String, Long>> get7DayPaise() {
|
public List<KeyValVo<String, Long>> get7DayPaise() {
|
||||||
Date[] days = DateUtil.getDays(1, 7);
|
Date[] days = DateUtil.getDays(0, 6);
|
||||||
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
|
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
|
||||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,20 +5,25 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.microservices.common.core.utils.DateUtils;
|
import com.microservices.common.core.utils.DateUtils;
|
||||||
import com.microservices.common.core.utils.StringUtils;
|
import com.microservices.common.core.utils.StringUtils;
|
||||||
|
import com.microservices.common.httpClient.service.HttpAPIService;
|
||||||
import com.microservices.common.security.utils.SecurityUtils;
|
import com.microservices.common.security.utils.SecurityUtils;
|
||||||
import com.microservices.dms.achievementLibrary.domain.*;
|
import com.microservices.dms.achievementLibrary.domain.*;
|
||||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||||
import com.microservices.dms.resourceLibrary.domain.Clicker;
|
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.Searcher;
|
||||||
|
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||||
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
||||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||||
import com.microservices.dms.utils.DateUtil;
|
import com.microservices.dms.utils.DateUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
@ -26,6 +31,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||||
|
|
||||||
|
import static com.microservices.dms.constant.BlockChainFunConstants.QUERY_REPO;
|
||||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,6 +41,7 @@ import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||||
* @date 2025-04-02
|
* @date 2025-04-02
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class AchievementsServiceImpl implements IAchievementsService {
|
public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AchievementsMapper achievementsMapper;
|
private AchievementsMapper achievementsMapper;
|
||||||
|
@ -60,6 +67,11 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Value("${http.gatewayUrl}")
|
@Value("${http.gatewayUrl}")
|
||||||
public String gatewayUrl;
|
public String gatewayUrl;
|
||||||
|
|
||||||
|
// @Value("${gitlink.fiscobcosUrl}")
|
||||||
|
public String fiscobcosUrl;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HttpAPIService httpAPIService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询成果
|
* 查询成果
|
||||||
|
@ -70,20 +82,25 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Override
|
@Override
|
||||||
public Achievements selectAchievementsById(Long id) {
|
public Achievements selectAchievementsById(Long id) {
|
||||||
Achievements a = achievementsMapper.selectAchievementsById(id);
|
Achievements a = achievementsMapper.selectAchievementsById(id);
|
||||||
if(StringUtils.isNotNull(a)){
|
if (StringUtils.isNotNull(a)) {
|
||||||
String gender = a.getGender();
|
String gender = a.getGender();
|
||||||
String img = "images/avatars/User/boy.jpg";
|
String img = "";
|
||||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||||
img = "images/avatars/User/girl.jpg";
|
img = "images/avatars/User/girl.jpg";
|
||||||
|
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||||
|
img = "images/avatars/User/boy.jpg";
|
||||||
}
|
}
|
||||||
a.setUserImg(img);
|
a.setUserImg(img);
|
||||||
if(StringUtils.isNotEmpty(a.getField1())) {
|
if (StringUtils.isNotEmpty(a.getField1())) {
|
||||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||||
if (StringUtils.isNotNull(field1Name)) {
|
if (StringUtils.isNotNull(field1Name)) {
|
||||||
a.setField1Name(field1Name);
|
a.setField1Name(field1Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a.setUserImg(img);
|
a.setUserImg(img);
|
||||||
|
|
||||||
|
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||||
|
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
@ -99,13 +116,15 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||||
for (Achievements a : list) {
|
for (Achievements a : list) {
|
||||||
String gender = a.getGender();
|
String gender = a.getGender();
|
||||||
String img = "images/avatars/User/boy.jpg";
|
String img = "";
|
||||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||||
img = "images/avatars/User/girl.jpg";
|
img = "images/avatars/User/girl.jpg";
|
||||||
|
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||||
|
img = "images/avatars/User/boy.jpg";
|
||||||
}
|
}
|
||||||
a.setUserImg(img);
|
a.setUserImg(img);
|
||||||
//根据id获取领域名称
|
//根据id获取领域名称
|
||||||
if(StringUtils.isNotEmpty(a.getField1())) {
|
if (StringUtils.isNotEmpty(a.getField1())) {
|
||||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||||
if (StringUtils.isNotNull(field1Name)) {
|
if (StringUtils.isNotNull(field1Name)) {
|
||||||
a.setField1Name(field1Name);
|
a.setField1Name(field1Name);
|
||||||
|
@ -113,6 +132,10 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
}
|
}
|
||||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||||
|
|
||||||
|
//拼接对接的用户信息
|
||||||
|
List<Map<String,Object>> dockingUserInfo = achievementsMapper.getDockingUserInfo(a.getId());
|
||||||
|
a.setDockingUserInfo(dockingUserInfo);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -183,25 +206,26 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
return aStr;
|
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")) {
|
if (Objects.equals(source, "1") || Objects.equals(source, "3")) {
|
||||||
concatUrl(list,gitLinkUrl);
|
concatUrl(list, gitLinkUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(source, "2")) {
|
if (Objects.equals(source, "2")) {
|
||||||
concatUrl(list,markerSpaceUrl);
|
concatUrl(list, markerSpaceUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(source, "4")) {
|
if (Objects.equals(source, "4")) {
|
||||||
concatUrl(list,gatewayUrl);
|
concatUrl(list, gatewayUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return JSON.toJSONString(list);
|
return JSON.toJSONString(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void concatUrl(List<Map<String, String>> list, String url) {
|
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 v = map.getOrDefault("v", "");
|
||||||
String urlPath = getUrlPath(v);
|
String urlPath = getUrlPath(v);
|
||||||
map.put("v", url + urlPath);
|
map.put("v", url + urlPath);
|
||||||
|
@ -231,13 +255,15 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
//遍历成果数据,获取对应成果的点击数
|
//遍历成果数据,获取对应成果的点击数
|
||||||
for (Achievements a : list) {
|
for (Achievements a : list) {
|
||||||
String gender = a.getGender();
|
String gender = a.getGender();
|
||||||
String img = "images/avatars/User/boy.jpg";
|
String img = "";
|
||||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||||
img = "images/avatars/User/girl.jpg";
|
img = "images/avatars/User/girl.jpg";
|
||||||
|
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||||
|
img = "images/avatars/User/boy.jpg";
|
||||||
}
|
}
|
||||||
a.setUserImg(img);
|
a.setUserImg(img);
|
||||||
//根据id获取领域名称
|
//根据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());
|
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||||
if (StringUtils.isNotNull(field1Name)) {
|
if (StringUtils.isNotNull(field1Name)) {
|
||||||
a.setField1Name(field1Name);
|
a.setField1Name(field1Name);
|
||||||
|
@ -281,8 +307,21 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, String>> getHotAchievement() {
|
public List<HotAchVo> getHotAchievement() {
|
||||||
return achievementsMapper.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -313,7 +352,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> indexTaskStatistic() {
|
public Map<String, Object> indexTaskStatistic() {
|
||||||
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
|
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
|
||||||
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount();
|
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount2();
|
||||||
res.put("convertedTaskAmount", convertedTaskAmount);
|
res.put("convertedTaskAmount", convertedTaskAmount);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -367,10 +406,13 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<KeyValVo<String, Long>> get7AddClickById(String id) {
|
public List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType) {
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(clickType)) {
|
||||||
|
clickType = "Achievements";
|
||||||
|
}
|
||||||
Date[] days = DateUtil.getDays(0, 6);
|
Date[] days = DateUtil.getDays(0, 6);
|
||||||
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], "Achievements", id)
|
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], clickType, id)
|
||||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||||
|
|
||||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||||
|
@ -429,6 +471,55 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
return relatedResultList;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据查询内容,调用搜索行为接口
|
* 根据查询内容,调用搜索行为接口
|
||||||
*
|
*
|
||||||
|
@ -466,4 +557,36 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
public List<String> getExpertAreasByName(String areaName) {
|
public List<String> getExpertAreasByName(String areaName) {
|
||||||
return achievementsMapper.getExpertAreasByName(areaName);
|
return achievementsMapper.getExpertAreasByName(areaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TokenListVo> projectTokenList() {
|
||||||
|
List<TokenListVo> list = projectResourceLibraryMapper.selectProjectInfos();
|
||||||
|
for (TokenListVo v : list) {
|
||||||
|
Long totalToken = queryTotalToken(v);
|
||||||
|
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
|
||||||
|
v.setCurrentToken(totalToken - issueTokenSum);
|
||||||
|
v.setTotalToken(totalToken);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long queryTotalToken(TokenListVo v) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("request-type",QUERY_REPO);
|
||||||
|
param.put("token_name",v.getId());
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject reps = httpAPIService.doPost(fiscobcosUrl,param);
|
||||||
|
if (reps.containsKey("status") && reps.getString("status").equals("0")) {
|
||||||
|
// Long curSupply = reps.getLong("cur_supply");
|
||||||
|
return reps.getLong("total_supply");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("区块链信息查询失败", e);
|
||||||
|
return -1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1L;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package com.microservices.dms.achievementLibrary.service.impl;
|
package com.microservices.dms.achievementLibrary.service.impl;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
import com.microservices.common.core.utils.DateUtils;
|
import com.microservices.common.core.utils.DateUtils;
|
||||||
|
import com.microservices.common.core.utils.StringUtils;
|
||||||
import com.microservices.common.security.utils.SecurityUtils;
|
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.domain.Achievements;
|
||||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||||
|
@ -49,7 +48,15 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
|
||||||
@Override
|
@Override
|
||||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
|
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
|
||||||
{
|
{
|
||||||
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,6 +81,16 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
|
||||||
return list;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增校企成果
|
* 新增校企成果
|
||||||
*
|
*
|
||||||
|
|
|
@ -116,9 +116,8 @@ public class BehaviorImageController extends BaseController {
|
||||||
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
|
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 根据用户ID,获取用户对应的成果汇总
|
@ApiOperation("/根据用户ID,获取用户对应的成果汇总")
|
||||||
*/
|
|
||||||
@GetMapping(value = "/getUserTypeStatistic")
|
@GetMapping(value = "/getUserTypeStatistic")
|
||||||
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
|
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
|
||||||
{
|
{
|
||||||
|
@ -171,4 +170,12 @@ public class BehaviorImageController extends BaseController {
|
||||||
{
|
{
|
||||||
return AjaxResult.success(behaviorImageService.getActivityStatistic());
|
return AjaxResult.success(behaviorImageService.getActivityStatistic());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/getUserBehaviorSum")
|
||||||
|
@ApiOperation("获取用户的所有关注、点赞数")
|
||||||
|
public AjaxResult getUserBehaviorSum(Long userId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(behaviorImageService.getUserBehaviorSum(userId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,16 @@ public class AchievementBehaviorSumVo {
|
||||||
private Long favoriteSum;
|
private Long favoriteSum;
|
||||||
//下载量
|
//下载量
|
||||||
private Long downloadSum;
|
private Long downloadSum;
|
||||||
|
//成果用户对接
|
||||||
|
private Long userDockingSum;
|
||||||
|
|
||||||
|
public Long getUserDockingSum() {
|
||||||
|
return userDockingSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserDockingSum(Long userDockingSum) {
|
||||||
|
this.userDockingSum = userDockingSum;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getClickSum() {
|
public Long getClickSum() {
|
||||||
return clickSum;
|
return clickSum;
|
||||||
|
|
|
@ -99,4 +99,8 @@ public interface BehaviorImageMapper {
|
||||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||||
|
|
||||||
List<KeyValueVo> getActivityStatistic();
|
List<KeyValueVo> getActivityStatistic();
|
||||||
|
|
||||||
|
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
|
||||||
|
|
||||||
|
UserTypeTotalVo getUserBehaviorSum(@Param("userId")Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,4 +76,6 @@ public interface IBehaviorImageService {
|
||||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||||
|
|
||||||
List<KeyValueVo> getActivityStatistic();
|
List<KeyValueVo> getActivityStatistic();
|
||||||
|
|
||||||
|
UserTypeTotalVo getUserBehaviorSum(Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,19 +318,30 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
||||||
* @param activityUserLibrary 活跃用户资源库
|
* @param activityUserLibrary 活跃用户资源库
|
||||||
* @return
|
* @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
|
@Override
|
||||||
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
|
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
|
||||||
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryList(activityUserLibrary);
|
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryListAll(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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserTypeTotalVo getUserBehaviorSum(Long userId) {
|
||||||
|
return behaviorImageMapper.getUserBehaviorSum(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
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分配给本项目中的其他用户
|
||||||
|
|
||||||
|
}
|
|
@ -2,7 +2,8 @@ package com.microservices.dms.constant;
|
||||||
|
|
||||||
public class TaskConstant {
|
public class TaskConstant {
|
||||||
|
|
||||||
private TaskConstant() {}
|
private TaskConstant() {
|
||||||
|
}
|
||||||
|
|
||||||
public static final String TASK_TYPE_WATCHERS = "MakerTask";
|
public static final String TASK_TYPE_WATCHERS = "MakerTask";
|
||||||
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
|
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
|
||||||
|
@ -22,4 +23,16 @@ public class TaskConstant {
|
||||||
public static final String EXPERTS = "Experts";
|
public static final String EXPERTS = "Experts";
|
||||||
public static final String ACHIEVEMENTS = "Achievements";
|
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; //待修缮状态
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,17 @@ import com.microservices.common.core.web.domain.AjaxResult;
|
||||||
import com.microservices.dms.referral.service.TalentReferralService;
|
import com.microservices.dms.referral.service.TalentReferralService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@Api(tags = "数据管理体系-人才推荐接口")
|
@Data
|
||||||
|
@Api(tags = "数据管理体系-推荐接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/talentReferral")
|
@RequestMapping("/talentReferral")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -21,12 +25,33 @@ public class TalentReferralController {
|
||||||
@GetMapping("/issueTalentReferral")
|
@GetMapping("/issueTalentReferral")
|
||||||
@ApiOperation(value = "疑修人才推荐")
|
@ApiOperation(value = "疑修人才推荐")
|
||||||
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
|
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
|
||||||
return AjaxResult.success(talentReferralService.issueTalentReferral(issueId, projectId));
|
return AjaxResult.success(talentReferralService.doIssueTalentReferral(issueId, projectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/pullRequestTalentReferral")
|
@GetMapping("/pullRequestTalentReferral")
|
||||||
@ApiOperation(value = "PR人才推荐")
|
@ApiOperation(value = "PR人才推荐")
|
||||||
public AjaxResult pullRequestTalentReferral(@RequestParam("prId") Long prId, @RequestParam("projectId") Long projectId) {
|
public AjaxResult pullRequestTalentReferral(@RequestParam("prId") Long prId, @RequestParam("projectId") Long projectId) {
|
||||||
return AjaxResult.success(talentReferralService.PRTalentReferral(prId, projectId));
|
return AjaxResult.success(talentReferralService.doPRTalentReferral(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));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package com.microservices.dms.referral.mapper;
|
package com.microservices.dms.referral.mapper;
|
||||||
|
|
||||||
import com.microservices.common.datasource.annotation.Slave;
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
import com.microservices.dms.referral.vo.IssuesVo;
|
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
import com.microservices.dms.referral.vo.*;
|
||||||
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
@Slave
|
@Slave
|
||||||
|
@ -27,4 +29,21 @@ public interface TalentReferralMapper {
|
||||||
String selectRepositoriesUrl(@Param("id") Long id);
|
String selectRepositoriesUrl(@Param("id") Long id);
|
||||||
|
|
||||||
Long selectIdByLogin(@Param("login") String login);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,17 @@ package com.microservices.dms.referral.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
import com.microservices.common.core.utils.StringUtils;
|
import com.microservices.common.core.utils.StringUtils;
|
||||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||||
|
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||||
import com.microservices.dms.constant.ReferralConstant;
|
import com.microservices.dms.constant.ReferralConstant;
|
||||||
|
import com.microservices.dms.constant.TaskConstant;
|
||||||
import com.microservices.dms.referral.mapper.TalentReferralMapper;
|
import com.microservices.dms.referral.mapper.TalentReferralMapper;
|
||||||
import com.microservices.dms.referral.vo.IssueDto;
|
import com.microservices.dms.referral.vo.*;
|
||||||
import com.microservices.dms.referral.vo.IssuesVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
|
||||||
import com.microservices.dms.utils.DmsGitLinkRequestUrl;
|
import com.microservices.dms.utils.DmsGitLinkRequestUrl;
|
||||||
import com.microservices.dms.utils.DmsRequestHelper;
|
import com.microservices.dms.utils.DmsRequestHelper;
|
||||||
import com.microservices.dms.utils.SimilarityService;
|
import com.microservices.dms.utils.SimilarityService;
|
||||||
|
@ -33,15 +36,17 @@ public class TalentReferralService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DmsRequestHelper dmsRequestHelper;
|
private DmsRequestHelper dmsRequestHelper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AchievementsMapper achievementsMapper;
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(TalentReferralService.class);
|
private static final Logger logger = LoggerFactory.getLogger(TalentReferralService.class);
|
||||||
|
|
||||||
public Set<Long> getContributors(String projectFullName) {
|
public Set<Long> getContributors(String projectFullName) {
|
||||||
try {
|
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("contributions")).filter(StringUtils::isNotBlank)
|
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("contributions")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
||||||
.mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
|
||||||
|
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
||||||
|
@ -52,10 +57,9 @@ public class TalentReferralService {
|
||||||
public Set<Long> getCollaborators(String projectFullName) {
|
public Set<Long> getCollaborators(String projectFullName) {
|
||||||
try {
|
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"))
|
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
||||||
.filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
|
||||||
|
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
logger.error("【{}】获取项目成员者数量失败:{}", projectFullName, e.getMessage());
|
logger.error("【{}】获取项目成员者数量失败:{}", projectFullName, e.getMessage());
|
||||||
|
@ -87,6 +91,14 @@ public class TalentReferralService {
|
||||||
return collaborators;
|
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) {
|
public List<Map.Entry<Long, Double>> issueTalentReferral(Long projectId, Long issueId) {
|
||||||
|
|
||||||
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
|
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
|
||||||
|
@ -96,12 +108,12 @@ public class TalentReferralService {
|
||||||
|
|
||||||
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
|
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
|
||||||
if (!curIssueAssigners.isEmpty()) {
|
if (!curIssueAssigners.isEmpty()) {
|
||||||
return new ArrayList<>();
|
// return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
IssuesVo vo = new IssuesVo();
|
IssuesVo vo = new IssuesVo();
|
||||||
vo.setProjectId(projectId);
|
vo.setProjectId(projectId);
|
||||||
vo.setStatusIds(Collections.singletonList(ReferralConstant.ISSUE_CLOSED));
|
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED,ReferralConstant.ISSUE_RESOLVED));
|
||||||
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
||||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||||
// 计算与解决issue的相似度, 标题+描述
|
// 计算与解决issue的相似度, 标题+描述
|
||||||
|
@ -138,13 +150,14 @@ public class TalentReferralService {
|
||||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||||
Map<String, Double> userNameFractionMap = new HashMap<>();
|
Map<String, Double> userNameFractionMap = new HashMap<>();
|
||||||
Map<String, Set<String>> PRFilesMap = new HashMap<>();
|
Map<String, Set<String>> PRFilesMap = new HashMap<>();
|
||||||
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11");
|
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11").stream()
|
||||||
|
.filter(e->StringUtils.isNotBlank(e.getAssignUserLogin())).collect(Collectors.toList());
|
||||||
|
|
||||||
for (IssueDto pr : prs) {
|
for (IssueDto pr : prs) {
|
||||||
|
PrInfoVo curPrInfoVo = talentReferralMapper.selectPRInfoById(pr.getPullRequestId());
|
||||||
//关闭PR的对比
|
//关闭PR的对比
|
||||||
for (IssueDto dto : closedPullRequests) {
|
for (IssueDto dto : closedPullRequests) {
|
||||||
List<String> reviewers = dto.getReviewers();
|
String reviewer = dto.getAssignUserLogin();
|
||||||
for (String reviewer : reviewers) {
|
|
||||||
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
|
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
|
||||||
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
|
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
|
||||||
HashSet<String> set = new HashSet<>();
|
HashSet<String> set = new HashSet<>();
|
||||||
|
@ -152,23 +165,26 @@ public class TalentReferralService {
|
||||||
set.addAll(b);
|
set.addAll(b);
|
||||||
return set;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> curPrFiles = getPRFiles(projectId, pr.getPullRequestNumber());
|
Set<String> curPrFiles = getPRFiles(projectId, pr.getPullRequestNumber());
|
||||||
for (String curPrFile : curPrFiles) {
|
for (String curPrFile : curPrFiles) {
|
||||||
PRFilesMap.forEach((k, v) -> {
|
PRFilesMap.forEach((k, v) -> {
|
||||||
if (v.contains(curPrFile)) {
|
if (v.contains(curPrFile)) {
|
||||||
userNameFractionMap.merge(k, 60.0D, Double::sum);
|
userNameFractionMap.merge(k, 30.0D, Double::sum);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算每个负责人关闭的 PR数量
|
// 计算每个负责人关闭的 PR数量
|
||||||
closedPullRequests.stream().map(IssueDto::getReviewers).flatMap(List::stream)
|
closedPullRequests.stream().map(IssueDto::getAssignUserLogin).forEach(s -> userNameFractionMap.merge(s, 30.0D, Double::sum));
|
||||||
.forEach(s -> userNameFractionMap.merge(s, 40.0D, Double::sum));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
userNameFractionMap.forEach((k, v) -> {
|
userNameFractionMap.forEach((k, v) -> {
|
||||||
|
@ -210,7 +226,7 @@ public class TalentReferralService {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "issues", "files");
|
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "files", "file_nums");
|
||||||
return allDataByPage.stream().map(o -> (JSONObject) o).map(o -> (String) o.get("filename")).collect(Collectors.toSet());
|
return allDataByPage.stream().map(o -> (JSONObject) o).map(o -> (String) o.get("filename")).collect(Collectors.toSet());
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
logger.error("【{}】获取PR文件失败:{}", projectFullName, e.getMessage());
|
logger.error("【{}】获取PR文件失败:{}", projectFullName, e.getMessage());
|
||||||
|
@ -218,25 +234,172 @@ public class TalentReferralService {
|
||||||
return new HashSet<>();
|
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) {
|
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId) {
|
||||||
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
|
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
|
||||||
openPullRequests = openPullRequests.stream().filter(e -> e.getReviewers().isEmpty())
|
openPullRequests = openPullRequests.stream().filter(e -> StringUtils.isEmpty(e.getAssignUserLogin())).collect(Collectors.toList());
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
if (prId != null) {
|
if (prId != null) {
|
||||||
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getId()), prId))
|
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getPullRequestId()), prId)).collect(Collectors.toList());
|
||||||
.filter(e -> e.getReviewers().isEmpty())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
return PRTalentReferral(projectId, prId, openPullRequests);
|
||||||
}
|
}
|
||||||
|
|
||||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
return PRTalentReferral(projectId, null, 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);
|
||||||
|
|
||||||
|
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中任务标题和任务描述 与专家简介进行比较 ,匹配结果分数,取前10;30%
|
||||||
|
* 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(TaskConstant.TASK_COMPLETE_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()) || Objects.equals(taskDomain, t1.getReviewAreaTwo()) || Objects.equals(taskDomain, t1.getReviewAreaThree())) {
|
||||||
|
step1Map.put(t1.getId(), 50.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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中竞赛标题和竞赛描述 与专家简介进行比较 ,匹配结果分数,取前10;30%
|
||||||
|
* 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());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.microservices.dms.referral.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PrInfoVo {
|
||||||
|
private Long id;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -21,7 +21,7 @@ public class CollectUserActDataController {
|
||||||
|
|
||||||
@PostMapping("/addClicker")
|
@PostMapping("/addClicker")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise)", paramType = "query", dataTypeClass = String.class),
|
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise,成果用户对接:userDocking)", paramType = "query", dataTypeClass = String.class),
|
||||||
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||||
@ApiImplicitParam(name = "userId", 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)
|
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class CompetitionResourceLibrary extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String competitionField;
|
private String competitionField;
|
||||||
/**
|
/**
|
||||||
* 竞赛状态 0进行中 1已结束
|
* 竞赛状态 status: 0 未上架 1上架
|
||||||
*/
|
*/
|
||||||
private String competitionStatus;
|
private String competitionStatus;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -112,7 +112,7 @@ public interface ExpertResourceLibraryMapper
|
||||||
|
|
||||||
List<KeyValueVo> getMemoAduit();
|
List<KeyValueVo> getMemoAduit();
|
||||||
|
|
||||||
KeyValueVo getIsOriginalStatistic();
|
List<KeyValueVo> getIsOriginalStatistic();
|
||||||
|
|
||||||
List<KeyValueVo> getMemoTotalByYear();
|
List<KeyValueVo> getMemoTotalByYear();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.microservices.dms.resourceLibrary.mapper;
|
package com.microservices.dms.resourceLibrary.mapper;
|
||||||
|
|
||||||
import com.microservices.common.datasource.annotation.Slave;
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||||
|
@ -51,4 +52,8 @@ public interface ProjectResourceLibraryMapper {
|
||||||
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
|
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
|
||||||
|
|
||||||
String getProjectDomainNameByKey(@Param("projectDomain") String projectDomain );
|
String getProjectDomainNameByKey(@Param("projectDomain") String projectDomain );
|
||||||
|
|
||||||
|
List<TokenListVo> selectProjectInfos();
|
||||||
|
|
||||||
|
Long sumProjectIssueToken(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,4 +108,6 @@ public interface TaskResourceLibraryMapper {
|
||||||
int delFavorite(Favorite favorite);
|
int delFavorite(Favorite favorite);
|
||||||
|
|
||||||
int delWatcher(Watcher watcher);
|
int delWatcher(Watcher watcher);
|
||||||
|
|
||||||
|
double getConvertedTaskAmount2();
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class ProjectResourceLibraryService {
|
||||||
if (v.startsWith("http")) {
|
if (v.startsWith("http")) {
|
||||||
String urlPath = getUrlPath(v);
|
String urlPath = getUrlPath(v);
|
||||||
if (StringUtils.isNotEmpty(urlPath)) {
|
if (StringUtils.isNotEmpty(urlPath)) {
|
||||||
if (urlPath.startsWith("/")) {
|
if (urlPath.startsWith("/api")) {
|
||||||
a.setV(gitLinkUrl + urlPath);
|
a.setV(gitLinkUrl + urlPath);
|
||||||
}else {
|
}else {
|
||||||
a.setV(gitLinkUrl +"/api"+ urlPath);
|
a.setV(gitLinkUrl +"/api"+ urlPath);
|
||||||
|
|
|
@ -122,6 +122,8 @@ public class TaskResourceLibraryService {
|
||||||
|
|
||||||
|
|
||||||
public int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
|
public int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
|
||||||
|
taskResourceLibrary.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
taskResourceLibrary.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return taskResourceLibraryMapper.updateTaskResourceLibrary(taskResourceLibrary);
|
return taskResourceLibraryMapper.updateTaskResourceLibrary(taskResourceLibrary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,20 @@ 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) {
|
public static Date[] getCurrentYearEndOf(LocalDate endDate) {
|
||||||
Year year = Year.now();
|
Year year = Year.now();
|
||||||
|
|
||||||
|
@ -68,6 +82,19 @@ public class DateUtil {
|
||||||
.collect(Collectors.toList());
|
.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) {
|
public static List<String> getDateStrYYYYMMDD(Date start, Date end) {
|
||||||
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||||
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class DmsRequestHelper extends GitLinkRequestHelper {
|
||||||
int pageNum = 1;
|
int pageNum = 1;
|
||||||
// 循环分页获取gitlink组织下所有成员
|
// 循环分页获取gitlink组织下所有成员
|
||||||
while (!isAllData) {
|
while (!isAllData) {
|
||||||
JSONObject result = doGet(GitLinkRequestUrl.GET_LIST_BY_PAGES(url, pageNum, 50)
|
JSONObject result = doGet(GET_LIST_BY_PAGES(url, pageNum, 50)
|
||||||
);
|
);
|
||||||
allList.addAll(result.getList(listKey, tClass));
|
allList.addAll(result.getList(listKey, tClass));
|
||||||
long total = result.getLong("search_count");
|
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) {
|
public static GitLinkRequestUrl GET_LIST_BY_PAGES(String url, Integer page, Integer limit) {
|
||||||
String p = url.contains("?")? "&page=%d&limit=%d": "%s?page=%d&limit=%d";
|
String p = url.contains("?")? "%s&page=%s&limit=%s": "%s?page=%s&limit=%s";
|
||||||
return getAdminGitLinkRequestUrl(String.format(p, url, page, limit));
|
return getAdminGitLinkRequestUrl(String.format(p, url, page, limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?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>
|
|
@ -125,4 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from achievement_team
|
from achievement_team
|
||||||
where achievement_id = #{aid}
|
where achievement_id = #{aid}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectAchievementTeamByAchId" resultMap="AchievementTeamResult">
|
||||||
|
<include refid="selectAchievementTeamVo"/>
|
||||||
|
where achievement_id = #{achId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<resultMap type="Achievements" id="AchievementsResult">
|
<resultMap type="Achievements" id="AchievementsResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
|
<result property="showAchievementName" column="showAchievementName" />
|
||||||
<result property="achievementName" column="achievement_name" />
|
<result property="achievementName" column="achievement_name" />
|
||||||
<result property="field1" column="field_1" />
|
<result property="field1" column="field_1" />
|
||||||
<result property="field2" column="field_2" />
|
<result property="field2" column="field_2" />
|
||||||
|
@ -40,12 +41,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectAchievementsVo">
|
<sql id="selectAchievementsVo">
|
||||||
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
|
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 from achievements
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectAchievementsList" parameterType="Achievements" resultMap="AchievementsResult">
|
<select id="selectAchievementsList" parameterType="Achievements" resultMap="AchievementsResult">
|
||||||
<include refid="selectAchievementsVo"/>
|
<include refid="selectAchievementsVo"/>
|
||||||
<where>
|
<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="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||||
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
|
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
|
||||||
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
|
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
|
||||||
|
@ -73,10 +75,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="hotRank != null and hotRank != ''"> and hot_rank = #{hotRank}</if>
|
<if test="hotRank != null and hotRank != ''"> and hot_rank = #{hotRank}</if>
|
||||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAchievementsById" parameterType="Long" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
<select id="selectAchievementsById" parameterType="Long" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||||
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
|
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
|
||||||
,u.login as "userLogin",IFNULL(u.nickname,owner_name) as "userNickName",ue.gender as "gender",
|
,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.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
|
a.reviewer,a.review_date,a.review_comments, a.images,a.attachments,a.create_by,a.create_time,a.update_by,a.update_time
|
||||||
|
@ -97,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<insert id="insertAchievements" parameterType="Achievements" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertAchievements" parameterType="Achievements" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into achievements
|
insert into achievements
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="showAchievementName != null">show_ach_name,</if>
|
||||||
<if test="achievementName != null">achievement_name,</if>
|
<if test="achievementName != null">achievement_name,</if>
|
||||||
<if test="field1 != null">field_1,</if>
|
<if test="field1 != null">field_1,</if>
|
||||||
<if test="field2 != null">field_2,</if>
|
<if test="field2 != null">field_2,</if>
|
||||||
|
@ -130,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="hotRank != null">hot_rank,</if>
|
<if test="hotRank != null">hot_rank,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="showAchievementName != null">#{showAchievementName},</if>
|
||||||
<if test="achievementName != null">#{achievementName},</if>
|
<if test="achievementName != null">#{achievementName},</if>
|
||||||
<if test="field1 != null">#{field1},</if>
|
<if test="field1 != null">#{field1},</if>
|
||||||
<if test="field2 != null">#{field2},</if>
|
<if test="field2 != null">#{field2},</if>
|
||||||
|
@ -167,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateAchievements" parameterType="Achievements">
|
<update id="updateAchievements" parameterType="Achievements">
|
||||||
update achievements
|
update achievements
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="showAchievementName != null">show_ach_name = #{showAchievementName},</if>
|
||||||
<if test="achievementName != null">achievement_name = #{achievementName},</if>
|
<if test="achievementName != null">achievement_name = #{achievementName},</if>
|
||||||
<if test="field1 != null">field_1 = #{field1},</if>
|
<if test="field1 != null">field_1 = #{field1},</if>
|
||||||
<if test="field2 != null">field_2 = #{field2},</if>
|
<if test="field2 != null">field_2 = #{field2},</if>
|
||||||
|
@ -214,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getChoiceImport" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
<select id="getChoiceImport" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||||
select id, achievement_name,images,field_1,field_2,field_3,source,source_id
|
select id,IFNULL(show_ach_name,achievement_name) as "showAchievementName",achievement_name,images,field_1,field_2,field_3,summary,source,source_id
|
||||||
from achievements
|
from achievements
|
||||||
where is_featured ='1'
|
where is_featured ='1'
|
||||||
order by update_time desc
|
order by update_time desc
|
||||||
|
@ -249,21 +255,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||||
<if test="source == '' or source == null">
|
<if test="source == '' or source == null">
|
||||||
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,
|
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",u.nickname as "userNickName",ue.gender as "gender",
|
u.login as "userLogin",
|
||||||
|
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 = id) as watcherSum,
|
(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
|
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = id) as favoriteSum
|
||||||
from achievements a
|
from achievements a
|
||||||
left join users u on a.owner_name = u.login
|
left join users u on a.owner_name = u.login
|
||||||
left join user_extensions ue on u.id = ue.user_id
|
left join user_extensions ue on u.id = ue.user_id
|
||||||
<where>
|
<where>
|
||||||
|
and a.status='1'
|
||||||
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
|
<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>
|
</where>
|
||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</if>
|
</if>
|
||||||
<if test='source=="1"'>
|
<if test='source=="1"'>
|
||||||
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,
|
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",u.nickname as "userNickName",ue.gender as "gender",
|
c.name as "field1Name",u.login as "userLogin",
|
||||||
|
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 watcherSum,
|
(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 watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
|
||||||
from achievements a
|
from achievements a
|
||||||
|
@ -271,7 +283,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join user_extensions ue on u.id = ue.user_id
|
left join user_extensions ue on u.id = ue.user_id
|
||||||
left join project_categories c on a.field_1 = c.id
|
left join project_categories c on a.field_1 = c.id
|
||||||
<where>
|
<where>
|
||||||
|
and a.status='1'
|
||||||
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
|
<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="source != null and source != ''"> and a.source = #{source}</if>
|
||||||
<if test='areaQuery != null and areaQuery != "" '>
|
<if test='areaQuery != null and areaQuery != "" '>
|
||||||
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
||||||
|
@ -280,8 +294,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</if>
|
</if>
|
||||||
<if test='source=="2" or source=="3" or source=="4" '>
|
<if test='source=="2" or source=="3" or source=="4" '>
|
||||||
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,
|
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",u.nickname as "userNickName",ue.gender as "gender",
|
c.name as "field1Name",u.login as "userLogin",
|
||||||
|
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 watcherSum,
|
(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 watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
|
||||||
from achievements a
|
from achievements a
|
||||||
|
@ -289,7 +305,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join user_extensions ue on u.id = ue.user_id
|
left join user_extensions ue on u.id = ue.user_id
|
||||||
left join categories c on a.field_1 = c.id
|
left join categories c on a.field_1 = c.id
|
||||||
<where>
|
<where>
|
||||||
|
and a.status='1'
|
||||||
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
|
<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="source != null and source != ''"> and a.source = #{source}</if>
|
||||||
<if test='areaQuery != null and areaQuery != "" '>
|
<if test='areaQuery != null and areaQuery != "" '>
|
||||||
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
|
||||||
|
@ -324,14 +342,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by DATE_FORMAT(created_at, '%m-%d')
|
order by DATE_FORMAT(created_at, '%m-%d')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getHotAchievement" resultType="java.util.Map">
|
<select id="getHotAchievement" resultType="com.microservices.dms.achievementLibrary.domain.HotAchVo">
|
||||||
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
|
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
|
as userName,t.gender,t.userNickName
|
||||||
from (select a.achievement_name,
|
from (select a.achievement_name,
|
||||||
|
IFNULL(a.show_ach_name,a.achievement_name) as "show_ach_name",
|
||||||
a.id,a.owner_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 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
|
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as w
|
||||||
from achievements a) as t
|
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
|
||||||
order by (f+w) desc
|
order by (f+w) desc
|
||||||
limit 0,3
|
limit 0,3
|
||||||
</select>
|
</select>
|
||||||
|
@ -349,33 +374,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="indexProjectStatistic" resultType="java.util.Map">
|
<select id="indexProjectStatistic" resultType="java.util.Map">
|
||||||
select COUNT(*) as projectAchievementCount,
|
select COUNT(*) as projectAchievementCount,
|
||||||
IFNULL(SUM(attachment_count), 0) as attachmentCount,
|
IFNULL(SUM(attachment_count), 0) as attachmentCount,
|
||||||
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1') as clickCount,
|
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1' and a.status=1) as clickCount,
|
||||||
(select COUNT(distinct project_id) from project_resource_library) as projectCount
|
(select COUNT(distinct project_id) from project_resource_library) as projectCount
|
||||||
from achievements
|
from achievements
|
||||||
where source = '1'
|
where source = '1' and status='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="indexTaskStatistic" resultType="java.util.Map">
|
<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') as taskCount,
|
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') as clickCount,
|
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='2' and a.status=1) as clickCount,
|
||||||
COUNT(*) as expertAuditCount
|
COUNT(*) as expertAuditCount
|
||||||
from achievements
|
from achievements
|
||||||
where source = '2'
|
where source = '2' and status=1
|
||||||
</select>
|
</select>
|
||||||
<select id="indexCompetitionStatistic" resultType="java.util.Map">
|
<select id="indexCompetitionStatistic" resultType="java.util.Map">
|
||||||
select COUNT(*) as CompetitionCountAchievementCount,
|
select COUNT(*) as CompetitionCountAchievementCount,
|
||||||
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount,
|
(select COUNT(distinct crl.open_competition_id) from achievements a join competition_resource_library crl
|
||||||
(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,
|
on a.source_id = crl.id where source = '3' and a.is_expert_audit = 1 and a.status='1') as expertAuditCount,
|
||||||
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCount
|
(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
|
||||||
from achievements
|
from achievements
|
||||||
where source = '3'
|
where source = '3' and status='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="indexSchoolEnterpriseStatistic" resultType="java.lang.Long">
|
<select id="indexSchoolEnterpriseStatistic" resultType="java.lang.Long">
|
||||||
select COUNT(*)
|
select COUNT(*)
|
||||||
from achievements a
|
from achievements a
|
||||||
where source = #{s}
|
where source = #{s}
|
||||||
|
and a.status = '1'
|
||||||
|
<if test="t != null and t != ''">
|
||||||
and tags = #{t}
|
and tags = #{t}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAreasByName" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
<select id="getAreasByName" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||||
|
@ -406,6 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
union all
|
union all
|
||||||
select review_area_one as "domainName" from experts
|
select review_area_one as "domainName" from experts
|
||||||
)a
|
)a
|
||||||
|
where a.domainName is not null and a.domainName !=""
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getActDataStatisticById"
|
<select id="getActDataStatisticById"
|
||||||
|
@ -443,7 +473,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select count(*)
|
select count(*)
|
||||||
from achievements
|
from achievements
|
||||||
<where>
|
<where>
|
||||||
<if test="source != null and source != ''">and `source` = #{source}</if>
|
<if test="t != null and t != ''">and `source` = #{t}</if>
|
||||||
<if test="s != null">and create_time >= #{s}</if>
|
<if test="s != null">and create_time >= #{s}</if>
|
||||||
<if test="e != null">and create_time <= #{e}</if>
|
<if test="e != null">and create_time <= #{e}</if>
|
||||||
</where>
|
</where>
|
||||||
|
@ -458,19 +488,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="getAchievementType" resultType="java.util.Map">
|
<select id="getAchievementType" resultType="java.util.Map">
|
||||||
select achievement_type as 'k', count(*) as 'v'
|
select achievement_type as 'k', count(*) as 'v'
|
||||||
from achievements
|
from achievements where achievement_type is not null
|
||||||
group by achievement_type
|
group by achievement_type
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAchievementActData" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
<select id="getAchievementActData" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||||
select * from (
|
select * from (
|
||||||
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')
|
select '关注' as `key`, DATE_FORMAT(created_at, '%m-%d') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
union all
|
union all
|
||||||
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')
|
select '浏览' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from clickers where click_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
union all
|
union all
|
||||||
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')
|
select '下载' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from downloads where download_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
union all
|
union all
|
||||||
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
|
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d'))t
|
||||||
order by t.name
|
order by t.name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -490,7 +520,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
group by field_3) a
|
group by field_3) a
|
||||||
group by a.domain_value
|
group by a.domain_value
|
||||||
order by sum(a.countResult) desc) f
|
order by sum(a.countResult) desc) f
|
||||||
right join categories c on c.id = f.name
|
right join categories c on c.id = f.name where f.value is not null
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -510,24 +540,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
|
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
|
||||||
select z.name as "areaName",
|
select
|
||||||
|
z.name as "areaName",
|
||||||
z.field_1 as "areaKey",
|
z.field_1 as "areaKey",
|
||||||
z.remark as "remark",
|
z.remark as "remark",
|
||||||
sum(z.kyxm) as "kyxmSum",
|
sum(z.kyxm) as "kyxmSum",
|
||||||
sum(z.ckrw) as "ckrwSum",
|
sum(z.ckrw) as "ckrwSum",
|
||||||
sum(z.kfjs) as "kfjsSum",
|
sum(z.kfjs) as "kfjsSum",
|
||||||
sum(z.xqcg) as "xqcgSum"
|
sum(z.xqcg) as "xqcgSum"
|
||||||
from (select r.name,
|
from (
|
||||||
|
select r.name,
|
||||||
r.field_1,
|
r.field_1,
|
||||||
r.remark,
|
r.remark,
|
||||||
case when r.source = 1 then tmp else 0 end as "kyxm",
|
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 = 2 then tmp else 0 end as "ckrw",
|
||||||
case when r.source = 3 then tmp else 0 end as "kfjs",
|
case when r.source = 3 then tmp else 0 end as "kfjs",
|
||||||
case when r.source = 4 then tmp else 0 end as "xqcg"
|
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 (
|
||||||
|
select t.name,t.source,count(1) as "tmp",t.field_1,t.remark
|
||||||
|
from (
|
||||||
|
select c.name,a.source, a.field_1,c.remark
|
||||||
from achievements a
|
from achievements a
|
||||||
inner join categories c on a.field_1 = c.id
|
left join project_categories c on a.field_1 = c.id where a.source='1'
|
||||||
group by c.name, a.source, a.field_1, c.remark) r) z
|
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')
|
||||||
|
)t
|
||||||
|
where t.field_1 is not null and t.field_1 !=""
|
||||||
|
group by t.name, t.source, t.field_1, t.remark
|
||||||
|
) r
|
||||||
|
) z
|
||||||
<where>
|
<where>
|
||||||
<if test="areaKey != null and areaKey != ''">
|
<if test="areaKey != null and areaKey != ''">
|
||||||
and z.field_1 = #{areaKey}
|
and z.field_1 = #{areaKey}
|
||||||
|
@ -542,6 +585,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where project_id = (select project_id from project_resource_library where id = #{sourceId})
|
where project_id = (select project_id from project_resource_library where id = #{sourceId})
|
||||||
</select>
|
</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 id="getDistinctYear" resultType="String">
|
||||||
select distinct DATE_FORMAT(create_time, '%Y')
|
select distinct DATE_FORMAT(create_time, '%Y')
|
||||||
from achievements
|
from achievements
|
||||||
|
@ -561,6 +614,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
source as "source",
|
source as "source",
|
||||||
source_id as "sourceId" ,
|
source_id as "sourceId" ,
|
||||||
achievement_name as "achRelateName",
|
achievement_name as "achRelateName",
|
||||||
|
show_ach_name as "showAchievementName",
|
||||||
#{paramYear} as resultYear
|
#{paramYear} as resultYear
|
||||||
from achievements
|
from achievements
|
||||||
where source_id in
|
where source_id in
|
||||||
|
@ -570,6 +624,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
|
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
|
||||||
order by DATE_FORMAT(create_time, '%m-%d')
|
order by DATE_FORMAT(create_time, '%m-%d')
|
||||||
</select>
|
</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="selectAchievementsByName" resultType="Long">
|
||||||
select id
|
select id
|
||||||
from achievements
|
from achievements
|
||||||
|
@ -600,4 +684,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where a.id=#{id}
|
where a.id=#{id}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</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 >= #{s}
|
||||||
|
and create_time <= #{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 >= #{s} and created_at <= #{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 >= #{s} and created_at <= #{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 >= #{s} and created_at <= #{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 >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDockingUserInfo" resultType="java.util.Map">
|
||||||
|
select u.id,u.login,u.nickname,u.phone,u.company_name
|
||||||
|
from users u
|
||||||
|
inner join (select distinct user_id from clickers where click_id = #{id} and click_type ='userDocking') c on u.id = c.user_id
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -139,21 +139,41 @@
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
|
||||||
|
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,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
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getrelatedProjectCount" resultType="long">
|
<select id="getrelatedProjectCount" resultType="long">
|
||||||
select sum(r.pCount) from (
|
select sum(r.pCount) from (
|
||||||
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = 1
|
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = #{userId}
|
||||||
union all
|
union all
|
||||||
SELECT count(1) as "pCount"
|
SELECT count(1) as "pCount"
|
||||||
FROM `projects`
|
FROM `projects`
|
||||||
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
|
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
|
||||||
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != 1 AND `members`.`user_id` = 1
|
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != #{userId} AND `members`.`user_id` = #{userId}
|
||||||
union all
|
union all
|
||||||
SELECT count(1) as "pCount"
|
SELECT count(1) as "pCount"
|
||||||
FROM `projects`
|
FROM `projects`
|
||||||
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
|
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
|
||||||
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
|
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
|
||||||
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
|
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
|
||||||
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = 1
|
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = #{userId}
|
||||||
)r
|
)r
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -295,4 +315,13 @@
|
||||||
inner join experts e on u.id = e.user_id
|
inner join experts e on u.id = e.user_id
|
||||||
where e.is_delete='0' and e.status = 1
|
where e.is_delete='0' and e.status = 1
|
||||||
</select>
|
</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>
|
||||||
</mapper>
|
</mapper>
|
|
@ -284,21 +284,21 @@
|
||||||
|
|
||||||
<select id="getCompetitionYearlyPaperAdd"
|
<select id="getCompetitionYearlyPaperAdd"
|
||||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
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') as 'k', count(*) as 'v'
|
||||||
from competition_infos
|
from competition_infos
|
||||||
where created_at >= #{s}
|
where created_at >= #{s}
|
||||||
and created_at <= #{e}
|
and created_at <= #{e}
|
||||||
group by DATE_FORMAT(created_at, '%m-%d')
|
group by DATE_FORMAT(created_at, '%Y-%m')
|
||||||
order by DATE_FORMAT(created_at, '%m-%d')
|
order by DATE_FORMAT(created_at, '%Y-%m')
|
||||||
</select>
|
</select>
|
||||||
<select id="getCompetitionYearlyFinish"
|
<select id="getCompetitionYearlyFinish"
|
||||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||||
select DATE_FORMAT(upload_date, '%m-%d') as 'k', count(*) as 'v'
|
select DATE_FORMAT(upload_date, '%Y-%m') as 'k', count(*) as 'v'
|
||||||
from competition_infos
|
from competition_infos
|
||||||
where upload_date >= #{s}
|
where upload_date >= #{s}
|
||||||
and upload_date <= #{e}
|
and upload_date <= #{e}
|
||||||
group by DATE_FORMAT(upload_date, '%m-%d')
|
group by DATE_FORMAT(upload_date, '%Y-%m')
|
||||||
order by DATE_FORMAT(upload_date, '%m-%d')
|
order by DATE_FORMAT(upload_date, '%Y-%m')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary" useGeneratedKeys="true"
|
<insert id="insertCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary" useGeneratedKeys="true"
|
||||||
|
|
|
@ -72,15 +72,15 @@
|
||||||
<select id="selectExpertResourceLibraryList" parameterType="ExpertResourceLibrary"
|
<select id="selectExpertResourceLibraryList" parameterType="ExpertResourceLibrary"
|
||||||
resultType="com.microservices.dms.resourceLibrary.domain.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,
|
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",ue.gender as "gender",
|
u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
|
||||||
e.id_number,images, attachments,
|
e.id_number,images, attachments,
|
||||||
e.major, e.workplace, e.phone,
|
e.major, e.workplace, e.phone,
|
||||||
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
||||||
expert_domain,u.authentication as expertAuth,
|
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,
|
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,
|
erl.create_time,
|
||||||
(select COUNT(*) 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 = 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,
|
(select COUNT(distinct container_id) 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
|
erl.update_by, erl.update_time,erl.sort_no
|
||||||
from experts e
|
from experts e
|
||||||
inner join users u on e.user_id = u.id
|
inner join users u on e.user_id = u.id
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
<select id="selectExpertResourceLibraryList2" parameterType="ExpertResourceLibrary"
|
<select id="selectExpertResourceLibraryList2" parameterType="ExpertResourceLibrary"
|
||||||
resultMap="ExpertResourceLibraryResult">
|
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,
|
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,
|
e.major, e.workplace, e.phone,u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
|
||||||
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
||||||
expert_domain,images, attachments,
|
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,
|
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
|
||||||
|
@ -131,7 +131,10 @@
|
||||||
(select count(*) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = erl.id) as watcherSum,
|
(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,
|
(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
|
erl.update_by, erl.update_time,erl.sort_no
|
||||||
from expert_resource_library erl left join experts e on e.id = erl.expert_id
|
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
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null ">and user_id = #{userId}</if>
|
<if test="userId != null ">and user_id = #{userId}</if>
|
||||||
<if test="expertName != null and expertName != ''">and erl.expert_name like concat('%', #{expertName}, '%')
|
<if test="expertName != null and expertName != ''">and erl.expert_name like concat('%', #{expertName}, '%')
|
||||||
|
@ -179,15 +182,15 @@
|
||||||
|
|
||||||
<select id="competitionAuditCount" resultType="java.lang.Long">
|
<select id="competitionAuditCount" resultType="java.lang.Long">
|
||||||
select IFNULL(SUM(competitionAuditCount), 0)
|
select IFNULL(SUM(competitionAuditCount), 0)
|
||||||
from (select (select COUNT(distinct container_id)
|
from (select COUNT(distinct container_id) as competitionAuditCount
|
||||||
from task_expert
|
from task_expert te
|
||||||
where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
|
join experts e on e.id = te.expert_id and te.container_type = 2 and te.`status` in (1, 2)) tmp
|
||||||
from experts e) tmp
|
|
||||||
</select>
|
</select>
|
||||||
<select id="taskAuditCount" resultType="java.lang.Long">
|
<select id="taskAuditCount" resultType="java.lang.Long">
|
||||||
select IFNULL(SUM(taskAuditCount), 0)
|
select IFNULL(SUM(taskAuditCount), 0)
|
||||||
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 (select COUNT(distinct container_id) as taskAuditCount
|
||||||
from experts e) tmp
|
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
|
||||||
</select>
|
</select>
|
||||||
<select id="auditCompetitionAuditExpertCount" resultType="java.lang.Long">
|
<select id="auditCompetitionAuditExpertCount" resultType="java.lang.Long">
|
||||||
select count(*)
|
select count(*)
|
||||||
|
@ -372,7 +375,7 @@
|
||||||
inner join users u on e.user_id = u.id
|
inner join users u on e.user_id = u.id
|
||||||
where e.is_delete = '0'
|
where e.is_delete = '0'
|
||||||
and e.status = 1
|
and e.status = 1
|
||||||
and u.authentication = true) d
|
and (u.authentication = true or u.enterprise_certification='1')) d
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -415,6 +418,8 @@
|
||||||
and review_area_three is not null
|
and review_area_three is not null
|
||||||
and review_area_three != '') a
|
and review_area_three != '') a
|
||||||
group by a.domain_value
|
group by a.domain_value
|
||||||
|
order by count(a.domain_value) desc
|
||||||
|
limit 0,9
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getExpertAduit" resultType="com.microservices.dms.achievementLibrary.domain.ExpertTotallVo">
|
<select id="getExpertAduit" resultType="com.microservices.dms.achievementLibrary.domain.ExpertTotallVo">
|
||||||
|
@ -424,17 +429,13 @@
|
||||||
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
|
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
|
||||||
from (select e.expert_name,
|
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 = 1 and `status` in (1,2)) as taskAuditCount,
|
||||||
(select COUNT(distinct container_id)
|
(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 task_expert
|
|
||||||
where expert_id = e.id
|
|
||||||
and container_type = 2 and `status` in (1,2)) as competitionAuditCount
|
|
||||||
from experts e
|
from experts e
|
||||||
inner join users u on e.user_id = u.id
|
left 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'
|
where e.is_delete = '0'
|
||||||
and e.status = 1) tmp
|
and e.status = 1) tmp
|
||||||
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
|
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
|
||||||
limit 0,9
|
limit 0,12
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -451,10 +452,11 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||||
select b.watchSum, d.favoriteSum
|
select b.watchSum, d.favoriteSum,c.userDockingSum
|
||||||
from (
|
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 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 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>
|
</select>
|
||||||
|
|
||||||
|
@ -494,13 +496,14 @@
|
||||||
|
|
||||||
<select id="getForumSectionStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
<select id="getForumSectionStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||||
select a.ancestry as "key", fs.title as "name", a.tmp as "value"
|
select a.ancestry as "key", fs.title as "name", a.tmp as "value"
|
||||||
from (select f.ancestry, count(1) as "tmp"
|
from (
|
||||||
from memos m
|
select IFNULL(f.ancestry, m.forum_section_id) as"ancestry",count(1) as "tmp" from memos m
|
||||||
left join forum_sections f on m.forum_section_id = f.id
|
inner join forum_sections f on m.forum_section_id = f.id
|
||||||
where m.destroy_status is null
|
where m.destroy_status is null
|
||||||
and m.hidden = 0
|
and m.hidden = 0
|
||||||
and m.published_at is not null
|
and m.published_at is not null
|
||||||
group by f.ancestry) a
|
group by IFNULL(f.ancestry, m.forum_section_id)
|
||||||
|
) a
|
||||||
left join forum_sections fs on fs.id = a.ancestry
|
left join forum_sections fs on fs.id = a.ancestry
|
||||||
ORDER BY a.ancestry DESC
|
ORDER BY a.ancestry DESC
|
||||||
</select>
|
</select>
|
||||||
|
@ -524,13 +527,13 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="get7DayPaise" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
<select id="get7DayPaise" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||||
select DATE_FORMAT(created_at, '%Y-%m-%d') as 'k', count(*) as 'v'
|
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
|
||||||
from praise_treads
|
from praise_treads
|
||||||
where praise_tread_object_type='Memo'
|
where praise_tread_object_type='Memo'
|
||||||
and created_at >= #{s}
|
and created_at >= #{s}
|
||||||
and created_at <= #{e}
|
and created_at <= #{e}
|
||||||
group by DATE_FORMAT(created_at, '%Y-%m-%d')
|
group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
order by DATE_FORMAT(created_at, '%Y-%m-%d')
|
order by DATE_FORMAT(created_at, '%m-%d')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getExpertInfoById" resultType="com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo">
|
<select id="getExpertInfoById" resultType="com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo">
|
||||||
|
|
|
@ -369,4 +369,16 @@
|
||||||
select name from project_categories where id=#{projectDomain}
|
select name from project_categories where id=#{projectDomain}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectProjectInfos" resultType="com.microservices.dms.achievementLibrary.domain.TokenListVo">
|
||||||
|
select p.id ,p.name ,created_on, r.identifier repositoryName, r.id as repositoryId from projects p
|
||||||
|
join repositories r on p.id = r.project_id where p.use_blockchain = 1
|
||||||
|
</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>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -35,10 +35,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="achievementStatus" column="achievement_status" />
|
<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>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSchoolEnterpriseAchievementsVo">
|
<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, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, 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, 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
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSchoolEnterpriseAchievementsList" parameterType="SchoolEnterpriseAchievements" resultMap="SchoolEnterpriseAchievementsResult">
|
<select id="selectSchoolEnterpriseAchievementsList" parameterType="SchoolEnterpriseAchievements" resultMap="SchoolEnterpriseAchievementsResult">
|
||||||
|
@ -70,6 +77,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||||
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
|
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
|
||||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</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>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -105,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
|
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
|
||||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||||
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</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>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -140,6 +153,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="achievementStatus != null">achievement_status,</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>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="achievementName != null">#{achievementName},</if>
|
<if test="achievementName != null">#{achievementName},</if>
|
||||||
|
@ -171,6 +187,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="achievementStatus != null">#{achievementStatus},</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>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
@ -206,6 +225,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="achievementStatus != null">achievement_status = #{achievementStatus},</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>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<mapper namespace="com.microservices.dms.referral.mapper.TalentReferralMapper">
|
<mapper namespace="com.microservices.dms.referral.mapper.TalentReferralMapper">
|
||||||
|
|
||||||
<select id="selectIssuesCondition" resultType="com.microservices.dms.referral.vo.IssuesVo">
|
<select id="selectIssuesCondition" resultType="com.microservices.dms.referral.vo.IssuesVo">
|
||||||
select project_id,`subject`,description,status_id from issues
|
select id,project_id,`subject`,description,status_id from issues
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null ">and id = #{id}</if>
|
<if test="id != null ">and id = #{id}</if>
|
||||||
<if test="projectId != null ">and project_id = #{projectId}</if>
|
<if test="projectId != null ">and project_id = #{projectId}</if>
|
||||||
|
@ -66,5 +66,58 @@
|
||||||
select id from users where login = #{login} limit 1
|
select id from users where login = #{login} limit 1
|
||||||
</select>
|
</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 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
|
||||||
|
from experts e
|
||||||
|
where is_delete = 0
|
||||||
|
</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 < 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>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -522,11 +522,22 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
|
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
|
||||||
select IFNULL(sum(t.bounty), 0)
|
select IFNULL(SUM(bounty), 0)
|
||||||
|
from (select distinct t.id, t.bounty
|
||||||
from tasks t
|
from tasks t
|
||||||
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
|
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
|
join task_resource_library on t.id = task_resource_library.task_id
|
||||||
where is_transferred_to_results_library = 1
|
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>
|
</select>
|
||||||
|
|
||||||
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class CommonController extends BaseController {
|
||||||
@ApiOperation("通用上传请求")
|
@ApiOperation("通用上传请求")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "file", value = "文件实体", paramType = "form", dataType = "_file"),
|
@ApiImplicitParam(name = "file", value = "文件实体", paramType = "form", dataType = "_file"),
|
||||||
@ApiImplicitParam(name = "type", value = "文件类型(zone-identifier:专区下支持文件标识的附件,cms:内容管理,resource:专区资源,pms:项目管理,pms-gitlink:项目管理gitlink附件,gitlink:gitlink附件)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "type", value = "文件类型(zone-identifier:专区下支持文件标识的附件,dms:资源库,cms:内容管理,resource:专区资源,pms:项目管理,pms-gitlink:项目管理gitlink附件,gitlink:gitlink附件)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "hierarchy", value = "层级结构(eg: pms项目管理中{enterpriseIdentifier}/products,{enterpriseIdentifier}/projects,{enterpriseIdentifier}/docs/{projectId})", 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) {
|
public AjaxResult uploadFile(@RequestPart("file") MultipartFile file, String type, String hierarchy) {
|
||||||
|
@ -168,7 +168,7 @@ public class CommonController extends BaseController {
|
||||||
@DeleteMapping("/byIdentifier/{fileIdentifier}")
|
@DeleteMapping("/byIdentifier/{fileIdentifier}")
|
||||||
@ApiOperation("通用删除请求")
|
@ApiOperation("通用删除请求")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "type", value = "文件类型(cms:内容管理,resource:专区资源,pms:项目管理,pms-gitlink:项目管理gitlink附件)", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "type", value = "文件类型(cms:内容管理,dms:资源库,resource:专区资源,pms:项目管理,pms-gitlink:项目管理gitlink附件)", paramType = "query", dataType = "String")
|
||||||
})
|
})
|
||||||
public AjaxResult deleteFile(@PathVariable("fileIdentifier") String fileIdentifier, @RequestParam("type") String type) {
|
public AjaxResult deleteFile(@PathVariable("fileIdentifier") String fileIdentifier, @RequestParam("type") String type) {
|
||||||
return toAjax(sysFileInfoService.deleteFile(fileIdentifier, type));
|
return toAjax(sysFileInfoService.deleteFile(fileIdentifier, type));
|
||||||
|
|
Loading…
Reference in New Issue