forked from Gitlink/microservices
Compare commits
110 Commits
dev_monito
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
c001df36d8 | |
|
|
d216d3d0b8 | |
|
|
35f94f3ac5 | |
|
|
fb850bad71 | |
|
|
2fef3cbc24 | |
|
|
9786975fe1 | |
|
|
dbcdb468ab | |
|
|
7d16bccea8 | |
|
|
85913c605a | |
|
|
79136717ef | |
|
|
64b4c36635 | |
|
|
db6b1cfe10 | |
|
|
af7cd7d006 | |
|
|
fa41454534 | |
|
|
f459e84521 | |
|
|
6f63a0de72 | |
|
|
e6322835db | |
|
|
0e83fa62ce | |
|
|
5232236167 | |
|
|
ce1692ac66 | |
|
|
65e66013cf | |
|
|
bd0b24eb1a | |
|
|
154e139f59 | |
|
|
e7fb87c759 | |
|
|
879133b8c7 | |
|
|
93185be706 | |
|
|
d5d4fa4805 | |
|
|
ea2d703a5e | |
|
|
1b8f1ea253 | |
|
|
8acecc5f13 | |
|
|
143fa631ce | |
|
|
f4dd5ce278 | |
|
|
b24412a1b3 | |
|
|
e48ce7f4b0 | |
|
|
7a1306929b | |
|
|
6e2b1f348f | |
|
|
f61b11bc93 | |
|
|
83f86f623d | |
|
|
a3fc3246fc | |
|
|
6e7ae41dac | |
|
|
311383d2a3 | |
|
|
5dd17b1142 | |
|
|
7c6617626a | |
|
|
d815c57f12 | |
|
|
b266bb82d6 | |
|
|
e77576f085 | |
|
|
e9137d30ba | |
|
|
5ae151e360 | |
|
|
b7b21b1f35 | |
|
|
0b69e3bafa | |
|
|
ee3d983c49 | |
|
|
dcea028be3 | |
|
|
5199a829f5 | |
|
|
1354a2b7a0 | |
|
|
e6413d1efe | |
|
|
fe7c642a08 | |
|
|
3c2b288068 | |
|
|
71e5c84a1a | |
|
|
d49f0621c8 | |
|
|
f05d5cf548 | |
|
|
6faba9a9c5 | |
|
|
d6141fe73d | |
|
|
fd54700340 | |
|
|
b429ce6563 | |
|
|
618e3a7731 | |
|
|
73ba9c53e7 | |
|
|
611b59a533 | |
|
|
de64d3c4c6 | |
|
|
070a404685 | |
|
|
7f54998e61 | |
|
|
79e05c109c | |
|
|
99952b884f | |
|
|
900122d258 | |
|
|
f6e0b6083a | |
|
|
0297b476eb | |
|
|
10e80dbf49 | |
|
|
f1da2939c6 | |
|
|
a3542daa9f | |
|
|
ee97b24e51 | |
|
|
fad993e486 | |
|
|
11e8f2efb9 | |
|
|
a708082d1e | |
|
|
4d7bb9184a | |
|
|
aaf956a352 | |
|
|
4b97dd9521 | |
|
|
855c2e9e53 | |
|
|
f2d1fc350d | |
|
|
5e3ccaf4e7 | |
|
|
e69a54033e | |
|
|
0429fe5ab7 | |
|
|
876cdd9eed | |
|
|
1d8b646876 | |
|
|
3ea6352091 | |
|
|
bd89d8bbc9 | |
|
|
06b334e782 | |
|
|
99c4842442 | |
|
|
31da182157 | |
|
|
7707757ac4 | |
|
|
4d08c973fe | |
|
|
cca9296f5b | |
|
|
f6eb2f9901 | |
|
|
6f7d969ce9 | |
|
|
9d6bbe5785 | |
|
|
992a07f154 | |
|
|
94061dc01c | |
|
|
713104e353 | |
|
|
05533c9475 | |
|
|
63e9d65b60 | |
|
|
103beae4d8 | |
|
|
edb5e65035 |
|
|
@ -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,74 @@
|
||||||
|
package com.microservices.dms.achievementLibrary.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成果相关字典Mapper接口
|
||||||
|
*
|
||||||
|
* @author microservices
|
||||||
|
* @date 2025-05-23
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
@Slave
|
||||||
|
public interface AchievementDictDataMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询成果相关字典
|
||||||
|
*
|
||||||
|
* @param dictCode 成果相关字典主键
|
||||||
|
* @return 成果相关字典
|
||||||
|
*/
|
||||||
|
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成果相关字典列表
|
||||||
|
*
|
||||||
|
* @param achievementDictData 成果相关字典
|
||||||
|
* @return 成果相关字典集合
|
||||||
|
*/
|
||||||
|
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增成果相关字典
|
||||||
|
*
|
||||||
|
* @param achievementDictData 成果相关字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAchievementDictData(AchievementDictData achievementDictData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改成果相关字典
|
||||||
|
*
|
||||||
|
* @param achievementDictData 成果相关字典
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAchievementDictData(AchievementDictData achievementDictData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成果相关字典
|
||||||
|
*
|
||||||
|
* @param dictCode 成果相关字典主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAchievementDictDataByDictCode(Long dictCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除成果相关字典
|
||||||
|
*
|
||||||
|
* @param dictCodes 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
|
||||||
|
|
||||||
|
List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType);
|
||||||
|
|
||||||
|
int selectDictDataByLabel(@Param("label") String label,@Param("type") String type);
|
||||||
|
|
||||||
|
List<String> getDictTypes();
|
||||||
|
}
|
||||||
|
|
@ -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,12 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -45,9 +52,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBehaviorImageService behaviorImageService;
|
private IBehaviorImageService behaviorImageService;
|
||||||
|
|
||||||
|
|
@ -60,7 +64,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Value("${http.gatewayUrl}")
|
@Value("${http.gatewayUrl}")
|
||||||
public String gatewayUrl;
|
public String gatewayUrl;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询成果
|
* 查询成果
|
||||||
*
|
*
|
||||||
|
|
@ -70,20 +73,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 +107,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 +123,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 +197,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 +246,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 +298,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 +343,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 +397,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 +462,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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据查询内容,调用搜索行为接口
|
* 根据查询内容,调用搜索行为接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.microservices.dms.behaviorImage.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
public class ActivityUserTotal {
|
||||||
|
//活跃用户
|
||||||
|
private Long totalUser;
|
||||||
|
//活跃用户专家数
|
||||||
|
private Long totalExpert;
|
||||||
|
//活跃用户实名认证
|
||||||
|
private Long authTotal;
|
||||||
|
|
||||||
|
public Long getTotalUser() {
|
||||||
|
return totalUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalUser(Long totalUser) {
|
||||||
|
this.totalUser = totalUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotalExpert() {
|
||||||
|
return totalExpert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalExpert(Long totalExpert) {
|
||||||
|
this.totalExpert = totalExpert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAuthTotal() {
|
||||||
|
return authTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthTotal(Long authTotal) {
|
||||||
|
this.authTotal = authTotal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,10 +2,7 @@ package com.microservices.dms.behaviorImage.mapper;
|
||||||
|
|
||||||
import com.microservices.common.datasource.annotation.Slave;
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
import com.microservices.dms.behaviorImage.domain.*;
|
||||||
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
|
|
||||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
|
||||||
import com.microservices.dms.behaviorImage.domain.UserTypeTotalVo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -98,5 +95,9 @@ public interface BehaviorImageMapper {
|
||||||
|
|
||||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||||
|
|
||||||
List<KeyValueVo> getActivityStatistic();
|
ActivityUserTotal getActivityStatistic();
|
||||||
|
|
||||||
|
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
|
||||||
|
|
||||||
|
UserTypeTotalVo getUserBehaviorSum(@Param("userId")Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,5 +75,7 @@ public interface IBehaviorImageService {
|
||||||
|
|
||||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||||
|
|
||||||
List<KeyValueVo> getActivityStatistic();
|
ActivityUserTotal getActivityStatistic();
|
||||||
|
|
||||||
|
UserTypeTotalVo getUserBehaviorSum(Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<KeyValueVo> getActivityStatistic() {
|
public ActivityUserTotal getActivityStatistic() {
|
||||||
return behaviorImageMapper.getActivityStatistic();
|
return behaviorImageMapper.getActivityStatistic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,23 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -157,4 +170,22 @@ public class OpenController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/downloadAch")
|
||||||
|
@ApiOperation("成果征集信息下载")
|
||||||
|
public ResponseEntity<Resource> downloadAch() throws IOException {
|
||||||
|
String fileName = "红山开源优秀科研成果信息征集.zip";
|
||||||
|
Resource resource = new ClassPathResource(fileName);
|
||||||
|
if (!resource.exists()) {
|
||||||
|
throw new RuntimeException("文件不存在: " + fileName);
|
||||||
|
}
|
||||||
|
String encodedFileName = URLEncoder.encode(fileName, String.valueOf(StandardCharsets.UTF_8))
|
||||||
|
.replace("+", "%20");
|
||||||
|
|
||||||
|
return ResponseEntity.ok()
|
||||||
|
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||||
|
"attachment; filename*=UTF-8''" + encodedFileName)
|
||||||
|
.contentType(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
|
.body(resource);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,37 +150,41 @@ 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<>();
|
set.addAll(a);
|
||||||
set.addAll(a);
|
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
|
||||||
|
|
@ -224,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||||
select sum(1) as "value",source as "key"
|
select sum(1) as "value",source as "key"
|
||||||
from achievements
|
from achievements
|
||||||
|
where status='1'
|
||||||
group by source
|
group by source
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -249,21 +256,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 +284,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 +295,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 +306,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 +343,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 +375,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 tags = #{t}
|
and a.status = '1'
|
||||||
|
<if test="t != null and 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 +436,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"
|
||||||
|
|
@ -432,10 +463,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</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 = 'Achievements' and watchable_id = #{id} and user_id=#{userId}) b,
|
(select count(1) as watchSum from watchers where watchable_type = 'Achievements' and watchable_id = #{id} and user_id=#{userId}) b,
|
||||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d
|
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d,
|
||||||
|
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -443,7 +475,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 +490,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 +522,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 +542,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.field_1 as "areaKey",
|
z.name as "areaName",
|
||||||
z.remark as "remark",
|
z.field_1 as "areaKey",
|
||||||
sum(z.kyxm) as "kyxmSum",
|
z.remark as "remark",
|
||||||
sum(z.ckrw) as "ckrwSum",
|
sum(z.kyxm) as "kyxmSum",
|
||||||
sum(z.kfjs) as "kfjsSum",
|
sum(z.ckrw) as "ckrwSum",
|
||||||
sum(z.xqcg) as "xqcgSum"
|
sum(z.kfjs) as "kfjsSum",
|
||||||
from (select r.name,
|
sum(z.xqcg) as "xqcgSum"
|
||||||
r.field_1,
|
from (
|
||||||
r.remark,
|
select r.name,
|
||||||
case when r.source = 1 then tmp else 0 end as "kyxm",
|
r.field_1,
|
||||||
case when r.source = 2 then tmp else 0 end as "ckrw",
|
r.remark,
|
||||||
case when r.source = 3 then tmp else 0 end as "kfjs",
|
case when r.source = 1 then tmp else 0 end as "kyxm",
|
||||||
case when r.source = 4 then tmp else 0 end as "xqcg"
|
case when r.source = 2 then tmp else 0 end as "ckrw",
|
||||||
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark
|
case when r.source = 3 then tmp else 0 end as "kfjs",
|
||||||
from achievements a
|
case when r.source = 4 then tmp else 0 end as "xqcg"
|
||||||
inner join categories c on a.field_1 = c.id
|
from (
|
||||||
group by c.name, a.source, a.field_1, c.remark) r) z
|
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
|
||||||
|
left join project_categories c on a.field_1 = c.id where a.source='1'
|
||||||
|
union all
|
||||||
|
select c.name, a.source, a.field_1, c.remark
|
||||||
|
from achievements a
|
||||||
|
left join categories c on a.field_1 = c.id where a.source in ('2','3','4')
|
||||||
|
)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 +587,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 +616,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 +626,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 +686,51 @@ 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 * from (
|
||||||
|
select u.id,u.login,u.nickname,p.name as "lastname,",u.phone,u.company_name,u.mail,p.card as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
|
||||||
|
from users u
|
||||||
|
inner join entities e on u.id = e.user_id
|
||||||
|
inner join personalities p on e.id = p.entity_id
|
||||||
|
inner join (select created_at, user_id from clickers where click_id = #{id} and click_type ='userDocking' order by created_at desc limit 1) c on u.id = c.user_id
|
||||||
|
where u.authentication='1'
|
||||||
|
union all
|
||||||
|
select u.id,u.login,u.nickname,u.lastname,u.phone,en.name as "company_name",u.mail,en.credit_code as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
|
||||||
|
from users u
|
||||||
|
inner join entities e on u.id = e.user_id
|
||||||
|
inner join enterprises en on e.id = en.entity_id
|
||||||
|
inner join (select created_at,user_id from clickers where click_id = #{id} and click_type ='userDocking' order by created_at desc limit 1) c on u.id = c.user_id
|
||||||
|
where u.enterprise_certification='1') t
|
||||||
|
order by t.created_at
|
||||||
|
</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.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||||
|
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication as "isAuth",
|
||||||
|
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
|
||||||
|
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
|
||||||
|
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
|
||||||
|
( SELECT count(1) as "pCount"
|
||||||
|
FROM `projects`
|
||||||
|
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
|
||||||
|
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
|
||||||
|
(SELECT count(1) as "pCount"
|
||||||
|
FROM `projects`
|
||||||
|
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
|
||||||
|
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
|
||||||
|
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
|
||||||
|
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
|
||||||
|
from users u) res
|
||||||
|
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0
|
||||||
|
</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>
|
||||||
|
|
||||||
|
|
@ -286,13 +306,32 @@
|
||||||
)t group by t.resultType
|
)t group by t.resultType
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getActivityStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
<select id="getActivityStatistic" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserTotal">
|
||||||
select 'totalUser' as `key`, count(1) as " value" from users
|
select count(1) as "totalUser",sum(r.isExpert) as "totalExpert",sum(r.enterprise_certification+r.authentication) as "authTotal" from (
|
||||||
union all
|
select res.userId,res.loginName,res.userName,res.isExpert,res.authentication,res.enterprise_certification,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||||
select'authTotal' as `key`,sum(u.authentication) as "value" from users u
|
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication,u.enterprise_certification,
|
||||||
union all
|
(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 'totalexpert' as `key`, count(1) as " value"from users u
|
(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",
|
||||||
inner join experts e on u.id = e.user_id
|
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
|
||||||
where e.is_delete='0' and e.status = 1
|
( SELECT count(1) as "pCount"
|
||||||
|
FROM `projects` INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
|
||||||
|
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
|
||||||
|
(SELECT count(1) as "pCount"
|
||||||
|
FROM `projects`
|
||||||
|
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
|
||||||
|
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
|
||||||
|
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
|
||||||
|
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
|
||||||
|
from users u) res
|
||||||
|
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0 )r
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserBehaviorSum" resultType="com.microservices.dms.behaviorImage.domain.UserTypeTotalVo">
|
||||||
|
select
|
||||||
|
(select count(1) as "resultCount" from watchers where user_id = u.id ) as "watchSum",
|
||||||
|
(select count(1) as "resultCount" from favorites where user_id = u.id ) as "favoriteSum",
|
||||||
|
(select count(1) as "resultCount" from praise_treads where user_id = u.id ) as "praiseSum"
|
||||||
|
from users u
|
||||||
|
where u.id = #{userId}
|
||||||
</select>
|
</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(*)
|
||||||
|
|
@ -367,12 +370,12 @@
|
||||||
select b.expertTotal as "total", d.expertAuth as "value"
|
select b.expertTotal as "total", d.expertAuth as "value"
|
||||||
from (
|
from (
|
||||||
(select count(1) as "expertTotal" from experts where is_delete = '0' and status = 1) b,
|
(select count(1) as "expertTotal" from experts where is_delete = '0' and status = 1) b,
|
||||||
(select count(1) as "expertAuth"
|
(select count(1) as "expertAuth"
|
||||||
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
|
||||||
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,14 +496,15 @@
|
||||||
|
|
||||||
<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)
|
||||||
left join forum_sections fs on fs.id = a.ancestry
|
) a
|
||||||
|
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 tasks t
|
from (select distinct t.id, t.bounty
|
||||||
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
|
from tasks t
|
||||||
join task_resource_library on t.id = task_resource_library.task_id
|
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
|
||||||
where is_transferred_to_results_library = 1
|
join task_resource_library on t.id = task_resource_library.task_id
|
||||||
|
where is_transferred_to_results_library = 1) tmp
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getConvertedTaskAmount2" resultType="java.lang.Double">
|
||||||
|
select IFNULL(SUM(bounty), 0)
|
||||||
|
from (select distinct t.id, t.bounty
|
||||||
|
from tasks t
|
||||||
|
join (select task_id from papers where status = 2) p on t.id = p.task_id
|
||||||
|
join task_resource_library on t.id = task_resource_library.task_id
|
||||||
|
join achievements a on a.source_id = task_resource_library.id and a.source='2' and a.status= '1'
|
||||||
|
where is_transferred_to_results_library = 1) tmp
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -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));
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
@ -172,6 +173,12 @@ public class PmsDashboardController extends BaseController {
|
||||||
}
|
}
|
||||||
todoProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
todoProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||||
JSONObject result = pmsProjectIssuesService.selectMyTodoPmsProjectIssuesList(todoProjectIssuesSearchVo);
|
JSONObject result = pmsProjectIssuesService.selectMyTodoPmsProjectIssuesList(todoProjectIssuesSearchVo);
|
||||||
|
|
||||||
|
// 判断projectList中是否存在projectAssigneeId和当前用户id相等
|
||||||
|
Long currentUserId = SecurityUtils.getGitlinkUserId();
|
||||||
|
boolean isProjectAssigner = projectList.stream()
|
||||||
|
.anyMatch(project -> currentUserId != null && currentUserId.equals(project.getProjectAssigneeId()));
|
||||||
|
result.put("isProjectAssigner", isProjectAssigner);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ import java.util.List;
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||||
})
|
})
|
||||||
public class PmsDocumentController extends BaseController
|
public class PmsDocumentController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPmsDocumentService pmsDocumentService;
|
private IPmsDocumentService pmsDocumentService;
|
||||||
|
|
||||||
|
|
@ -46,8 +45,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||||
})
|
})
|
||||||
public GenericsTableDataInfo<PmsDocumentVo> list( @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
|
public GenericsTableDataInfo<PmsDocumentVo> list(@Validated PmsDocumentSearchVo pmsDocumentSearchVo) {
|
||||||
{
|
|
||||||
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
|
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,8 +56,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
|
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
|
||||||
public void export(HttpServletResponse response, PmsDocument pmsDocument)
|
public void export(HttpServletResponse response, PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
|
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
|
||||||
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
|
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
|
||||||
util.exportExcel(response, list, "项目管理-文档库数据");
|
util.exportExcel(response, list, "项目管理-文档库数据");
|
||||||
|
|
@ -71,8 +68,7 @@ public class PmsDocumentController extends BaseController
|
||||||
// @RequiresPermissions("pms:document:query")
|
// @RequiresPermissions("pms:document:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiOperation(value = "获取项目管理-文档库详细信息")
|
@ApiOperation(value = "获取项目管理-文档库详细信息")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId)
|
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId) {
|
||||||
{
|
|
||||||
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
|
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,8 +79,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "新增项目管理-文档库")
|
@ApiOperation(value = "新增项目管理-文档库")
|
||||||
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo)
|
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
|
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,8 +90,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
|
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/fileType")
|
@PostMapping("/fileType")
|
||||||
@ApiOperation(value = "新增附件类型文档")
|
@ApiOperation(value = "新增附件类型文档")
|
||||||
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo)
|
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
|
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,8 +101,7 @@ public class PmsDocumentController extends BaseController
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation(value = "修改项目管理-文档库")
|
@ApiOperation(value = "修改项目管理-文档库")
|
||||||
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo)
|
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
|
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,12 +110,11 @@ public class PmsDocumentController extends BaseController
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("pms:document:remove")
|
// @RequiresPermissions("pms:document:remove")
|
||||||
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
|
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation(value = "删除项目管理-文档库")
|
@ApiOperation(value = "删除项目管理-文档库")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids,
|
public AjaxResult remove(@PathVariable Long[] ids,
|
||||||
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
|
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
|
||||||
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId)
|
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId) {
|
||||||
{
|
|
||||||
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
|
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,8 +123,16 @@ public class PmsDocumentController extends BaseController
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/optionalWikiRepoList")
|
@GetMapping(value = "/optionalWikiRepoList")
|
||||||
@ApiOperation(value = "导入wiki时可选的仓库列表")
|
@ApiOperation(value = "导入wiki时可选的仓库列表")
|
||||||
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo)
|
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo) {
|
||||||
{
|
|
||||||
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
|
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载文档类型文件
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/downloadDoc/{docId}")
|
||||||
|
@ApiOperation(value = "下载文档类型文件")
|
||||||
|
public void downloadDoc(@PathVariable String enterpriseIdentifier, @PathVariable Long docId, HttpServletResponse response) {
|
||||||
|
pmsDocumentService.downloadDoc(response, enterpriseIdentifier, docId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.pms.document.domain.PmsDocument;
|
import com.microservices.pms.document.domain.PmsDocument;
|
||||||
import com.microservices.pms.document.domain.vo.*;
|
import com.microservices.pms.document.domain.vo.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -93,4 +94,6 @@ public interface IPmsDocumentService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
JSONObject getOptionalWikiRepoList(OptionalWikiReposSearchVo optionalWikiReposSearchVo);
|
JSONObject getOptionalWikiRepoList(OptionalWikiReposSearchVo optionalWikiReposSearchVo);
|
||||||
|
|
||||||
|
void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.constant.HttpStatus;
|
||||||
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.core.utils.StringUtils;
|
||||||
|
import com.microservices.common.core.utils.file.FileUtils;
|
||||||
import com.microservices.common.core.web.page.Breadcrumb;
|
import com.microservices.common.core.web.page.Breadcrumb;
|
||||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||||
|
|
@ -21,6 +22,7 @@ import com.microservices.pms.enums.PmsDocumentType;
|
||||||
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
||||||
import com.microservices.pms.project.service.IPmsProjectService;
|
import com.microservices.pms.project.service.IPmsProjectService;
|
||||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
@ -28,7 +30,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -42,9 +49,9 @@ import static com.microservices.common.httpClient.constant.GitLinkConstants.DATA
|
||||||
* @author wanjia
|
* @author wanjia
|
||||||
* @date 2024-01-08
|
* @date 2024-01-08
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class PmsDocumentServiceImpl implements IPmsDocumentService
|
public class PmsDocumentServiceImpl implements IPmsDocumentService {
|
||||||
{
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PmsDocumentServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(PmsDocumentServiceImpl.class);
|
||||||
@Resource
|
@Resource
|
||||||
private PmsDocumentMapper pmsDocumentMapper;
|
private PmsDocumentMapper pmsDocumentMapper;
|
||||||
|
|
@ -74,8 +81,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 项目管理-文档库
|
* @return 项目管理-文档库
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId)
|
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId) {
|
||||||
{
|
|
||||||
boolean isEnterpriseAdmin = pmsCommonService.hasDocsManageRole(enterpriseId);
|
boolean isEnterpriseAdmin = pmsCommonService.hasDocsManageRole(enterpriseId);
|
||||||
return pmsDocumentMapper.selectPmsDocumentByIdAndEnterpriseId(id, enterpriseId, isEnterpriseAdmin, SecurityUtils.getUsername());
|
return pmsDocumentMapper.selectPmsDocumentByIdAndEnterpriseId(id, enterpriseId, isEnterpriseAdmin, SecurityUtils.getUsername());
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +108,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 项目管理-文档库
|
* @return 项目管理-文档库
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument)
|
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
return pmsDocumentMapper.selectPmsDocumentList(pmsDocument);
|
return pmsDocumentMapper.selectPmsDocumentList(pmsDocument);
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +121,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
pmsDocumentSearchVo.setCurrentUserName(currentUserName);
|
pmsDocumentSearchVo.setCurrentUserName(currentUserName);
|
||||||
startPage();
|
startPage();
|
||||||
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsDocumentListBySearchInput(pmsDocumentSearchVo);
|
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsDocumentListBySearchInput(pmsDocumentSearchVo);
|
||||||
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList,this::buildPmsDocumentVo);
|
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList, this::buildPmsDocumentVo);
|
||||||
//构建面包屑列表
|
//构建面包屑列表
|
||||||
if (pmsDocumentSearchVo.getParentId() != 0) {
|
if (pmsDocumentSearchVo.getParentId() != 0) {
|
||||||
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
||||||
|
|
@ -132,12 +137,45 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(enterpriseId);
|
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(enterpriseId);
|
||||||
Map<String, String> queryParams = buildRepoListQueryParams(optionalWikiReposSearchVo);
|
Map<String, String> queryParams = buildRepoListQueryParams(optionalWikiReposSearchVo);
|
||||||
try {
|
try {
|
||||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId) {
|
||||||
|
PmsEnterprise enterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||||
|
PmsDocument pmsDocument = selectPmsDocumentByIdAndEnterpriseId(docId, enterprise.getId());
|
||||||
|
if (!pmsDocument.getDocType().equals(PmsDocumentType.DOCUMENT.getKey())) {
|
||||||
|
throw new ServiceException("当前接口仅允许下载文档类型");
|
||||||
|
}
|
||||||
|
Path tempFilePath = null;
|
||||||
|
try {
|
||||||
|
String docFileName = pmsDocument.getName() + ".md";
|
||||||
|
FileUtils.setAttachmentResponseHeader(response, docFileName);
|
||||||
|
// 创建临时文件
|
||||||
|
tempFilePath = Files.createTempFile(pmsDocument.getName(), ".md");
|
||||||
|
String content = "";
|
||||||
|
if (pmsDocument.getContent() != null) {
|
||||||
|
content = pmsDocument.getContent();
|
||||||
|
}
|
||||||
|
Files.write(tempFilePath, content.getBytes(StandardCharsets.UTF_8));
|
||||||
|
FileUtils.writeBytes(tempFilePath.toString(), response.getOutputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("文档下载失败:{}", e.getMessage());
|
||||||
|
throw new ServiceException("文档下载失败");
|
||||||
|
} finally {
|
||||||
|
if (tempFilePath != null) {
|
||||||
|
try {
|
||||||
|
Files.deleteIfExists(tempFilePath);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("删除临时文件失败:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增项目管理-文档库
|
* 新增项目管理-文档库
|
||||||
*
|
*
|
||||||
|
|
@ -145,8 +183,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPmsDocument(PmsDocument pmsDocument)
|
public int insertPmsDocument(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
|
|
@ -174,8 +211,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updatePmsDocument(PmsDocument pmsDocument)
|
public int updatePmsDocument(PmsDocument pmsDocument) {
|
||||||
{
|
|
||||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||||
|
|
@ -195,8 +231,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId)
|
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId) {
|
||||||
{
|
|
||||||
checkPmsProjectById(projectId);
|
checkPmsProjectById(projectId);
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||||
|
|
@ -212,8 +247,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId)
|
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId) {
|
||||||
{
|
|
||||||
checkPmsProjectById(projectId);
|
checkPmsProjectById(projectId);
|
||||||
String currentUserName = SecurityUtils.getUsername();
|
String currentUserName = SecurityUtils.getUsername();
|
||||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||||
|
|
@ -306,7 +340,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
throw new ServiceException("文件类型的文档名称个数与文件标识个数不匹配");
|
throw new ServiceException("文件类型的文档名称个数与文件标识个数不匹配");
|
||||||
}
|
}
|
||||||
List<PmsDocument> pmsDocumentList = new ArrayList<>();
|
List<PmsDocument> pmsDocumentList = new ArrayList<>();
|
||||||
for (int i=0; i < names.length; i++) {
|
for (int i = 0; i < names.length; i++) {
|
||||||
PmsDocument pmsDocument = new PmsDocument();
|
PmsDocument pmsDocument = new PmsDocument();
|
||||||
BeanUtils.copyProperties(pmsFileTypeDocumentInputVo, pmsDocument);
|
BeanUtils.copyProperties(pmsFileTypeDocumentInputVo, pmsDocument);
|
||||||
pmsDocument.setName(names[i]);
|
pmsDocument.setName(names[i]);
|
||||||
|
|
@ -376,7 +410,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||||
queryParams.put("pm_project_repository_ids", unlinkedRepoIdsString);
|
queryParams.put("pm_project_repository_ids", unlinkedRepoIdsString);
|
||||||
}
|
}
|
||||||
queryParams.put("search", optionalWikiReposSearchVo.getSearch());
|
queryParams.put("search", optionalWikiReposSearchVo.getSearch());
|
||||||
queryParams.put("page" , String.valueOf(optionalWikiReposSearchVo.getPage()));
|
queryParams.put("page", String.valueOf(optionalWikiReposSearchVo.getPage()));
|
||||||
queryParams.put("limit", String.valueOf(optionalWikiReposSearchVo.getLimit()));
|
queryParams.put("limit", String.valueOf(optionalWikiReposSearchVo.getLimit()));
|
||||||
queryParams.put("sort_by", optionalWikiReposSearchVo.getSortBy());
|
queryParams.put("sort_by", optionalWikiReposSearchVo.getSortBy());
|
||||||
queryParams.put("sort_direction", "desc");
|
queryParams.put("sort_direction", "desc");
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,8 @@ public class ProductReqSpecsController extends BaseController {
|
||||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/activePlan")
|
@PutMapping("/activePlan")
|
||||||
@ApiOperation(value = "需求纳入计划")
|
@ApiOperation(value = "需求纳入计划")
|
||||||
public AjaxResult activePlan(@RequestBody @Validated ProductReqSpecsActivePlanVo productReqSpecsActivePlanVo) {
|
public AjaxResult activePlan(@PathVariable String enterpriseIdentifier, @RequestBody @Validated ProductReqSpecsActivePlanVo productReqSpecsActivePlanVo) {
|
||||||
|
productReqSpecsActivePlanVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
return toAjax(pmsProductRequirementService.activePlan(productReqSpecsActivePlanVo));
|
return toAjax(pmsProductRequirementService.activePlan(productReqSpecsActivePlanVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,12 @@ public class ProductReqSpecsActivePlanVo {
|
||||||
@NotNull
|
@NotNull
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||||
|
private String enterpriseIdentifier;
|
||||||
|
|
||||||
public PmsProjectIssuesInputVo toPmsProjectIssuesInputVo(PmsProductRequirement reqSpecs, List<String> forgeFileIdentifierList) {
|
public PmsProjectIssuesInputVo toPmsProjectIssuesInputVo(PmsProductRequirement reqSpecs, List<String> forgeFileIdentifierList) {
|
||||||
PmsProjectIssuesInputVo issue = new PmsProjectIssuesInputVo();
|
PmsProjectIssuesInputVo issue = new PmsProjectIssuesInputVo();
|
||||||
|
issue.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
issue.setSubject(reqSpecs.getTitle());
|
issue.setSubject(reqSpecs.getTitle());
|
||||||
issue.setPmProjectId(projectId);
|
issue.setPmProjectId(projectId);
|
||||||
issue.setStatusId(ProjectIssueStatus.RESOLVING.getId());
|
issue.setStatusId(ProjectIssueStatus.RESOLVING.getId());
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
* @date 2024-06-20
|
* @date 2024-06-20
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class PmsProductLibraryRepositoriesServiceImpl implements IPmsProductLibraryRepositoriesService {
|
public class PmsProductLibraryRepositoriesServiceImpl extends ProductLibraryCommonService implements IPmsProductLibraryRepositoriesService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PmsProductLibraryRepositoriesMapper pmsProductLibraryRepositoriesMapper;
|
private PmsProductLibraryRepositoriesMapper pmsProductLibraryRepositoriesMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -328,7 +328,15 @@ public class PmsProductLibraryRepositoriesServiceImpl implements IPmsProductLibr
|
||||||
pmsProductLibraryRepositoriesSearch.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
pmsProductLibraryRepositoriesSearch.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
return PageUtils.toPage(
|
return PageUtils.toPage(
|
||||||
pmsProductLibraryRepositoriesMapper.selectPmsProductLibraryRepositoriesList(pmsProductLibraryRepositoriesSearch),
|
pmsProductLibraryRepositoriesMapper.selectPmsProductLibraryRepositoriesList(pmsProductLibraryRepositoriesSearch),
|
||||||
PmsProductLibraryRepositories::toPmsProductLibraryRepositoriesSimpleVo);
|
this::toPmsProductLibraryRepositoriesSimpleVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private PmsProductLibraryRepositoriesSimpleVo toPmsProductLibraryRepositoriesSimpleVo(PmsProductLibraryRepositories productLibraryRepositories) {
|
||||||
|
PmsProductLibraryRepositoriesSimpleVo target = productLibraryRepositories.toPmsProductLibraryRepositoriesSimpleVo();
|
||||||
|
if (StringUtils.isNotEmpty(externalUrl)) {
|
||||||
|
target.setUrl(target.getUrl().replace(nexusUrl, externalUrl));
|
||||||
|
}
|
||||||
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ import com.microservices.system.api.utils.FeignUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -60,7 +61,7 @@ import java.util.stream.Collectors;
|
||||||
* @author OTTO
|
* @author OTTO
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class PmsProductLibraryServiceImpl implements IPmsProductLibraryService {
|
public class PmsProductLibraryServiceImpl extends ProductLibraryCommonService implements IPmsProductLibraryService {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(PmsProductLibraryServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(PmsProductLibraryServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -158,6 +159,9 @@ public class PmsProductLibraryServiceImpl implements IPmsProductLibraryService {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(externalUrl)) {
|
||||||
|
pmsProductLibrarySimpleVo.setUrl(pmsProductLibrarySimpleVo.getUrl().replace(nexusUrl, externalUrl));
|
||||||
|
}
|
||||||
return pmsProductLibrarySimpleVo;
|
return pmsProductLibrarySimpleVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.microservices.pms.productLibrary.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
|
public abstract class ProductLibraryCommonService {
|
||||||
|
|
||||||
|
@Value("${nexus.proxy.externalUrl:}")
|
||||||
|
public String externalUrl;
|
||||||
|
@Value("${nexus.proxy.targetAddr:}")
|
||||||
|
public String nexusUrl;
|
||||||
|
}
|
||||||
|
|
@ -44,7 +44,8 @@ public class PmsProjectIssuesController extends BaseController {
|
||||||
@RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe", "pms:pmsProjectTestsheet:edit"}, logical = Logical.OR)
|
@RequiresPermissions(value = {"pms:pmsProject:show", "pms:pmsProject:showMe", "pms:pmsProjectTestsheet:edit"}, logical = Logical.OR)
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation(value = "项目工作项列表")
|
@ApiOperation(value = "项目工作项列表")
|
||||||
public AjaxResult list(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
public AjaxResult list(@PathVariable String enterpriseIdentifier, PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
||||||
|
pmsProjectIssuesSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -384,4 +385,15 @@ public class PmsProjectIssuesController extends BaseController {
|
||||||
public void exportIssues(HttpServletResponse response, @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) {
|
public void exportIssues(HttpServletResponse response, @ApiParam("项目Id") @RequestParam(name = "pmProjectId") Long pmProjectId) {
|
||||||
pmsProjectIssuesService.exportIssues(response, pmProjectId);
|
pmsProjectIssuesService.exportIssues(response, pmProjectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步更新issue企业标识
|
||||||
|
* 说明:旧issues数据直接通过pmProjectId与pms建立关联,新需求要与企业建立关联,故需要同步更新issue企业标识
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateIssueEnterpriseIdentifier")
|
||||||
|
@ApiOperation(value = "同步更新issue企业标识")
|
||||||
|
public AjaxResult updateIssueEnterpriseIdentifier() {
|
||||||
|
boolean result = pmsProjectIssuesService.updateIssueEnterpriseIdentifier();
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.microservices.pms.project.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.microservices.common.core.web.domain.AjaxResult;
|
import com.microservices.common.core.web.domain.AjaxResult;
|
||||||
|
import com.microservices.pms.project.domain.vo.PmsPersonalWeeklyIssuesSearchVo;
|
||||||
|
import com.microservices.pms.project.domain.vo.PmsPersonalWeeklyReportSearchVo;
|
||||||
import com.microservices.pms.project.domain.vo.PmsProjectIssuesInputVo;
|
import com.microservices.pms.project.domain.vo.PmsProjectIssuesInputVo;
|
||||||
import com.microservices.pms.project.domain.vo.PmsProjectIssuesSearchVo;
|
import com.microservices.pms.project.domain.vo.PmsProjectIssuesSearchVo;
|
||||||
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
||||||
|
|
@ -35,20 +37,62 @@ public class PmsProjectWeeklyReportController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation(value = "项目周报列表")
|
@ApiOperation(value = "项目周报列表")
|
||||||
public AjaxResult list(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo)
|
public AjaxResult list(@PathVariable String enterpriseIdentifier, PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo)
|
||||||
{
|
{
|
||||||
|
pmsProjectIssuesSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询周报-个人工作项统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/personal")
|
||||||
|
@ApiOperation(value = "周报-个人工作项统计")
|
||||||
|
public AjaxResult getPersonalWeeklyReport(@PathVariable String enterpriseIdentifier, PmsPersonalWeeklyReportSearchVo pmsPersonalWeeklyReportSearchVo)
|
||||||
|
{
|
||||||
|
JSONObject result = pmsProjectIssuesService.getPersonalIssuesStatistics(enterpriseIdentifier, pmsPersonalWeeklyReportSearchVo);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/personalIssueList")
|
||||||
|
@ApiOperation(value = "周报-个人工作项列表")
|
||||||
|
public AjaxResult getPersonalIssueList(@PathVariable String enterpriseIdentifier, PmsPersonalWeeklyIssuesSearchVo pmsPersonalWeeklyIssuesSearchVo)
|
||||||
|
{
|
||||||
|
pmsPersonalWeeklyIssuesSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
|
JSONObject result = pmsProjectIssuesService.getPersonalIssueList(pmsPersonalWeeklyIssuesSearchVo);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询周报-项目组工作项统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/projectTeam")
|
||||||
|
@ApiOperation(value = "周报-项目组工作项统计")
|
||||||
|
public AjaxResult getProjectTeamWeeklyReport(@PathVariable String enterpriseIdentifier)
|
||||||
|
{
|
||||||
|
JSONObject result = pmsProjectIssuesService.getProjectTeamIssuesStatistics(enterpriseIdentifier);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/projectIssueList")
|
||||||
|
@ApiOperation(value = "周报-项目组工作项列表")
|
||||||
|
public AjaxResult getProjectIssueList(@PathVariable String enterpriseIdentifier, PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo)
|
||||||
|
{
|
||||||
|
pmsProjectIssuesSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
|
JSONObject result = pmsProjectIssuesService.getProjectIssueList(pmsProjectIssuesSearchVo);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增项目项目周报
|
* 新增项目项目周报
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation(value = "新增项目周报")
|
@ApiOperation(value = "新增项目周报")
|
||||||
public AjaxResult add(@RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo)
|
public AjaxResult add(@PathVariable String enterpriseIdentifier, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo)
|
||||||
{
|
{
|
||||||
JSONObject result = pmsProjectIssuesService.insertPmsProjectIssues(pmsProjectIssuesInputVo);
|
pmsProjectIssuesInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
|
JSONObject result = pmsProjectIssuesService.insertPmsProjectWeeklyReportIssues(pmsProjectIssuesInputVo);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,18 +103,18 @@ public class PmsProjectWeeklyReportController {
|
||||||
@ApiOperation(value = "编辑项目周报")
|
@ApiOperation(value = "编辑项目周报")
|
||||||
public AjaxResult edit(@PathVariable("id") Long id, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo)
|
public AjaxResult edit(@PathVariable("id") Long id, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo)
|
||||||
{
|
{
|
||||||
JSONObject result = pmsProjectIssuesService.updatePmsProjectIssues(id, pmsProjectIssuesInputVo);
|
JSONObject result = pmsProjectIssuesService.updatePmsProjectWeeklyReportIssues(id, pmsProjectIssuesInputVo);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除项目周报
|
* 删除项目周报
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{id}")
|
||||||
public AjaxResult remove(@ApiParam( "周报id数组,为-1时删除全部")@PathVariable Long[] ids, @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId)
|
public AjaxResult remove(@ApiParam( "周报id")@PathVariable Long id)
|
||||||
{
|
{
|
||||||
|
|
||||||
JSONObject result = pmsProjectIssuesService.deletePmsProjectIssueByIds(ids, pmProjectId);
|
JSONObject result = pmsProjectIssuesService.deletePmsProjectWeeklyReportIssueByIds(id);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,10 +122,10 @@ public class PmsProjectWeeklyReportController {
|
||||||
* 查看项目周报
|
* 查看项目周报
|
||||||
*/
|
*/
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult query(@PathVariable("id") Long id, @ApiParam( "项目Id")@RequestParam(name = "pmProjectId") Long pmProjectId)
|
public AjaxResult query(@PathVariable String enterpriseIdentifier, @PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
|
|
||||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssueById(id, pmProjectId);
|
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssueByIdAndEnterPrise(id, enterpriseIdentifier);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
package com.microservices.pms.project.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ForgeIssues {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer trackerId;
|
||||||
|
|
||||||
|
private Integer projectId;
|
||||||
|
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
private Date dueDate;
|
||||||
|
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
private Integer statusId;
|
||||||
|
|
||||||
|
private Integer assignedToId;
|
||||||
|
|
||||||
|
private Integer priorityId;
|
||||||
|
|
||||||
|
private Integer fixedVersionId;
|
||||||
|
|
||||||
|
private Integer authorId;
|
||||||
|
|
||||||
|
private Date createdOn;
|
||||||
|
|
||||||
|
private Date updatedOn;
|
||||||
|
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
private Integer doneRatio;
|
||||||
|
|
||||||
|
private Float estimatedHours;
|
||||||
|
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
private Integer rootId;
|
||||||
|
|
||||||
|
private Integer lft;
|
||||||
|
|
||||||
|
private Integer rgt;
|
||||||
|
|
||||||
|
private Boolean isPrivate;
|
||||||
|
|
||||||
|
private Date closedOn;
|
||||||
|
|
||||||
|
private Integer projectIssuesIndex;
|
||||||
|
|
||||||
|
private String issueType;
|
||||||
|
|
||||||
|
private Integer token;
|
||||||
|
|
||||||
|
private String issueTagsValue;
|
||||||
|
|
||||||
|
private Boolean isLock;
|
||||||
|
|
||||||
|
private String issueClassify;
|
||||||
|
|
||||||
|
private String refName;
|
||||||
|
|
||||||
|
private String branchName;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Integer blockchainTokenNum;
|
||||||
|
|
||||||
|
private Long pmProjectId;
|
||||||
|
|
||||||
|
private Long pmSprintId;
|
||||||
|
|
||||||
|
private Integer pmIssueType;
|
||||||
|
|
||||||
|
private BigDecimal timeScale;
|
||||||
|
|
||||||
|
private Integer childCount;
|
||||||
|
private Long changerId;
|
||||||
|
|
||||||
|
private Integer fakeId;
|
||||||
|
|
||||||
|
private String enterpriseIdentifier;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.microservices.pms.project.domain.vo;
|
||||||
|
|
||||||
|
import com.microservices.common.core.utils.ServletUtils;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("个人周报工作项搜索对象")
|
||||||
|
public class PmsPersonalWeeklyIssuesSearchVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户gitlink用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||||
|
private String enterpriseIdentifier;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态值,可多个状态逗号隔开")
|
||||||
|
private String statusIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序方式: issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级")
|
||||||
|
private String sortBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序方向:asc 正序 desc 倒序")
|
||||||
|
private String sortDirection;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "本周工作项页码")
|
||||||
|
private String thisWeekPage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分页数")
|
||||||
|
private String thisWeekLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "本周工作项页码")
|
||||||
|
private String nextWeekPage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分页数")
|
||||||
|
private String nextWeekLimit;
|
||||||
|
|
||||||
|
public void setKeyword(String keyword) {
|
||||||
|
this.keyword = ServletUtils.urlDecode(keyword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.microservices.pms.project.domain.vo;
|
||||||
|
|
||||||
|
import com.microservices.common.core.utils.ServletUtils;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("个人周报工作项统计对象")
|
||||||
|
public class PmsPersonalWeeklyReportSearchVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户gitlink用户id", hidden = true)
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||||
|
private String enterpriseIdentifier;
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,10 @@ import lombok.Data;
|
||||||
@ApiModel("项目工作项搜索对象")
|
@ApiModel("项目工作项搜索对象")
|
||||||
public class PmsProjectIssuesSearchVo {
|
public class PmsProjectIssuesSearchVo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "项目id", required = true)
|
@ApiModelProperty(value = "企业标识", hidden = true)
|
||||||
|
private String enterpriseIdentifier;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "项目id")
|
||||||
private String pmProjectId;
|
private String pmProjectId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "项目迭代id")
|
@ApiModelProperty(value = "项目迭代id")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.microservices.pms.project.mapper;
|
||||||
|
|
||||||
|
import com.microservices.common.datasource.annotation.Slave;
|
||||||
|
import com.microservices.pms.project.domain.ForgeIssues;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户表 数据层
|
||||||
|
*
|
||||||
|
* @author microservices
|
||||||
|
*/
|
||||||
|
@Slave
|
||||||
|
@Mapper
|
||||||
|
public interface ForgeIssuesMapper {
|
||||||
|
|
||||||
|
List<ForgeIssues> getBriefIssues();
|
||||||
|
|
||||||
|
int updateForIssues(ForgeIssues forgeIssues);
|
||||||
|
}
|
||||||
|
|
@ -89,4 +89,8 @@ public interface PmsProjectMapper
|
||||||
void updatePmsProjectNoProduct(@Param("projectIdList") List<Long> projectIdList);
|
void updatePmsProjectNoProduct(@Param("projectIdList") List<Long> projectIdList);
|
||||||
|
|
||||||
PmsProject selectPmsProjectById(Long id);
|
PmsProject selectPmsProjectById(Long id);
|
||||||
|
|
||||||
|
List<Long> selectProjectIdsByAssigneeUserId(@Param("enterpriseIdentifier") String enterpriseIdentifier, @Param("gitlinkUserId") Long gitlinkUserId);
|
||||||
|
|
||||||
|
String selectEnterpriseIdentifierByProjectId(@Param("pmProjectId") Long pmProjectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,8 @@ public interface PmsProjectSprintMapper
|
||||||
Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId);
|
Integer selectOpeningSprintLastWeekIterationCount(@Param("pmProjectId") Long pmProjectId);
|
||||||
|
|
||||||
PmsProjectSprintStatisticsVo selectPmsProjectSprintStatisticsByProjectId(@Param("pmProjectId") Long pmProjectId);
|
PmsProjectSprintStatisticsVo selectPmsProjectSprintStatisticsByProjectId(@Param("pmProjectId") Long pmProjectId);
|
||||||
|
|
||||||
|
int selectNewSprintCurrentNaturalWeekCount(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
int selectCompleteSprintCurrentNaturalWeekCount(@Param("projectId") Long projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,4 +68,8 @@ public interface PmsProjectTestsheetMapper
|
||||||
int deletePmsProjectTestsheetByProjectId(@Param("projectId") Long projectId);
|
int deletePmsProjectTestsheetByProjectId(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
Integer selectCountBySprintId(@Param("sprintId") Long sprintId);
|
Integer selectCountBySprintId(@Param("sprintId") Long sprintId);
|
||||||
|
|
||||||
|
int selectNewTestSheetCurrentNaturalWeekCount(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
int selectCompleteTestSheetCurrentNaturalWeekCount(@Param("projectId") Long projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||||
import com.microservices.pms.project.domain.PmsProject;
|
import com.microservices.pms.project.domain.PmsProject;
|
||||||
import com.microservices.pms.project.domain.vo.*;
|
import com.microservices.pms.project.domain.vo.*;
|
||||||
import com.microservices.system.api.domain.SimpleSysUser;
|
import com.microservices.system.api.domain.SimpleSysUser;
|
||||||
import com.microservices.system.api.domain.SysNotice;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -100,4 +99,6 @@ public interface IPmsProjectService
|
||||||
JSONObject getMyRepositoriesStatistics(Long repositoryId);
|
JSONObject getMyRepositoriesStatistics(Long repositoryId);
|
||||||
|
|
||||||
PmsProject selectPmsProjectByIdNoCheckRole(Long pmsProjectId);
|
PmsProject selectPmsProjectByIdNoCheckRole(Long pmsProjectId);
|
||||||
|
|
||||||
|
List<Long> selectProjectIdsByAssigneeUserId(String enterpriseIdentifier, Long gitlinkUserId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
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.httpClient.util.GitLinkRequestHelper;
|
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||||
import com.microservices.common.security.utils.SecurityUtils;
|
import com.microservices.common.security.utils.SecurityUtils;
|
||||||
import com.microservices.pms.common.service.IPmsCommonService;
|
import com.microservices.pms.common.service.IPmsCommonService;
|
||||||
|
|
@ -14,9 +15,14 @@ import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
||||||
import com.microservices.pms.enums.ProjectIssueStatus;
|
import com.microservices.pms.enums.ProjectIssueStatus;
|
||||||
import com.microservices.pms.product.domain.enums.ProductReqStatus;
|
import com.microservices.pms.product.domain.enums.ProductReqStatus;
|
||||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||||
|
import com.microservices.pms.project.domain.ForgeIssues;
|
||||||
import com.microservices.pms.project.domain.PmsProject;
|
import com.microservices.pms.project.domain.PmsProject;
|
||||||
import com.microservices.pms.project.domain.SimpleRepository;
|
import com.microservices.pms.project.domain.SimpleRepository;
|
||||||
import com.microservices.pms.project.domain.vo.*;
|
import com.microservices.pms.project.domain.vo.*;
|
||||||
|
import com.microservices.pms.project.mapper.ForgeIssuesMapper;
|
||||||
|
import com.microservices.pms.project.mapper.PmsProjectMapper;
|
||||||
|
import com.microservices.pms.project.mapper.PmsProjectSprintMapper;
|
||||||
|
import com.microservices.pms.project.mapper.PmsProjectTestsheetMapper;
|
||||||
import com.microservices.pms.utils.PmsConstants;
|
import com.microservices.pms.utils.PmsConstants;
|
||||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||||
import com.microservices.pms.utils.PmsUtils;
|
import com.microservices.pms.utils.PmsUtils;
|
||||||
|
|
@ -31,6 +37,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -72,6 +79,14 @@ public class PmsProjectIssuesService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPmsCommonService pmsCommonService;
|
private IPmsCommonService pmsCommonService;
|
||||||
|
@Resource
|
||||||
|
private PmsProjectSprintMapper pmsProjectSprintMapper;
|
||||||
|
@Resource
|
||||||
|
private PmsProjectTestsheetMapper pmsProjectTestsheetMapper;
|
||||||
|
@Resource
|
||||||
|
private PmsProjectMapper pmsProjectMapper;
|
||||||
|
@Resource
|
||||||
|
private ForgeIssuesMapper forgeIssuesMapper;
|
||||||
|
|
||||||
|
|
||||||
public JSONObject selectPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
public JSONObject selectPmsProjectIssuesList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
||||||
|
|
@ -92,6 +107,7 @@ public class PmsProjectIssuesService {
|
||||||
for (int i = 0; i < issues.size(); i++) {
|
for (int i = 0; i < issues.size(); i++) {
|
||||||
JSONObject issue = issues.getJSONObject(i);
|
JSONObject issue = issues.getJSONObject(i);
|
||||||
setIssueAssignersState(issue, gitlinkUserNickNameMap);
|
setIssueAssignersState(issue, gitlinkUserNickNameMap);
|
||||||
|
setIssuePmsProjectName(issue);
|
||||||
issues.set(i, issue);
|
issues.set(i, issue);
|
||||||
}
|
}
|
||||||
issueListResult.put("issues", issues);
|
issueListResult.put("issues", issues);
|
||||||
|
|
@ -99,6 +115,60 @@ public class PmsProjectIssuesService {
|
||||||
return issueListResult;
|
return issueListResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject enrichProjectIssueList(JSONObject issueListResult) {
|
||||||
|
HashMap<Long, String> gitlinkUserNickNameMap = new HashMap<>();
|
||||||
|
if (issueListResult.containsKey("this_week_all_issues")) {
|
||||||
|
JSONArray issues = issueListResult.getJSONArray("this_week_all_issues");
|
||||||
|
if (issues != null) {
|
||||||
|
for (int i = 0; i < issues.size(); i++) {
|
||||||
|
JSONObject issue = issues.getJSONObject(i);
|
||||||
|
setIssueAssignersState(issue, gitlinkUserNickNameMap);
|
||||||
|
setIssuePmsProjectName(issue);
|
||||||
|
issues.set(i, issue);
|
||||||
|
}
|
||||||
|
issueListResult.put("this_week_all_issues", issues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (issueListResult.containsKey("next_week_all_issues")) {
|
||||||
|
JSONArray issues = issueListResult.getJSONArray("next_week_all_issues");
|
||||||
|
if (issues != null) {
|
||||||
|
for (int i = 0; i < issues.size(); i++) {
|
||||||
|
JSONObject issue = issues.getJSONObject(i);
|
||||||
|
setIssueAssignersState(issue, gitlinkUserNickNameMap);
|
||||||
|
setIssuePmsProjectName(issue);
|
||||||
|
issues.set(i, issue);
|
||||||
|
}
|
||||||
|
issueListResult.put("next_week_all_issues", issues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (issueListResult.containsKey("close_task_issues")) {
|
||||||
|
JSONArray issues = issueListResult.getJSONArray("close_task_issues");
|
||||||
|
if (issues != null) {
|
||||||
|
for (int i = 0; i < issues.size(); i++) {
|
||||||
|
JSONObject issue = issues.getJSONObject(i);
|
||||||
|
setIssueAssignersState(issue, gitlinkUserNickNameMap);
|
||||||
|
setIssuePmsProjectName(issue);
|
||||||
|
issues.set(i, issue);
|
||||||
|
}
|
||||||
|
issueListResult.put("close_task_issues", issues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return issueListResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setIssuePmsProjectName(JSONObject issue) {
|
||||||
|
if (issue.containsKey("pm_project_id")) {
|
||||||
|
Long pmProjectId = issue.getLong("pm_project_id");
|
||||||
|
if (pmProjectId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PmsProject pmsProject = pmsProjectMapper.selectPmsProjectById(pmProjectId);
|
||||||
|
if (pmsProject != null) {
|
||||||
|
issue.put("pm_project_name", pmsProject.getProjectName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public JSONObject insertPmsProjectIssuesRestricted(PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
public JSONObject insertPmsProjectIssuesRestricted(PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||||
PmsProject pmsProject = pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesInputVo.getPmProjectId());
|
PmsProject pmsProject = pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesInputVo.getPmProjectId());
|
||||||
if (pmsProject.getPmsProductId() != null
|
if (pmsProject.getPmsProductId() != null
|
||||||
|
|
@ -115,6 +185,11 @@ public class PmsProjectIssuesService {
|
||||||
return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.CREATE_ISSUE(), issueInput);
|
return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.CREATE_ISSUE(), issueInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject insertPmsProjectWeeklyReportIssues(PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||||
|
JSONObject issueInput = convertPmsProjectIssuesInputVoToIssueInputJSON(pmsProjectIssuesInputVo);
|
||||||
|
return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.CREATE_ISSUE(), issueInput);
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject updatePmsProjectIssues(Long id, PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
public JSONObject updatePmsProjectIssues(Long id, PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||||
PmsProject pmsProject = pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesInputVo.getPmProjectId());
|
PmsProject pmsProject = pmsProjectService.selectAndCheckPmsProjectById(pmsProjectIssuesInputVo.getPmProjectId());
|
||||||
|
|
@ -152,7 +227,7 @@ public class PmsProjectIssuesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (PmsConstants.PROJECT_ISSUE_TYPE_WEEKLY_REPORT.equals(updatedIssue.getString("pm_issue_type"))
|
if (PmsConstants.PROJECT_ISSUE_TYPE_PERSONAL_WEEKLY_REPORT.equals(updatedIssue.getString("pm_issue_type"))
|
||||||
&& updatedIssue.getString("root_id") != null
|
&& updatedIssue.getString("root_id") != null
|
||||||
&& !updatedIssue.getJSONObject("author").getLong("id").equals(SecurityUtils.getGitlinkUserId())) {
|
&& !updatedIssue.getJSONObject("author").getLong("id").equals(SecurityUtils.getGitlinkUserId())) {
|
||||||
throw new ServiceException("非本人周报,不可编辑");
|
throw new ServiceException("非本人周报,不可编辑");
|
||||||
|
|
@ -161,6 +236,27 @@ public class PmsProjectIssuesService {
|
||||||
return gitLinkRequestHelper.doPut(PmsGitLinkRequestUrl.UPDATE_ISSUE(id), issueInput);
|
return gitLinkRequestHelper.doPut(PmsGitLinkRequestUrl.UPDATE_ISSUE(id), issueInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject updatePmsProjectWeeklyReportIssues(Long id, PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||||
|
JSONObject updatedIssue;
|
||||||
|
try {
|
||||||
|
updatedIssue = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE(id, null));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
isIssueCreatedByCurrentUser(updatedIssue);
|
||||||
|
JSONObject issueInput = convertPmsProjectIssuesInputVoToIssueInputJSON(pmsProjectIssuesInputVo);
|
||||||
|
return gitLinkRequestHelper.doPut(PmsGitLinkRequestUrl.UPDATE_ISSUE(id), issueInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void isIssueCreatedByCurrentUser(JSONObject updatedIssue) {
|
||||||
|
if ((PmsConstants.PROJECT_ISSUE_TYPE_PERSONAL_WEEKLY_REPORT.equals(updatedIssue.getString("pm_issue_type"))
|
||||||
|
|| PmsConstants.PROJECT_ISSUE_TYPE_GROUP_WEEKLY_REPORT.equals(updatedIssue.getString("pm_issue_type")))
|
||||||
|
&& updatedIssue.getString("root_id") != null
|
||||||
|
&& !updatedIssue.getJSONObject("author").getLong("id").equals(SecurityUtils.getGitlinkUserId())) {
|
||||||
|
throw new ServiceException("非本人周报,不可编辑");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public JSONObject batchUpdatePmsProjectIssues(Long pmProjectId, PmsProjectIssuesBatchUpdateVo pmsProjectIssuesUpdateVo) {
|
public JSONObject batchUpdatePmsProjectIssues(Long pmProjectId, PmsProjectIssuesBatchUpdateVo pmsProjectIssuesUpdateVo) {
|
||||||
pmsProjectService.selectAndCheckPmsProjectById(pmProjectId);
|
pmsProjectService.selectAndCheckPmsProjectById(pmProjectId);
|
||||||
//转换为issue入参
|
//转换为issue入参
|
||||||
|
|
@ -180,6 +276,17 @@ public class PmsProjectIssuesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject selectPmsProjectIssueByIdAndEnterPrise(Long id, String enterpriseIdentifier) {
|
||||||
|
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||||
|
try {
|
||||||
|
JSONObject result = setProjectIssueUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE(id, null)));
|
||||||
|
result.put("pm_enterprise_name", pmsEnterprise.getEnterpriseName());
|
||||||
|
return result;
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public JSONObject selectPmsProjectIssueByIdNoCheckRole(Long id, Long pmProjectId) {
|
public JSONObject selectPmsProjectIssueByIdNoCheckRole(Long id, Long pmProjectId) {
|
||||||
PmsProject pmsProject = pmsProjectService.selectPmsProjectByIdNoCheckRole(pmProjectId);
|
PmsProject pmsProject = pmsProjectService.selectPmsProjectByIdNoCheckRole(pmProjectId);
|
||||||
try {
|
try {
|
||||||
|
|
@ -309,6 +416,17 @@ public class PmsProjectIssuesService {
|
||||||
return gitLinkRequestHelper.doDelete(PmsGitLinkRequestUrl.DELETE_ISSUES_BATCH(pmProjectId), jsonObject);
|
return gitLinkRequestHelper.doDelete(PmsGitLinkRequestUrl.DELETE_ISSUES_BATCH(pmProjectId), jsonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject deletePmsProjectWeeklyReportIssueByIds(Long id) {
|
||||||
|
JSONObject updatedIssue;
|
||||||
|
try {
|
||||||
|
updatedIssue = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ISSUE(id, null));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
isIssueCreatedByCurrentUser(updatedIssue);
|
||||||
|
return gitLinkRequestHelper.doDelete(PmsGitLinkRequestUrl.DELETE_WEEKLY_REPORT_ISSUE(id));
|
||||||
|
}
|
||||||
|
|
||||||
public JSONObject selectPmsProjectIssueStatus() {
|
public JSONObject selectPmsProjectIssueStatus() {
|
||||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_REPO_ISSUE_DEFAULT_STATUS());
|
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_REPO_ISSUE_DEFAULT_STATUS());
|
||||||
}
|
}
|
||||||
|
|
@ -574,4 +692,108 @@ public class PmsProjectIssuesService {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JSONObject getPersonalIssuesStatistics(String enterpriseIdentifier, PmsPersonalWeeklyReportSearchVo pmsPersonalWeeklyReportSearchVo) {
|
||||||
|
Long gitlinkUserId = SecurityUtils.getGitlinkUserId();
|
||||||
|
pmsPersonalWeeklyReportSearchVo.setUserId(gitlinkUserId);
|
||||||
|
pmsPersonalWeeklyReportSearchVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
|
JSONObject issueSearch = new JSONObject();
|
||||||
|
convertObjectToJSONObject(pmsPersonalWeeklyReportSearchVo, issueSearch, null);
|
||||||
|
try {
|
||||||
|
return enrichProjectIssueList(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_WEEKLY_ISSUES_PERSONAL(issueSearch)));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getProjectTeamIssuesStatistics(String enterpriseIdentifier) {
|
||||||
|
List<Long> pmProjectIds = pmsProjectService.selectProjectIdsByAssigneeUserId(enterpriseIdentifier, SecurityUtils.getGitlinkUserId());
|
||||||
|
String pmProjectIdsStr = StringUtils.join(pmProjectIds, ",");
|
||||||
|
JSONObject result = gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_WEEKLY_ISSUES_GROUP(enterpriseIdentifier, pmProjectIdsStr));
|
||||||
|
enrichProjectInfo(result);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enrichProjectInfo(JSONObject inputJson) {
|
||||||
|
if (inputJson == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 遍历最外层 key
|
||||||
|
for (String projectIdStr : inputJson.keySet()) {
|
||||||
|
Long projectId;
|
||||||
|
try {
|
||||||
|
projectId = Long.valueOf(projectIdStr); // 转换为 Long
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// 非数字字符串跳过处理
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 查询项目信息
|
||||||
|
PmsProject project = pmsProjectMapper.selectPmsProjectById(projectId);
|
||||||
|
|
||||||
|
JSONObject innerData = inputJson.getJSONObject(projectIdStr);
|
||||||
|
if (project != null) {
|
||||||
|
// 将项目信息转换为 JSONObject
|
||||||
|
JSONObject projectInfo = new JSONObject();
|
||||||
|
projectInfo.put("projectId", project.getId());
|
||||||
|
projectInfo.put("projectName", project.getProjectName());
|
||||||
|
projectInfo.put("enterpriseId", project.getPmsEnterpriseId());
|
||||||
|
projectInfo.put("createdTime", project.getCreateTime());
|
||||||
|
// 将 projectInfo 插入到原 JSON 的对应层级中
|
||||||
|
|
||||||
|
innerData.put("project_info", projectInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统计新建迭代数
|
||||||
|
innerData.put("this_week_new_sprint_count", pmsProjectSprintMapper.selectNewSprintCurrentNaturalWeekCount(projectId));
|
||||||
|
// 统计完成迭代数
|
||||||
|
innerData.put("this_week_complete_sprint_count", pmsProjectSprintMapper.selectCompleteSprintCurrentNaturalWeekCount(projectId));
|
||||||
|
// 统计新建测试单数
|
||||||
|
innerData.put("this_week_new_test_sheet_count", pmsProjectTestsheetMapper.selectNewTestSheetCurrentNaturalWeekCount(projectId));
|
||||||
|
// 统计完成测试单数
|
||||||
|
innerData.put("this_week_complete_test_sheet_count", pmsProjectTestsheetMapper.selectCompleteTestSheetCurrentNaturalWeekCount(projectId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getProjectIssueList(PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo) {
|
||||||
|
List<Long> pmProjectIds = pmsProjectService.selectProjectIdsByAssigneeUserId(
|
||||||
|
pmsProjectIssuesSearchVo.getEnterpriseIdentifier(),
|
||||||
|
StringUtils.isEmpty(pmsProjectIssuesSearchVo.getAssignerId()) ? SecurityUtils.getGitlinkUserId() : Long.valueOf(pmsProjectIssuesSearchVo.getAssignerId()));
|
||||||
|
String pmProjectIdsStr = StringUtils.join(pmProjectIds, ",");
|
||||||
|
pmsProjectIssuesSearchVo.setPmProjectIds(pmProjectIdsStr);
|
||||||
|
JSONObject issueSearch = new JSONObject();
|
||||||
|
convertObjectToJSONObject(pmsProjectIssuesSearchVo, issueSearch, null);
|
||||||
|
try {
|
||||||
|
return setProjectIssueListUserState(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_GROUP_ISSUE_LIST(issueSearch)));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getPersonalIssueList(PmsPersonalWeeklyIssuesSearchVo pmsPersonalWeeklyIssuesSearchVo) {
|
||||||
|
pmsPersonalWeeklyIssuesSearchVo.setUserId(pmsPersonalWeeklyIssuesSearchVo.getUserId() == null ? SecurityUtils.getGitlinkUserId() : pmsPersonalWeeklyIssuesSearchVo.getUserId());
|
||||||
|
JSONObject issueSearch = new JSONObject();
|
||||||
|
convertObjectToJSONObject(pmsPersonalWeeklyIssuesSearchVo, issueSearch, null);
|
||||||
|
try {
|
||||||
|
return enrichProjectIssueList(gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_PERSONAL_ISSUE_LIST(issueSearch)));
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean updateIssueEnterpriseIdentifier() {
|
||||||
|
Long currentUserId = SecurityUtils.getGitlinkUserId();
|
||||||
|
if (currentUserId == null || currentUserId != 831) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
List<ForgeIssues> forgeIssuesList = forgeIssuesMapper.getBriefIssues();
|
||||||
|
for (ForgeIssues forgeIssues : forgeIssuesList) {
|
||||||
|
String enterpriseIdentifier = pmsProjectMapper.selectEnterpriseIdentifierByProjectId(forgeIssues.getPmProjectId());
|
||||||
|
if (enterpriseIdentifier != null) {
|
||||||
|
forgeIssues.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||||
|
forgeIssuesMapper.updateForIssues(forgeIssues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@ public class PmsProjectRepositoryServiceImpl implements IPmsProjectRepositorySer
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPmsProjectRepository(PmsProjectRepository pmsProjectRepository) {
|
public int insertPmsProjectRepository(PmsProjectRepository pmsProjectRepository) {
|
||||||
pmsProjectService.selectAndCheckPmsProjectById(pmsProjectRepository.getPmsProjectId());
|
|
||||||
//仓库已被关联,返回错误提示
|
//仓库已被关联,返回错误提示
|
||||||
if (pmsProjectRepositoryMapper.countPmsProjectRepositoryByProjectRepositoryId(pmsProjectRepository.getProjectRepositoryId()) > 0) {
|
if (pmsProjectRepositoryMapper.countPmsProjectRepositoryByProjectRepositoryId(pmsProjectRepository.getProjectRepositoryId()) > 0) {
|
||||||
throw new ServiceException("代码库id:[%s]已被关联", pmsProjectRepository.getProjectRepositoryId());
|
throw new ServiceException("代码库id:[%s]已被关联", pmsProjectRepository.getProjectRepositoryId());
|
||||||
|
|
|
||||||
|
|
@ -396,6 +396,11 @@ public class PmsProjectServiceImpl implements IPmsProjectService {
|
||||||
return pmsProject;
|
return pmsProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> selectProjectIdsByAssigneeUserId(String enterpriseIdentifier, Long gitlinkUserId) {
|
||||||
|
return pmsProjectMapper.selectProjectIdsByAssigneeUserId(enterpriseIdentifier, gitlinkUserId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PmsProject selectAndCheckPmsProjectById(String idStr) {
|
public PmsProject selectAndCheckPmsProjectById(String idStr) {
|
||||||
if (StringUtils.isEmpty(idStr)) {
|
if (StringUtils.isEmpty(idStr)) {
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,14 @@ public class PmsConstants {
|
||||||
public final static String PROJECT_ISSUE_TYPE_BUG = "3";
|
public final static String PROJECT_ISSUE_TYPE_BUG = "3";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目工作项——周报类型
|
* 项目工作项——个人周报类型
|
||||||
*/
|
*/
|
||||||
public final static String PROJECT_ISSUE_TYPE_WEEKLY_REPORT = "4";
|
public final static String PROJECT_ISSUE_TYPE_PERSONAL_WEEKLY_REPORT = "4";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目工作项——项目组周报类型
|
||||||
|
*/
|
||||||
|
public final static String PROJECT_ISSUE_TYPE_GROUP_WEEKLY_REPORT = "5";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 疑修筛选类型-全部
|
* 疑修筛选类型-全部
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,9 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
||||||
|
|
||||||
public static GitLinkRequestUrl GET_ISSUE(Long id, Long pmProjectId) throws URISyntaxException {
|
public static GitLinkRequestUrl GET_ISSUE(Long id, Long pmProjectId) throws URISyntaxException {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put("pm_project_id", String.valueOf(pmProjectId));
|
if (pmProjectId != null) {
|
||||||
|
params.put("pm_project_id", String.valueOf(pmProjectId));
|
||||||
|
}
|
||||||
return getGitLinkRequestUrl(buildUri(String.format(
|
return getGitLinkRequestUrl(buildUri(String.format(
|
||||||
"/api/pm/issues/%s", id), params
|
"/api/pm/issues/%s", id), params
|
||||||
));
|
));
|
||||||
|
|
@ -164,6 +166,12 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl DELETE_WEEKLY_REPORT_ISSUE(Long id) {
|
||||||
|
return getGitLinkRequestUrl(String.format(
|
||||||
|
"/api/pm/issues/%s", id
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public static GitLinkRequestUrl DELETE_ISSUES_BATCH(Long pmProjectId) {
|
public static GitLinkRequestUrl DELETE_ISSUES_BATCH(Long pmProjectId) {
|
||||||
String path = String.format("/api/pm/issues/batch_destroy?pm_project_id=%s", pmProjectId);
|
String path = String.format("/api/pm/issues/batch_destroy?pm_project_id=%s", pmProjectId);
|
||||||
return getGitLinkRequestUrl(path);
|
return getGitLinkRequestUrl(path);
|
||||||
|
|
@ -439,4 +447,25 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
||||||
public static GitLinkRequestUrl GET_ACTION_RUN_DATA(String owner, String workflows) {
|
public static GitLinkRequestUrl GET_ACTION_RUN_DATA(String owner, String workflows) {
|
||||||
return getGitLinkRequestUrl(String.format("/api/pm/action_runs?owner_id=%s&workflows=%s", owner, workflows), "data");
|
return getGitLinkRequestUrl(String.format("/api/pm/action_runs?owner_id=%s&workflows=%s", owner, workflows), "data");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_WEEKLY_ISSUES_PERSONAL(JSONObject issueSearch) throws URISyntaxException {
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
buildUri("/api/pm/weekly_issues/personal.json", issueSearch));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_WEEKLY_ISSUES_GROUP(String enterpriseIdentifier, String pmProjectIds){
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
String.format("/api/pm/weekly_issues/group.json?enterprise_identifier=%s&pm_project_ids=%s", enterpriseIdentifier, pmProjectIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_GROUP_ISSUE_LIST(JSONObject params) throws URISyntaxException {
|
||||||
|
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
buildUri("/api/pm/weekly_issues/group_issues.json", params));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GitLinkRequestUrl GET_PERSONAL_ISSUE_LIST(JSONObject issueSearch) throws URISyntaxException {
|
||||||
|
return getGitLinkRequestUrl(
|
||||||
|
buildUri("/api/pm/weekly_issues/personal_issues.json", issueSearch));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?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.pms.project.mapper.ForgeIssuesMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.microservices.pms.project.domain.ForgeIssues">
|
||||||
|
<id column="id" property="id" jdbcType="INTEGER" />
|
||||||
|
<result column="tracker_id" property="trackerId" jdbcType="INTEGER" />
|
||||||
|
<result column="project_id" property="projectId" jdbcType="INTEGER" />
|
||||||
|
<result column="subject" property="subject" jdbcType="VARCHAR" />
|
||||||
|
<result column="due_date" property="dueDate" jdbcType="DATE" />
|
||||||
|
<result column="category_id" property="categoryId" jdbcType="INTEGER" />
|
||||||
|
<result column="status_id" property="statusId" jdbcType="INTEGER" />
|
||||||
|
<result column="assigned_to_id" property="assignedToId" jdbcType="INTEGER" />
|
||||||
|
<result column="priority_id" property="priorityId" jdbcType="INTEGER" />
|
||||||
|
<result column="fixed_version_id" property="fixedVersionId" jdbcType="INTEGER" />
|
||||||
|
<result column="author_id" property="authorId" jdbcType="INTEGER" />
|
||||||
|
<result column="created_on" property="createdOn" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="updated_on" property="updatedOn" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="start_date" property="startDate" jdbcType="DATE" />
|
||||||
|
<result column="done_ratio" property="doneRatio" jdbcType="INTEGER" />
|
||||||
|
<result column="estimated_hours" property="estimatedHours" jdbcType="REAL" />
|
||||||
|
<result column="parent_id" property="parentId" jdbcType="INTEGER" />
|
||||||
|
<result column="root_id" property="rootId" jdbcType="INTEGER" />
|
||||||
|
<result column="lft" property="lft" jdbcType="INTEGER" />
|
||||||
|
<result column="rgt" property="rgt" jdbcType="INTEGER" />
|
||||||
|
<result column="is_private" property="isPrivate" jdbcType="BIT" />
|
||||||
|
<result column="closed_on" property="closedOn" jdbcType="TIMESTAMP" />
|
||||||
|
<result column="project_issues_index" property="projectIssuesIndex" jdbcType="INTEGER" />
|
||||||
|
<result column="issue_type" property="issueType" jdbcType="VARCHAR" />
|
||||||
|
<result column="token" property="token" jdbcType="INTEGER" />
|
||||||
|
<result column="issue_tags_value" property="issueTagsValue" jdbcType="VARCHAR" />
|
||||||
|
<result column="is_lock" property="isLock" jdbcType="BIT" />
|
||||||
|
<result column="issue_classify" property="issueClassify" jdbcType="VARCHAR" />
|
||||||
|
<result column="ref_name" property="refName" jdbcType="VARCHAR" />
|
||||||
|
<result column="branch_name" property="branchName" jdbcType="VARCHAR" />
|
||||||
|
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||||
|
<result column="blockchain_token_num" property="blockchainTokenNum" jdbcType="INTEGER" />
|
||||||
|
<result column="pm_project_id" property="pmProjectId" jdbcType="BIGINT" />
|
||||||
|
<result column="pm_sprint_id" property="pmSprintId" jdbcType="BIGINT" />
|
||||||
|
<result column="pm_issue_type" property="pmIssueType" jdbcType="INTEGER" />
|
||||||
|
<result column="time_scale" property="timeScale" jdbcType="DECIMAL" />
|
||||||
|
<result column="child_count" property="childCount" jdbcType="INTEGER" />
|
||||||
|
<result column="changer_id" property="changerId" jdbcType="BIGINT" />
|
||||||
|
<result column="fake_id" property="fakeId" jdbcType="INTEGER" />
|
||||||
|
<result column="enterprise_identifier" property="enterpriseIdentifier" jdbcType="VARCHAR" />
|
||||||
|
</resultMap>
|
||||||
|
<update id="updateForIssues">
|
||||||
|
UPDATE issues
|
||||||
|
set enterprise_identifier = #{enterpriseIdentifier}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getBriefIssues" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
id, pm_project_id, enterprise_identifier
|
||||||
|
FROM
|
||||||
|
issues
|
||||||
|
WHERE pm_project_id IS NOT NULL AND (enterprise_identifier IS NULL OR enterprise_identifier = '');
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -173,6 +173,19 @@
|
||||||
from pms_project
|
from pms_project
|
||||||
<include refid="selectWhereBySearchVo"/>
|
<include refid="selectWhereBySearchVo"/>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectProjectIdsByAssigneeUserId" resultType="java.lang.Long">
|
||||||
|
select pp.id
|
||||||
|
from pms_project pp
|
||||||
|
left join pms_enterprise pe on pe.id = pp.pms_enterprise_id
|
||||||
|
where pp.project_assignee_id = #{gitlinkUserId}
|
||||||
|
and pe.enterprise_identifier = #{enterpriseIdentifier}
|
||||||
|
</select>
|
||||||
|
<select id="selectEnterpriseIdentifierByProjectId" resultType="java.lang.String">
|
||||||
|
select pe.enterprise_identifier
|
||||||
|
from pms_project pp
|
||||||
|
left join pms_enterprise pe on pe.id = pp.pms_enterprise_id
|
||||||
|
where pp.id = #{pmProjectId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertPmsProject" parameterType="PmsProject" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertPmsProject" parameterType="PmsProject" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into pms_project
|
insert into pms_project
|
||||||
|
|
|
||||||
|
|
@ -221,4 +221,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE pms_project_id = #{pmProjectId} AND status = 2
|
WHERE pms_project_id = #{pmProjectId} AND status = 2
|
||||||
) AS `closed_sprint_count`
|
) AS `closed_sprint_count`
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectNewSprintCurrentNaturalWeekCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from pms_project_sprint
|
||||||
|
where pms_project_id = #{projectId}
|
||||||
|
AND create_time <![CDATA[ >= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w')
|
||||||
|
AND create_time <![CDATA[ <= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w') + INTERVAL 6 DAY
|
||||||
|
</select>
|
||||||
|
<select id="selectCompleteSprintCurrentNaturalWeekCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from pms_project_sprint
|
||||||
|
where pms_project_id = #{projectId}
|
||||||
|
AND status = 2
|
||||||
|
AND update_time <![CDATA[ >= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w')
|
||||||
|
AND update_time <![CDATA[ <= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w') + INTERVAL 6 DAY
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -53,6 +53,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectCountBySprintId" resultType="java.lang.Integer">
|
<select id="selectCountBySprintId" resultType="java.lang.Integer">
|
||||||
select count(*) from pms_project_testsheet where project_sprint_id = #{sprintId}
|
select count(*) from pms_project_testsheet where project_sprint_id = #{sprintId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectNewTestSheetCurrentNaturalWeekCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from pms_project_testsheet
|
||||||
|
where pms_project_id = #{projectId}
|
||||||
|
AND create_time <![CDATA[ >= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w')
|
||||||
|
AND create_time <![CDATA[ <= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w') + INTERVAL 6 DAY
|
||||||
|
</select>
|
||||||
|
<select id="selectCompleteTestSheetCurrentNaturalWeekCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from pms_project_testsheet
|
||||||
|
where pms_project_id = #{projectId}
|
||||||
|
AND status = 2
|
||||||
|
AND update_time <![CDATA[ >= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w')
|
||||||
|
AND update_time <![CDATA[ <= ]]> STR_TO_DATE(DATE_FORMAT(NOW(), '%Y-%V-1'), '%Y-%U-%w') + INTERVAL 6 DAY
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertPmsProjectTestsheet" parameterType="PmsProjectTestsheet" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertPmsProjectTestsheet" parameterType="PmsProjectTestsheet" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into pms_project_testsheet
|
insert into pms_project_testsheet
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.microservices.wiki.contoller.sys;
|
package com.microservices.wiki.controller.sys;
|
||||||
|
|
||||||
|
|
||||||
import com.microservices.common.core.web.domain.AjaxResult;
|
import com.microservices.common.core.web.domain.AjaxResult;
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
package com.microservices.wiki.contoller.wiki;
|
package com.microservices.wiki.controller.wiki;
|
||||||
|
|
||||||
|
import com.microservices.common.core.constant.HttpStatus;
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
import com.microservices.common.core.web.domain.AjaxResult;
|
import com.microservices.common.core.web.domain.AjaxResult;
|
||||||
import com.microservices.wiki.domain.sys.User;
|
import com.microservices.wiki.domain.sys.User;
|
||||||
import com.microservices.wiki.domain.wiki.Wiki;
|
import com.microservices.wiki.domain.wiki.Wiki;
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiAllVo;
|
import com.microservices.wiki.domain.wiki.vo.*;
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiContent;
|
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiDeleteVo;
|
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiPageVo;
|
|
||||||
import com.microservices.wiki.refactoring.response.HttpClientResult;
|
import com.microservices.wiki.refactoring.response.HttpClientResult;
|
||||||
import com.microservices.wiki.refactoring.utils.BeanCopyUtils;
|
import com.microservices.wiki.refactoring.utils.BeanCopyUtils;
|
||||||
import com.microservices.wiki.refactoring.utils.FastJsonUtils;
|
import com.microservices.wiki.refactoring.utils.FastJsonUtils;
|
||||||
|
|
@ -36,6 +34,9 @@ public class WikiController {
|
||||||
@Value("${gitea-wiki-api-base-url}")
|
@Value("${gitea-wiki-api-base-url}")
|
||||||
private String giteaApiBaseUrl;
|
private String giteaApiBaseUrl;
|
||||||
|
|
||||||
|
@Value("${gitea-hat-wiki-api-base-url}")
|
||||||
|
private String giteaHatApiBaseUrl;
|
||||||
|
|
||||||
@Value("${gitea-wiki-token}")
|
@Value("${gitea-wiki-token}")
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
|
|
@ -138,6 +139,44 @@ public class WikiController {
|
||||||
return new AjaxResult(httpClientResult.getCode(), "", httpClientResult.getContent());
|
return new AjaxResult(httpClientResult.getCode(), "", httpClientResult.getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("getWikiRevisions")
|
||||||
|
@GetMapping("/getWikiRevisions")
|
||||||
|
public AjaxResult getWikiRevisions(
|
||||||
|
HttpServletRequest request,
|
||||||
|
@ApiParam(value = "owner of the repo", required = true) @RequestParam(defaultValue = "") String owner,
|
||||||
|
@ApiParam(value = "name of the repo", required = true) @RequestParam(defaultValue = "") String repo,
|
||||||
|
@ApiParam(value = "name of the wikipage", required = true) @RequestParam(defaultValue = "") String pageName,
|
||||||
|
@ApiParam(value = "id of the project", required = true) @RequestParam(defaultValue = "") Integer projectId) throws Exception {
|
||||||
|
String giteaToken = wikiService.getGiteaToken(request, projectId);
|
||||||
|
//未获取有效giteaToken时,赋值内置giteaToken
|
||||||
|
giteaToken = giteaToken == null ? token : giteaToken;
|
||||||
|
WikiRevisionsVo wikiRevisionsVo = wikiService.getWikiRevisions(owner, repo, pageName, giteaApiDomain+giteaApiBaseUrl, giteaToken);
|
||||||
|
return new AjaxResult(HttpStatus.SUCCESS,"操作成功", wikiRevisionsVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("getPreviousWiki")
|
||||||
|
@GetMapping("/getPreviousWiki")
|
||||||
|
public AjaxResult getPreviousWiki(
|
||||||
|
HttpServletRequest request,
|
||||||
|
@ApiParam(value = "owner of the repo", required = true) @RequestParam(defaultValue = "") String owner,
|
||||||
|
@ApiParam(value = "name of the repo", required = true) @RequestParam(defaultValue = "") String repo,
|
||||||
|
@ApiParam(value = "name of the wikipage", required = true) @RequestParam(defaultValue = "") String pageName,
|
||||||
|
@ApiParam(value = "id of the project", required = true) @RequestParam(defaultValue = "") Integer projectId,
|
||||||
|
@ApiParam(value = "sha of the project", required = true) @RequestParam(defaultValue = "") String sha) throws Exception {
|
||||||
|
String giteaToken = wikiService.getGiteaToken(request, projectId);
|
||||||
|
//未获取有效giteaToken时,赋值内置giteaToken
|
||||||
|
giteaToken = giteaToken == null ? token : giteaToken;
|
||||||
|
HttpClientResult httpClientResult = wikiService.getPreviousWiki(owner, repo, pageName, sha, giteaApiDomain+giteaHatApiBaseUrl, giteaToken);
|
||||||
|
if (httpClientResult == null) {
|
||||||
|
throw new ServiceException("获取wiki历史版本数据异常");
|
||||||
|
}
|
||||||
|
if (httpClientResult.getCode() != 200) {
|
||||||
|
return new AjaxResult(httpClientResult.getCode(),"操作失败", httpClientResult.getContent());
|
||||||
|
}
|
||||||
|
WikiContent wikiContent = getWikiContent(httpClientResult);
|
||||||
|
return new AjaxResult(httpClientResult.getCode(), "操作成功", wikiContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -150,7 +189,10 @@ public class WikiController {
|
||||||
WikiContent wikiContent = FastJsonUtils.toBean(httpClientResult.getContent(), WikiContent.class);
|
WikiContent wikiContent = FastJsonUtils.toBean(httpClientResult.getContent(), WikiContent.class);
|
||||||
if (wikiContent != null && wikiContent.getLast_commit() != null
|
if (wikiContent != null && wikiContent.getLast_commit() != null
|
||||||
&& wikiContent.getLast_commit().getAuthor() != null) {
|
&& wikiContent.getLast_commit().getAuthor() != null) {
|
||||||
wikiContent.setImage_url(userService.getRemoteUserLogoByUserLogin(wikiContent.getLast_commit().getAuthor().getName()));
|
String image_url = userService.getRemoteUserLogoByUserLogin(wikiContent.getLast_commit().getCommiter().getName());
|
||||||
|
wikiContent.setImage_url(image_url);
|
||||||
|
wikiContent.getLast_commit().getCommiter().setImage_url(image_url);
|
||||||
|
wikiContent.getLast_commit().getAuthor().setImage_url(image_url);
|
||||||
User commitUser = userService.getUserByLogin(wikiContent.getLast_commit().getAuthor().getName());
|
User commitUser = userService.getUserByLogin(wikiContent.getLast_commit().getAuthor().getName());
|
||||||
if(commitUser != null){
|
if(commitUser != null){
|
||||||
wikiContent.setUserName(StringUtils.isEmpty(commitUser.getNickname()) ? commitUser.getLogin() : commitUser.getNickname());
|
wikiContent.setUserName(StringUtils.isEmpty(commitUser.getNickname()) ? commitUser.getLogin() : commitUser.getNickname());
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.microservices.wiki.contoller.wiki;
|
package com.microservices.wiki.controller.wiki;
|
||||||
|
|
||||||
|
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
|
|
@ -12,4 +12,6 @@ public class AuthorMessage {
|
||||||
private Date date;
|
private Date date;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
private String image_url;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,6 @@ public class CommitMessage {
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
private AuthorMessage author;
|
private AuthorMessage author;
|
||||||
|
|
||||||
|
private AuthorMessage commiter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.microservices.wiki.domain.wiki.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WikiRevisionsVo {
|
||||||
|
private List<CommitMessage> commits;
|
||||||
|
|
||||||
|
private Integer count;
|
||||||
|
}
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
package com.microservices.wiki.service.wiki;
|
package com.microservices.wiki.service.wiki;
|
||||||
|
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.github.jhonnymertz.wkhtmltopdf.wrapper.Pdf;
|
import com.github.jhonnymertz.wkhtmltopdf.wrapper.Pdf;
|
||||||
import com.github.jhonnymertz.wkhtmltopdf.wrapper.configurations.WrapperConfig;
|
import com.github.jhonnymertz.wkhtmltopdf.wrapper.configurations.WrapperConfig;
|
||||||
import com.github.jhonnymertz.wkhtmltopdf.wrapper.params.Param;
|
import com.github.jhonnymertz.wkhtmltopdf.wrapper.params.Param;
|
||||||
import com.microservices.common.core.exception.ServiceException;
|
import com.microservices.common.core.exception.ServiceException;
|
||||||
|
import com.microservices.common.core.web.domain.AjaxResult;
|
||||||
import com.microservices.wiki.domain.projects.Projects;
|
import com.microservices.wiki.domain.projects.Projects;
|
||||||
|
import com.microservices.wiki.domain.sys.User;
|
||||||
import com.microservices.wiki.domain.sys.UserVo;
|
import com.microservices.wiki.domain.sys.UserVo;
|
||||||
import com.microservices.wiki.domain.wiki.Wiki;
|
import com.microservices.wiki.domain.wiki.Wiki;
|
||||||
import com.microservices.wiki.domain.wiki.WikiContentSimple;
|
import com.microservices.wiki.domain.wiki.WikiContentSimple;
|
||||||
import com.microservices.wiki.domain.wiki.WikiPage;
|
import com.microservices.wiki.domain.wiki.WikiPage;
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiCloneLinkVo;
|
import com.microservices.wiki.domain.wiki.vo.WikiCloneLinkVo;
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiPageVo;
|
import com.microservices.wiki.domain.wiki.vo.WikiPageVo;
|
||||||
|
import com.microservices.wiki.domain.wiki.vo.WikiRevisionsVo;
|
||||||
import com.microservices.wiki.domain.wiki.vo.WikiVo;
|
import com.microservices.wiki.domain.wiki.vo.WikiVo;
|
||||||
import com.microservices.wiki.mapper.members.MembersMapper;
|
import com.microservices.wiki.mapper.members.MembersMapper;
|
||||||
import com.microservices.wiki.mapper.projects.ProjectsMapper;
|
import com.microservices.wiki.mapper.projects.ProjectsMapper;
|
||||||
|
|
@ -20,6 +24,7 @@ import com.microservices.wiki.mapper.team_projects.TeamProjectsMapper;
|
||||||
import com.microservices.wiki.refactoring.response.HttpClientResult;
|
import com.microservices.wiki.refactoring.response.HttpClientResult;
|
||||||
import com.microservices.wiki.refactoring.utils.*;
|
import com.microservices.wiki.refactoring.utils.*;
|
||||||
import com.microservices.wiki.service.sys.UserService;
|
import com.microservices.wiki.service.sys.UserService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -82,9 +87,9 @@ public class WikiService {
|
||||||
urlFormat += "?access_token=" + giteaToken;
|
urlFormat += "?access_token=" + giteaToken;
|
||||||
}
|
}
|
||||||
String completeUrl = giteaApiDomain + urlFormat;
|
String completeUrl = giteaApiDomain + urlFormat;
|
||||||
logger.info("completeUrl:" + completeUrl);
|
logger.info("getWikiPages completeUrl:{}", completeUrl);
|
||||||
HttpClientResult httpClientResult = HttpClientUtils.doGet(completeUrl, null);
|
HttpClientResult httpClientResult = HttpClientUtils.doGet(completeUrl, null);
|
||||||
logger.info("httpClientResultCode:" + httpClientResult.getCode());
|
logger.info("httpClientResultCode:{}", httpClientResult.getCode());
|
||||||
return httpClientResult;
|
return httpClientResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,7 +111,7 @@ public class WikiService {
|
||||||
urlFormat += "?access_token=" + giteaToken;
|
urlFormat += "?access_token=" + giteaToken;
|
||||||
}
|
}
|
||||||
String completeUrl = URL + urlFormat;
|
String completeUrl = URL + urlFormat;
|
||||||
logger.info("completeUrl: " + completeUrl);
|
logger.info("getWiki completeUrl: {}", completeUrl);
|
||||||
return HttpClientUtils.doGet(completeUrl, null, null);
|
return HttpClientUtils.doGet(completeUrl, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +122,7 @@ public class WikiService {
|
||||||
Map<String, String> params;
|
Map<String, String> params;
|
||||||
WikiVo wikiVo = BeanCopyUtils.beanPropertiesCopy(wiki, WikiVo.class);
|
WikiVo wikiVo = BeanCopyUtils.beanPropertiesCopy(wiki, WikiVo.class);
|
||||||
params = ConvertBean.convertToStringMap(wikiVo);
|
params = ConvertBean.convertToStringMap(wikiVo);
|
||||||
logger.info("completeUrl: " + URL + urlFormat);
|
logger.info("completeUrl: {}{}", URL, urlFormat);
|
||||||
String completeUrl = URL + urlFormat;
|
String completeUrl = URL + urlFormat;
|
||||||
return HttpClientUtils.doPost(completeUrl, null, params);
|
return HttpClientUtils.doPost(completeUrl, null, params);
|
||||||
}
|
}
|
||||||
|
|
@ -129,7 +134,7 @@ public class WikiService {
|
||||||
String pageName = wiki.getTitle();
|
String pageName = wiki.getTitle();
|
||||||
String urlFormat = String.format("/repos/%s/%s/wiki/page/%s?access_token=%s", owner, repo, pageName, giteaToken);
|
String urlFormat = String.format("/repos/%s/%s/wiki/page/%s?access_token=%s", owner, repo, pageName, giteaToken);
|
||||||
String completeUrl = URL + urlFormat;
|
String completeUrl = URL + urlFormat;
|
||||||
logger.info("delete completeUrl " + completeUrl);
|
logger.info("delete completeUrl {}", completeUrl);
|
||||||
return HttpClientUtils.doDelete(completeUrl);
|
return HttpClientUtils.doDelete(completeUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,10 +145,52 @@ public class WikiService {
|
||||||
String urlFormat = String.format("/repos/%s/%s/wiki/page/%s?access_token=%s", owner, repo, pageName, giteaToken);
|
String urlFormat = String.format("/repos/%s/%s/wiki/page/%s?access_token=%s", owner, repo, pageName, giteaToken);
|
||||||
WikiVo wikiVo = BeanCopyUtils.beanPropertiesCopy(wiki, WikiVo.class);
|
WikiVo wikiVo = BeanCopyUtils.beanPropertiesCopy(wiki, WikiVo.class);
|
||||||
String completeUrl = URL + urlFormat;
|
String completeUrl = URL + urlFormat;
|
||||||
logger.info("completeUrl: " + completeUrl);
|
logger.info("completeUrl: {}", completeUrl);
|
||||||
return HttpClientUtils.doPatch(completeUrl, ConvertBean.convertToStringMap(wikiVo));
|
return HttpClientUtils.doPatch(completeUrl, ConvertBean.convertToStringMap(wikiVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WikiRevisionsVo getWikiRevisions(String owner, String repo, String pageName, String URL, String giteaToken) throws Exception {
|
||||||
|
String urlFormat = String.format("/repos/%s/%s/wiki/revisions/%s", owner, repo, pageName);
|
||||||
|
if (giteaToken != null) {
|
||||||
|
urlFormat += "?access_token=" + giteaToken;
|
||||||
|
}
|
||||||
|
String completeUrl = URL + urlFormat;
|
||||||
|
logger.info("getWikiRevisions completeUrl: {}", completeUrl);
|
||||||
|
HttpClientResult httpClientResult = HttpClientUtils.doGet(completeUrl, null, null);
|
||||||
|
if (httpClientResult == null) {
|
||||||
|
throw new ServiceException("获取wiki历史版本列表数据异常");
|
||||||
|
}
|
||||||
|
if (httpClientResult.getCode() != 200) {
|
||||||
|
throw new ServiceException(httpClientResult.getCode(),"操作失败", httpClientResult.getContent());
|
||||||
|
}
|
||||||
|
WikiRevisionsVo wikiRevisionsVo = JSON.parseObject(httpClientResult.getContent(), WikiRevisionsVo.class);
|
||||||
|
wikiRevisionsVo.getCommits().forEach(commit -> {
|
||||||
|
commit.getCommiter().setImage_url(userService.getRemoteUserLogoByUserLogin(commit.getCommiter().getName()));
|
||||||
|
User commitUser = userService.getUserByLogin(commit.getCommiter().getName());
|
||||||
|
if(commitUser != null){
|
||||||
|
commit.getCommiter().setName(StringUtils.isEmpty(commitUser.getNickname()) ? commitUser.getLogin() : commitUser.getNickname());
|
||||||
|
}
|
||||||
|
|
||||||
|
commit.getAuthor().setImage_url(userService.getRemoteUserLogoByUserLogin(commit.getAuthor().getName()));
|
||||||
|
User authorUser = userService.getUserByLogin(commit.getAuthor().getName());
|
||||||
|
if(authorUser != null){
|
||||||
|
commit.getAuthor().setName(StringUtils.isEmpty(authorUser.getNickname()) ? authorUser.getLogin() : authorUser.getNickname());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return wikiRevisionsVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpClientResult getPreviousWiki(String owner, String repo, String pageName, String sha, String URL, String giteaToken) throws Exception {
|
||||||
|
String urlFormat = String.format("/repos/%s/%s/wiki/revisions/%s/%s", owner, repo, pageName, sha);
|
||||||
|
if (giteaToken != null) {
|
||||||
|
urlFormat += "?access_token=" + giteaToken;
|
||||||
|
}
|
||||||
|
String completeUrl = URL + urlFormat;
|
||||||
|
logger.info("getPreviousWiki completeUrl: {}", completeUrl);
|
||||||
|
return HttpClientUtils.doGet(completeUrl, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String StringToURLEncode(String s) throws UnsupportedEncodingException {
|
public String StringToURLEncode(String s) throws UnsupportedEncodingException {
|
||||||
s = java.net.URLEncoder.encode(s, "UTF-8").replaceAll("\\+", "-").replaceAll("\\*", "%2A");
|
s = java.net.URLEncoder.encode(s, "UTF-8").replaceAll("\\+", "-").replaceAll("\\*", "%2A");
|
||||||
|
|
@ -224,7 +271,7 @@ public class WikiService {
|
||||||
if (httpClientResult1.getCode() == 200) {
|
if (httpClientResult1.getCode() == 200) {
|
||||||
WikiContentSimple wikiContentSimple = FastJsonUtils.toBean(httpClientResult1.getContent(), WikiContentSimple.class);
|
WikiContentSimple wikiContentSimple = FastJsonUtils.toBean(httpClientResult1.getContent(), WikiContentSimple.class);
|
||||||
fileUtils.writeStringToFile(wikiContentSimple.getContent_base64(), wikiContentSimple.getTitle() + ".md", dirPath);
|
fileUtils.writeStringToFile(wikiContentSimple.getContent_base64(), wikiContentSimple.getTitle() + ".md", dirPath);
|
||||||
logger.info("wikiContent" + wikiContentSimple.getSimple_content());
|
logger.info("wikiContent:{}", wikiContentSimple.getSimple_content());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
downLoadZip(response, repoName, dirPath);
|
downLoadZip(response, repoName, dirPath);
|
||||||
|
|
@ -309,7 +356,7 @@ public class WikiService {
|
||||||
org.apache.commons.io.FileUtils.forceDelete(new File(completeDestPath));
|
org.apache.commons.io.FileUtils.forceDelete(new File(completeDestPath));
|
||||||
org.apache.commons.io.FileUtils.forceDelete(new File(dirPath));
|
org.apache.commons.io.FileUtils.forceDelete(new File(dirPath));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("delete scratch zip file fail: " + completeDestPath);
|
logger.warn("delete scratch zip file fail: {}", completeDestPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -332,7 +379,7 @@ public class WikiService {
|
||||||
try {
|
try {
|
||||||
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
|
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("delete scratch file fail: " + filePath);
|
logger.warn("delete scratch file fail: {}", filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue