forked from Gitlink/microservices
Merge pull request '数据管理模块-成果管理开发' (#865) from liuhuazhong/microservices:feat_chievements_dev into feat_chievements_dev
This commit is contained in:
commit
616bf1229f
|
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-modules</artifactId>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>microservices-modules-dms</artifactId>
|
||||
|
||||
<description>
|
||||
microservices-modules-dms数据管理体系模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Async -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-async</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-log</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!-- 处理访问Gitlink相关接口 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-httpClient</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.shibing624</groupId>
|
||||
<artifactId>similarity</artifactId>
|
||||
<version>1.1.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms;
|
||||
|
||||
import com.microservices.common.security.annotation.EnableCustomConfig;
|
||||
import com.microservices.common.security.annotation.EnableRyFeignClients;
|
||||
import com.microservices.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 项目管理模块
|
||||
*
|
||||
* @author otto
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class MicroservicesDmsApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MicroservicesDmsApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 数据管理体系模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成果团队Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "数据管理体系-成果团队接口")
|
||||
@RequestMapping("/achievementsTeam")
|
||||
public class AchievementTeamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAchievementTeamService achievementTeamService;
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AchievementTeam achievementTeam)
|
||||
{
|
||||
startPage();
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果团队列表
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AchievementTeam achievementTeam)
|
||||
{
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
ExcelUtil<AchievementTeam> util = new ExcelUtil<AchievementTeam>(AchievementTeam.class);
|
||||
util.exportExcel(response, list, "成果团队数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果团队详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(achievementTeamService.selectAchievementTeamById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.insertAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.updateAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(achievementTeamService.deleteAchievementTeamByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/achievements")
|
||||
@Api(tags = "数据管理体系-成果库接口")
|
||||
public class AchievementsController extends BaseController {
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Achievements achievements) {
|
||||
startPage();
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果列表
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Achievements achievements) {
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
ExcelUtil<Achievements> util = new ExcelUtil<Achievements>(Achievements.class);
|
||||
util.exportExcel(response, list, "成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(achievementsService.selectAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.insertAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.updateAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(achievementsService.deleteAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取精选成果")
|
||||
@GetMapping("/getChoiceImport")
|
||||
public AjaxResult getChoiceImport() {
|
||||
return success(achievementsService.getChoiceImport());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果来源对成果数据进行分类统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果来源对成果数据进行分类统计")
|
||||
@GetMapping("/getTjBySources")
|
||||
public AjaxResult getTjBySources() {
|
||||
return success(achievementsService.getTjBySources());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果领域对成功数据进行汇总
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果领域对成果数据进行汇总")
|
||||
@GetMapping("/getTjByAreas")
|
||||
public AjaxResult getTjByAreas() {
|
||||
return success(achievementsService.getTjByAreas());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据领域分类名称,获取领域相关数据
|
||||
*/
|
||||
@ApiOperation("根据领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/getAreasByName")
|
||||
public AjaxResult getAreasByName(String areaName) {
|
||||
return success(achievementsService.getAreasByName(areaName));
|
||||
}
|
||||
|
||||
/* 获取全部成果,根据成果名称、成果领域、成果来源进行查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取全部成果,根据成果名称、成果领域、成果来源进行查询")
|
||||
@GetMapping("/getAllResult")
|
||||
public TableDataInfo getAllResult(AchQueryVo achQueryVo) {
|
||||
startPage();
|
||||
return getDataTable(achievementsService.getAllResult(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("近七日用户行为数据")
|
||||
@GetMapping("/getUerActionData")
|
||||
public AjaxResult getUerActionData() {
|
||||
return success(achievementsService.getUerActionData());
|
||||
}
|
||||
|
||||
@ApiOperation("热门成果")
|
||||
@GetMapping("/getHotAchievement")
|
||||
public AjaxResult getHotAchievement() {
|
||||
return success(achievementsService.getHotAchievement());
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增")
|
||||
@GetMapping("/get7DayAdd")
|
||||
public AjaxResult get7DayAdd(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAdd(achQueryVo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页项目统计")
|
||||
@GetMapping("/indexProjectStatistic")
|
||||
public AjaxResult indexProjectStatistic() {
|
||||
return success(achievementsService.indexProjectStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页task统计")
|
||||
@GetMapping("/indexTaskStatistic")
|
||||
public AjaxResult indexTaskStatistic() {
|
||||
return success(achievementsService.indexTaskStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页Competition统计")
|
||||
@GetMapping("/indexCompetitionStatistic")
|
||||
public AjaxResult indexCompetitionStatistic() {
|
||||
return success(achievementsService.indexCompetitionStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页SchoolEnterprise统计")
|
||||
@GetMapping("/indexSchoolEnterpriseStatistic")
|
||||
public AjaxResult indexSchoolEnterpriseStatistic() {
|
||||
return success(achievementsService.indexSchoolEnterpriseStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页专家统计")
|
||||
@GetMapping("/indexExpertStatistic")
|
||||
public AjaxResult indexExpertStatistic() {
|
||||
return success(achievementsService.indexExpertStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据当前用户以及成果ID,获取当前成果的 是否收藏与关注状态")
|
||||
@GetMapping("/getWatchFavoriteStatusById")
|
||||
public AjaxResult getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return success(achievementsService.getWatchFavoriteStatusById(id, userId));
|
||||
}
|
||||
@ApiOperation("根据成果ID,获取近7日成果点击数量(折线图)")
|
||||
@GetMapping("/get7AddClickById")
|
||||
public AjaxResult get7AddClickById(String id) {
|
||||
return success(achievementsService.get7AddClickById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||
@GetMapping("/getActDataStatisticById")
|
||||
public AjaxResult getActDataStatisticById(Long id) {
|
||||
return success(achievementsService.getActDataStatisticById(id));
|
||||
}
|
||||
/**
|
||||
* 根据领域,将成果数据进行分类
|
||||
*
|
||||
*/
|
||||
@GetMapping("/getAreaStatistic")
|
||||
public AjaxResult getAreaStatistic(String areaKey)
|
||||
{
|
||||
return success(achievementsService.getAreaStatistic(areaKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开源项目的相关成果
|
||||
*/
|
||||
@ApiOperation(value = "获取开源项目的相关成果")
|
||||
@GetMapping("/getRelatedAch")
|
||||
public AjaxResult getRelatedAch(Long id,Long sourceId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAch(id,sourceId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "搜索行为数据记录")
|
||||
@GetMapping("/getSearchResult")
|
||||
public AjaxResult getSearchResult(String achName,Long userId)
|
||||
{
|
||||
return success(achievementsService.getSearchResult(achName,userId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.BigScreenStatisticService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-大屏统计接口")
|
||||
@RequestMapping("/bigScreenStatistic")
|
||||
public class BigScreenStatisticController {
|
||||
|
||||
private final BigScreenStatisticService bigScreenStatisticService;
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementTopStatistic")
|
||||
@ApiOperation(value = "成果任务统计顶部折线图")
|
||||
public AjaxResult getAchievementTopStatistic(String source) {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementTopStatistic(source));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDataYearly")
|
||||
@ApiOperation(value = "年度成果数据")
|
||||
public AjaxResult getAchievementDataYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDataYearly());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementType")
|
||||
@ApiOperation(value = "成果类型")
|
||||
public AjaxResult getAchievementType() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementType());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDomain")
|
||||
@ApiOperation(value = "成果领域分布")
|
||||
public AjaxResult getAchievementDomain() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDomain());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementAddYearly")
|
||||
@ApiOperation(value = "近1年新增成果数")
|
||||
public AjaxResult getAchievementAddYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementAddYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementActData")
|
||||
@ApiOperation(value = "成果行为数据展示")
|
||||
public AjaxResult getAchievementActData() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementActData());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementHotRank")
|
||||
@ApiOperation(value = "成果热度排行")
|
||||
public AjaxResult getAchievementHotRank() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementHotRank());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionTopStatistic")
|
||||
@ApiOperation(value = "competition统计顶部")
|
||||
public AjaxResult getAchievementTopStatistic() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionTopStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionStatisticYearly")
|
||||
@ApiOperation(value = "竞赛数据统计")
|
||||
public AjaxResult getCompetitionStatisticYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionStatisticYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionHot")
|
||||
@ApiOperation(value = "热门竞赛统计")
|
||||
public AjaxResult getCompetitionHot() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionHot());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyPaperAdd")
|
||||
@ApiOperation(value = "年度竞赛作品新增数")
|
||||
public AjaxResult getCompetitionYearlyPaperAdd() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyPaperAdd());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyFinish")
|
||||
@ApiOperation(value = "近1年竞赛完成情况")
|
||||
public AjaxResult getCompetitionYearlyFinish() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyFinish());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.ExpertDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-专家可视化接口")
|
||||
@RequestMapping("/expertDashboard")
|
||||
public class ExpertDashboardController {
|
||||
@Autowired
|
||||
private ExpertDashboardService expertDashboardService;
|
||||
|
||||
@GetMapping(value = "getExpertTotal")
|
||||
@ApiOperation(value = "获取专家总数")
|
||||
public AjaxResult getExpertTotal() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotal());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAuthenticationStatistic")
|
||||
@ApiOperation(value = "专家实名完成度")
|
||||
public AjaxResult getAuthenticationStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getAuthenticationStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTitleRankStatistic")
|
||||
@ApiOperation(value = "专家职称级分布")
|
||||
public AjaxResult getTitleRankStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getTitleRankStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertAduit")
|
||||
@ApiOperation(value = "近一年专家评审作品数")
|
||||
public AjaxResult getExpertAduit() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertTypeStatistic")
|
||||
@ApiOperation(value = "专家专业类别")
|
||||
public AjaxResult getExpertTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getWorkplaceTypeStatistic")
|
||||
@ApiOperation(value = "专家单位类别分布")
|
||||
public AjaxResult getWorkplaceTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getWorkplaceTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getHighestDegreeStatistic")
|
||||
@ApiOperation(value = "专家学历分布")
|
||||
public AjaxResult getHighestDegreeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getHighestDegreeStatistic());
|
||||
}
|
||||
|
||||
//7、年度专家数据统计 cretate_on
|
||||
@GetMapping(value = "getExpertTotalByYear")
|
||||
@ApiOperation(value = "年度专家数据统计")
|
||||
public AjaxResult getExpertTotalByYear() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getReviewAreasStatistic")
|
||||
@ApiOperation(value = "热门专家领域")
|
||||
public AjaxResult getReviewAreasStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getReviewAreasStatistic());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.MemoDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-社区动态可视化接口")
|
||||
@RequestMapping("/memoDashboard")
|
||||
public class MemoDashboardController {
|
||||
@Autowired
|
||||
private MemoDashboardService memoDashboardService;
|
||||
|
||||
@GetMapping(value = "getMemoAduit")
|
||||
@ApiOperation(value = "帖子审核通过率、帖子总数")
|
||||
public AjaxResult getMemoAduit() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getIsOriginalStatistic")
|
||||
@ApiOperation(value = "帖子原创、非原创")
|
||||
public AjaxResult getIsOriginalStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getIsOriginalStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getMemoTotalByYear")
|
||||
@ApiOperation(value = "年度论坛帖子总数")
|
||||
public AjaxResult getMemoTotalByYear() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getForumSectionStatistic(")
|
||||
@ApiOperation(value = "帖子分类")
|
||||
public AjaxResult getForumSectionStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAddMemoStatistic(")
|
||||
@ApiOperation(value = "近一年新增帖子数")
|
||||
public AjaxResult getAddMemoStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTop5Memos(")
|
||||
@ApiOperation(value = "年度帖子热度top5")
|
||||
public AjaxResult getTop5Memos() {
|
||||
return AjaxResult.success(memoDashboardService.getTop5Memos());
|
||||
}
|
||||
|
||||
@GetMapping(value = "get7DayPaise(")
|
||||
@ApiOperation(value = "近7日帖子点赞数")
|
||||
public AjaxResult get7DayPaise() {
|
||||
return AjaxResult.success(memoDashboardService.get7DayPaise());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校企成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Api(tags = "数据管理体系-校企成果接口")
|
||||
@RestController
|
||||
@RequestMapping("/schoolEnterpriseAchievements")
|
||||
public class SchoolEnterpriseAchievementsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISchoolEnterpriseAchievementsService schoolEnterpriseAchievementsService;
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
startPage();
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出校企成果列表
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
ExcelUtil<SchoolEnterpriseAchievements> util = new ExcelUtil<SchoolEnterpriseAchievements>(SchoolEnterpriseAchievements.class);
|
||||
util.exportExcel(response, list, "校企成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校企成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.deleteSchoolEnterpriseAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部统计
|
||||
*/
|
||||
@GetMapping("/topStatistic")
|
||||
@ApiOperation(value = "顶部统计数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags", value = "成果标签", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "成果状态", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
|
||||
Long value = schoolEnterpriseAchievementsService.topStatistic(schoolEnterpriseAchievements);
|
||||
return AjaxResult.success(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchQueryVo {
|
||||
|
||||
private String areaQuery;//领域
|
||||
private String source;//来源
|
||||
private String achievementName;//名称
|
||||
private Long userId;
|
||||
public String getAreaQuery() {
|
||||
return areaQuery;
|
||||
}
|
||||
|
||||
public void setAreaQuery(String areaQuery) {
|
||||
this.areaQuery = areaQuery;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchRelatedVo {
|
||||
private Long id;
|
||||
private String attachments;
|
||||
private String summary;
|
||||
private String achievementType;
|
||||
private String achMonthDay;
|
||||
private String source;
|
||||
private Long sourceId;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchMonthDay() {
|
||||
return achMonthDay;
|
||||
}
|
||||
|
||||
public void setAchMonthDay(String achMonthDay) {
|
||||
this.achMonthDay = achMonthDay;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成果团队对象 achievement_team
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class AchievementTeam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 成果ld */
|
||||
@Excel(name = "成果ld")
|
||||
private Long achievementId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String username;
|
||||
|
||||
/** 所属单位 */
|
||||
@Excel(name = "所属单位")
|
||||
private String company;
|
||||
|
||||
/** 职称 */
|
||||
@Excel(name = "职称")
|
||||
private String technicalTitle;
|
||||
|
||||
/** 专业 */
|
||||
@Excel(name = "专业")
|
||||
private String professionalTitle;
|
||||
|
||||
/** 研究方向 */
|
||||
@Excel(name = "研究方向")
|
||||
private String researchDirection;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "联系方式")
|
||||
private String phone;
|
||||
|
||||
/** 个人简介 */
|
||||
@Excel(name = "个人简介")
|
||||
private String summary;
|
||||
|
||||
/** 本项成果中主要承担工作 */
|
||||
@Excel(name = "本项成果中主要承担工作")
|
||||
private String workContent;
|
||||
|
||||
/** 是否是负责人 */
|
||||
@Excel(name = "是否是负责人")
|
||||
private String isLeader;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAchievementId(Long achievementId)
|
||||
{
|
||||
this.achievementId = achievementId;
|
||||
}
|
||||
|
||||
public Long getAchievementId()
|
||||
{
|
||||
return achievementId;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setCompany(String company)
|
||||
{
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
public void setTechnicalTitle(String technicalTitle)
|
||||
{
|
||||
this.technicalTitle = technicalTitle;
|
||||
}
|
||||
|
||||
public String getTechnicalTitle()
|
||||
{
|
||||
return technicalTitle;
|
||||
}
|
||||
public void setProfessionalTitle(String professionalTitle)
|
||||
{
|
||||
this.professionalTitle = professionalTitle;
|
||||
}
|
||||
|
||||
public String getProfessionalTitle()
|
||||
{
|
||||
return professionalTitle;
|
||||
}
|
||||
public void setResearchDirection(String researchDirection)
|
||||
{
|
||||
this.researchDirection = researchDirection;
|
||||
}
|
||||
|
||||
public String getResearchDirection()
|
||||
{
|
||||
return researchDirection;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setSummary(String summary)
|
||||
{
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return summary;
|
||||
}
|
||||
public void setWorkContent(String workContent)
|
||||
{
|
||||
this.workContent = workContent;
|
||||
}
|
||||
|
||||
public String getWorkContent()
|
||||
{
|
||||
return workContent;
|
||||
}
|
||||
public void setIsLeader(String isLeader)
|
||||
{
|
||||
this.isLeader = isLeader;
|
||||
}
|
||||
|
||||
public String getIsLeader()
|
||||
{
|
||||
return isLeader;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementId", getAchievementId())
|
||||
.append("username", getUsername())
|
||||
.append("company", getCompany())
|
||||
.append("technicalTitle", getTechnicalTitle())
|
||||
.append("professionalTitle", getProfessionalTitle())
|
||||
.append("researchDirection", getResearchDirection())
|
||||
.append("phone", getPhone())
|
||||
.append("summary", getSummary())
|
||||
.append("workContent", getWorkContent())
|
||||
.append("isLeader", getIsLeader())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,471 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成果对象 achievementsll
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public class Achievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(name = "成果领域1")
|
||||
private String field1;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private Long sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(name = "成果标签")
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "成果状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "成果图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
|
||||
private Long clickSum;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
private Float hotRank;
|
||||
private Long attachmentCount;
|
||||
private Integer isExpertAudit;
|
||||
|
||||
public Long getWatcherSum() {
|
||||
return watcherSum;
|
||||
}
|
||||
|
||||
public void setWatcherSum(Long watcherSum) {
|
||||
this.watcherSum = watcherSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Float getHotRank() {
|
||||
return hotRank;
|
||||
}
|
||||
|
||||
public void setHotRank(Float hotRank) {
|
||||
this.hotRank = hotRank;
|
||||
}
|
||||
|
||||
public Integer getIsExpertAudit() {
|
||||
return isExpertAudit;
|
||||
}
|
||||
|
||||
public void setIsExpertAudit(Integer isExpertAudit) {
|
||||
this.isExpertAudit = isExpertAudit;
|
||||
}
|
||||
|
||||
public Long getAttachmentCount() {
|
||||
return attachmentCount;
|
||||
}
|
||||
|
||||
public void setAttachmentCount(Long attachmentCount) {
|
||||
this.attachmentCount = attachmentCount;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
private List<KeyValVo> attachmentList;
|
||||
|
||||
public List<KeyValVo> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementName", getAchievementName())
|
||||
.append("field1", getField1())
|
||||
.append("field2", getField2())
|
||||
.append("field3", getField3())
|
||||
.append("achievementType", getAchievementType())
|
||||
.append("source", getSource())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("sourceLink", getSourceLink())
|
||||
.append("tags", getTags())
|
||||
.append("summary", getSummary())
|
||||
.append("publishingUnit", getPublishingUnit())
|
||||
.append("address", getAddress())
|
||||
.append("isFeatured", getIsFeatured())
|
||||
.append("contactPerson", getContactPerson())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("ownerName", getOwnerName())
|
||||
.append("status", getStatus())
|
||||
.append("details", getDetails())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("reviewComments", getReviewComments())
|
||||
.append("images", getImages())
|
||||
.append("attachments", getAttachments())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AreaStatisticVo {
|
||||
//领域名称
|
||||
private String areaName;
|
||||
//领域key
|
||||
private String areaKey;
|
||||
//领域说明
|
||||
private String remark;
|
||||
//开源项目汇总
|
||||
private Long kyxmSum;
|
||||
//创客任务汇总
|
||||
private Long ckrwSum;
|
||||
//开放竞赛汇总
|
||||
private Long kfjsSum;
|
||||
//校企成果汇总
|
||||
private Long xqcgSum;
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaKey() {
|
||||
return areaKey;
|
||||
}
|
||||
|
||||
public void setAreaKey(String areaKey) {
|
||||
this.areaKey = areaKey;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getKyxmSum() {
|
||||
return kyxmSum;
|
||||
}
|
||||
|
||||
public void setKyxmSum(Long kyxmSum) {
|
||||
this.kyxmSum = kyxmSum;
|
||||
}
|
||||
|
||||
public Long getCkrwSum() {
|
||||
return ckrwSum;
|
||||
}
|
||||
|
||||
public void setCkrwSum(Long ckrwSum) {
|
||||
this.ckrwSum = ckrwSum;
|
||||
}
|
||||
|
||||
public Long getKfjsSum() {
|
||||
return kfjsSum;
|
||||
}
|
||||
|
||||
public void setKfjsSum(Long kfjsSum) {
|
||||
this.kfjsSum = kfjsSum;
|
||||
}
|
||||
|
||||
public Long getXqcgSum() {
|
||||
return xqcgSum;
|
||||
}
|
||||
|
||||
public void setXqcgSum(Long xqcgSum) {
|
||||
this.xqcgSum = xqcgSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AreasTjVo {
|
||||
private Long areaSum;
|
||||
private List<KeyValueVo> areaDetails;
|
||||
|
||||
public Long getAreaSum() {
|
||||
return areaSum;
|
||||
}
|
||||
|
||||
public void setAreaSum(Long areaSum) {
|
||||
this.areaSum = areaSum;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getAreaDetails() {
|
||||
return areaDetails;
|
||||
}
|
||||
|
||||
public void setAreaDetails(List<KeyValueVo> areaDetails) {
|
||||
this.areaDetails = areaDetails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class ExpertTotallVo {
|
||||
//专家名称
|
||||
private String name;
|
||||
//任务审核数
|
||||
private Long taskAuditSum;
|
||||
//竞赛审核数
|
||||
private Long competitionAuditSum;
|
||||
//总数
|
||||
private Long total;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getTaskAuditSum() {
|
||||
return taskAuditSum;
|
||||
}
|
||||
|
||||
public void setTaskAuditSum(Long taskAuditSum) {
|
||||
this.taskAuditSum = taskAuditSum;
|
||||
}
|
||||
|
||||
public Long getCompetitionAuditSum() {
|
||||
return competitionAuditSum;
|
||||
}
|
||||
|
||||
public void setCompetitionAuditSum(Long competitionAuditSum) {
|
||||
this.competitionAuditSum = competitionAuditSum;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class KeyValueVo {
|
||||
private String key;
|
||||
private String name;
|
||||
private String result;
|
||||
private Long value;
|
||||
private Long value2;
|
||||
private Long total;
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Long getValue2() {
|
||||
return value2;
|
||||
}
|
||||
|
||||
public void setValue2(Long value2) {
|
||||
this.value2 = value2;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Long getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Long value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MemoTotalVo {
|
||||
private Long id;
|
||||
private String subject;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "发布时间", hidden = true)
|
||||
private Date publishedAt;
|
||||
private Long viewedCount;
|
||||
private Long praisesCount;
|
||||
private Long repliesCount;
|
||||
private Long behavioreSum;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public Date getPublishedAt() {
|
||||
return publishedAt;
|
||||
}
|
||||
|
||||
public void setPublishedAt(Date publishedAt) {
|
||||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public Long getViewedCount() {
|
||||
return viewedCount;
|
||||
}
|
||||
|
||||
public void setViewedCount(Long viewedCount) {
|
||||
this.viewedCount = viewedCount;
|
||||
}
|
||||
|
||||
public Long getPraisesCount() {
|
||||
return praisesCount;
|
||||
}
|
||||
|
||||
public void setPraisesCount(Long praisesCount) {
|
||||
this.praisesCount = praisesCount;
|
||||
}
|
||||
|
||||
public Long getRepliesCount() {
|
||||
return repliesCount;
|
||||
}
|
||||
|
||||
public void setRepliesCount(Long repliesCount) {
|
||||
this.repliesCount = repliesCount;
|
||||
}
|
||||
|
||||
public Long getBehavioreSum() {
|
||||
return behavioreSum;
|
||||
}
|
||||
|
||||
public void setBehavioreSum(Long behavioreSum) {
|
||||
this.behavioreSum = behavioreSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 校企成果对象 school_enterprise_achievements
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public class SchoolEnterpriseAchievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(name = "成果领域1")
|
||||
private String field1;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(name = "成果标签")
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "成果状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "成果图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
private Integer achievementStatus;
|
||||
|
||||
public Integer getAchievementStatus() {
|
||||
return achievementStatus;
|
||||
}
|
||||
|
||||
public void setAchievementStatus(Integer achievementStatus) {
|
||||
this.achievementStatus = achievementStatus;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(String sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementName", getAchievementName())
|
||||
.append("field1", getField1())
|
||||
.append("field2", getField2())
|
||||
.append("field3", getField3())
|
||||
.append("achievementType", getAchievementType())
|
||||
.append("source", getSource())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("sourceLink", getSourceLink())
|
||||
.append("tags", getTags())
|
||||
.append("summary", getSummary())
|
||||
.append("publishingUnit", getPublishingUnit())
|
||||
.append("address", getAddress())
|
||||
.append("isFeatured", getIsFeatured())
|
||||
.append("contactPerson", getContactPerson())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("ownerName", getOwnerName())
|
||||
.append("status", getStatus())
|
||||
.append("details", getDetails())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("reviewComments", getReviewComments())
|
||||
.append("images", getImages())
|
||||
.append("attachments", getAttachments())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 成果团队Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementTeamMapper
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Master;
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementsMapper {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
@MapKey("k")
|
||||
@Master
|
||||
List<Map<String, String>> getFileInfoByIdents(@Param("idents") Set<String> idents);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> selectAchievementsByParam(AchQueryVo achQueryVo);
|
||||
|
||||
Long getAchievementClickSum(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> getaWatcher(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getFavorite(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
|
||||
|
||||
List<Map<String, String>> getHotAchievement();
|
||||
|
||||
Map<String, Long> indexProjectStatistic();
|
||||
|
||||
Map<String, Object> indexTaskStatistic();
|
||||
|
||||
Map<String, Long> indexCompetitionStatistic();
|
||||
|
||||
Long indexSchoolEnterpriseStatistic(@Param("s") String s, @Param("t") String tags);
|
||||
|
||||
List<KeyValueVo> getAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements, @Param("id") String id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(@Param("id") Long id, @Param("userId")Long userId);
|
||||
|
||||
Long countAchievementBySource(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<Map<String, Object>> getAchievementDataYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementType();
|
||||
|
||||
List<KeyValueVo> getAchievementActData();
|
||||
|
||||
List<Map<String, Object>> getAchievementDomain();
|
||||
|
||||
List<Map<String, Object>> getAchievementAddYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementHotRank();
|
||||
|
||||
List<Long> getAllId();
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(@Param("areaKey") String areaKey);
|
||||
|
||||
List<AchRelatedVo> getRelatedAch(@Param("id")Long id, @Param("sourceId") Long sourceId, @Param("paramYear")String paramYear);
|
||||
|
||||
List<String> getDistinctYear(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
||||
|
||||
List<Long> selectAchievementsByName(@Param("achName") String achName);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 校企成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface SchoolEnterpriseAchievementsMapper
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BigScreenStatisticService {
|
||||
|
||||
private final AchievementsMapper achievementsMapper;
|
||||
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
|
||||
|
||||
public Map<String, Object> getAchievementTopStatistic(String source) {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrYYYYMMDD(days[0], days[1]);
|
||||
Date[] lastDays = DateUtil.getDays(7, 13);
|
||||
long lastSum = Optional.ofNullable(achievementsMapper.countAchievementBySource(lastDays[0], lastDays[1], source)).orElse(0L);
|
||||
long sum = Optional.ofNullable(achievementsMapper.countAchievementBySource(null, null, source)).orElse(0L);
|
||||
long cSum = m.values().stream().mapToLong(Long::longValue).sum();
|
||||
double rate;
|
||||
if (lastSum == 0) rate = 100D;
|
||||
else {
|
||||
rate = (double) (cSum - lastSum) / lastSum;
|
||||
}
|
||||
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("list", res);
|
||||
map.put("sum", sum);
|
||||
map.put("rate", rate);
|
||||
return map;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDataYearly() {
|
||||
return achievementsMapper.getAchievementDataYearly();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementType() {
|
||||
return achievementsMapper.getAchievementType();
|
||||
}
|
||||
|
||||
public Map<String, List<KeyValueVo>> getAchievementActData() {
|
||||
List<KeyValueVo> list = achievementsMapper.getAchievementActData();
|
||||
Map<String, List<KeyValueVo>> res = list.stream().collect(Collectors.groupingBy(KeyValueVo::getKey));
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDomain() {
|
||||
return achievementsMapper.getAchievementDomain();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementAddYearly() {
|
||||
return achievementsMapper.getAchievementAddYearly();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementHotRank() {
|
||||
return achievementsMapper.getAchievementHotRank();
|
||||
}
|
||||
|
||||
public Map<String, Object> getCompetitionTopStatistic() {
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
Long finish = competitionResourceLibraryMapper.getCompetitionFinish();
|
||||
res.put("finish", finish);
|
||||
Long enroll = competitionResourceLibraryMapper.getCompetitionEnroll();
|
||||
res.put("enroll", enroll);
|
||||
Long underway = competitionResourceLibraryMapper.getCompetitionUnderway();
|
||||
res.put("underway", underway);
|
||||
Long submitCount = competitionResourceLibraryMapper.getCompetitionSubmitCount();
|
||||
res.put("submitCount", submitCount);
|
||||
Long transfer = competitionResourceLibraryMapper.getCompetitionTransferCount();
|
||||
res.put("transfer", transfer);
|
||||
Long needAudit = competitionResourceLibraryMapper.getCompetitionNeedAuditCount();
|
||||
res.put("needAudit", needAudit);
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getCompetitionStatisticYearly() {
|
||||
return competitionResourceLibraryMapper.getCompetitionStatisticYearly();
|
||||
}
|
||||
|
||||
public Object getCompetitionHot() {
|
||||
return competitionResourceLibraryMapper.getCompetitionHot();
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
|
||||
Date[] currentYear = DateUtil.getCurrentYear();
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
|
||||
Date[] currentYear = DateUtil.getCurrentYear();
|
||||
Date[] YearEndOfCur = DateUtil.getCurrentYearEndOf(LocalDate.now());
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(YearEndOfCur[0],YearEndOfCur[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.ExpertTotallVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ExpertDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
/**
|
||||
* 专家职称级分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getTitleRankStatistic() {
|
||||
return expertResourceLibraryMapper.getTitleRankStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家专业类别
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getExpertTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家学历分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getHighestDegreeStatistic() {
|
||||
return expertResourceLibraryMapper.getHighestDegreeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家单位类别分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getWorkplaceTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getWorkplaceTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专家总数
|
||||
* @return
|
||||
*/
|
||||
public Long getExpertTotal() {
|
||||
return expertResourceLibraryMapper.getExpertTotal();
|
||||
}
|
||||
/**
|
||||
* 专家实名完成度 userId users.authentication
|
||||
* @return
|
||||
*/
|
||||
public KeyValueVo getAuthenticationStatistic() {
|
||||
return expertResourceLibraryMapper.getAuthenticationStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度专家数据统计 cretate_on
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTotalByYear() {
|
||||
return expertResourceLibraryMapper.getExpertTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 热门专家领域
|
||||
* reviewAreaOne、reviewAreaTwo、reviewAreaThree
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getReviewAreasStatistic() {
|
||||
return expertResourceLibraryMapper.getReviewAreasStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年专家评审数
|
||||
* @return
|
||||
*/
|
||||
public List<ExpertTotallVo> getExpertAduit() {
|
||||
return expertResourceLibraryMapper.getExpertAduit();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
|
||||
/**
|
||||
* 成果团队Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public interface IAchievementTeamService
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public interface IAchievementsService {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
void buildFileInfoByIdents(String img, String att, Map<String, Object> map);
|
||||
|
||||
List<Achievements> selectAchievementsFrontList(Achievements achievements);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> getAllResult(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String, Object> getUerActionData();
|
||||
|
||||
List<Map<String, String>> getHotAchievement();
|
||||
|
||||
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String,Long> indexProjectStatistic();
|
||||
|
||||
Map<String,Object> indexTaskStatistic();
|
||||
|
||||
Map<String,Long> indexCompetitionStatistic();
|
||||
|
||||
Map<String,Long> indexSchoolEnterpriseStatistic();
|
||||
|
||||
Map<String,Long> indexExpertStatistic();
|
||||
|
||||
List<KeyValueVo> getAreasByName(String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(String id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(String areaKey);
|
||||
|
||||
List<AchRelatedVo> getRelatedAch(Long id, Long sourceId);
|
||||
|
||||
int getSearchResult(String achName, Long userId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
|
||||
/**
|
||||
* 校企成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MemoDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper memoResourceLibraryMapper;
|
||||
/**
|
||||
* 审核通过率
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoAduit() {
|
||||
return memoResourceLibraryMapper.getMemoAduit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 原创、非原创
|
||||
* @return
|
||||
*/
|
||||
public KeyValueVo getIsOriginalStatistic() {
|
||||
return memoResourceLibraryMapper.getIsOriginalStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度动态数据统计
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoTotalByYear() {
|
||||
return memoResourceLibraryMapper.getMemoTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据帖子类型汇总
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getForumSectionStatistic() {
|
||||
return memoResourceLibraryMapper.getForumSectionStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年新增帖子数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getAddMemoStatistic() {
|
||||
return memoResourceLibraryMapper.getAddMemoStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 本年帖子热度top5(论坛评论、点击、点赞)
|
||||
* @return
|
||||
*/
|
||||
public List<MemoTotalVo> getTop5Memos() {
|
||||
return memoResourceLibraryMapper.getTop5Memos();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近7日帖子点赞数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValVo<String, Long>> get7DayPaise() {
|
||||
Date[] days = DateUtil.getDays(1, 7);
|
||||
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
|
||||
/**
|
||||
* 成果团队Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Service
|
||||
public class AchievementTeamServiceImpl implements IAchievementTeamService
|
||||
{
|
||||
@Autowired
|
||||
private AchievementTeamMapper achievementTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public AchievementTeam selectAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamList(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setCreateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.insertAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.updateAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamByIds(Long[] ids)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,377 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import com.microservices.dms.resourceLibrary.domain.Clicker;
|
||||
import com.microservices.dms.resourceLibrary.domain.Searcher;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
|
||||
/**
|
||||
* 成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Service
|
||||
public class AchievementsServiceImpl implements IAchievementsService {
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskResourceLibraryMapper taskResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public Achievements selectAchievementsById(Long id) {
|
||||
return achievementsMapper.selectAchievementsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
buildFileInfoByIdents(a.getImages(), a.getAttachments(), a.getParams());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsFrontList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
a.setDetails(null);
|
||||
buildFileInfoByIdents(a.getImages(), a.getAttachments(), a.getParams());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievements(Achievements achievements) {
|
||||
achievements.setCreateTime(DateUtils.getNowDate());
|
||||
achievements.setCreateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.insertAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievements(Achievements achievements) {
|
||||
achievements.setUpdateTime(DateUtils.getNowDate());
|
||||
achievements.setUpdateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.updateAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsByIds(Long[] ids) {
|
||||
return achievementsMapper.deleteAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsById(Long id) {
|
||||
return achievementsMapper.deleteAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildFileInfoByIdents(String img, String att, Map<String, Object> map) {
|
||||
// Set<String> imgs = Arrays.stream(Optional.ofNullable(img).orElse("").split(",")).collect(Collectors.toSet());
|
||||
// imgs = imgs.stream().filter(StringUtils::isNotEmpty).collect(Collectors.toSet());
|
||||
// HashMap<String, String> imgMap = new HashMap<>();
|
||||
// if (!CollectionUtils.isEmpty(imgs)) {
|
||||
// Optional.ofNullable(achievementsMapper.getFileInfoByIdents(imgs)).orElse(new ArrayList<>()).forEach(s -> {
|
||||
// imgMap.put(s.get("k"), s.get("v"));
|
||||
// });
|
||||
// }
|
||||
// map.put("img", imgMap);
|
||||
// String a = Optional.ofNullable(img).orElse("[]");
|
||||
// JSONArray ao = JSONArray.parseArray(a);
|
||||
// map.put("att", ao);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> getChoiceImport() {
|
||||
return achievementsMapper.getChoiceImport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjBySources() {
|
||||
return achievementsMapper.getTjBySources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjByAreas() {
|
||||
return achievementsMapper.getTjByAreas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Achievements> getAllResult(AchQueryVo achQueryVo) {
|
||||
//根据查询条件获取所有的成果数据
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsByParam(achQueryVo);
|
||||
//遍历成果数据,获取对应成果的点击数
|
||||
for (Achievements a : list) {
|
||||
Long clickSum = achievementsMapper.getAchievementClickSum(a.getId());
|
||||
a.setClickSum(clickSum);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUerActionData() {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getaWatcher(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
Map<String, Long> g = achievementsMapper.getFavorite(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> wRes = new ArrayList<>();
|
||||
List<KeyValVo<String, Long>> gRes = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
Long b = g.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
KeyValVo<String, Long> k2 = new KeyValVo<>();
|
||||
k2.setK(s);
|
||||
k2.setV(b);
|
||||
|
||||
wRes.add(k1);
|
||||
gRes.add(k2);
|
||||
}
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
res.put("watcher", wRes);
|
||||
res.put("favorite", gRes);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getHotAchievement() {
|
||||
return achievementsMapper.getHotAchievement();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo) {
|
||||
Date[] days = DateUtil.getDays(1, 7);
|
||||
Map<String, Long> w = achievementsMapper.getAchievement(days[0], days[1], achQueryVo.getSource())
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexProjectStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexProjectStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> indexTaskStatistic() {
|
||||
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
|
||||
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount();
|
||||
res.put("convertedTaskAmount", convertedTaskAmount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexCompetitionStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexCompetitionStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexSchoolEnterpriseStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long schoolEnterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "");
|
||||
res.put("schoolEnterpriseCount", schoolEnterpriseCount);
|
||||
Long schoolCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "1");
|
||||
res.put("schoolCount", schoolCount);
|
||||
Long enterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "2");
|
||||
res.put("enterpriseCount", enterpriseCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("schoolEnterprise");
|
||||
long clickCount = taskResourceLibraryMapper.countClicker(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexExpertStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long expertResourceCount = expertResourceLibraryMapper.expertResourceCount();
|
||||
res.put("expertResourceCount", expertResourceCount);
|
||||
Long auditTaskAuditExpertCount = expertResourceLibraryMapper.auditTaskAuditExpertCount();
|
||||
res.put("auditTaskAuditExpertCount", auditTaskAuditExpertCount);
|
||||
Long auditCompetitionAuditExpertCount = expertResourceLibraryMapper.auditCompetitionAuditExpertCount();
|
||||
res.put("auditCompetitionAuditExpertCount", auditCompetitionAuditExpertCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("Experts");
|
||||
long clickCount = taskResourceLibraryMapper.countClicker(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getAreasByName(String areaName) {
|
||||
return achievementsMapper.getAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getActDataStatisticById(Long id) {
|
||||
return achievementsMapper.getActDataStatisticById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7AddClickById(String id) {
|
||||
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], "Achievements",id)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return achievementsMapper.getWatchFavoriteStatusById(id,userId);
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "${cron.calculateHotRank}")
|
||||
public void timingCalcHotRank(){
|
||||
List<Long> ids = achievementsMapper.getAllId();
|
||||
for (Long id : ids) {
|
||||
AchievementImageVo image = behaviorImageService.getAchievementImageById(id);
|
||||
float score = image.getScore();
|
||||
Achievements u = new Achievements();
|
||||
u.setId(id);
|
||||
u.setHotRank(score);
|
||||
achievementsMapper.updateAchievements(u);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaStatisticVo> getAreaStatistic(String areaKey) {
|
||||
return achievementsMapper.getAreaStatistic(areaKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AchRelatedVo> getRelatedAch(Long id,Long sourceId) {
|
||||
List<AchRelatedVo> relatedResultList = new ArrayList<>();
|
||||
//想根据开源项目id,获取对应的年度信息
|
||||
List<String> allYear = achievementsMapper.getDistinctYear(id,sourceId);
|
||||
if(StringUtils.isNotNull(allYear)) {
|
||||
//遍历年度信息,获取年度成果数据
|
||||
for(String paramYear : allYear) {
|
||||
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id,sourceId,paramYear);
|
||||
relatedResultList.addAll(tmpList);
|
||||
}
|
||||
}
|
||||
return relatedResultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据查询内容,调用搜索行为接口
|
||||
* @param achName
|
||||
* @param userId
|
||||
*/
|
||||
@Override
|
||||
public int getSearchResult(String achName, Long userId) {
|
||||
int num = 0;
|
||||
if (StringUtils.isEmpty(achName)){
|
||||
return num;
|
||||
}
|
||||
List<Long> idList = achievementsMapper.selectAchievementsByName(achName);
|
||||
if(StringUtils.isNotNull(idList)) {
|
||||
for (Long searchId : idList) {
|
||||
Searcher e = new Searcher();
|
||||
e.setCreatedAt(DateUtils.getNowDate());
|
||||
e.setUserId(userId);
|
||||
e.setSearchId(searchId);
|
||||
e.setExtInfo(achName);
|
||||
e.setSearchType("Achievements");
|
||||
num = taskResourceLibraryMapper.insertSearcher(e);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
|
||||
/**
|
||||
* 校企成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
@Autowired
|
||||
private SchoolEnterpriseAchievementsMapper schoolEnterpriseAchievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
for (SchoolEnterpriseAchievements a : list) {
|
||||
achievementsService.buildFileInfoByIdents(a.getImages(),a.getAttachments(),a.getParams());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
schoolEnterpriseAchievements.setCreateTime(DateUtils.getNowDate());
|
||||
schoolEnterpriseAchievementsMapper.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
return schoolEnterpriseAchievements.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
schoolEnterpriseAchievements.setUpdateTime(DateUtils.getNowDate());
|
||||
return schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
|
||||
return schoolEnterpriseAchievementsMapper.topStatistic(schoolEnterpriseAchievements);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.microservices.dms.behaviorImage.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* 成果画像Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/behaviorImage")
|
||||
@Api(tags = "数据管理体系-画像接口")
|
||||
public class BehaviorImageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
/**
|
||||
* 根据成果ID,获取对应的成果画像
|
||||
*/
|
||||
//@RequiresPermissions("dms:achievements:query")
|
||||
@ApiOperation(value = "根据成果ID,获取对应的成果画像")
|
||||
@GetMapping(value = "/achievementImage")
|
||||
public AjaxResult getAchievementImageById(Long id)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getAchievementImageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
startPage();
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出画像行为权重列表
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
ExcelUtil<BehaviorImageWeight> util = new ExcelUtil<BehaviorImageWeight>(BehaviorImageWeight.class);
|
||||
util.exportExcel(response, list, "画像行为权重数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画像行为权重详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(behaviorImageService.selectBehaviorImageWeightById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.insertBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.updateBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(behaviorImageService.deleteBehaviorImageWeightByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class AchievementBehaviorSumVo {
|
||||
private Long clickSum;
|
||||
private Long watchSum;
|
||||
private Long searchSum;
|
||||
private Long favoriteSum;
|
||||
private Long downloadSum;
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
public Long getWatchSum() {
|
||||
return watchSum;
|
||||
}
|
||||
|
||||
public void setWatchSum(Long watchSum) {
|
||||
this.watchSum = watchSum;
|
||||
}
|
||||
|
||||
public Long getSearchSum() {
|
||||
return searchSum;
|
||||
}
|
||||
|
||||
public void setSearchSum(Long searchSum) {
|
||||
this.searchSum = searchSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Long getDownloadSum() {
|
||||
return downloadSum;
|
||||
}
|
||||
|
||||
public void setDownloadSum(Long downloadSum) {
|
||||
this.downloadSum = downloadSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
/**
|
||||
* 成果画像结果
|
||||
*/
|
||||
public class AchievementImageVo {
|
||||
private Long id;
|
||||
private float score;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public float getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(float score) {
|
||||
this.score = score;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class BehaviorContant {
|
||||
/**
|
||||
* 成果画像
|
||||
*/
|
||||
public final static String ACHIEVEMENTS_IMAGE = "Achievements";
|
||||
|
||||
/**
|
||||
* 点击行为
|
||||
*/
|
||||
public final static String CLICK_BEHAVIOR = "click";
|
||||
/**
|
||||
* 收藏行为
|
||||
*/
|
||||
public final static String FAVORITE_BEHAVIOR = "favorite";
|
||||
/**
|
||||
* 搜索行为
|
||||
*/
|
||||
public final static String SEARCH_BEHAVIOR = "search";
|
||||
/**
|
||||
* 关注行为
|
||||
*/
|
||||
public final static String WATCH_BEHAVIOR = "watch";
|
||||
/**
|
||||
* 附件下载行为
|
||||
*/
|
||||
public final static String FILE_DOWNLOAD_BEHAVIOR = "file_download";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 画像行为权重对象 behavior_image_weight
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class BehaviorImageWeight extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 行为编码 */
|
||||
@Excel(name = "行为编码")
|
||||
private String behaviorCode;
|
||||
|
||||
/** 画像分类 */
|
||||
@Excel(name = "画像分类")
|
||||
private String imageType;
|
||||
|
||||
/** 行为名称 */
|
||||
@Excel(name = "行为名称")
|
||||
private String behaviorName;
|
||||
|
||||
/** 行为权重 */
|
||||
@Excel(name = "行为权重")
|
||||
private String behaviorWeight;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setBehaviorCode(String behaviorCode)
|
||||
{
|
||||
this.behaviorCode = behaviorCode;
|
||||
}
|
||||
|
||||
public String getBehaviorCode()
|
||||
{
|
||||
return behaviorCode;
|
||||
}
|
||||
public void setImageType(String imageType)
|
||||
{
|
||||
this.imageType = imageType;
|
||||
}
|
||||
|
||||
public String getImageType()
|
||||
{
|
||||
return imageType;
|
||||
}
|
||||
public void setBehaviorName(String behaviorName)
|
||||
{
|
||||
this.behaviorName = behaviorName;
|
||||
}
|
||||
|
||||
public String getBehaviorName()
|
||||
{
|
||||
return behaviorName;
|
||||
}
|
||||
public void setBehaviorWeight(String behaviorWeight)
|
||||
{
|
||||
this.behaviorWeight = behaviorWeight;
|
||||
}
|
||||
|
||||
public String getBehaviorWeight()
|
||||
{
|
||||
return behaviorWeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("behaviorCode", getBehaviorCode())
|
||||
.append("imageType", getImageType())
|
||||
.append("behaviorName", getBehaviorName())
|
||||
.append("behaviorWeight", getBehaviorWeight())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.behaviorImage.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface BehaviorImageMapper {
|
||||
AchievementBehaviorSumVo getBehaviorSumListByType();
|
||||
|
||||
List<KeyValueVo> getWeightListByType(@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFavoriteSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getSearchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getWatchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFileDownloadSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getClickSumByAchievementId(@Param("id") Long id, @Param("achievementsImage") String achievementsImage);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.microservices.dms.behaviorImage.service;
|
||||
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBehaviorImageService {
|
||||
AchievementImageVo getAchievementImageById(Long id);
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
package com.microservices.dms.behaviorImage.service.impl;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorContant;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.mapper.BehaviorImageMapper;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
||||
@Autowired
|
||||
private BehaviorImageMapper behaviorImageMapper;
|
||||
@Override
|
||||
public AchievementImageVo getAchievementImageById(Long id) {
|
||||
AchievementImageVo achievementImageVo = new AchievementImageVo();
|
||||
//获取所有行为汇总数据
|
||||
AchievementBehaviorSumVo achievementBehaviorSumVo = behaviorImageMapper.getBehaviorSumListByType();
|
||||
if(StringUtils.isNotNull(achievementBehaviorSumVo)) {
|
||||
float score = 0f;
|
||||
//从行为表中获取成果行为数据权限
|
||||
List<KeyValueVo> behaviorImageWeightList = behaviorImageMapper.getWeightListByType(BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
float clickResult = 0L;
|
||||
float watchResult = 0L;
|
||||
float searchResult = 0L;
|
||||
float favoriteResult = 0L;
|
||||
float fileDownloadResult = 0L;
|
||||
//简单算法
|
||||
for (KeyValueVo keyValueVo : behaviorImageWeightList) {
|
||||
String bhavior = keyValueVo.getKey();
|
||||
Long weight = keyValueVo.getValue();
|
||||
if (bhavior.equals(BehaviorContant.CLICK_BEHAVIOR)) {//点击
|
||||
//根据当前成果ID,获取成果点击行为数量
|
||||
Long clickSum = achievementBehaviorSumVo.getClickSum();
|
||||
if(StringUtils.isNotNull(clickSum) && clickSum > 0) {
|
||||
Long click = behaviorImageMapper.getClickSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(click)) {
|
||||
clickResult = click * weight / clickSum ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FAVORITE_BEHAVIOR)) {//收藏
|
||||
//根据当前成果ID,获取成果收藏行为数量
|
||||
Long favoriteSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(favoriteSum) && favoriteSum > 0) {
|
||||
Long favorite = behaviorImageMapper.getFavoriteSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(favorite)) {
|
||||
favoriteResult = favorite *weight / favoriteSum ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.SEARCH_BEHAVIOR)) {//搜索
|
||||
//根据当前成果ID,获取成果搜索行为数量
|
||||
Long searchSum = achievementBehaviorSumVo.getSearchSum();
|
||||
if(StringUtils.isNotNull(searchSum) && searchSum > 0) {
|
||||
Long search = behaviorImageMapper.getSearchSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(search)) {
|
||||
searchResult = search *weight / searchSum;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.WATCH_BEHAVIOR)) {//关注
|
||||
//根据当前成果ID,获取成果关注行为数量
|
||||
Long watchSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull( watchSum) && watchSum > 0) {
|
||||
Long watch = behaviorImageMapper.getWatchSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull( watch) ) {
|
||||
watchResult = watch *weight / watchSum;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FILE_DOWNLOAD_BEHAVIOR)) {//文件下载
|
||||
//根据当前成果ID,获取成果文件下载行为数量
|
||||
Long fileDownloadSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(fileDownloadSum) && fileDownloadSum > 0) {
|
||||
Long fileDownload = behaviorImageMapper.getFileDownloadSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(fileDownload)) {
|
||||
fileDownloadResult = fileDownload *weight / fileDownloadSum ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
score = clickResult+watchResult+searchResult+favoriteResult+fileDownloadResult;
|
||||
achievementImageVo.setScore(score);
|
||||
}
|
||||
return achievementImageVo;
|
||||
}
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setCreateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.insertBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setUpdateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.updateBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class DmsConstants {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class ReferralConstant {
|
||||
|
||||
public static final Long ISSUE_CLOSED = 5L;
|
||||
public static final Long ISSUE_RESOLVED = 3L;
|
||||
public static final Long ISSUE_RESOLVING = 2L;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.constant;
|
||||
|
||||
public class TaskConstant {
|
||||
|
||||
private TaskConstant() {}
|
||||
|
||||
public static final String TASK_TYPE_WATCHERS = "MakerTask";
|
||||
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
|
||||
public static final String TASK_TYPE_PAPERS = "";
|
||||
public static final String TASK_TYPE_OTHER = "makerSpaceTask";
|
||||
|
||||
public static final String COMPETITION_TYPE_WATCHERS = "CompetitionInfo";
|
||||
public static final String COMPETITION_TYPE_CLICK = "CompetitionInfo";
|
||||
public static final String COMPETITION_TYPE_DOWNLOAD = "CompetitionOpusDownload";
|
||||
|
||||
|
||||
public static final String PROJECT_DOWNLOAD_API = "%s/api/attachments/%s";
|
||||
public static final String MARKER_SPACE_DOWNLOAD_API_BY_NAME = "%s/busiAttachments/downloadAttachment/%s";
|
||||
public static final String MARKER_SPACE_DOWNLOAD_API_BY_ID = "%s/busiAttachments/download/%s";
|
||||
|
||||
//favorites
|
||||
public static final String EXPERTS = "Experts";
|
||||
public static final String ACHIEVEMENTS = "Achievements";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.referral.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.referral.service.TalentReferralService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "数据管理体系-人才推荐接口")
|
||||
@RestController
|
||||
@RequestMapping("/talentReferral")
|
||||
@RequiredArgsConstructor
|
||||
public class TalentReferralController {
|
||||
|
||||
private final TalentReferralService talentReferralService;
|
||||
|
||||
@GetMapping("/issueTalentReferral")
|
||||
@ApiOperation(value = "疑修人才推荐")
|
||||
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
|
||||
return AjaxResult.success(talentReferralService.issueTalentReferral(issueId, projectId));
|
||||
}
|
||||
|
||||
@GetMapping("/pullRequestTalentReferral")
|
||||
@ApiOperation(value = "PR人才推荐")
|
||||
public AjaxResult pullRequestTalentReferral(@RequestParam("prId") Long prId, @RequestParam("projectId") Long projectId) {
|
||||
return AjaxResult.success(talentReferralService.PRTalentReferral(prId, projectId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.microservices.dms.referral.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface TalentReferralMapper {
|
||||
|
||||
List<IssuesVo> selectIssuesCondition(IssuesVo issuesVo);
|
||||
|
||||
List<IssuesVo> countIssuesAssigner(@Param("projectId") Long projectId);
|
||||
|
||||
List<PullRequestVo> countPRUser(@Param("projectId") Long projectId);
|
||||
|
||||
IssuesVo selectIssuesById(@Param("id") Long id);
|
||||
|
||||
PullRequestVo selectPRById(@Param("id") Long id);
|
||||
|
||||
List<Long> selectIssuesAssigners(@Param("issueId") Long issueId);
|
||||
|
||||
String selectRepositoriesUrl(@Param("id") Long id);
|
||||
|
||||
Long selectIdByLogin(@Param("login") String login);
|
||||
}
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
package com.microservices.dms.referral.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.dms.constant.ReferralConstant;
|
||||
import com.microservices.dms.referral.mapper.TalentReferralMapper;
|
||||
import com.microservices.dms.referral.vo.IssueDto;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
||||
import com.microservices.dms.utils.DmsGitLinkRequestUrl;
|
||||
import com.microservices.dms.utils.DmsRequestHelper;
|
||||
import com.microservices.dms.utils.SimilarityService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人才推荐服务
|
||||
*/
|
||||
@Service
|
||||
public class TalentReferralService {
|
||||
|
||||
@Autowired
|
||||
private TalentReferralMapper talentReferralMapper;
|
||||
|
||||
@Autowired
|
||||
private DmsRequestHelper dmsRequestHelper;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TalentReferralService.class);
|
||||
|
||||
public Set<Long> getContributors(String projectFullName) {
|
||||
try {
|
||||
// 获取项目贡献者数量
|
||||
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list","total_count");
|
||||
|
||||
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("contributions")).filter(StringUtils::isNotBlank)
|
||||
.mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
public Set<Long> getCollaborators(String projectFullName) {
|
||||
try {
|
||||
// 获取项目成员者数量
|
||||
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.QUERY_USER_FROM_PROJECT(projectFullName), "members","total_count");
|
||||
|
||||
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id"))
|
||||
.filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取项目成员者数量失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
public String getRepoName(Long projectId) {
|
||||
// 获取仓库的fullName,用来查询贡献者
|
||||
String s = talentReferralMapper.selectRepositoriesUrl(projectId);
|
||||
return StringUtils.isNotEmpty(s) ? s : "";
|
||||
}
|
||||
|
||||
public Set<Long> getContributorsByProjectId(Long projectId) {
|
||||
Set<Long> contributors = new HashSet<>();
|
||||
String repoName = getRepoName(projectId);
|
||||
if (StringUtils.isNotBlank(repoName)) {
|
||||
contributors.addAll(getContributors(repoName));
|
||||
}
|
||||
return contributors;
|
||||
}
|
||||
|
||||
public Set<Long> getCollaboratorsByProjectId(Long projectId) {
|
||||
Set<Long> collaborators = new HashSet<>();
|
||||
String repoName = getRepoName(projectId);
|
||||
if (StringUtils.isNotBlank(repoName)) {
|
||||
collaborators.addAll(getCollaborators(repoName));
|
||||
}
|
||||
return collaborators;
|
||||
}
|
||||
|
||||
public List<Map.Entry<Long, Double>> issueTalentReferral(Long projectId, Long issueId) {
|
||||
|
||||
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
|
||||
if (curIssue == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
|
||||
if (!curIssueAssigners.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
IssuesVo vo = new IssuesVo();
|
||||
vo.setProjectId(projectId);
|
||||
vo.setStatusIds(Collections.singletonList(ReferralConstant.ISSUE_CLOSED));
|
||||
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||
// 计算与解决issue的相似度, 标题+描述
|
||||
for (IssuesVo v : issuesVos) {
|
||||
String subject = v.getSubject();
|
||||
String description = v.getDescription();
|
||||
double subjectFraction = SimilarityService.sentence(subject, curIssue.getSubject());
|
||||
double descFraction = SimilarityService.text(description, curIssue.getDescription());
|
||||
//这个数据可以缓存下来
|
||||
List<Long> assigners = talentReferralMapper.selectIssuesAssigners(v.getId());
|
||||
for (Long assigner : assigners) {
|
||||
userFractionMap.merge(assigner, (subjectFraction + descFraction) * 60.0D, Double::sum);
|
||||
}
|
||||
}
|
||||
|
||||
// 计算每个负责人关闭的issues数量
|
||||
List<IssuesVo> assIs = talentReferralMapper.countIssuesAssigner(projectId);
|
||||
for (IssuesVo a : assIs) {
|
||||
userFractionMap.merge(a.getId(), a.getNum() * 40.0D, Double::sum);
|
||||
}
|
||||
|
||||
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(userFractionMap.entrySet());
|
||||
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
|
||||
|
||||
Set<Long> contributors = getContributorsByProjectId(projectId);
|
||||
if (!contributors.isEmpty() && !entryList.isEmpty()) {
|
||||
entryList.removeIf(s -> !contributors.contains(s.getKey()));
|
||||
}
|
||||
return entryList;
|
||||
}
|
||||
|
||||
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId, List<IssueDto> prs) {
|
||||
|
||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||
Map<String, Double> userNameFractionMap = new HashMap<>();
|
||||
Map<String, Set<String>> PRFilesMap = new HashMap<>();
|
||||
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11");
|
||||
|
||||
for (IssueDto pr : prs) {
|
||||
//关闭PR的对比
|
||||
for (IssueDto dto : closedPullRequests) {
|
||||
List<String> reviewers = dto.getReviewers();
|
||||
for (String reviewer : reviewers) {
|
||||
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
|
||||
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
|
||||
HashSet<String> set = new HashSet<>();
|
||||
set.addAll(a);
|
||||
set.addAll(b);
|
||||
return set;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> curPrFiles = getPRFiles(projectId, pr.getPullRequestNumber());
|
||||
for (String curPrFile : curPrFiles) {
|
||||
PRFilesMap.forEach((k, v) -> {
|
||||
if (v.contains(curPrFile)) {
|
||||
userNameFractionMap.merge(k, 60.0D, Double::sum);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 计算每个负责人关闭的 PR数量
|
||||
closedPullRequests.stream().map(IssueDto::getReviewers).flatMap(List::stream)
|
||||
.forEach(s -> userNameFractionMap.merge(s, 40.0D, Double::sum));
|
||||
|
||||
|
||||
}
|
||||
|
||||
userNameFractionMap.forEach((k, v) -> {
|
||||
Long id = talentReferralMapper.selectIdByLogin(k);
|
||||
userFractionMap.put(id, v);
|
||||
});
|
||||
|
||||
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(userFractionMap.entrySet());
|
||||
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
|
||||
|
||||
//必须是项目成员
|
||||
Set<Long> collaborators = getCollaboratorsByProjectId(projectId);
|
||||
if (!collaborators.isEmpty() && !entryList.isEmpty()) {
|
||||
entryList.removeIf(s -> !collaborators.contains(s.getKey()));
|
||||
}
|
||||
|
||||
return entryList;
|
||||
}
|
||||
|
||||
public List<IssueDto> getPullRequests(Long projectId, String statusType) {
|
||||
|
||||
String projectFullName = getRepoName(projectId);
|
||||
if (StringUtils.isEmpty(projectFullName)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
try {
|
||||
return dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PULL_REQUEST(projectFullName, statusType), "issues", IssueDto.class);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取PR失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public Set<String> getPRFiles(Long projectId, int PRNum) {
|
||||
String projectFullName = getRepoName(projectId);
|
||||
if (StringUtils.isEmpty(projectFullName)) {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
try {
|
||||
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "issues", "files");
|
||||
return allDataByPage.stream().map(o -> (JSONObject) o).map(o -> (String) o.get("filename")).collect(Collectors.toSet());
|
||||
} catch (ServiceException e) {
|
||||
logger.error("【{}】获取PR文件失败:{}", projectFullName, e.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
|
||||
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId) {
|
||||
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
|
||||
openPullRequests = openPullRequests.stream().filter(e -> e.getReviewers().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (prId != null) {
|
||||
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getId()), prId))
|
||||
.filter(e -> e.getReviewers().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
||||
}
|
||||
|
||||
return PRTalentReferral(projectId, prId, openPullRequests);
|
||||
}
|
||||
|
||||
//定时统计
|
||||
public void projectsStatistic(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
@Data
|
||||
public class IssueDto {
|
||||
|
||||
@JsonProperty("pull_request_id")
|
||||
private int pullRequestId;
|
||||
@JsonProperty("pull_request_number")
|
||||
private int pullRequestNumber;
|
||||
@JsonProperty("pull_request_status")
|
||||
private int pullRequestStatus;
|
||||
@JsonProperty("pull_request_head")
|
||||
private String pullRequestHead;
|
||||
@JsonProperty("pull_request_base")
|
||||
private String pullRequestBase;
|
||||
@JsonProperty("pull_request_staus")
|
||||
private String pullRequestStaus;
|
||||
@JsonProperty("is_original")
|
||||
private boolean isOriginal;
|
||||
@JsonProperty("fork_project_id")
|
||||
private String forkProjectId;
|
||||
@JsonProperty("fork_project_identifier")
|
||||
private String forkProjectIdentifier;
|
||||
@JsonProperty("fork_project_user")
|
||||
private String forkProjectUser;
|
||||
@JsonProperty("fork_project_user_name")
|
||||
private String forkProjectUserName;
|
||||
private List<String> reviewers;
|
||||
private int id;
|
||||
private String name;
|
||||
@JsonProperty("pr_time")
|
||||
private String prTime;
|
||||
@JsonProperty("assign_user_name")
|
||||
private String assignUserName;
|
||||
@JsonProperty("assign_user_login")
|
||||
private String assignUserLogin;
|
||||
@JsonProperty("author_name")
|
||||
private String authorName;
|
||||
@JsonProperty("author_login")
|
||||
private String authorLogin;
|
||||
@JsonProperty("avatar_url")
|
||||
private String avatarUrl;
|
||||
private String priority;
|
||||
private String version;
|
||||
@JsonProperty("journals_count")
|
||||
private int journalsCount;
|
||||
@JsonProperty("issue_tags")
|
||||
private String issueTags;
|
||||
@JsonProperty("attached_issues")
|
||||
private List<String> attachedIssues;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class IssuesVo {
|
||||
private Long id;
|
||||
private Long projectId;
|
||||
private String subject;
|
||||
private String description;
|
||||
private Long statusId;
|
||||
private List<Long> statusIds;
|
||||
private Long num;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.microservices.dms.referral.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PullRequestVo {
|
||||
private Long id;
|
||||
private Long projectId;
|
||||
private Long userId;
|
||||
private Long giteaNumber;
|
||||
private String title;
|
||||
private String description;
|
||||
private Long statusId;
|
||||
private List<Long> statusIds;
|
||||
private Long num;
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.resourceLibrary.domain.*;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "数据管理体系-用户行为信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/collectUserActData")
|
||||
@RequiredArgsConstructor
|
||||
public class CollectUserActDataController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
|
||||
@PostMapping("/addClicker")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
@ApiOperation(value = "记录点击次数")
|
||||
public AjaxResult addTaskClick(@RequestBody Clicker clicker) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addClick(clicker));
|
||||
}
|
||||
|
||||
@PostMapping("/addDownloader")
|
||||
@ApiOperation(value = "记录下载次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "downloadType", value = "下载类型(任务:makerSpaceTask、竞赛作品:CompetitionOpusDownload、成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "downloadId", value = "下载对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addDownloader(@RequestBody Downloader downloader) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addDownloader(downloader));
|
||||
}
|
||||
|
||||
@PostMapping("/addSearcher")
|
||||
@ApiOperation(value = "记录搜索次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "searchType", value = "搜索类型(任务:makerSpaceTask、项目:Project、竞赛:CompetitionInfo)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "searchId", value = "搜索对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addSearcher(@RequestBody Searcher searcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addSearcher(searcher));
|
||||
}
|
||||
|
||||
@PostMapping("/addSearcher2")
|
||||
@ApiOperation(value = "记录搜索次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "searchType", value = "搜索类型(任务:makerSpaceTask、项目:Project、竞赛:CompetitionInfo)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "searchIds", value = "搜索对象ID,多个,分隔", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addSearcher2(@RequestBody Searcher searcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addSearcher2(searcher));
|
||||
}
|
||||
|
||||
@PostMapping("/addFavorite")
|
||||
@ApiOperation(value = "记录收藏次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "收藏类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addFavorite(@RequestBody Favorite favorite) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addFavorite(favorite));
|
||||
}
|
||||
|
||||
@PostMapping("/addWatcher")
|
||||
@ApiOperation(value = "记录关注次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "关注类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
public AjaxResult addFavorite(@RequestBody Watcher watcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.addWatcher(watcher));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delFavorite")
|
||||
@ApiOperation(value = "删除收藏次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "收藏类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult delFavorite(Favorite favorite) {
|
||||
return AjaxResult.success(taskResourceLibraryService.delFavorite(favorite));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delWatcher")
|
||||
@ApiOperation(value = "删除关注次数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "favoriteType", value = "关注类型(成果:Achievements、专家:Experts)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "favoriteId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult delWatcher(Watcher watcher) {
|
||||
return AjaxResult.success(taskResourceLibraryService.delWatcher(watcher));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
|
||||
import com.microservices.dms.resourceLibrary.service.CompetitionResourceLibraryService;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
import static com.microservices.common.core.web.domain.AjaxResult.success;
|
||||
|
||||
@Api(tags = "数据管理体系-竞赛资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/competitionResourceLibrary")
|
||||
@RequiredArgsConstructor
|
||||
public class CompetitionResourceLibraryController extends BaseController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
private final CompetitionResourceLibraryService competitionResourceLibraryService;
|
||||
|
||||
@GetMapping("/selectRegisterCondition")
|
||||
@ApiOperation(value = "查询用户报名")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectRegisterCondition(UserActionDataVo taskJournals) {
|
||||
startPage();
|
||||
List<UserActionDataVo> userActionDataVos = competitionResourceLibraryService.selectRegisterCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/selectOpusCondition")
|
||||
@ApiOperation(value = "查询用户作品")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "status", value = "状态3", paramType = "query", dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectOpusCondition(UserActionDataVo taskJournals) {
|
||||
startPage();
|
||||
List<UserActionDataVo> userActionDataVos = competitionResourceLibraryService.selectOpusCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/selectCompetitionListCondition")
|
||||
@ApiOperation(value = "查询竞赛作品列表")
|
||||
public GenericsTableDataInfo<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo taskJournals) {
|
||||
startPage();
|
||||
List<CompetitionListVo> userActionDataVos = competitionResourceLibraryService.selectCompetitionListCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
startPage();
|
||||
List<CompetitionResourceLibrary> list = competitionResourceLibraryService.selectCompetitionResourceLibraryList(competitionResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
List<CompetitionResourceLibrary> list = competitionResourceLibraryService.selectCompetitionResourceLibraryList(competitionResourceLibrary);
|
||||
ExcelUtil<CompetitionResourceLibrary> util = new ExcelUtil<CompetitionResourceLibrary>(CompetitionResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(competitionResourceLibraryService.selectCompetitionResourceLibraryById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
return success(competitionResourceLibraryService.insertCompetitionResourceLibrary(competitionResourceLibrary));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
return success(competitionResourceLibraryService.updateCompetitionResourceLibrary(competitionResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return success(competitionResourceLibraryService.deleteCompetitionResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回开放竞赛总数
|
||||
*
|
||||
* @return 开放竞赛总数
|
||||
*/
|
||||
@ApiOperation(value = "返回开放竞赛总数")
|
||||
@GetMapping(value = "/getTotalOpenCompetitions")
|
||||
public AjaxResult getTotalOpenCompetitions() {
|
||||
// 这里替换成你的实际逻辑,例如从数据库查询
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalOpenCompetitions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛转换成果数
|
||||
*
|
||||
* @return 竞赛转换成果数
|
||||
*/
|
||||
@ApiOperation(value = "返回竞赛转换成果数")
|
||||
@GetMapping(value = "/getTotalCompetitionAchievements")
|
||||
public AjaxResult getTotalCompetitionAchievements() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalCompetitionAchievements());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛提交作品数
|
||||
*
|
||||
* @return 竞赛提交作品数
|
||||
*/
|
||||
@ApiOperation(value = "返回竞赛提交作品数")
|
||||
@GetMapping(value = "/getTotalCompetitionSubmissions")
|
||||
public AjaxResult getTotalCompetitionSubmissions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalCompetitionSubmissions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回已结束竞赛数
|
||||
*
|
||||
* @return 已结束竞赛数
|
||||
*/
|
||||
@ApiOperation(value = "返回已结束竞赛数")
|
||||
@GetMapping(value = "/getTotalFinishedCompetitions")
|
||||
public AjaxResult getTotalFinishedCompetitions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getTotalFinishedCompetitions());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回需评审竞赛数
|
||||
*
|
||||
* @return 需评审竞赛数
|
||||
*/
|
||||
@ApiOperation(value = "需评审竞赛数")
|
||||
@GetMapping(value = "/getReviewCompetitionCount")
|
||||
public AjaxResult getReviewCompetitionCount() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return AjaxResult.success(competitionResourceLibraryService.getReviewCompetitionCount());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 专家资源库Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
@Api(tags = "数据管理体系-优质专家库")
|
||||
@RestController
|
||||
@RequestMapping("/expertResourceLibrary")
|
||||
public class ExpertResourceLibraryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IExpertResourceLibraryService expertResourceLibraryService;
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/listFront")
|
||||
public TableDataInfo listFront(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList2(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出专家资源库列表
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList(expertResourceLibrary);
|
||||
ExcelUtil<ExpertResourceLibrary> util = new ExcelUtil<ExpertResourceLibrary>(ExpertResourceLibrary.class);
|
||||
util.exportExcel(response, list, "专家资源库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专家资源库详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(expertResourceLibraryService.selectExpertResourceLibraryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.insertExpertResourceLibrary(expertResourceLibrary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.updateExpertResourceLibrary(expertResourceLibrary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除专家资源库
|
||||
*/
|
||||
@Log(title = "专家资源库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(expertResourceLibraryService.deleteExpertResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "评审专家数")
|
||||
@GetMapping("/auditExpertCount")
|
||||
public AjaxResult auditExpertCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.auditExpertCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "竞赛评审数")
|
||||
@GetMapping("/competitionAuditCount")
|
||||
public AjaxResult competitionAuditCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.competitionAuditCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "任务评审数")
|
||||
@GetMapping("/taskAuditCount")
|
||||
public AjaxResult taskAuditCount()
|
||||
{
|
||||
return AjaxResult.success(expertResourceLibraryService.taskAuditCount());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据当前用户以及专家ID,获取当前专家的 是否收藏与关注状态")
|
||||
@GetMapping("/getWatchFavoriteStatusById")
|
||||
public AjaxResult getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return success(expertResourceLibraryService.getWatchFavoriteStatusById(id, userId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据成果ID,获取专家的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||
@GetMapping("/getActDataStatisticById")
|
||||
public AjaxResult getActDataStatisticById(Long id) {
|
||||
return success(expertResourceLibraryService.getActDataStatisticById(id));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.ProjectResourceLibraryService;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "数据管理体系-项目资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/projectResourceLibrary/")
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectResourceLibraryController extends BaseController {
|
||||
|
||||
private final ProjectResourceLibraryService projectResourceLibraryService;
|
||||
|
||||
@GetMapping("selectSearcherCondition")
|
||||
@ApiOperation(value = "查询用户搜索")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(Project)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectSearcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectSearchCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectCodeCommitCondition")
|
||||
@ApiOperation(value = "查询用户提交")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectCodeCommitCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectCodeCommitCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectForkCondition")
|
||||
@ApiOperation(value = "查询用户Fork")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectForkCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectForkCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectIssueCondition")
|
||||
@ApiOperation(value = "查询用户Issue")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectIssueCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectIssueCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPRCondition")
|
||||
@ApiOperation(value = "查询用户PR")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPRCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectPRCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPraisesCondition")
|
||||
@ApiOperation(value = "查询用户点赞")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(Project)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPraisesCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = projectResourceLibraryService.selectPraisesCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectProjectListCondition")
|
||||
@ApiOperation(value = "查询项目统计列表")
|
||||
public GenericsTableDataInfo<ProjectListVo> selectProjectListCondition(ProjectListVo projectListVo) {
|
||||
PageUtils.startPage();
|
||||
List<ProjectListVo> userActionDataVos = projectResourceLibraryService.selectProjectListCondition(projectListVo);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询项目资源库-列表")
|
||||
@GetMapping(value = "/list")
|
||||
public TableDataInfo list(ProjectResourceLibrary projectResourceLibrary) {
|
||||
startPage();
|
||||
List<ProjectResourceLibrary> list = projectResourceLibraryService.selectProjectResourceLibraryList(projectResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProjectResourceLibrary projectResourceLibrary) {
|
||||
List<ProjectResourceLibrary> list = projectResourceLibraryService.selectProjectResourceLibraryList(projectResourceLibrary);
|
||||
ExcelUtil<ProjectResourceLibrary> util = new ExcelUtil<ProjectResourceLibrary>(ProjectResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(projectResourceLibraryService.selectProjectResourceLibraryById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProjectResourceLibrary projectResourceLibrary) {
|
||||
return AjaxResult.success(projectResourceLibraryService.insertProjectResourceLibrary(projectResourceLibrary));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProjectResourceLibrary projectResourceLibrary) {
|
||||
return AjaxResult.success(projectResourceLibraryService.updateProjectResourceLibrary(projectResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return AjaxResult.success(projectResourceLibraryService.deleteProjectResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "项目转换成果数")
|
||||
@GetMapping(value = "/getTotalConversionCount")
|
||||
public AjaxResult getTotalConversionCount() {
|
||||
return success(projectResourceLibraryService.getTotalConversionCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目公开数")
|
||||
@GetMapping(value = "/getPublicProjectCount")
|
||||
public AjaxResult getPublicProjectCount() {
|
||||
return success(projectResourceLibraryService.getPublicProjectCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目发布版本数")
|
||||
@GetMapping(value = "/getTotalReleaseCount")
|
||||
public AjaxResult getTotalReleaseCount() {
|
||||
return success(projectResourceLibraryService.getTotalReleaseCount());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目总数")
|
||||
@GetMapping(value = "/getTotalProjectCount")
|
||||
public AjaxResult getTotalProjectCount() {
|
||||
return success(projectResourceLibraryService.getTotalProjectCount());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
package com.microservices.dms.resourceLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.PageUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.service.TaskResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "数据管理体系-任务资源库接口")
|
||||
@RestController
|
||||
@RequestMapping("/taskResourceLibrary")
|
||||
@RequiredArgsConstructor
|
||||
public class TaskResourceLibraryController extends BaseController {
|
||||
|
||||
private final TaskResourceLibraryService taskResourceLibraryService;
|
||||
|
||||
|
||||
@GetMapping("/selectTaskJournalsCondition")
|
||||
@ApiOperation(value = "查询用户评论")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectTaskJournalsCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectTaskJournalsCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectClickerCondition")
|
||||
@ApiOperation(value = "查询用户点击")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectClickerCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectClickerCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectDownloaderCondition")
|
||||
@ApiOperation(value = "查询用户下载")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectDownloaderCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectDownloaderCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectVisitCondition")
|
||||
@ApiOperation(value = "查询用户点击")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectVisitCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectVisitCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectPapersCondition")
|
||||
@ApiOperation(value = "查询用户交稿")
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectPapersCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectPapersCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectWatcherCondition")
|
||||
@ApiOperation(value = "查询用户关注")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:MakerTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectWatcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectWatcherCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectSearcherCondition")
|
||||
@ApiOperation(value = "查询用户搜索")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "itemType", value = "类型(任务:makerSpaceTask)", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "itemId", value = "对象ID", paramType = "query", dataTypeClass = String.class),
|
||||
})
|
||||
public GenericsTableDataInfo<UserActionDataVo> selectSearcherCondition(UserActionDataVo taskJournals) {
|
||||
PageUtils.startPage();
|
||||
List<UserActionDataVo> userActionDataVos = taskResourceLibraryService.selectSearcherCondition(taskJournals);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("selectTaskListCondition")
|
||||
@ApiOperation(value = "查询任务列表")
|
||||
public GenericsTableDataInfo<TaskListVo> selectTaskListCondition(TaskListVo taskListVo) {
|
||||
PageUtils.startPage();
|
||||
List<TaskListVo> userActionDataVos = taskResourceLibraryService.selectTaskListCondition(taskListVo);
|
||||
return PageUtils.toPage(userActionDataVos);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TaskResourceLibrary taskResourceLibrary) {
|
||||
startPage();
|
||||
List<TaskResourceLibrary> list = taskResourceLibraryService.selectTaskResourceLibraryList(taskResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TaskResourceLibrary taskResourceLibrary) {
|
||||
List<TaskResourceLibrary> list = taskResourceLibraryService.selectTaskResourceLibraryList(taskResourceLibrary);
|
||||
ExcelUtil<TaskResourceLibrary> util = new ExcelUtil<TaskResourceLibrary>(TaskResourceLibrary.class);
|
||||
util.exportExcel(response, list, "数据");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(taskResourceLibraryService.selectTaskResourceLibraryById(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TaskResourceLibrary taskResourceLibrary) {
|
||||
return AjaxResult.success(taskResourceLibraryService.insertTaskResourceLibrary(taskResourceLibrary));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TaskResourceLibrary taskResourceLibrary) {
|
||||
return AjaxResult.success(taskResourceLibraryService.updateTaskResourceLibrary(taskResourceLibrary));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return AjaxResult.success(taskResourceLibraryService.deleteTaskResourceLibraryByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getTotalTasks")
|
||||
@ApiOperation(value = "获取任务总数")
|
||||
public AjaxResult getTotalTasks() {
|
||||
return success(taskResourceLibraryService.getTotalTasks());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getConvertedTaskAmount")
|
||||
@ApiOperation(value = "获取转换成果任务金额")
|
||||
public AjaxResult getConvertedTaskAmount() {
|
||||
return success(taskResourceLibraryService.getConvertedTaskAmount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getConvertedTasksCount")
|
||||
@ApiOperation(value = "获取任务转换成果数")
|
||||
public AjaxResult getConvertedTasksCount() {
|
||||
return success(taskResourceLibraryService.getConvertedTasksCount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getTaskAmount")
|
||||
@ApiOperation(value = "获取任务金额")
|
||||
public AjaxResult getTaskAmount() {
|
||||
return success(taskResourceLibraryService.getTaskAmount());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getReviewTaskCount")
|
||||
@ApiOperation(value = "需评审任务数")
|
||||
public AjaxResult getReviewTaskCount() {
|
||||
return success(taskResourceLibraryService.getReviewTaskCount());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Clicker{
|
||||
private Long id;
|
||||
private String clickType;
|
||||
private Long clickId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,276 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* @author microservices
|
||||
* @date 2025-04-09
|
||||
*/
|
||||
public class CompetitionResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 开放竞赛ID
|
||||
*/
|
||||
private Long openCompetitionId;
|
||||
/**
|
||||
* 开放竞赛名称
|
||||
*/
|
||||
private String openCompetitionName;
|
||||
/**
|
||||
* 开放竞赛创建者
|
||||
*/
|
||||
private Long competitionUserId;
|
||||
/**
|
||||
* 竞赛领域
|
||||
*/
|
||||
private String competitionField;
|
||||
/**
|
||||
* 竞赛状态 0进行中 1已结束
|
||||
*/
|
||||
private String competitionStatus;
|
||||
/**
|
||||
* 竞赛提交名称
|
||||
*/
|
||||
private String competitionSubmissionName;
|
||||
/**
|
||||
* 作品提交时间
|
||||
*/
|
||||
private Date submissionTime;
|
||||
/**
|
||||
* 提交者
|
||||
*/
|
||||
private String submitter;
|
||||
/**
|
||||
* 提交类型
|
||||
*/
|
||||
private String submissionType;
|
||||
/**
|
||||
* 提交单位
|
||||
*/
|
||||
private String submittingUnit;
|
||||
/**
|
||||
* 竞赛提交摘要
|
||||
*/
|
||||
private String submissionSummary;
|
||||
/**
|
||||
* 竞赛提交详情
|
||||
*/
|
||||
private String submissionDetails;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactPerson;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
/**
|
||||
* 是否已转入成果库 0否 1是
|
||||
*/
|
||||
private Integer isTransferredToResultLibrary;
|
||||
/**
|
||||
* 转入成果库时间
|
||||
*/
|
||||
private Date transferredToResultLibraryTime;
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
private Integer isFeaturedResult;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 专家审核
|
||||
*/
|
||||
private Integer isExpertAudit;
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String attachment;
|
||||
|
||||
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
|
||||
|
||||
public Integer getIsExpertAudit() {
|
||||
return isExpertAudit;
|
||||
}
|
||||
|
||||
public void setIsExpertAudit(Integer isExpertAudit) {
|
||||
this.isExpertAudit = isExpertAudit;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setOpenCompetitionId(Long openCompetitionId) {
|
||||
this.openCompetitionId = openCompetitionId;
|
||||
}
|
||||
|
||||
public Long getOpenCompetitionId() {
|
||||
return openCompetitionId;
|
||||
}
|
||||
|
||||
public void setOpenCompetitionName(String openCompetitionName) {
|
||||
this.openCompetitionName = openCompetitionName;
|
||||
}
|
||||
|
||||
public String getOpenCompetitionName() {
|
||||
return openCompetitionName;
|
||||
}
|
||||
|
||||
public void setCompetitionUserId(Long competitionUserId) {
|
||||
this.competitionUserId = competitionUserId;
|
||||
}
|
||||
|
||||
public Long getCompetitionUserId() {
|
||||
return competitionUserId;
|
||||
}
|
||||
|
||||
public void setCompetitionField(String competitionField) {
|
||||
this.competitionField = competitionField;
|
||||
}
|
||||
|
||||
public String getCompetitionField() {
|
||||
return competitionField;
|
||||
}
|
||||
|
||||
public void setCompetitionStatus(String competitionStatus) {
|
||||
this.competitionStatus = competitionStatus;
|
||||
}
|
||||
|
||||
public String getCompetitionStatus() {
|
||||
return competitionStatus;
|
||||
}
|
||||
|
||||
public void setCompetitionSubmissionName(String competitionSubmissionName) {
|
||||
this.competitionSubmissionName = competitionSubmissionName;
|
||||
}
|
||||
|
||||
public String getCompetitionSubmissionName() {
|
||||
return competitionSubmissionName;
|
||||
}
|
||||
|
||||
public void setSubmissionTime(Date submissionTime) {
|
||||
this.submissionTime = submissionTime;
|
||||
}
|
||||
|
||||
public Date getSubmissionTime() {
|
||||
return submissionTime;
|
||||
}
|
||||
|
||||
public void setSubmitter(String submitter) {
|
||||
this.submitter = submitter;
|
||||
}
|
||||
|
||||
public String getSubmitter() {
|
||||
return submitter;
|
||||
}
|
||||
|
||||
public void setSubmissionType(String submissionType) {
|
||||
this.submissionType = submissionType;
|
||||
}
|
||||
|
||||
public String getSubmissionType() {
|
||||
return submissionType;
|
||||
}
|
||||
|
||||
public void setSubmittingUnit(String submittingUnit) {
|
||||
this.submittingUnit = submittingUnit;
|
||||
}
|
||||
|
||||
public String getSubmittingUnit() {
|
||||
return submittingUnit;
|
||||
}
|
||||
|
||||
public void setSubmissionSummary(String submissionSummary) {
|
||||
this.submissionSummary = submissionSummary;
|
||||
}
|
||||
|
||||
public String getSubmissionSummary() {
|
||||
return submissionSummary;
|
||||
}
|
||||
|
||||
public void setSubmissionDetails(String submissionDetails) {
|
||||
this.submissionDetails = submissionDetails;
|
||||
}
|
||||
|
||||
public String getSubmissionDetails() {
|
||||
return submissionDetails;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToResultLibrary(Integer isTransferredToResultLibrary) {
|
||||
this.isTransferredToResultLibrary = isTransferredToResultLibrary;
|
||||
}
|
||||
|
||||
public Integer getIsTransferredToResultLibrary() {
|
||||
return isTransferredToResultLibrary;
|
||||
}
|
||||
|
||||
public void setTransferredToResultLibraryTime(Date transferredToResultLibraryTime) {
|
||||
this.transferredToResultLibraryTime = transferredToResultLibraryTime;
|
||||
}
|
||||
|
||||
public Date getTransferredToResultLibraryTime() {
|
||||
return transferredToResultLibraryTime;
|
||||
}
|
||||
|
||||
public void setIsFeaturedResult(Integer isFeaturedResult) {
|
||||
this.isFeaturedResult = isFeaturedResult;
|
||||
}
|
||||
|
||||
public Integer getIsFeaturedResult() {
|
||||
return isFeaturedResult;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setAttachment(String attachment) {
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
public String getAttachment() {
|
||||
return attachment;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Downloader {
|
||||
private Long id;
|
||||
private String downloadType;
|
||||
private Long downloadId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
|
@ -0,0 +1,334 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 专家资源库对象 expert_resource_library
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
public class ExpertResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long expertId;
|
||||
private Long id;
|
||||
//专家ID
|
||||
private Long userId;
|
||||
//专家名称
|
||||
private String expertName;
|
||||
//最高学历
|
||||
private String highestDegree;
|
||||
//毕业院校
|
||||
private String graduatedFrom;
|
||||
//身份证
|
||||
private String idNumber;
|
||||
|
||||
private String major;
|
||||
//工作单位
|
||||
private String workplace;
|
||||
//电话
|
||||
private String phone;
|
||||
|
||||
private String workplaceType;
|
||||
//邮箱
|
||||
private String expertEmail;
|
||||
//专家简介
|
||||
private String expertSummary;
|
||||
//专家详情
|
||||
private String expertDetail;
|
||||
|
||||
private String professionalTitle;
|
||||
|
||||
private String expertType;
|
||||
//专家领域
|
||||
private String expertDomain;
|
||||
|
||||
private String titleRank;
|
||||
|
||||
private Long status;
|
||||
//评审领域1
|
||||
private String reviewAreaOne;
|
||||
//评审领域2
|
||||
private String reviewAreaTwo;
|
||||
//评审领域3
|
||||
private String reviewAreaThree;
|
||||
|
||||
private Integer isDelete;
|
||||
|
||||
private Long expertAuth;
|
||||
|
||||
private Integer sortNo;
|
||||
|
||||
private Long taskAuditCount;
|
||||
|
||||
private Long competitionAuditCount;
|
||||
|
||||
private String images;
|
||||
private String attachments;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
|
||||
public Long getWatcherSum() {
|
||||
return watcherSum;
|
||||
}
|
||||
|
||||
public void setWatcherSum(Long watcherSum) {
|
||||
this.watcherSum = watcherSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public Long getExpertAuth() {
|
||||
return expertAuth;
|
||||
}
|
||||
|
||||
public void setExpertAuth(Long expertAuth) {
|
||||
this.expertAuth = expertAuth;
|
||||
}
|
||||
|
||||
public Long getTaskAuditCount() {
|
||||
return taskAuditCount;
|
||||
}
|
||||
|
||||
public void setTaskAuditCount(Long taskAuditCount) {
|
||||
this.taskAuditCount = taskAuditCount;
|
||||
}
|
||||
|
||||
public Long getCompetitionAuditCount() {
|
||||
return competitionAuditCount;
|
||||
}
|
||||
|
||||
public void setCompetitionAuditCount(Long competitionAuditCount) {
|
||||
this.competitionAuditCount = competitionAuditCount;
|
||||
}
|
||||
|
||||
public String gender;
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Integer getSortNo() {
|
||||
return sortNo;
|
||||
}
|
||||
|
||||
public void setSortNo(Integer sortNo) {
|
||||
this.sortNo = sortNo;
|
||||
}
|
||||
|
||||
public Long getExpertId() {
|
||||
return expertId;
|
||||
}
|
||||
|
||||
public void setExpertId(Long expertId) {
|
||||
this.expertId = expertId;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setExpertName(String expertName) {
|
||||
this.expertName = expertName;
|
||||
}
|
||||
|
||||
public String getExpertName() {
|
||||
return expertName;
|
||||
}
|
||||
|
||||
public void setHighestDegree(String highestDegree) {
|
||||
this.highestDegree = highestDegree;
|
||||
}
|
||||
|
||||
public String getHighestDegree() {
|
||||
return highestDegree;
|
||||
}
|
||||
|
||||
public void setGraduatedFrom(String graduatedFrom) {
|
||||
this.graduatedFrom = graduatedFrom;
|
||||
}
|
||||
|
||||
public String getGraduatedFrom() {
|
||||
return graduatedFrom;
|
||||
}
|
||||
|
||||
public void setIdNumber(String idNumber) {
|
||||
this.idNumber = idNumber;
|
||||
}
|
||||
|
||||
public String getIdNumber() {
|
||||
return idNumber;
|
||||
}
|
||||
|
||||
public void setMajor(String major) {
|
||||
this.major = major;
|
||||
}
|
||||
|
||||
public String getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
public void setWorkplace(String workplace) {
|
||||
this.workplace = workplace;
|
||||
}
|
||||
|
||||
public String getWorkplace() {
|
||||
return workplace;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setWorkplaceType(String workplaceType) {
|
||||
this.workplaceType = workplaceType;
|
||||
}
|
||||
|
||||
public String getWorkplaceType() {
|
||||
return workplaceType;
|
||||
}
|
||||
|
||||
public void setExpertEmail(String expertEmail) {
|
||||
this.expertEmail = expertEmail;
|
||||
}
|
||||
|
||||
public String getExpertEmail() {
|
||||
return expertEmail;
|
||||
}
|
||||
|
||||
public void setExpertSummary(String expertSummary) {
|
||||
this.expertSummary = expertSummary;
|
||||
}
|
||||
|
||||
public String getExpertSummary() {
|
||||
return expertSummary;
|
||||
}
|
||||
|
||||
public void setExpertDetail(String expertDetail) {
|
||||
this.expertDetail = expertDetail;
|
||||
}
|
||||
|
||||
public String getExpertDetail() {
|
||||
return expertDetail;
|
||||
}
|
||||
|
||||
public void setProfessionalTitle(String professionalTitle) {
|
||||
this.professionalTitle = professionalTitle;
|
||||
}
|
||||
|
||||
public String getProfessionalTitle() {
|
||||
return professionalTitle;
|
||||
}
|
||||
|
||||
public void setExpertType(String expertType) {
|
||||
this.expertType = expertType;
|
||||
}
|
||||
|
||||
public String getExpertType() {
|
||||
return expertType;
|
||||
}
|
||||
|
||||
public void setExpertDomain(String expertDomain) {
|
||||
this.expertDomain = expertDomain;
|
||||
}
|
||||
|
||||
public String getExpertDomain() {
|
||||
return expertDomain;
|
||||
}
|
||||
|
||||
public void setTitleRank(String titleRank) {
|
||||
this.titleRank = titleRank;
|
||||
}
|
||||
|
||||
public String getTitleRank() {
|
||||
return titleRank;
|
||||
}
|
||||
|
||||
public void setStatus(Long status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setReviewAreaOne(String reviewAreaOne) {
|
||||
this.reviewAreaOne = reviewAreaOne;
|
||||
}
|
||||
|
||||
public String getReviewAreaOne() {
|
||||
return reviewAreaOne;
|
||||
}
|
||||
|
||||
public void setReviewAreaTwo(String reviewAreaTwo) {
|
||||
this.reviewAreaTwo = reviewAreaTwo;
|
||||
}
|
||||
|
||||
public String getReviewAreaTwo() {
|
||||
return reviewAreaTwo;
|
||||
}
|
||||
|
||||
public void setReviewAreaThree(String reviewAreaThree) {
|
||||
this.reviewAreaThree = reviewAreaThree;
|
||||
}
|
||||
|
||||
public String getReviewAreaThree() {
|
||||
return reviewAreaThree;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Favorite {
|
||||
private Long id;
|
||||
private String favoriteType;
|
||||
private Long favoriteId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 对象 project_resource_library
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-07
|
||||
*/
|
||||
public class ProjectResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id;
|
||||
//项目资源名称
|
||||
private String projectName;
|
||||
//项目领域
|
||||
private String projectDomain;
|
||||
//
|
||||
private String identifier;
|
||||
//开源项目ID
|
||||
private Long projectId;
|
||||
//仓库ID
|
||||
private Long repositoryId;
|
||||
//版本Id
|
||||
private Long versionReleasesId;
|
||||
//项目是否已公开
|
||||
private Long isPublic;
|
||||
//发版名称
|
||||
private String releaseName;
|
||||
//发版时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date releaseDate;
|
||||
//发版人
|
||||
private String releasePerson;
|
||||
//发版类型
|
||||
private String releaseType;
|
||||
//发版单位
|
||||
private String releaseUnit;
|
||||
//发版摘要
|
||||
private String releaseSummary;
|
||||
//发版详情
|
||||
private String releaseDetails;
|
||||
//联系人
|
||||
private String contactPerson;
|
||||
//联系时间
|
||||
private String contactPhone;
|
||||
//是否已转入成果库
|
||||
private Long isTransferredToAchievement;
|
||||
//转入成果库时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date transferDate;
|
||||
//是否精选成果
|
||||
private Long isSelectedAchievement;
|
||||
//图片
|
||||
private String images;
|
||||
//附件
|
||||
private String attachments;
|
||||
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
|
||||
|
||||
public String getProjectDomain() {
|
||||
return projectDomain;
|
||||
}
|
||||
|
||||
public void setProjectDomain(String projectDomain) {
|
||||
this.projectDomain = projectDomain;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
public void setIdentifier(String identifier) {
|
||||
this.identifier = identifier;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setRepositoryId(Long repositoryId) {
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
|
||||
public Long getRepositoryId() {
|
||||
return repositoryId;
|
||||
}
|
||||
|
||||
public void setVersionReleasesId(Long versionReleasesId) {
|
||||
this.versionReleasesId = versionReleasesId;
|
||||
}
|
||||
|
||||
public Long getVersionReleasesId() {
|
||||
return versionReleasesId;
|
||||
}
|
||||
|
||||
public void setIsPublic(Long isPublic) {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
|
||||
public Long getIsPublic() {
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
public void setReleaseName(String releaseName) {
|
||||
this.releaseName = releaseName;
|
||||
}
|
||||
|
||||
public String getReleaseName() {
|
||||
return releaseName;
|
||||
}
|
||||
|
||||
public void setReleaseDate(Date releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
public Date getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleasePerson(String releasePerson) {
|
||||
this.releasePerson = releasePerson;
|
||||
}
|
||||
|
||||
public String getReleasePerson() {
|
||||
return releasePerson;
|
||||
}
|
||||
|
||||
public void setReleaseType(String releaseType) {
|
||||
this.releaseType = releaseType;
|
||||
}
|
||||
|
||||
public String getReleaseType() {
|
||||
return releaseType;
|
||||
}
|
||||
|
||||
public void setReleaseUnit(String releaseUnit) {
|
||||
this.releaseUnit = releaseUnit;
|
||||
}
|
||||
|
||||
public String getReleaseUnit() {
|
||||
return releaseUnit;
|
||||
}
|
||||
|
||||
public void setReleaseSummary(String releaseSummary) {
|
||||
this.releaseSummary = releaseSummary;
|
||||
}
|
||||
|
||||
public String getReleaseSummary() {
|
||||
return releaseSummary;
|
||||
}
|
||||
|
||||
public void setReleaseDetails(String releaseDetails) {
|
||||
this.releaseDetails = releaseDetails;
|
||||
}
|
||||
|
||||
public String getReleaseDetails() {
|
||||
return releaseDetails;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToAchievement(Long isTransferredToAchievement) {
|
||||
this.isTransferredToAchievement = isTransferredToAchievement;
|
||||
}
|
||||
|
||||
public Long getIsTransferredToAchievement() {
|
||||
return isTransferredToAchievement;
|
||||
}
|
||||
|
||||
public void setTransferDate(Date transferDate) {
|
||||
this.transferDate = transferDate;
|
||||
}
|
||||
|
||||
public Date getTransferDate() {
|
||||
return transferDate;
|
||||
}
|
||||
|
||||
public void setIsSelectedAchievement(Long isSelectedAchievement) {
|
||||
this.isSelectedAchievement = isSelectedAchievement;
|
||||
}
|
||||
|
||||
public Long getIsSelectedAchievement() {
|
||||
return isSelectedAchievement;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Searcher {
|
||||
private Long id;
|
||||
private String searchType;
|
||||
private Long searchId;
|
||||
private String searchIds;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* @author microservices
|
||||
* @date 2025-04-08
|
||||
*/
|
||||
public class TaskResourceLibrary extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//
|
||||
private Long id;
|
||||
//创客任务ID
|
||||
private Long taskId;
|
||||
//
|
||||
private Long paperId;
|
||||
//创客任务名称
|
||||
private String taskName;
|
||||
//任务领域
|
||||
private String taskDomain;
|
||||
//创客任务金额
|
||||
private BigDecimal taskAmount;
|
||||
//胜出交稿名称
|
||||
private String submissionName;
|
||||
//交稿时间
|
||||
private Date submissionDate;
|
||||
//交稿人
|
||||
private String submitterName;
|
||||
//交稿类型
|
||||
private String submissionType;
|
||||
//交稿单位
|
||||
private String submissionOrganization;
|
||||
//交稿摘要
|
||||
private String submissionSummary;
|
||||
//交稿详情
|
||||
private String releaseDetails;
|
||||
//联系人
|
||||
private String contactName;
|
||||
//联系电话
|
||||
private String contactPhone;
|
||||
//是否已转入成果库
|
||||
private Long isTransferredToResultsLibrary;
|
||||
//转入成果库时间
|
||||
private Date transferToResultsDate;
|
||||
//是否精选成果 0否 1是
|
||||
private Long isSelectedResult;
|
||||
//图片
|
||||
private String imageUrl;
|
||||
//附件
|
||||
private String attachmentUrl;
|
||||
private List<KeyValVo<String, String>> attachmentList;
|
||||
//专家审核
|
||||
private Integer expertReview;
|
||||
|
||||
public Integer getExpertReview() {
|
||||
return expertReview;
|
||||
}
|
||||
|
||||
public void setExpertReview(Integer expertReview) {
|
||||
this.expertReview = expertReview;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, String>> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setPaperId(Long paperId) {
|
||||
this.paperId = paperId;
|
||||
}
|
||||
|
||||
public Long getPaperId() {
|
||||
return paperId;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskDomain(String taskDomain) {
|
||||
this.taskDomain = taskDomain;
|
||||
}
|
||||
|
||||
public String getTaskDomain() {
|
||||
return taskDomain;
|
||||
}
|
||||
|
||||
public void setTaskAmount(BigDecimal taskAmount) {
|
||||
this.taskAmount = taskAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaskAmount() {
|
||||
return taskAmount;
|
||||
}
|
||||
|
||||
public void setSubmissionName(String submissionName) {
|
||||
this.submissionName = submissionName;
|
||||
}
|
||||
|
||||
public String getSubmissionName() {
|
||||
return submissionName;
|
||||
}
|
||||
|
||||
public void setSubmissionDate(Date submissionDate) {
|
||||
this.submissionDate = submissionDate;
|
||||
}
|
||||
|
||||
public Date getSubmissionDate() {
|
||||
return submissionDate;
|
||||
}
|
||||
|
||||
public void setSubmitterName(String submitterName) {
|
||||
this.submitterName = submitterName;
|
||||
}
|
||||
|
||||
public String getSubmitterName() {
|
||||
return submitterName;
|
||||
}
|
||||
|
||||
public void setSubmissionType(String submissionType) {
|
||||
this.submissionType = submissionType;
|
||||
}
|
||||
|
||||
public String getSubmissionType() {
|
||||
return submissionType;
|
||||
}
|
||||
|
||||
public void setSubmissionOrganization(String submissionOrganization) {
|
||||
this.submissionOrganization = submissionOrganization;
|
||||
}
|
||||
|
||||
public String getSubmissionOrganization() {
|
||||
return submissionOrganization;
|
||||
}
|
||||
|
||||
public void setSubmissionSummary(String submissionSummary) {
|
||||
this.submissionSummary = submissionSummary;
|
||||
}
|
||||
|
||||
public String getSubmissionSummary() {
|
||||
return submissionSummary;
|
||||
}
|
||||
|
||||
public void setReleaseDetails(String releaseDetails) {
|
||||
this.releaseDetails = releaseDetails;
|
||||
}
|
||||
|
||||
public String getReleaseDetails() {
|
||||
return releaseDetails;
|
||||
}
|
||||
|
||||
public void setContactName(String contactName) {
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getContactName() {
|
||||
return contactName;
|
||||
}
|
||||
|
||||
public void setContactPhone(String contactPhone) {
|
||||
this.contactPhone = contactPhone;
|
||||
}
|
||||
|
||||
public String getContactPhone() {
|
||||
return contactPhone;
|
||||
}
|
||||
|
||||
public void setIsTransferredToResultsLibrary(Long isTransferredToResultsLibrary) {
|
||||
this.isTransferredToResultsLibrary = isTransferredToResultsLibrary;
|
||||
}
|
||||
|
||||
public Long getIsTransferredToResultsLibrary() {
|
||||
return isTransferredToResultsLibrary;
|
||||
}
|
||||
|
||||
public void setTransferToResultsDate(Date transferToResultsDate) {
|
||||
this.transferToResultsDate = transferToResultsDate;
|
||||
}
|
||||
|
||||
public Date getTransferToResultsDate() {
|
||||
return transferToResultsDate;
|
||||
}
|
||||
|
||||
public void setIsSelectedResult(Long isSelectedResult) {
|
||||
this.isSelectedResult = isSelectedResult;
|
||||
}
|
||||
|
||||
public Long getIsSelectedResult() {
|
||||
return isSelectedResult;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setAttachmentUrl(String attachmentUrl) {
|
||||
this.attachmentUrl = attachmentUrl;
|
||||
}
|
||||
|
||||
public String getAttachmentUrl() {
|
||||
return attachmentUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("paperId", getPaperId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("taskDomain", getTaskDomain())
|
||||
.append("taskAmount", getTaskAmount())
|
||||
.append("submissionName", getSubmissionName())
|
||||
.append("submissionDate", getSubmissionDate())
|
||||
.append("submitterName", getSubmitterName())
|
||||
.append("submissionType", getSubmissionType())
|
||||
.append("submissionOrganization", getSubmissionOrganization())
|
||||
.append("submissionSummary", getSubmissionSummary())
|
||||
.append("releaseDetails", getReleaseDetails())
|
||||
.append("contactName", getContactName())
|
||||
.append("contactPhone", getContactPhone())
|
||||
.append("isTransferredToResultsLibrary", getIsTransferredToResultsLibrary())
|
||||
.append("transferToResultsDate", getTransferToResultsDate())
|
||||
.append("isSelectedResult", getIsSelectedResult())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("attachmentUrl", getAttachmentUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Watcher {
|
||||
private Long id;
|
||||
private String watchableType;
|
||||
private Long watchableId;
|
||||
private Long userId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private String extInfo;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CompetitionListVo {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String categoryName;
|
||||
private Long status;
|
||||
private Long totalTaskDays;
|
||||
|
||||
private Long visits;
|
||||
private Long watchersCount;
|
||||
private Long registrationsCount;
|
||||
private Long opusCount;
|
||||
private Long opusDownloadCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
|
||||
public class ExpertAttachmentVo {
|
||||
private Long expertId;
|
||||
private Long academicAchievementsAttachments;
|
||||
private Long honorsAttachments;
|
||||
private Long resumeAttachments;
|
||||
private Long titleCertificateAttachments;
|
||||
|
||||
public Long getExpertId() {
|
||||
return expertId;
|
||||
}
|
||||
|
||||
public void setExpertId(Long expertId) {
|
||||
this.expertId = expertId;
|
||||
}
|
||||
|
||||
public Long getAcademicAchievementsAttachments() {
|
||||
return academicAchievementsAttachments;
|
||||
}
|
||||
|
||||
public void setAcademicAchievementsAttachments(Long academicAchievementsAttachments) {
|
||||
this.academicAchievementsAttachments = academicAchievementsAttachments;
|
||||
}
|
||||
|
||||
public Long getHonorsAttachments() {
|
||||
return honorsAttachments;
|
||||
}
|
||||
|
||||
public void setHonorsAttachments(Long honorsAttachments) {
|
||||
this.honorsAttachments = honorsAttachments;
|
||||
}
|
||||
|
||||
public Long getResumeAttachments() {
|
||||
return resumeAttachments;
|
||||
}
|
||||
|
||||
public void setResumeAttachments(Long resumeAttachments) {
|
||||
this.resumeAttachments = resumeAttachments;
|
||||
}
|
||||
|
||||
public Long getTitleCertificateAttachments() {
|
||||
return titleCertificateAttachments;
|
||||
}
|
||||
|
||||
public void setTitleCertificateAttachments(Long titleCertificateAttachments) {
|
||||
this.titleCertificateAttachments = titleCertificateAttachments;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
public class KeyValVo<K, V> {
|
||||
private K k;
|
||||
private V v;
|
||||
|
||||
// 默认构造函数
|
||||
public KeyValVo() {}
|
||||
|
||||
// 带参构造函数
|
||||
public KeyValVo(K k, V v) {
|
||||
this.k = k;
|
||||
this.v = v;
|
||||
}
|
||||
|
||||
// Getters and Setters
|
||||
public K getK() {
|
||||
return k;
|
||||
}
|
||||
|
||||
public void setK(K k) {
|
||||
this.k = k;
|
||||
}
|
||||
|
||||
public V getV() {
|
||||
return v;
|
||||
}
|
||||
|
||||
public void setV(V v) {
|
||||
this.v = v;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ProjectListVo {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createdOn;
|
||||
private Long versionReleasesCount;
|
||||
private String projectLanguages;
|
||||
private String projectCategories;
|
||||
private Long categoryId;
|
||||
private Long praisesCount;
|
||||
private Long watchersCount;
|
||||
private Long forkedCount;
|
||||
private Long issuesCount;
|
||||
private Long pullRequestsCount;
|
||||
private Long commitsCount;
|
||||
private Long licenseId;
|
||||
private Long membersCount;
|
||||
private Long membersMonthAddCount;
|
||||
private Long projectSearchCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TaskListVo {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String categoryName;
|
||||
private Long categoryId;
|
||||
private BigDecimal bounty;
|
||||
private Long totalTaskDays;
|
||||
|
||||
private Long taskClickCount;
|
||||
private Long taskWatcherCount;
|
||||
private Long taskPapersCount;
|
||||
private Long taskJournalCount;
|
||||
private Long taskSearchCount;
|
||||
private Long taskDownloadCount;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.microservices.dms.resourceLibrary.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class UserActionDataVo {
|
||||
private Long id;
|
||||
private String itemType;
|
||||
private Long itemId;
|
||||
private String itemName;
|
||||
private Long userId;
|
||||
private String userName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "")
|
||||
private Date createdAt;
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface CompetitionResourceLibraryMapper {
|
||||
|
||||
List<UserActionDataVo> selectRegisterCondition(UserActionDataVo clicker);
|
||||
|
||||
List<UserActionDataVo> selectOpusCondition(UserActionDataVo searcher);
|
||||
|
||||
Long countRegisterCondition(UserActionDataVo clicker);
|
||||
|
||||
Long countOpusCondition(UserActionDataVo searcher);
|
||||
|
||||
List<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo downloader);
|
||||
|
||||
CompetitionResourceLibrary selectCompetitionResourceLibraryById(Long id);
|
||||
|
||||
List<CompetitionResourceLibrary> selectCompetitionResourceLibraryList(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int insertCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int updateCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);
|
||||
|
||||
int deleteCompetitionResourceLibraryById(Long id);
|
||||
|
||||
int deleteCompetitionResourceLibraryByIds(Long[] ids);
|
||||
|
||||
List<KeyValVo<String, String>> getAttachments(@Param("id") Long id);
|
||||
|
||||
long getTotalOpenCompetitions();
|
||||
|
||||
long getTotalCompetitionAchievements();
|
||||
|
||||
long getTotalCompetitionSubmissions();
|
||||
|
||||
long getTotalFinishedCompetitions();
|
||||
|
||||
long getReviewCompetitionCount();
|
||||
|
||||
Long getCompetitionFinish();
|
||||
|
||||
Long getCompetitionEnroll();
|
||||
|
||||
Long getCompetitionUnderway();
|
||||
|
||||
Long getCompetitionSubmitCount();
|
||||
|
||||
Long getCompetitionTransferCount();
|
||||
|
||||
Long getCompetitionNeedAuditCount();
|
||||
|
||||
List<KeyValueVo> getCompetitionStatisticYearly();
|
||||
|
||||
List<Map<String,Object>> getCompetitionHot();
|
||||
|
||||
List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValVo<String, Long>> getCompetitionYearlyFinish(@Param("s") Date s, @Param("e") Date e);
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.ExpertTotallVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 专家资源库Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface ExpertResourceLibraryMapper
|
||||
{
|
||||
/**
|
||||
* 查询专家资源库
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 专家资源库
|
||||
*/
|
||||
public ExpertResourceLibrary selectExpertResourceLibraryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 专家资源库集合
|
||||
*/
|
||||
public List<ExpertResourceLibrary> selectExpertResourceLibraryList(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 新增专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 修改专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 删除专家资源库
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExpertResourceLibraryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除专家资源库
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExpertResourceLibraryByIds(Long[] ids);
|
||||
|
||||
List<ExpertResourceLibrary> selectExpertResourceLibraryList2(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
Long auditExpertCount();
|
||||
|
||||
Long competitionAuditCount();
|
||||
|
||||
Long taskAuditCount();
|
||||
|
||||
Long expertResourceCount();
|
||||
|
||||
Long auditTaskAuditExpertCount();
|
||||
|
||||
Long auditCompetitionAuditExpertCount();
|
||||
|
||||
|
||||
List<KeyValueVo> getTitleRankStatistic();
|
||||
|
||||
List<KeyValueVo> getExpertTypeStatistic();
|
||||
|
||||
List<KeyValueVo> getHighestDegreeStatistic();
|
||||
|
||||
List<KeyValueVo> getWorkplaceTypeStatistic();
|
||||
|
||||
KeyValueVo getAuthenticationStatistic();
|
||||
|
||||
Long getExpertTotal();
|
||||
|
||||
List<KeyValueVo> getExpertTotalByYear();
|
||||
|
||||
List<KeyValueVo> getReviewAreasStatistic();
|
||||
|
||||
List<ExpertTotallVo> getExpertAduit();
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(@Param("id") Long id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(@Param("id") Long id, @Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getMemoAduit();
|
||||
|
||||
KeyValueVo getIsOriginalStatistic();
|
||||
|
||||
List<KeyValueVo> getMemoTotalByYear();
|
||||
|
||||
List<KeyValueVo> getForumSectionStatistic();
|
||||
|
||||
List<KeyValueVo> getAddMemoStatistic();
|
||||
|
||||
List<MemoTotalVo> getTop5Memos();
|
||||
|
||||
List<KeyValVo<String, Long>> get7DayPaise(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
ExpertAttachmentVo getExpertInfoById(@Param("expertId") Long expertId);
|
||||
|
||||
Map<String, Object> getAttachmentInfo(@Param("id") Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface ProjectResourceLibraryMapper {
|
||||
|
||||
List<ProjectListVo> selectProjectListCondition(ProjectListVo projectListVo);
|
||||
|
||||
List<UserActionDataVo> selectCodeCommitCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
List<UserActionDataVo> selectForkCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
List<UserActionDataVo> selectIssueCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
List<UserActionDataVo> selectPRCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
List<UserActionDataVo> selectPraisesCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
List<UserActionDataVo> selectSearchCondition(UserActionDataVo userActionDataVo);
|
||||
|
||||
public ProjectResourceLibrary selectProjectResourceLibraryById(Long id);
|
||||
|
||||
public List<ProjectResourceLibrary> selectProjectResourceLibraryList(ProjectResourceLibrary projectResourceLibrary);
|
||||
|
||||
public int insertProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary);
|
||||
|
||||
public int updateProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary);
|
||||
|
||||
public int deleteProjectResourceLibraryById(Long id);
|
||||
|
||||
public int deleteProjectResourceLibraryByIds(Long[] ids);
|
||||
|
||||
long getTotalProjectCount();
|
||||
|
||||
long getPublicProjectCount();
|
||||
|
||||
long getTotalReleaseCount();
|
||||
|
||||
long getTotalConversionCount();
|
||||
|
||||
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.resourceLibrary.domain.*;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slave
|
||||
@Mapper
|
||||
public interface TaskResourceLibraryMapper {
|
||||
|
||||
int insertClicker(Clicker record);
|
||||
long countClicker(Clicker record);
|
||||
int insertSearcher(Searcher record);
|
||||
|
||||
int insertDownloader(Downloader record);
|
||||
|
||||
List<UserActionDataVo> selectClickerCondition(UserActionDataVo clicker);
|
||||
|
||||
List<UserActionDataVo> selectVisitCondition(UserActionDataVo clicker);
|
||||
|
||||
List<UserActionDataVo> selectSearcherCondition(UserActionDataVo searcher);
|
||||
|
||||
List<UserActionDataVo> selectDownloaderCondition(UserActionDataVo downloader);
|
||||
|
||||
List<UserActionDataVo> selectWatcherCondition(UserActionDataVo watcher);
|
||||
|
||||
List<UserActionDataVo> selectPapersCondition(UserActionDataVo paper);
|
||||
|
||||
List<UserActionDataVo> selectTaskJournalsCondition(UserActionDataVo taskJournals);
|
||||
|
||||
List<TaskListVo> selectTaskListCondition(TaskListVo taskListVo);
|
||||
|
||||
long countClickerCondition(UserActionDataVo clicker);
|
||||
|
||||
long countVisitCondition(UserActionDataVo clicker);
|
||||
|
||||
long countSearcherCondition(UserActionDataVo searcher);
|
||||
|
||||
long countDownloaderCondition(UserActionDataVo downloader);
|
||||
|
||||
long countWatcherCondition(UserActionDataVo watcher);
|
||||
|
||||
long countPapersCondition(UserActionDataVo paper);
|
||||
|
||||
long countTaskJournalsCondition(UserActionDataVo taskJournals);
|
||||
|
||||
TaskResourceLibrary selectTaskResourceLibraryById(Long id);
|
||||
|
||||
List<TaskResourceLibrary> selectTaskResourceLibraryList(TaskResourceLibrary taskResourceLibrary);
|
||||
|
||||
int insertTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary);
|
||||
|
||||
int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary);
|
||||
|
||||
int deleteTaskResourceLibraryById(Long id);
|
||||
|
||||
int deleteTaskResourceLibraryByIds(Long[] ids);
|
||||
|
||||
List<KeyValVo<String, String>> getAttachments(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取任务总数
|
||||
*
|
||||
* @return 任务总数
|
||||
*/
|
||||
long getTotalTasks();
|
||||
|
||||
/**
|
||||
* 获取转换成果任务金额
|
||||
*
|
||||
* @return 转换成果任务金额
|
||||
*/
|
||||
double getConvertedTaskAmount();
|
||||
|
||||
/**
|
||||
* 获取任务转换成果数
|
||||
*
|
||||
* @return 任务转换成果数
|
||||
*/
|
||||
long getConvertedTasksCount();
|
||||
|
||||
/**
|
||||
* 获取任务金额
|
||||
*
|
||||
* @return 任务金额
|
||||
*/
|
||||
long getTaskAmount();
|
||||
|
||||
/**
|
||||
* 获取需评审任务数
|
||||
*
|
||||
* @return 需评审任务数
|
||||
*/
|
||||
long getReviewTaskCount();
|
||||
|
||||
int insertFavorite(Favorite favorite);
|
||||
|
||||
int insertWatcher(Watcher watcher);
|
||||
|
||||
int delFavorite(Favorite favorite);
|
||||
|
||||
int delWatcher(Watcher watcher);
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.microservices.dms.resourceLibrary.service;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.dms.constant.TaskConstant.COMPETITION_TYPE_DOWNLOAD;
|
||||
import static com.microservices.dms.constant.TaskConstant.PROJECT_DOWNLOAD_API;
|
||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CompetitionResourceLibraryService {
|
||||
|
||||
@Value("${http.gitLinkUrl}")
|
||||
public String gitLinkUrl;
|
||||
|
||||
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
|
||||
private final TaskResourceLibraryMapper taskResourceLibraryMapper;
|
||||
|
||||
public List<UserActionDataVo> selectRegisterCondition(UserActionDataVo vo) {
|
||||
return competitionResourceLibraryMapper.selectRegisterCondition(vo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectOpusCondition(UserActionDataVo vo) {
|
||||
return competitionResourceLibraryMapper.selectOpusCondition(vo);
|
||||
}
|
||||
|
||||
public List<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo dataVo) {
|
||||
List<CompetitionListVo> competitionListVos = competitionResourceLibraryMapper.selectCompetitionListCondition(dataVo);
|
||||
for (CompetitionListVo vo : competitionListVos) {
|
||||
UserActionDataVo c = new UserActionDataVo();
|
||||
c.setItemId(vo.getId());
|
||||
c.setItemType(COMPETITION_TYPE_DOWNLOAD);
|
||||
long opusDownload = taskResourceLibraryMapper.countDownloaderCondition(c);
|
||||
vo.setOpusDownloadCount(opusDownload);
|
||||
Long register = competitionResourceLibraryMapper.countRegisterCondition(c);
|
||||
vo.setRegistrationsCount(register);
|
||||
c.setStatus(3);
|
||||
Long opus = competitionResourceLibraryMapper.countOpusCondition(c);
|
||||
vo.setOpusCount(opus);
|
||||
}
|
||||
|
||||
return competitionListVos;
|
||||
}
|
||||
|
||||
public CompetitionResourceLibrary selectCompetitionResourceLibraryById(Long id) {
|
||||
return competitionResourceLibraryMapper.selectCompetitionResourceLibraryById(id);
|
||||
}
|
||||
|
||||
public List<CompetitionResourceLibrary> selectCompetitionResourceLibraryList(CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
List<CompetitionResourceLibrary> list = competitionResourceLibraryMapper.selectCompetitionResourceLibraryList(competitionResourceLibrary);
|
||||
// /api/attachments/10e9c28d-f8cb-4fbd-83c3-e46d2ff1b325
|
||||
for (CompetitionResourceLibrary l : list) {
|
||||
List<KeyValVo<String, String>> attachments = competitionResourceLibraryMapper.getAttachments(l.getCompetitionUserId());
|
||||
for (KeyValVo<String, String> a : attachments) {
|
||||
String v = a.getV();
|
||||
if (StringUtils.isNotEmpty(v)) {
|
||||
a.setV(String.format(PROJECT_DOWNLOAD_API, gitLinkUrl, v));
|
||||
}
|
||||
l.setAttachmentList(attachments);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long insertCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
competitionResourceLibrary.setCreateTime(DateUtils.getNowDate());
|
||||
competitionResourceLibrary.setCreateBy(SecurityUtils.getUsername());
|
||||
competitionResourceLibrary.setTransferredToResultLibraryTime(DateUtils.getNowDate());
|
||||
competitionResourceLibraryMapper.insertCompetitionResourceLibrary(competitionResourceLibrary);
|
||||
return competitionResourceLibrary.getId();
|
||||
}
|
||||
|
||||
public int updateCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary) {
|
||||
competitionResourceLibrary.setUpdateTime(DateUtils.getNowDate());
|
||||
return competitionResourceLibraryMapper.updateCompetitionResourceLibrary(competitionResourceLibrary);
|
||||
}
|
||||
|
||||
public int deleteCompetitionResourceLibraryByIds(Long[] ids) {
|
||||
return competitionResourceLibraryMapper.deleteCompetitionResourceLibraryByIds(ids);
|
||||
}
|
||||
|
||||
public int deleteCompetitionResourceLibraryById(Long id) {
|
||||
return competitionResourceLibraryMapper.deleteCompetitionResourceLibraryById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回开放竞赛总数
|
||||
*
|
||||
* @return 开放竞赛总数
|
||||
*/
|
||||
public long getTotalOpenCompetitions() {
|
||||
// 这里替换成你的实际逻辑,例如从数据库查询
|
||||
return competitionResourceLibraryMapper.getTotalOpenCompetitions();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛转换成果数
|
||||
*
|
||||
* @return 竞赛转换成果数
|
||||
*/
|
||||
public long getTotalCompetitionAchievements() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return competitionResourceLibraryMapper.getTotalCompetitionAchievements();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回竞赛提交作品数
|
||||
*
|
||||
* @return 竞赛提交作品数
|
||||
*/
|
||||
public long getTotalCompetitionSubmissions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return competitionResourceLibraryMapper.getTotalCompetitionSubmissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回已结束竞赛数
|
||||
*
|
||||
* @return 已结束竞赛数
|
||||
*/
|
||||
public long getTotalFinishedCompetitions() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return competitionResourceLibraryMapper.getTotalFinishedCompetitions();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回需评审竞赛数
|
||||
*
|
||||
* @return 需评审竞赛数
|
||||
*/
|
||||
public long getReviewCompetitionCount() {
|
||||
// 这里替换成你的实际逻辑
|
||||
return competitionResourceLibraryMapper.getReviewCompetitionCount();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.resourceLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 专家资源库Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
public interface IExpertResourceLibraryService
|
||||
{
|
||||
/**
|
||||
* 查询专家资源库
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 专家资源库
|
||||
*/
|
||||
public ExpertResourceLibrary selectExpertResourceLibraryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 专家资源库集合
|
||||
*/
|
||||
public List<ExpertResourceLibrary> selectExpertResourceLibraryList(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 新增专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 修改专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
/**
|
||||
* 批量删除专家资源库
|
||||
*
|
||||
* @param ids 需要删除的专家资源库主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExpertResourceLibraryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除专家资源库信息
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteExpertResourceLibraryById(Long id);
|
||||
|
||||
List<ExpertResourceLibrary> selectExpertResourceLibraryList2(ExpertResourceLibrary expertResourceLibrary);
|
||||
|
||||
Long auditExpertCount();
|
||||
|
||||
Long competitionAuditCount();
|
||||
|
||||
Long taskAuditCount();
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.microservices.dms.resourceLibrary.service;
|
||||
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.UrlUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.dms.constant.TaskConstant.PROJECT_DOWNLOAD_API;
|
||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectResourceLibraryService {
|
||||
|
||||
private final ProjectResourceLibraryMapper projectResourceLibraryMapper;
|
||||
|
||||
@Value("${http.gitLinkUrl}")
|
||||
public String gitLinkUrl;
|
||||
|
||||
public List<ProjectListVo> selectProjectListCondition(ProjectListVo projectListVo) {
|
||||
return projectResourceLibraryMapper.selectProjectListCondition(projectListVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectCodeCommitCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectCodeCommitCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectForkCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectForkCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectIssueCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectIssueCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectPRCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectPRCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectPraisesCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectPraisesCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectSearchCondition(UserActionDataVo userActionDataVo) {
|
||||
return projectResourceLibraryMapper.selectSearchCondition(userActionDataVo);
|
||||
}
|
||||
|
||||
|
||||
public ProjectResourceLibrary selectProjectResourceLibraryById(Long id) {
|
||||
return projectResourceLibraryMapper.selectProjectResourceLibraryById(id);
|
||||
}
|
||||
|
||||
|
||||
public List<ProjectResourceLibrary> selectProjectResourceLibraryList(ProjectResourceLibrary projectResourceLibrary) {
|
||||
List<ProjectResourceLibrary> list = projectResourceLibraryMapper.selectProjectResourceLibraryList(projectResourceLibrary);
|
||||
// /api/attachments/10e9c28d-f8cb-4fbd-83c3-e46d2ff1b325
|
||||
for (ProjectResourceLibrary l : list) {
|
||||
List<KeyValVo<String, String>> attachments = projectResourceLibraryMapper.getAttachments(l.getVersionReleasesId());
|
||||
for (KeyValVo<String, String> a : attachments) {
|
||||
String v = a.getV();
|
||||
if (StringUtils.isNotEmpty(v)) {
|
||||
if (v.startsWith("http")) {
|
||||
String urlPath = getUrlPath(v);
|
||||
a.setV(gitLinkUrl + urlPath);
|
||||
} else {
|
||||
a.setV(String.format(PROJECT_DOWNLOAD_API, gitLinkUrl, v));
|
||||
}
|
||||
}
|
||||
}
|
||||
l.setAttachmentList(attachments);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public Long insertProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary) {
|
||||
projectResourceLibrary.setCreateTime(DateUtils.getNowDate());
|
||||
projectResourceLibrary.setTransferDate(DateUtils.getNowDate());
|
||||
projectResourceLibrary.setCreateBy(SecurityUtils.getUsername());
|
||||
projectResourceLibraryMapper.insertProjectResourceLibrary(projectResourceLibrary);
|
||||
return projectResourceLibrary.getId();
|
||||
}
|
||||
|
||||
|
||||
public int updateProjectResourceLibrary(ProjectResourceLibrary projectResourceLibrary) {
|
||||
projectResourceLibrary.setUpdateTime(DateUtils.getNowDate());
|
||||
return projectResourceLibraryMapper.updateProjectResourceLibrary(projectResourceLibrary);
|
||||
}
|
||||
|
||||
|
||||
public int deleteProjectResourceLibraryByIds(Long[] ids) {
|
||||
return projectResourceLibraryMapper.deleteProjectResourceLibraryByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
public int deleteProjectResourceLibraryById(Long id) {
|
||||
return projectResourceLibraryMapper.deleteProjectResourceLibraryById(id);
|
||||
}
|
||||
|
||||
public long getTotalProjectCount() {
|
||||
return projectResourceLibraryMapper.getTotalProjectCount();
|
||||
}
|
||||
|
||||
public long getPublicProjectCount() {
|
||||
return projectResourceLibraryMapper.getPublicProjectCount();
|
||||
}
|
||||
|
||||
public long getTotalReleaseCount() {
|
||||
return projectResourceLibraryMapper.getTotalReleaseCount();
|
||||
}
|
||||
|
||||
public long getTotalConversionCount() {
|
||||
return projectResourceLibraryMapper.getTotalConversionCount();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
package com.microservices.dms.resourceLibrary.service;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.constant.TaskConstant;
|
||||
import com.microservices.dms.resourceLibrary.domain.*;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.microservices.dms.constant.TaskConstant.MARKER_SPACE_DOWNLOAD_API_BY_ID;
|
||||
import static com.microservices.dms.constant.TaskConstant.PROJECT_DOWNLOAD_API;
|
||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TaskResourceLibraryService {
|
||||
private final TaskResourceLibraryMapper taskResourceLibraryMapper;
|
||||
|
||||
@Value("${markerSpaceUrl}")
|
||||
public String markerSpaceUrl;
|
||||
|
||||
public int addClick(Clicker click) {
|
||||
click.setCreatedAt(DateUtils.getNowDate());
|
||||
return taskResourceLibraryMapper.insertClicker(click);
|
||||
}
|
||||
|
||||
public int addSearcher(Searcher searcher) {
|
||||
searcher.setCreatedAt(DateUtils.getNowDate());
|
||||
return taskResourceLibraryMapper.insertSearcher(searcher);
|
||||
}
|
||||
|
||||
public int addDownloader(Downloader downloader) {
|
||||
downloader.setCreatedAt(DateUtils.getNowDate());
|
||||
return taskResourceLibraryMapper.insertDownloader(downloader);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectClickerCondition(UserActionDataVo actionDataVo) {
|
||||
return taskResourceLibraryMapper.selectClickerCondition(actionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectVisitCondition(UserActionDataVo actionDataVo) {
|
||||
return taskResourceLibraryMapper.selectVisitCondition(actionDataVo);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectSearcherCondition(UserActionDataVo searcher) {
|
||||
return taskResourceLibraryMapper.selectSearcherCondition(searcher);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectDownloaderCondition(UserActionDataVo downloader) {
|
||||
return taskResourceLibraryMapper.selectDownloaderCondition(downloader);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectWatcherCondition(UserActionDataVo watcher) {
|
||||
return taskResourceLibraryMapper.selectWatcherCondition(watcher);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectPapersCondition(UserActionDataVo paper) {
|
||||
return taskResourceLibraryMapper.selectPapersCondition(paper);
|
||||
}
|
||||
|
||||
public List<UserActionDataVo> selectTaskJournalsCondition(UserActionDataVo taskJournals) {
|
||||
return taskResourceLibraryMapper.selectTaskJournalsCondition(taskJournals);
|
||||
}
|
||||
|
||||
public List<TaskListVo> selectTaskListCondition(TaskListVo taskListVo) {
|
||||
List<TaskListVo> taskListVos = taskResourceLibraryMapper.selectTaskListCondition(taskListVo);
|
||||
for (TaskListVo vo : taskListVos) {
|
||||
UserActionDataVo c = new UserActionDataVo();
|
||||
c.setItemId(vo.getId());
|
||||
c.setItemType(TaskConstant.TASK_TYPE_PAPERS);
|
||||
long papers = taskResourceLibraryMapper.countPapersCondition(c);
|
||||
c.setItemType(TaskConstant.TASK_TYPE_WATCHERS);
|
||||
long watcher = taskResourceLibraryMapper.countWatcherCondition(c);
|
||||
c.setItemType(TaskConstant.TASK_TYPE_JOURNALS);
|
||||
long clicker = taskResourceLibraryMapper.countClickerCondition(c);
|
||||
long downloader = taskResourceLibraryMapper.countDownloaderCondition(c);
|
||||
long taskJournals = taskResourceLibraryMapper.countTaskJournalsCondition(c);
|
||||
long searcher = taskResourceLibraryMapper.countSearcherCondition(c);
|
||||
|
||||
vo.setTaskClickCount(clicker);
|
||||
vo.setTaskWatcherCount(watcher);
|
||||
vo.setTaskPapersCount(papers);
|
||||
vo.setTaskDownloadCount(downloader);
|
||||
vo.setTaskJournalCount(taskJournals);
|
||||
vo.setTaskSearchCount(searcher);
|
||||
}
|
||||
return taskListVos;
|
||||
}
|
||||
|
||||
public TaskResourceLibrary selectTaskResourceLibraryById(Long id) {
|
||||
return taskResourceLibraryMapper.selectTaskResourceLibraryById(id);
|
||||
}
|
||||
|
||||
|
||||
public List<TaskResourceLibrary> selectTaskResourceLibraryList(TaskResourceLibrary taskResourceLibrary) {
|
||||
List<TaskResourceLibrary> list = taskResourceLibraryMapper.selectTaskResourceLibraryList(taskResourceLibrary);
|
||||
for (TaskResourceLibrary l : list) {
|
||||
List<KeyValVo<String, String>> attachments = taskResourceLibraryMapper.getAttachments(l.getPaperId());
|
||||
for (KeyValVo<String, String> a : attachments) {
|
||||
Object v = a.getV();
|
||||
a.setV(String.format(MARKER_SPACE_DOWNLOAD_API_BY_ID, markerSpaceUrl, v));
|
||||
}
|
||||
l.setAttachmentList(attachments);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public Long insertTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
|
||||
taskResourceLibrary.setCreateTime(DateUtils.getNowDate());
|
||||
taskResourceLibrary.setTransferToResultsDate(DateUtils.getNowDate());
|
||||
taskResourceLibrary.setCreateBy(SecurityUtils.getUsername());
|
||||
taskResourceLibraryMapper.insertTaskResourceLibrary(taskResourceLibrary);
|
||||
return taskResourceLibrary.getId();
|
||||
}
|
||||
|
||||
|
||||
public int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
|
||||
return taskResourceLibraryMapper.updateTaskResourceLibrary(taskResourceLibrary);
|
||||
}
|
||||
|
||||
public int deleteTaskResourceLibraryByIds(Long[] ids) {
|
||||
return taskResourceLibraryMapper.deleteTaskResourceLibraryByIds(ids);
|
||||
}
|
||||
|
||||
public int deleteTaskResourceLibraryById(Long id) {
|
||||
return taskResourceLibraryMapper.deleteTaskResourceLibraryById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取任务总数
|
||||
*
|
||||
* @return 任务总数
|
||||
*/
|
||||
public Long getTotalTasks() {
|
||||
return taskResourceLibraryMapper.getTotalTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转换成果任务金额
|
||||
*
|
||||
* @return 转换成果任务金额
|
||||
*/
|
||||
public Double getConvertedTaskAmount() {
|
||||
return taskResourceLibraryMapper.getConvertedTaskAmount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务转换成果数
|
||||
*
|
||||
* @return 任务转换成果数
|
||||
*/
|
||||
public Long getConvertedTasksCount() {
|
||||
return taskResourceLibraryMapper.getConvertedTasksCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务金额
|
||||
*
|
||||
* @return 任务金额
|
||||
*/
|
||||
public Long getTaskAmount() {
|
||||
return taskResourceLibraryMapper.getTaskAmount();
|
||||
}
|
||||
|
||||
|
||||
public Long getReviewTaskCount() {
|
||||
return taskResourceLibraryMapper.getReviewTaskCount();
|
||||
}
|
||||
|
||||
public int addFavorite(Favorite favorite) {
|
||||
favorite.setCreatedAt(DateUtils.getNowDate());
|
||||
return taskResourceLibraryMapper.insertFavorite(favorite);
|
||||
}
|
||||
|
||||
public int addWatcher(Watcher watcher) {
|
||||
watcher.setCreatedAt(DateUtils.getNowDate());
|
||||
return taskResourceLibraryMapper.insertWatcher(watcher);
|
||||
}
|
||||
|
||||
public int addSearcher2(Searcher searcher) {
|
||||
String[] split = searcher.getSearchIds().split(",");
|
||||
Arrays.stream(split).forEach(s -> {
|
||||
Searcher e = new Searcher();
|
||||
e.setCreatedAt(DateUtils.getNowDate());
|
||||
e.setSearchId(Long.parseLong(s));
|
||||
e.setUserId(searcher.getUserId());
|
||||
e.setExtInfo(searcher.getExtInfo());
|
||||
e.setSearchType(searcher.getSearchType());
|
||||
taskResourceLibraryMapper.insertSearcher(e);
|
||||
});
|
||||
|
||||
return split.length;
|
||||
}
|
||||
|
||||
public int delFavorite(Favorite favorite) {
|
||||
return taskResourceLibraryMapper.delFavorite(favorite);
|
||||
}
|
||||
|
||||
public int delWatcher(Watcher watcher) {
|
||||
return taskResourceLibraryMapper.delWatcher(watcher);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
package com.microservices.dms.resourceLibrary.service.impl;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.microservices.dms.constant.TaskConstant.MARKER_SPACE_DOWNLOAD_API_BY_ID;
|
||||
|
||||
/**
|
||||
* 专家资源库Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-11
|
||||
*/
|
||||
@Service
|
||||
public class ExpertResourceLibraryServiceImpl implements IExpertResourceLibraryService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
|
||||
@Value("${markerSpaceUrl}")
|
||||
public String markerSpaceUrl;
|
||||
/**
|
||||
* 查询专家资源库
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 专家资源库
|
||||
*/
|
||||
@Override
|
||||
public ExpertResourceLibrary selectExpertResourceLibraryById(Long id) {
|
||||
ExpertResourceLibrary res = expertResourceLibraryMapper.selectExpertResourceLibraryById(id);
|
||||
ExpertAttachmentVo attachmentVo = expertResourceLibraryMapper.getExpertInfoById(res.getExpertId());
|
||||
Map<String, Object> honorsAttachments = expertResourceLibraryMapper.getAttachmentInfo(attachmentVo.getHonorsAttachments());
|
||||
buildFullUrl(honorsAttachments);
|
||||
Map<String, Object> resumeAttachments = expertResourceLibraryMapper.getAttachmentInfo(attachmentVo.getResumeAttachments());
|
||||
buildFullUrl(resumeAttachments);
|
||||
Map<String, Object> titleCertificateAttachments = expertResourceLibraryMapper.getAttachmentInfo(attachmentVo.getTitleCertificateAttachments());
|
||||
buildFullUrl(titleCertificateAttachments);
|
||||
Map<String, Object> academicAchievementsAttachments = expertResourceLibraryMapper.getAttachmentInfo(attachmentVo.getAcademicAchievementsAttachments());
|
||||
buildFullUrl(academicAchievementsAttachments);
|
||||
res.getParams().put("academicAchievementsAttachments", academicAchievementsAttachments);
|
||||
res.getParams().put("honorsAttachments", honorsAttachments);
|
||||
res.getParams().put("resumeAttachments", resumeAttachments);
|
||||
res.getParams().put("titleCertificateAttachments", titleCertificateAttachments);
|
||||
return res;
|
||||
}
|
||||
|
||||
private void buildFullUrl(Map<String, Object> map) {
|
||||
if (map != null && map.containsKey("id") && map.get("id") != null) {
|
||||
String id = map.get("id").toString();
|
||||
map.put("url", String.format(MARKER_SPACE_DOWNLOAD_API_BY_ID, markerSpaceUrl, id));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 专家资源库
|
||||
*/
|
||||
@Override
|
||||
public List<ExpertResourceLibrary> selectExpertResourceLibraryList(ExpertResourceLibrary expertResourceLibrary) {
|
||||
return expertResourceLibraryMapper.selectExpertResourceLibraryList(expertResourceLibrary);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 专家资源库
|
||||
*/
|
||||
@Override
|
||||
public List<ExpertResourceLibrary> selectExpertResourceLibraryList2(ExpertResourceLibrary expertResourceLibrary) {
|
||||
return expertResourceLibraryMapper.selectExpertResourceLibraryList2(expertResourceLibrary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long auditExpertCount() {
|
||||
return expertResourceLibraryMapper.auditExpertCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long competitionAuditCount() {
|
||||
return expertResourceLibraryMapper.competitionAuditCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long taskAuditCount() {
|
||||
return expertResourceLibraryMapper.taskAuditCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getActDataStatisticById(Long id) {
|
||||
return expertResourceLibraryMapper.getActDataStatisticById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return expertResourceLibraryMapper.getWatchFavoriteStatusById(id, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary) {
|
||||
expertResourceLibrary.setCreateTime(DateUtils.getNowDate());
|
||||
return expertResourceLibraryMapper.insertExpertResourceLibrary(expertResourceLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改专家资源库
|
||||
*
|
||||
* @param expertResourceLibrary 专家资源库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateExpertResourceLibrary(ExpertResourceLibrary expertResourceLibrary) {
|
||||
expertResourceLibrary.setUpdateTime(DateUtils.getNowDate());
|
||||
return expertResourceLibraryMapper.updateExpertResourceLibrary(expertResourceLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除专家资源库
|
||||
*
|
||||
* @param ids 需要删除的专家资源库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteExpertResourceLibraryByIds(Long[] ids) {
|
||||
return expertResourceLibraryMapper.deleteExpertResourceLibraryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除专家资源库信息
|
||||
*
|
||||
* @param id 专家资源库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteExpertResourceLibraryById(Long id) {
|
||||
return expertResourceLibraryMapper.deleteExpertResourceLibraryById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.microservices.dms.utils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Year;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.LongStream;
|
||||
|
||||
public class DateUtil {
|
||||
|
||||
public static Date[] getDays(long start, long end) {
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate startOfWeek = today.minusDays(end);
|
||||
LocalDate endOfWeek = today.minusDays(start);
|
||||
|
||||
LocalDateTime startDateTime = startOfWeek.atStartOfDay();
|
||||
LocalDateTime endDateTime = endOfWeek.atTime(23, 59, 59);
|
||||
|
||||
return new Date[]{
|
||||
Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()),
|
||||
Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant()),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public static Date[] getCurrentYear() {
|
||||
Year year = Year.now();
|
||||
|
||||
LocalDate startDate = year.atDay(1);
|
||||
LocalDate endDate = year.atDay(year.length());
|
||||
|
||||
LocalDateTime startDateTime = startDate.atStartOfDay();
|
||||
LocalDateTime endDateTime = endDate.atTime(23, 59, 59);
|
||||
|
||||
return new Date[]{
|
||||
Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()),
|
||||
Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())
|
||||
};
|
||||
}
|
||||
|
||||
public static Date[] getCurrentYearEndOf(LocalDate endDate) {
|
||||
Year year = Year.now();
|
||||
|
||||
LocalDate startOfWeek = year.atDay(1);
|
||||
|
||||
LocalDateTime startDateTime = startOfWeek.atStartOfDay();
|
||||
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 List<String> getDateStrMMDD(Date start, Date end) {
|
||||
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||
String pattern = "MM-dd";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
|
||||
return LongStream.range(0, s.until(e).getDays() + 1)
|
||||
.mapToObj(s::plusDays)
|
||||
.map(formatter::format)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<String> getDateStrYYYYMMDD(Date start, Date end) {
|
||||
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
|
||||
String pattern = "yyyy-MM-dd";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
|
||||
return LongStream.range(0, s.until(e).getDays() + 1)
|
||||
.mapToObj(s::plusDays)
|
||||
.map(formatter::format)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.microservices.dms.utils;
|
||||
|
||||
import com.microservices.common.httpClient.domain.GitLinkRequestUrl;
|
||||
|
||||
public class DmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
||||
|
||||
/**
|
||||
* 获取项目贡献者
|
||||
*/
|
||||
public static String CONTRIBUTORS(String fullName) {
|
||||
return String.format("/api/%s/contributors.json", fullName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目成员//
|
||||
*/
|
||||
public static String QUERY_USER_FROM_PROJECT(String fullName) {
|
||||
return String.format("/api/%s/collaborators.json", fullName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的PR
|
||||
*/
|
||||
public static String GET_PULL_REQUEST(String fullName, String statusType) {
|
||||
return String.format("/api/%s/pulls.json?status_type=%s", fullName, statusType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取PR的文件
|
||||
*/
|
||||
public static String GET_PR_FILES(String fullName, int PRNum) {
|
||||
return String.format("/api/v1/%s/pulls/%s/files.json", fullName, PRNum);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.microservices.dms.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.httpClient.domain.GitLinkRequestUrl;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DmsRequestHelper extends GitLinkRequestHelper {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DmsRequestHelper.class);
|
||||
|
||||
/**
|
||||
* 循环分页获取Gitlink列表接口所有数据
|
||||
*
|
||||
* @return 所有数据列表
|
||||
*/
|
||||
public JSONArray getAllDataByPage(String url, String listKey) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
boolean isAllData = false;
|
||||
int pageNum = 1;
|
||||
// 循环分页获取gitlink组织下所有成员
|
||||
while (!isAllData) {
|
||||
JSONObject result = doGet(GET_LIST_BY_PAGES(url, pageNum, 50)
|
||||
);
|
||||
jsonArray.addAll(result.getJSONArray(listKey));
|
||||
long total = result.getLong("search_count");
|
||||
if (total <= jsonArray.size()) {
|
||||
isAllData = true;
|
||||
} else {
|
||||
pageNum++;
|
||||
}
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
public <T> List<T> getAllDataByPage(String url, String listKey, Class<T> tClass) {
|
||||
List<T> allList = new ArrayList<>();
|
||||
boolean isAllData = false;
|
||||
int pageNum = 1;
|
||||
// 循环分页获取gitlink组织下所有成员
|
||||
while (!isAllData) {
|
||||
JSONObject result = doGet(GitLinkRequestUrl.GET_LIST_BY_PAGES(url, pageNum, 50)
|
||||
);
|
||||
allList.addAll(result.getList(listKey, tClass));
|
||||
long total = result.getLong("search_count");
|
||||
if (total <= allList.size()) {
|
||||
isAllData = true;
|
||||
} else {
|
||||
pageNum++;
|
||||
}
|
||||
}
|
||||
return allList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 循环分页获取Gitlink列表接口所有数据
|
||||
*
|
||||
* @return 所有数据列表
|
||||
*/
|
||||
public JSONArray getAllDataByPage(String url, String listKey,String countKey) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
boolean isAllData = false;
|
||||
int pageNum = 1;
|
||||
while (!isAllData) {
|
||||
JSONObject result = doGet(GET_LIST_BY_PAGES(url, pageNum, 50)
|
||||
);
|
||||
jsonArray.addAll(result.getJSONArray(listKey));
|
||||
long total = result.getLong(countKey);
|
||||
if (total <= jsonArray.size()) {
|
||||
isAllData = true;
|
||||
} else {
|
||||
pageNum++;
|
||||
}
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
|
||||
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";
|
||||
return getAdminGitLinkRequestUrl(String.format(p, url, page, limit));
|
||||
}
|
||||
|
||||
|
||||
protected static GitLinkRequestUrl getAdminGitLinkRequestUrl(String path) {
|
||||
GitLinkRequestUrl gitLinkRequestUrl = new GitLinkRequestUrl();
|
||||
gitLinkRequestUrl.setIsOpen(false);
|
||||
gitLinkRequestUrl.setIsAdmin(true);
|
||||
gitLinkRequestUrl.setPath(path);
|
||||
return gitLinkRequestUrl;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.microservices.dms.utils;
|
||||
|
||||
import org.xm.Similarity;
|
||||
import org.xm.similarity.text.CosineSimilarity;
|
||||
import org.xm.similarity.text.TextSimilarity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <a href='https://github.com/shibing624/similarity'>类库地址</a>
|
||||
*/
|
||||
public class SimilarityService {
|
||||
|
||||
// public static double similarity(String s1, String s2) {
|
||||
// if (s1 == null || s2 == null || s1.isEmpty() || s2.isEmpty()) {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
public static double sentence(String s1, String s2) {
|
||||
if (s1 == null || s2 == null || s1.isEmpty() || s2.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
return Similarity.morphoSimilarity(s1, s2);
|
||||
}
|
||||
|
||||
public static double text(String text1, String text2) {
|
||||
if (text1 == null || text2 == null || text1.isEmpty() || text2.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
TextSimilarity cosSimilarity = new CosineSimilarity();
|
||||
return cosSimilarity.getSimilarity(text1, text2);
|
||||
}
|
||||
|
||||
public static void buildUserFractionMap(Map<Long, Double> map, Long assId, Double fraction) {
|
||||
map.merge(assId, fraction, Double::sum);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.microservices.dms.utils;
|
||||
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
public class UrlUtil {
|
||||
|
||||
public static String getUrlPath(String urlString) {
|
||||
if (StringUtils.isEmpty(urlString)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
URL url;
|
||||
try {
|
||||
url = new URL(urlString);
|
||||
} catch (MalformedURLException e) {
|
||||
return "";
|
||||
}
|
||||
return url.getPath();
|
||||
}
|
||||
|
||||
|
||||
public static String replaceUrlIp(String urlString,String newIp) {
|
||||
|
||||
urlString = getUrlPath(urlString);
|
||||
|
||||
if (StringUtils.isEmpty(urlString) || StringUtils.isEmpty(newIp)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
return newIp + urlString;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_
|
||||
(_)
|
||||
_ __ _ _ ___ _ _ _ ______ _ __ _ __ ___ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|| '_ \ | '_ ` _ \ / __|
|
||||
| | | |_| || (_) || |_| || | | |_) || | | | | |\__ \
|
||||
|_| \__,_| \___/ \__, ||_| | .__/ |_| |_| |_||___/
|
||||
__/ | | |
|
||||
|___/ |_|
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9119
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: microservices-dms
|
||||
config:
|
||||
activate:
|
||||
# 环境配置
|
||||
on-profile:
|
||||
prod
|
||||
cloud:
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos_ip}:${nacos_port}
|
||||
username: ${nacos_username}
|
||||
password: ${nacos_password}
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: ${nacos_ip}:${nacos_port}
|
||||
username: ${nacos_username}
|
||||
password: ${nacos_password}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- { dataId: "application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}",refresh: true }
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9119
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: microservices-dms
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: nacos
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- { dataId: "application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}",refresh: true }
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/microservices-dms"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.microservices" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<!-- add converter for %tid -->
|
||||
<conversionRule conversionWord="tid"
|
||||
converterClass="org.apache.skywalking.apm.toolkit.log.logback.v1.x.LogbackPatternConverter"/>
|
||||
<!-- add converter for %sw_ctx -->
|
||||
<conversionRule conversionWord="sw_ctx"
|
||||
converterClass="org.apache.skywalking.apm.toolkit.log.logback.v1.x.LogbackSkyWalkingContextPatternConverter"/>
|
||||
|
||||
<appender name="skywalking_grpc"
|
||||
class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>
|
||||
{
|
||||
"level": "%level",
|
||||
"tid": "%tid",
|
||||
"skyWalkingContext": "%sw_ctx",
|
||||
"thread": "%thread",
|
||||
"class": "%logger{1.}:%L",
|
||||
"message": "%message",
|
||||
"stackTrace": "%exception{10}"
|
||||
}
|
||||
</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="skywalking_grpc"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<?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.AchievementTeamMapper">
|
||||
|
||||
<resultMap type="AchievementTeam" id="AchievementTeamResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="achievementId" column="achievement_id" />
|
||||
<result property="username" column="username" />
|
||||
<result property="company" column="company" />
|
||||
<result property="technicalTitle" column="technical_title" />
|
||||
<result property="professionalTitle" column="professional_title" />
|
||||
<result property="researchDirection" column="research_direction" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="summary" column="summary" />
|
||||
<result property="workContent" column="work_content" />
|
||||
<result property="isLeader" column="is_leader" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAchievementTeamVo">
|
||||
select id, achievement_id, username, company, technical_title, professional_title, research_direction, phone, summary, work_content, is_leader, status, create_by, create_time, update_by, update_time from achievement_team
|
||||
</sql>
|
||||
|
||||
<select id="selectAchievementTeamList" parameterType="AchievementTeam" resultMap="AchievementTeamResult">
|
||||
<include refid="selectAchievementTeamVo"/>
|
||||
<where>
|
||||
<if test="achievementId != null "> and achievement_id = #{achievementId}</if>
|
||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||
<if test="company != null and company != ''"> and company = #{company}</if>
|
||||
<if test="technicalTitle != null and technicalTitle != ''"> and technical_title = #{technicalTitle}</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''"> and professional_title = #{professionalTitle}</if>
|
||||
<if test="researchDirection != null and researchDirection != ''"> and research_direction = #{researchDirection}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
<if test="workContent != null and workContent != ''"> and work_content = #{workContent}</if>
|
||||
<if test="isLeader != null and isLeader != ''"> and is_leader = #{isLeader}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAchievementTeamById" parameterType="Long" resultMap="AchievementTeamResult">
|
||||
<include refid="selectAchievementTeamVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAchievementTeam" parameterType="AchievementTeam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into achievement_team
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementId != null">achievement_id,</if>
|
||||
<if test="username != null and username != ''">username,</if>
|
||||
<if test="company != null">company,</if>
|
||||
<if test="technicalTitle != null">technical_title,</if>
|
||||
<if test="professionalTitle != null">professional_title,</if>
|
||||
<if test="researchDirection != null">research_direction,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="summary != null">summary,</if>
|
||||
<if test="workContent != null">work_content,</if>
|
||||
<if test="isLeader != null">is_leader,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementId != null">#{achievementId},</if>
|
||||
<if test="username != null and username != ''">#{username},</if>
|
||||
<if test="company != null">#{company},</if>
|
||||
<if test="technicalTitle != null">#{technicalTitle},</if>
|
||||
<if test="professionalTitle != null">#{professionalTitle},</if>
|
||||
<if test="researchDirection != null">#{researchDirection},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="summary != null">#{summary},</if>
|
||||
<if test="workContent != null">#{workContent},</if>
|
||||
<if test="isLeader != null">#{isLeader},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAchievementTeam" parameterType="AchievementTeam">
|
||||
update achievement_team
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="achievementId != null">achievement_id = #{achievementId},</if>
|
||||
<if test="username != null and username != ''">username = #{username},</if>
|
||||
<if test="company != null">company = #{company},</if>
|
||||
<if test="technicalTitle != null">technical_title = #{technicalTitle},</if>
|
||||
<if test="professionalTitle != null">professional_title = #{professionalTitle},</if>
|
||||
<if test="researchDirection != null">research_direction = #{researchDirection},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="workContent != null">work_content = #{workContent},</if>
|
||||
<if test="isLeader != null">is_leader = #{isLeader},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAchievementTeamById" parameterType="Long">
|
||||
delete from achievement_team where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAchievementTeamByIds" parameterType="String">
|
||||
delete from achievement_team where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
<?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.AchievementsMapper">
|
||||
|
||||
<resultMap type="Achievements" id="AchievementsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="achievementName" column="achievement_name" />
|
||||
<result property="field1" column="field_1" />
|
||||
<result property="field2" column="field_2" />
|
||||
<result property="field3" column="field_3" />
|
||||
<result property="achievementType" column="achievement_type" />
|
||||
<result property="source" column="source" />
|
||||
<result property="sourceId" column="source_id" />
|
||||
<result property="sourceLink" column="source_link" />
|
||||
<result property="tags" column="tags" />
|
||||
<result property="summary" column="summary" />
|
||||
<result property="publishingUnit" column="publishing_unit" />
|
||||
<result property="address" column="address" />
|
||||
<result property="isFeatured" column="is_featured" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
<result property="contactNumber" column="contact_number" />
|
||||
<result property="ownerId" column="owner_id" />
|
||||
<result property="ownerName" column="owner_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="details" column="details" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="reviewDate" column="review_date" />
|
||||
<result property="reviewComments" column="review_comments" />
|
||||
<result property="images" column="images" />
|
||||
<result property="attachments" column="attachments" />
|
||||
<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="attachmentCount" column="attachment_count" />
|
||||
<result property="isExpertAudit" column="is_expert_audit" />
|
||||
<result property="hotRank" column="hot_rank" />
|
||||
</resultMap>
|
||||
|
||||
<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
|
||||
</sql>
|
||||
|
||||
<select id="selectAchievementsList" parameterType="Achievements" resultMap="AchievementsResult">
|
||||
<include refid="selectAchievementsVo"/>
|
||||
<where>
|
||||
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
|
||||
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
|
||||
<if test="field3 != null and field3 != ''"> and field_3 = #{field3}</if>
|
||||
<if test="achievementType != null and achievementType != ''"> and achievement_type = #{achievementType}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
|
||||
<if test="sourceLink != null and sourceLink != ''"> and source_link = #{sourceLink}</if>
|
||||
<if test="tags != null and tags != ''"> and tags = #{tags}</if>
|
||||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
<if test="publishingUnit != null and publishingUnit != ''"> and publishing_unit = #{publishingUnit}</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="isFeatured != null "> and is_featured = #{isFeatured}</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
||||
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
|
||||
<if test="ownerName != null and ownerName != ''"> and owner_name like concat('%', #{ownerName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="details != null and details != ''"> and details = #{details}</if>
|
||||
<if test="reviewer != null and reviewer != ''"> and reviewer = #{reviewer}</if>
|
||||
<if test="reviewDate != null "> and review_date = #{reviewDate}</if>
|
||||
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
|
||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
|
||||
<if test="hotRank != null and hotRank != ''"> and hot_rank = #{hotRank}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAchievementsById" parameterType="Long" resultMap="AchievementsResult">
|
||||
<include refid="selectAchievementsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getFileInfoByIdents" resultType="java.util.Map">
|
||||
select file_identifier as k ,file_origin_name as v from sys_file_info
|
||||
where file_identifier in
|
||||
<foreach collection="idents" close=")" index="idx" item="item" open="(" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertAchievements" parameterType="Achievements" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into achievements
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementName != null">achievement_name,</if>
|
||||
<if test="field1 != null">field_1,</if>
|
||||
<if test="field2 != null">field_2,</if>
|
||||
<if test="field3 != null">field_3,</if>
|
||||
<if test="achievementType != null">achievement_type,</if>
|
||||
<if test="source != null">source,</if>
|
||||
<if test="sourceId != null">source_id,</if>
|
||||
<if test="sourceLink != null">source_link,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="summary != null">summary,</if>
|
||||
<if test="publishingUnit != null">publishing_unit,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="isFeatured != null">is_featured,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactNumber != null">contact_number,</if>
|
||||
<if test="ownerId != null">owner_id,</if>
|
||||
<if test="ownerName != null">owner_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="details != null">details,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="reviewDate != null">review_date,</if>
|
||||
<if test="reviewComments != null">review_comments,</if>
|
||||
<if test="images != null">images,</if>
|
||||
<if test="attachments != null">attachments,</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="attachmentCount != null">attachment_count,</if>
|
||||
<if test="isExpertAudit != null">is_expert_audit,</if>
|
||||
<if test="hotRank != null">hot_rank,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementName != null">#{achievementName},</if>
|
||||
<if test="field1 != null">#{field1},</if>
|
||||
<if test="field2 != null">#{field2},</if>
|
||||
<if test="field3 != null">#{field3},</if>
|
||||
<if test="achievementType != null">#{achievementType},</if>
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="sourceId != null">#{sourceId},</if>
|
||||
<if test="sourceLink != null">#{sourceLink},</if>
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="summary != null">#{summary},</if>
|
||||
<if test="publishingUnit != null">#{publishingUnit},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="isFeatured != null">#{isFeatured},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactNumber != null">#{contactNumber},</if>
|
||||
<if test="ownerId != null">#{ownerId},</if>
|
||||
<if test="ownerName != null">#{ownerName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="details != null">#{details},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="reviewDate != null">#{reviewDate},</if>
|
||||
<if test="reviewComments != null">#{reviewComments},</if>
|
||||
<if test="images != null">#{images},</if>
|
||||
<if test="attachments != null">#{attachments},</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="attachmentCount != null">#{attachmentCount},</if>
|
||||
<if test="isExpertAudit != null">#{isExpertAudit},</if>
|
||||
<if test="hotRank != null">#{hotRank},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAchievements" parameterType="Achievements">
|
||||
update achievements
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="achievementName != null">achievement_name = #{achievementName},</if>
|
||||
<if test="field1 != null">field_1 = #{field1},</if>
|
||||
<if test="field2 != null">field_2 = #{field2},</if>
|
||||
<if test="field3 != null">field_3 = #{field3},</if>
|
||||
<if test="achievementType != null">achievement_type = #{achievementType},</if>
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="sourceId != null">source_id = #{sourceId},</if>
|
||||
<if test="sourceLink != null">source_link = #{sourceLink},</if>
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="publishingUnit != null">publishing_unit = #{publishingUnit},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="isFeatured != null">is_featured = #{isFeatured},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
|
||||
<if test="ownerId != null">owner_id = #{ownerId},</if>
|
||||
<if test="ownerName != null">owner_name = #{ownerName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="details != null">details = #{details},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="reviewDate != null">review_date = #{reviewDate},</if>
|
||||
<if test="reviewComments != null">review_comments = #{reviewComments},</if>
|
||||
<if test="images != null">images = #{images},</if>
|
||||
<if test="attachments != null">attachments = #{attachments},</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="attachmentCount != null">attachment_count = #{attachmentCount},</if>
|
||||
<if test="isExpertAudit != null">is_expert_audit = #{isExpertAudit},</if>
|
||||
<if test="hotRank != null">hot_rank = #{hotRank},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAchievementsById" parameterType="Long">
|
||||
delete from achievements where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAchievementsByIds" parameterType="String">
|
||||
delete from achievements where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getChoiceImport" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||
select id, achievement_name,images,field_1,field_2,field_3,source,source_id
|
||||
from achievements
|
||||
where is_featured ='1'
|
||||
order by update_time desc
|
||||
limit 0,4
|
||||
</select>
|
||||
|
||||
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select sum(1) as "value",source as "key"
|
||||
from achievements
|
||||
group by source
|
||||
</select>
|
||||
|
||||
<select id="getTjByAreas" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select c.id as "key", c.name as "name", f.value as "value"
|
||||
from (select a.domain_value as "name", sum(a.countResult) as "value"
|
||||
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
|
||||
from achievements
|
||||
group by field_1
|
||||
union all
|
||||
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
|
||||
from achievements
|
||||
group by field_2
|
||||
union all
|
||||
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
|
||||
from achievements
|
||||
group by field_3) a
|
||||
group by a.domain_value
|
||||
order by sum(a.countResult) desc) f
|
||||
right join categories c on c.id = f.name
|
||||
limit 0,5
|
||||
</select>
|
||||
|
||||
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||
select id, achievement_name,summary,create_time,owner_name,tags,field_1,field_2,field_3,source,source_id,
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = id) as favoriteSum
|
||||
from achievements
|
||||
<where>
|
||||
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="areaQuery != null and areaQuery != ''">
|
||||
and (field_1 = #{areaQuery} or field_2 = #{areaQuery} or field_3 = #{areaQuery})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getAchievementClickSum" resultType="long">
|
||||
select count(1) from clickers
|
||||
where click_type='Achievements' and click_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getaWatcher" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
|
||||
from watchers
|
||||
where created_at >= #{s}
|
||||
and created_at <= #{e}
|
||||
and watchable_type = #{t}
|
||||
group by DATE_FORMAT(created_at, '%m-%d')
|
||||
order by DATE_FORMAT(created_at, '%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="getFavorite" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
|
||||
from favorites
|
||||
where created_at >= #{s}
|
||||
and created_at <= #{e}
|
||||
and favorite_type = #{t}
|
||||
group by DATE_FORMAT(created_at, '%m-%d')
|
||||
order by DATE_FORMAT(created_at, '%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="getHotAchievement" resultType="java.util.Map">
|
||||
select t.achievement_name as name, t.w as watcher, t.f as faviter, (t.w + t.f) as total, t.id as `id`,t.owner_name
|
||||
as userName
|
||||
from (select a.achievement_name,
|
||||
a.id,a.owner_name,
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as f,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as w
|
||||
from achievements a) as t
|
||||
order by (f+w) desc
|
||||
limit 0,3
|
||||
</select>
|
||||
|
||||
<select id="getAchievement" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(create_time, '%Y-%m-%d') as 'k', count(*) as 'v'
|
||||
from achievements
|
||||
where create_time >= #{s}
|
||||
and create_time <= #{e}
|
||||
and source = #{t}
|
||||
group by DATE_FORMAT(create_time, '%Y-%m-%d')
|
||||
order by DATE_FORMAT(create_time, '%Y-%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="indexProjectStatistic" resultType="java.util.Map">
|
||||
select COUNT(*) as projectCount,
|
||||
IFNULL(SUM(attachment_count), 0) as attachmentCount,
|
||||
(select COUNT(*) from clickers where click_type = 'Project') as clickCount,
|
||||
(select COUNT(distinct project_id) from project_resource_library) as projectAchievementCount
|
||||
from achievements
|
||||
where source = '1';
|
||||
</select>
|
||||
|
||||
<select id="indexTaskStatistic" resultType="java.util.Map">
|
||||
select COUNT(*) as taskCount,
|
||||
(select COUNT(*) from clickers where click_type = 'makerSpaceTask') as clickCount,
|
||||
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount
|
||||
from achievements
|
||||
where source = '2';
|
||||
</select>
|
||||
<select id="indexCompetitionStatistic" resultType="java.util.Map">
|
||||
select COUNT(*) as CompetitionCount,
|
||||
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount,
|
||||
(select COUNT(*) from clickers where click_type = 'CompetitionInfo') as clickCount,
|
||||
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCountAchievementCount
|
||||
from achievements
|
||||
where source = '3';
|
||||
</select>
|
||||
|
||||
<select id="indexSchoolEnterpriseStatistic" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from achievements a
|
||||
where source = #{s}
|
||||
and tags = #{t};
|
||||
</select>
|
||||
|
||||
<select id="getAreasByName" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
SELECT name as "key",id as "value"
|
||||
FROM categories
|
||||
<where>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
name like concat('%', #{areaName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getActDataStatisticById"
|
||||
resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||
select a.clickSum, b.watchSum, c.searchSum, d.favoriteSum, e.downloadSum
|
||||
from (
|
||||
(select count(1) as clickSum from clickers where click_type = 'Achievements' and click_id = #{id}) a,
|
||||
(select count(1) as watchSum from watchers where watchable_type = 'Achievements' and watchable_id = #{id}) b,
|
||||
(select count(1) as searchSum from searchers where search_type = 'Achievements' and search_id = #{id}) c,
|
||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id}) d,
|
||||
(select count(1) as downloadSum from downloads where download_type = 'Achievements' and download_id = #{id}) e
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="get7AddClickById" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
|
||||
from clickers
|
||||
where created_at >= #{s}
|
||||
and created_at <= #{e}
|
||||
and click_type = #{t}
|
||||
and click_id = #{id}
|
||||
group by DATE_FORMAT(created_at, '%m-%d')
|
||||
order by DATE_FORMAT(created_at, '%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||
select b.watchSum, d.favoriteSum
|
||||
from (
|
||||
(select count(1) as watchSum from watchers where watchable_type = 'Achievements' and watchable_id = #{id} and user_id=#{userId}) b,
|
||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="countAchievementBySource" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from achievements
|
||||
<where>
|
||||
<if test="source != null and source != ''">and `source` = #{source}</if>
|
||||
<if test="s != null">and create_time >= #{s}</if>
|
||||
<if test="e != null">and create_time <= #{e}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAchievementDataYearly" resultType="java.util.Map">
|
||||
select DATE_FORMAT(create_time, '%Y') as 'k', count(*) as 'v'
|
||||
from achievements
|
||||
group by DATE_FORMAT(create_time, '%Y')
|
||||
order by DATE_FORMAT(create_time, '%Y')
|
||||
</select>
|
||||
|
||||
<select id="getAchievementType" resultType="java.util.Map">
|
||||
select achievement_type as 'k', count(*) as 'v'
|
||||
from achievements
|
||||
group by achievement_type
|
||||
</select>
|
||||
|
||||
<select id="getAchievementActData" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
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')
|
||||
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')
|
||||
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')
|
||||
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
|
||||
order by t.name
|
||||
</select>
|
||||
|
||||
<select id="getAchievementDomain" resultType="java.util.Map">
|
||||
select c.id as "key", c.name as "name", f.value as "value"
|
||||
from (select a.domain_value as "name", sum(a.countResult) as "value"
|
||||
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
|
||||
from achievements
|
||||
group by field_1
|
||||
union all
|
||||
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
|
||||
from achievements
|
||||
group by field_2
|
||||
union all
|
||||
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
|
||||
from achievements
|
||||
group by field_3) a
|
||||
group by a.domain_value
|
||||
order by sum(a.countResult) desc) f
|
||||
right join categories c on c.id = f.name
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getAchievementAddYearly" resultType="java.util.Map">
|
||||
select DATE_FORMAT(create_time, '%Y') as 'k', count(*) as 'v'
|
||||
from achievements
|
||||
group by DATE_FORMAT(create_time, '%Y')
|
||||
order by DATE_FORMAT(create_time, '%Y')
|
||||
</select>
|
||||
<select id="getAchievementHotRank" resultType="java.util.Map">
|
||||
select achievement_name as name, create_time as reelaseTime, hot_rank from achievements
|
||||
order by hot_rank desc
|
||||
</select>
|
||||
|
||||
<select id="getAllId" resultType="java.lang.Long">
|
||||
select id from achievements
|
||||
</select>
|
||||
|
||||
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
|
||||
select z.name as "areaName",
|
||||
z.field_1 as "areaKey",
|
||||
z.remark as "remark",
|
||||
sum(z.kyxm) as "kyxmSum",
|
||||
sum(z.ckrw) as "ckrwSum",
|
||||
sum(z.kfjs) as "kfjsSum",
|
||||
sum(z.xqcg) as "xqcgSum"
|
||||
from (select r.name,
|
||||
r.field_1,
|
||||
r.remark,
|
||||
case when r.source = 1 then tmp else 0 end as "kyxm",
|
||||
case when r.source = 2 then tmp else 0 end as "ckrw",
|
||||
case when r.source = 3 then tmp else 0 end as "kfjs",
|
||||
case when r.source = 4 then tmp else 0 end as "xqcg"
|
||||
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark
|
||||
from achievements a
|
||||
inner join categories c on a.field_1 = c.id
|
||||
group by c.name, a.source, a.field_1, c.remark) r) z
|
||||
<where>
|
||||
<if test="areaKey != null and areaKey != ''">
|
||||
and z.field_1 = #{areaKey}
|
||||
</if>
|
||||
</where>
|
||||
group by z.name, z.field_1, z.remark
|
||||
</select>
|
||||
|
||||
<select id="getDistinctYear" resultType="String">
|
||||
select distinct DATE_FORMAT(create_time, '%Y')
|
||||
from achievements
|
||||
where id = #{id} and source_id=#{sourceId}
|
||||
order by DATE_FORMAT(create_time, '%Y') desc
|
||||
</select>
|
||||
|
||||
<select id="getRelatedAch" resultType="com.microservices.dms.achievementLibrary.domain.AchRelatedVo">
|
||||
select id as "id",
|
||||
attachments as "attachments",
|
||||
summary as "summary",
|
||||
achievement_type as "achievementType",
|
||||
DATE_FORMAT(create_time, '%m-%d') as "achMonthDay",
|
||||
source as "source",
|
||||
source_id as "sourceId" ,
|
||||
#{paramYear} as resultYear
|
||||
from achievements
|
||||
where id = #{id}
|
||||
and source_id = #{sourceId}
|
||||
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
|
||||
order by DATE_FORMAT(create_time, '%m-%d')
|
||||
</select>
|
||||
<select id="selectAchievementsByName" resultType="Long">
|
||||
select id
|
||||
from achievements
|
||||
<where>
|
||||
<if test="achName != null and achName != ''"> and achievement_name like concat('%', #{achName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
<?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.behaviorImage.mapper.BehaviorImageMapper">
|
||||
|
||||
<sql id="getBehaviorSumListByType" >
|
||||
</sql>
|
||||
|
||||
<select id="getBehaviorSumListByType" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||
select a.clickSum,b.watchSum,c.searchSum,d.favoriteSum,e.downloadSum from (
|
||||
(select count(1) as clickSum from clickers where click_type='Achievements') a,
|
||||
(select count(1) as watchSum from watchers where watchable_type='Achievements') b,
|
||||
(select count(1) as searchSum from searchers where search_type='Achievements') c,
|
||||
(select count(1) as favoriteSum from favorites where favorite_type='Achievements' ) d,
|
||||
(select count(1) as downloadSum from downloads where download_type='Achievements' ) e
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getWeightListByType" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select behavior_code as "key" ,behavior_weight as "value"
|
||||
from behavior_image_weight
|
||||
where image_type = #{achievementsImage}
|
||||
</select>
|
||||
|
||||
<select id="getSearchSumByAchievementId" resultType="long">
|
||||
select count(1) as searchSum from searchers where search_type = #{achievementsImage} and search_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getFavoriteSumByAchievementId" resultType="long">
|
||||
select count(1) as favoriteSum from favorites where favorite_type = #{achievementsImage} and favorite_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getWatchSumByAchievementId" resultType="long">
|
||||
select count(1) as watchSum from watchers where watchable_type = #{achievementsImage} and watchable_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getFileDownloadSumByAchievementId" resultType="long">
|
||||
select count(1) from downloads where download_type = #{achievementsImage} and download_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getClickSumByAchievementId" resultType="long">
|
||||
select count(1) as clickSum from clickers where click_type = #{achievementsImage} and click_id = #{id}
|
||||
</select>
|
||||
|
||||
<resultMap type="BehaviorImageWeight" id="BehaviorImageWeightResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="behaviorCode" column="behavior_code" />
|
||||
<result property="imageType" column="image_type" />
|
||||
<result property="behaviorName" column="behavior_name" />
|
||||
<result property="behaviorWeight" column="behavior_weight" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBehaviorImageWeightVo">
|
||||
select id, behavior_code, image_type, behavior_name, behavior_weight, remark, create_by, create_time, update_by, update_time from behavior_image_weight
|
||||
</sql>
|
||||
|
||||
<select id="selectBehaviorImageWeightList" parameterType="BehaviorImageWeight" resultMap="BehaviorImageWeightResult">
|
||||
<include refid="selectBehaviorImageWeightVo"/>
|
||||
<where>
|
||||
<if test="behaviorCode != null and behaviorCode != ''"> and behavior_code = #{behaviorCode}</if>
|
||||
<if test="imageType != null and imageType != ''"> and image_type = #{imageType}</if>
|
||||
<if test="behaviorName != null and behaviorName != ''"> and behavior_name like concat('%', #{behaviorName}, '%')</if>
|
||||
<if test="behaviorWeight != null and behaviorWeight != ''"> and behavior_weight = #{behaviorWeight}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBehaviorImageWeightById" parameterType="Long" resultMap="BehaviorImageWeightResult">
|
||||
<include refid="selectBehaviorImageWeightVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBehaviorImageWeight" parameterType="BehaviorImageWeight" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into behavior_image_weight
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="behaviorCode != null">behavior_code,</if>
|
||||
<if test="imageType != null and imageType != ''">image_type,</if>
|
||||
<if test="behaviorName != null">behavior_name,</if>
|
||||
<if test="behaviorWeight != null">behavior_weight,</if>
|
||||
<if test="remark != null">remark,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="behaviorCode != null">#{behaviorCode},</if>
|
||||
<if test="imageType != null and imageType != ''">#{imageType},</if>
|
||||
<if test="behaviorName != null">#{behaviorName},</if>
|
||||
<if test="behaviorWeight != null">#{behaviorWeight},</if>
|
||||
<if test="remark != null">#{remark},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBehaviorImageWeight" parameterType="BehaviorImageWeight">
|
||||
update behavior_image_weight
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="behaviorCode != null">behavior_code = #{behaviorCode},</if>
|
||||
<if test="imageType != null and imageType != ''">image_type = #{imageType},</if>
|
||||
<if test="behaviorName != null">behavior_name = #{behaviorName},</if>
|
||||
<if test="behaviorWeight != null">behavior_weight = #{behaviorWeight},</if>
|
||||
<if test="remark != null">remark = #{remark},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBehaviorImageWeightById" parameterType="Long">
|
||||
delete from behavior_image_weight where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBehaviorImageWeightByIds" parameterType="String">
|
||||
delete from behavior_image_weight where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,404 @@
|
|||
<?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.resourceLibrary.mapper.CompetitionResourceLibraryMapper">
|
||||
|
||||
|
||||
<select id="selectRegisterCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, competition_info_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from competition_users
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND competition_info_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOpusCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, competition_info_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from
|
||||
competition_users
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND competition_info_id = #{itemId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCompetitionListCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo">
|
||||
select title as name,id,`status`,visits,watchers_count,DATEDIFF(upload_date, start_at) as totalTaskDays
|
||||
from competition_infos
|
||||
<where>
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
</if>
|
||||
<if test="name != null and name.trim() != ''">
|
||||
AND `title` like concat('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="countRegisterCondition" resultType="java.lang.Long">
|
||||
select count(*) from competition_users
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND competition_info_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countOpusCondition" resultType="java.lang.Long">
|
||||
select count(*) from competition_users
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND competition_info_id = #{itemId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND `status` = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap type="CompetitionResourceLibrary" id="CompetitionResourceLibraryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="openCompetitionId" column="open_competition_id"/>
|
||||
<result property="openCompetitionName" column="open_competition_name"/>
|
||||
<result property="competitionUserId" column="competition_user_id"/>
|
||||
<result property="competitionField" column="competition_field"/>
|
||||
<result property="competitionStatus" column="competition_status"/>
|
||||
<result property="competitionSubmissionName" column="competition_submission_name"/>
|
||||
<result property="submissionTime" column="submission_time"/>
|
||||
<result property="submitter" column="submitter"/>
|
||||
<result property="submissionType" column="submission_type"/>
|
||||
<result property="submittingUnit" column="submitting_unit"/>
|
||||
<result property="submissionSummary" column="submission_summary"/>
|
||||
<result property="submissionDetails" column="submission_details"/>
|
||||
<result property="contactPerson" column="contact_person"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="isTransferredToResultLibrary" column="is_transferred_to_result_library"/>
|
||||
<result property="transferredToResultLibraryTime" column="transferred_to_result_library_time"/>
|
||||
<result property="isFeaturedResult" column="is_featured_result"/>
|
||||
<result property="image" column="image"/>
|
||||
<result property="attachment" column="attachment"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCompetitionResourceLibraryVo">
|
||||
select id,
|
||||
open_competition_id,
|
||||
open_competition_name,
|
||||
competition_user_id,
|
||||
competition_field,
|
||||
competition_status,
|
||||
competition_submission_name,
|
||||
submission_time,
|
||||
submitter,
|
||||
submission_type,
|
||||
submitting_unit,
|
||||
submission_summary,
|
||||
submission_details,
|
||||
contact_person,
|
||||
contact_phone,
|
||||
is_transferred_to_result_library,
|
||||
transferred_to_result_library_time,
|
||||
is_featured_result,
|
||||
image,
|
||||
attachment,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from competition_resource_library
|
||||
</sql>
|
||||
|
||||
<select id="selectCompetitionResourceLibraryList" parameterType="CompetitionResourceLibrary"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary">
|
||||
select crl.id,
|
||||
ci.id as open_competition_id,
|
||||
ci.title as open_competition_name,
|
||||
cu.id as competition_user_id,
|
||||
competition_field,
|
||||
ci.status as competition_status,
|
||||
cu.works_name as competition_submission_name,
|
||||
cu.created_at as submission_time,
|
||||
cu.leader as submitter,
|
||||
submission_type,
|
||||
cu.org_name as submitting_unit,
|
||||
cu.sub_item as submission_summary,
|
||||
cu.sub_item as submission_details,
|
||||
cu.leader as contact_person,
|
||||
cu.phone as contact_phone,
|
||||
is_transferred_to_result_library,
|
||||
transferred_to_result_library_time,
|
||||
is_featured_result,
|
||||
image,
|
||||
attachment,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
ci.is_expert_audit
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
left join competition_resource_library crl on crl.competition_user_id = cu.id
|
||||
<where>
|
||||
<if test="openCompetitionId != null ">and open_competition_id = #{openCompetitionId}</if>
|
||||
<if test="openCompetitionName != null and openCompetitionName != ''">and ci.title like
|
||||
concat('%', #{openCompetitionName}, '%')
|
||||
</if>
|
||||
<if test="competitionUserId != null ">and competition_user_id = #{competitionUserId}</if>
|
||||
<if test="competitionField != null and competitionField != ''">and competition_field =
|
||||
#{competitionField}
|
||||
</if>
|
||||
<if test="competitionStatus != null and competitionStatus != ''">and competition_status =
|
||||
#{competitionStatus}
|
||||
</if>
|
||||
<if test="competitionSubmissionName != null and competitionSubmissionName != ''">and
|
||||
competition_submission_name like concat('%', #{competitionSubmissionName}, '%')
|
||||
</if>
|
||||
<if test="submissionTime != null ">and submission_time = #{submissionTime}</if>
|
||||
<if test="submitter != null and submitter != ''">and submitter = #{submitter}</if>
|
||||
<if test="submissionType != null and submissionType != ''">and submission_type = #{submissionType}</if>
|
||||
<if test="submittingUnit != null and submittingUnit != ''">and submitting_unit = #{submittingUnit}</if>
|
||||
<if test="submissionSummary != null and submissionSummary != ''">and submission_summary =
|
||||
#{submissionSummary}
|
||||
</if>
|
||||
<if test="submissionDetails != null and submissionDetails != ''">and submission_details =
|
||||
#{submissionDetails}
|
||||
</if>
|
||||
<if test="contactPerson != null and contactPerson != ''">and contact_person = #{contactPerson}</if>
|
||||
<if test="contactPhone != null and contactPhone != ''">and contact_phone = #{contactPhone}</if>
|
||||
<if test="isTransferredToResultLibrary != null ">and is_transferred_to_result_library =
|
||||
#{isTransferredToResultLibrary}
|
||||
</if>
|
||||
<if test="transferredToResultLibraryTime != null ">and transferred_to_result_library_time =
|
||||
#{transferredToResultLibraryTime}
|
||||
</if>
|
||||
<if test="isFeaturedResult != null ">and is_featured_result = #{isFeaturedResult}</if>
|
||||
<if test="image != null and image != ''">and image = #{image}</if>
|
||||
<if test="attachment != null and attachment != ''">and attachment = #{attachment}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCompetitionResourceLibraryById" parameterType="Long" resultMap="CompetitionResourceLibraryResult">
|
||||
<include refid="selectCompetitionResourceLibraryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select uuid as v, filename as k
|
||||
from attachments
|
||||
where container_type = 'CompetitionUser'
|
||||
and container_id = #{id}
|
||||
</select>
|
||||
<select id="getTotalOpenCompetitions" resultType="java.lang.Long">
|
||||
select count(distinct ci.id)
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
</select>
|
||||
<select id="getTotalCompetitionAchievements" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
left join competition_resource_library crl on crl.competition_user_id = cu.id
|
||||
where crl.is_transferred_to_result_library = 1
|
||||
</select>
|
||||
<select id="getTotalCompetitionSubmissions" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
</select>
|
||||
|
||||
<select id="getTotalFinishedCompetitions" resultType="java.lang.Long">
|
||||
select count(distinct ci.id)
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
where ci.upload_date < now()
|
||||
</select>
|
||||
<select id="getReviewCompetitionCount" resultType="java.lang.Long">
|
||||
select count(distinct ci.id)
|
||||
from competition_infos ci
|
||||
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
|
||||
where ci.is_expert_audit = 1
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionFinish" resultType="java.lang.Long">
|
||||
select COUNT(*) from competition_infos where upload_date < now()
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionEnroll" resultType="java.lang.Long">
|
||||
select count(user_id) from competition_users
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionUnderway" resultType="java.lang.Long">
|
||||
select COUNT(*) from competition_infos where upload_date >= now() and start_at <= now()
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionSubmitCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from attachments
|
||||
where container_type = 'CompetitionUser'
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionTransferCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from achievements
|
||||
where source = '3'
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionNeedAuditCount" resultType="java.lang.Long">
|
||||
select COUNT(*) from competition_infos where is_expert_audit = 1
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionStatisticYearly"
|
||||
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select DATE_FORMAT(created_at, '%Y') as 'key', count(*) as 'value'
|
||||
from competition_infos
|
||||
group by DATE_FORMAT(created_at, '%Y')
|
||||
order by DATE_FORMAT(created_at, '%Y')
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionHot" resultType="java.util.Map">
|
||||
select t.title as name, achievementCount, enrollCount, paperCount, t.id as `id`,(achievementCount+enrollCount+paperCount) as total
|
||||
from (select c.title,
|
||||
c.id,
|
||||
(select count(*) from achievements a where source='3' and a.source_id = c.id ) as achievementCount,
|
||||
(select count(*) from competition_users cu where cu.competition_info_id = c.id) as enrollCount,
|
||||
(select count(*) from (select * from competition_users) cu inner join attachments on container_type = 'CompetitionUser' and container_id=cu.id where cu.competition_info_id=c.id) as paperCount
|
||||
from competition_infos c ) as t
|
||||
order by total desc
|
||||
limit 0,10
|
||||
</select>
|
||||
|
||||
<select id="getCompetitionYearlyPaperAdd"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
|
||||
from competition_infos
|
||||
where created_at >= #{s}
|
||||
and created_at <= #{e}
|
||||
group by DATE_FORMAT(created_at, '%m-%d')
|
||||
order by DATE_FORMAT(created_at, '%m-%d')
|
||||
</select>
|
||||
<select id="getCompetitionYearlyFinish"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(upload_date, '%m-%d') as 'k', count(*) as 'v'
|
||||
from competition_infos
|
||||
where upload_date >= #{s}
|
||||
and upload_date <= #{e}
|
||||
group by DATE_FORMAT(upload_date, '%m-%d')
|
||||
order by DATE_FORMAT(upload_date, '%m-%d')
|
||||
</select>
|
||||
|
||||
<insert id="insertCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into competition_resource_library
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="openCompetitionId != null">open_competition_id,</if>
|
||||
<if test="openCompetitionName != null">open_competition_name,</if>
|
||||
<if test="competitionUserId != null">competition_user_id,</if>
|
||||
<if test="competitionField != null">competition_field,</if>
|
||||
<if test="competitionStatus != null">competition_status,</if>
|
||||
<if test="competitionSubmissionName != null">competition_submission_name,</if>
|
||||
<if test="submissionTime != null">submission_time,</if>
|
||||
<if test="submitter != null">submitter,</if>
|
||||
<if test="submissionType != null">submission_type,</if>
|
||||
<if test="submittingUnit != null">submitting_unit,</if>
|
||||
<if test="submissionSummary != null">submission_summary,</if>
|
||||
<if test="submissionDetails != null">submission_details,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="isTransferredToResultLibrary != null">is_transferred_to_result_library,</if>
|
||||
<if test="transferredToResultLibraryTime != null">transferred_to_result_library_time,</if>
|
||||
<if test="isFeaturedResult != null">is_featured_result,</if>
|
||||
<if test="image != null">image,</if>
|
||||
<if test="attachment != null">attachment,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="openCompetitionId != null">#{openCompetitionId},</if>
|
||||
<if test="openCompetitionName != null">#{openCompetitionName},</if>
|
||||
<if test="competitionUserId != null">#{competitionUserId},</if>
|
||||
<if test="competitionField != null">#{competitionField},</if>
|
||||
<if test="competitionStatus != null">#{competitionStatus},</if>
|
||||
<if test="competitionSubmissionName != null">#{competitionSubmissionName},</if>
|
||||
<if test="submissionTime != null">#{submissionTime},</if>
|
||||
<if test="submitter != null">#{submitter},</if>
|
||||
<if test="submissionType != null">#{submissionType},</if>
|
||||
<if test="submittingUnit != null">#{submittingUnit},</if>
|
||||
<if test="submissionSummary != null">#{submissionSummary},</if>
|
||||
<if test="submissionDetails != null">#{submissionDetails},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="isTransferredToResultLibrary != null">#{isTransferredToResultLibrary},</if>
|
||||
<if test="transferredToResultLibraryTime != null">#{transferredToResultLibraryTime},</if>
|
||||
<if test="isFeaturedResult != null">#{isFeaturedResult},</if>
|
||||
<if test="image != null">#{image},</if>
|
||||
<if test="attachment != null">#{attachment},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary">
|
||||
update competition_resource_library
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="openCompetitionId != null">open_competition_id = #{openCompetitionId},</if>
|
||||
<if test="openCompetitionName != null">open_competition_name = #{openCompetitionName},</if>
|
||||
<if test="competitionUserId != null">competition_user_id = #{competitionUserId},</if>
|
||||
<if test="competitionField != null">competition_field = #{competitionField},</if>
|
||||
<if test="competitionStatus != null">competition_status = #{competitionStatus},</if>
|
||||
<if test="competitionSubmissionName != null">competition_submission_name = #{competitionSubmissionName},
|
||||
</if>
|
||||
<if test="submissionTime != null">submission_time = #{submissionTime},</if>
|
||||
<if test="submitter != null">submitter = #{submitter},</if>
|
||||
<if test="submissionType != null">submission_type = #{submissionType},</if>
|
||||
<if test="submittingUnit != null">submitting_unit = #{submittingUnit},</if>
|
||||
<if test="submissionSummary != null">submission_summary = #{submissionSummary},</if>
|
||||
<if test="submissionDetails != null">submission_details = #{submissionDetails},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="isTransferredToResultLibrary != null">is_transferred_to_result_library =
|
||||
#{isTransferredToResultLibrary},
|
||||
</if>
|
||||
<if test="transferredToResultLibraryTime != null">transferred_to_result_library_time =
|
||||
#{transferredToResultLibraryTime},
|
||||
</if>
|
||||
<if test="isFeaturedResult != null">is_featured_result = #{isFeaturedResult},</if>
|
||||
<if test="image != null">image = #{image},</if>
|
||||
<if test="attachment != null">attachment = #{attachment},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCompetitionResourceLibraryById" parameterType="Long">
|
||||
delete
|
||||
from competition_resource_library
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCompetitionResourceLibraryByIds" parameterType="String">
|
||||
delete from competition_resource_library where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,544 @@
|
|||
<?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.resourceLibrary.mapper.ExpertResourceLibraryMapper">
|
||||
|
||||
<resultMap type="ExpertResourceLibrary" id="ExpertResourceLibraryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="expertId" column="expert_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="expertName" column="expert_name"/>
|
||||
<result property="highestDegree" column="highest_degree"/>
|
||||
<result property="graduatedFrom" column="graduated_from"/>
|
||||
<result property="idNumber" column="id_number"/>
|
||||
<result property="major" column="major"/>
|
||||
<result property="workplace" column="workplace"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="workplaceType" column="workplace_type"/>
|
||||
<result property="expertEmail" column="expert_email"/>
|
||||
<result property="expertSummary" column="expert_summary"/>
|
||||
<result property="expertDetail" column="expert_detail"/>
|
||||
<result property="professionalTitle" column="professional_title"/>
|
||||
<result property="expertType" column="expert_type"/>
|
||||
<result property="expertDomain" column="expert_domain"/>
|
||||
<result property="titleRank" column="title_rank"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="reviewAreaOne" column="review_area_one"/>
|
||||
<result property="reviewAreaTwo" column="review_area_two"/>
|
||||
<result property="reviewAreaThree" column="review_area_three"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<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="sortNo" column="sort_no"/>
|
||||
<result property="gender" column="gender"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExpertResourceLibraryVo">
|
||||
select id,
|
||||
user_id,
|
||||
expert_id,
|
||||
gender,
|
||||
sort_no,
|
||||
expert_name,
|
||||
highest_degree,
|
||||
graduated_from,
|
||||
id_number,
|
||||
major,
|
||||
workplace,
|
||||
phone,
|
||||
workplace_type,
|
||||
expert_email,
|
||||
expert_summary,
|
||||
expert_detail,
|
||||
professional_title,
|
||||
expert_type,
|
||||
expert_domain,
|
||||
title_rank,
|
||||
status,
|
||||
review_area_one,
|
||||
review_area_two,
|
||||
review_area_three,
|
||||
is_delete,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,images, attachments,gender,sort_no,status
|
||||
from expert_resource_library
|
||||
</sql>
|
||||
|
||||
<select id="selectExpertResourceLibraryList" parameterType="ExpertResourceLibrary"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary">
|
||||
select * from ( select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from,
|
||||
e.id_number,erl.gender,images, attachments,
|
||||
e.major, e.workplace, e.phone,
|
||||
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
||||
expert_domain,u.authentication as expertAuth,
|
||||
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
|
||||
erl.create_time,
|
||||
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 1) as taskAuditCount,
|
||||
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 2) as competitionAuditCount,
|
||||
erl.update_by, erl.update_time,erl.sort_no
|
||||
from experts e
|
||||
inner join users u on e.user_id = u.id
|
||||
left join expert_resource_library erl on e.id = erl.expert_id
|
||||
<where>
|
||||
e.is_delete='0' and e.status=1
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="gender != null ">and gender = #{gender}</if>
|
||||
<if test="expertName != null and expertName != ''">and e.expert_name like concat('%', #{expertName}, '%')
|
||||
</if>
|
||||
<if test="highestDegree != null and highestDegree != ''">and highest_degree = #{highestDegree}</if>
|
||||
<if test="graduatedFrom != null and graduatedFrom != ''">and graduated_from = #{graduatedFrom}</if>
|
||||
<if test="idNumber != null and idNumber != ''">and id_number = #{idNumber}</if>
|
||||
<if test="major != null and major != ''">and major = #{major}</if>
|
||||
<if test="workplace != null and workplace != ''">and workplace = #{workplace}</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="workplaceType != null and workplaceType != ''">and workplace_type = #{workplaceType}</if>
|
||||
<if test="expertEmail != null and expertEmail != ''">and expert_email = #{expertEmail}</if>
|
||||
<if test="expertSummary != null and expertSummary != ''">and expert_summary = #{expertSummary}</if>
|
||||
<if test="expertDetail != null and expertDetail != ''">and expert_detail = #{expertDetail}</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''">and professional_title =
|
||||
#{professionalTitle}
|
||||
</if>
|
||||
<if test="expertType != null and expertType != ''">and expert_type = #{expertType}</if>
|
||||
<if test="expertDomain != null and expertDomain != ''">and expert_domain = #{expertDomain}</if>
|
||||
<if test="titleRank != null and titleRank != ''">and title_rank = #{titleRank}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="reviewAreaOne != null and reviewAreaOne != ''">and review_area_one = #{reviewAreaOne}</if>
|
||||
<if test="reviewAreaTwo != null and reviewAreaTwo != ''">and review_area_two = #{reviewAreaTwo}</if>
|
||||
<if test="reviewAreaThree != null and reviewAreaThree != ''">and review_area_three = #{reviewAreaThree}
|
||||
</if>
|
||||
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
) tmp where tmp.taskAuditCount > 0 OR tmp.competitionAuditCount > 0
|
||||
</select>
|
||||
|
||||
<select id="selectExpertResourceLibraryList2" parameterType="ExpertResourceLibrary"
|
||||
resultMap="ExpertResourceLibraryResult">
|
||||
select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from, e.id_number,
|
||||
e.major, e.workplace, e.phone,
|
||||
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
|
||||
expert_domain,images, attachments,
|
||||
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
|
||||
erl.create_time,
|
||||
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 1) as taskAuditCount,
|
||||
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 2) as competitionAuditCount,
|
||||
(select count(*) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = erl.id) as watcherSum,
|
||||
(select count(*) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = erl.id) as favoriteSum,
|
||||
erl.update_by, erl.update_time,erl.sort_no
|
||||
from expert_resource_library erl left join experts e on e.id = erl.expert_id
|
||||
<where>
|
||||
<if test="userId != null ">and user_id = #{userId}</if>
|
||||
<if test="expertName != null and expertName != ''">and erl.expert_name like concat('%', #{expertName}, '%')
|
||||
</if>
|
||||
<if test="highestDegree != null and highestDegree != ''">and erl.highest_degree = #{highestDegree}</if>
|
||||
<if test="graduatedFrom != null and graduatedFrom != ''">and erl.graduated_from = #{graduatedFrom}</if>
|
||||
<if test="idNumber != null and idNumber != ''">and erl.id_number = #{idNumber}</if>
|
||||
<if test="major != null and major != ''">and erl.major = #{major}</if>
|
||||
<if test="workplace != null and workplace != ''">and erl.workplace = #{workplace}</if>
|
||||
<if test="phone != null and phone != ''">and erl.phone = #{phone}</if>
|
||||
<if test="workplaceType != null and workplaceType != ''">and erl.workplace_type = #{workplaceType}</if>
|
||||
<if test="expertEmail != null and expertEmail != ''">and erl.expert_email = #{expertEmail}</if>
|
||||
<if test="expertSummary != null and expertSummary != ''">and expert_summary = #{expertSummary}</if>
|
||||
<if test="expertDetail != null and expertDetail != ''">and expert_detail = #{expertDetail}</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''">and erl.professional_title =
|
||||
#{professionalTitle}
|
||||
</if>
|
||||
<if test="expertType != null and expertType != ''">and erl.expert_type = #{expertType}</if>
|
||||
<if test="expertDomain != null and expertDomain != ''">and expert_domain = #{expertDomain}</if>
|
||||
<if test="titleRank != null and titleRank != ''">and erl.title_rank = #{titleRank}</if>
|
||||
<if test="status != null ">and erl.status = #{status}</if>
|
||||
<if test="reviewAreaOne != null and reviewAreaOne != ''">and erl.review_area_one = #{reviewAreaOne}</if>
|
||||
<if test="reviewAreaTwo != null and reviewAreaTwo != ''">and erl.review_area_two = #{reviewAreaTwo}</if>
|
||||
<if test="reviewAreaThree != null and reviewAreaThree != ''">and erl.review_area_three = #{reviewAreaThree}
|
||||
</if>
|
||||
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">
|
||||
<include refid="selectExpertResourceLibraryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="auditExpertCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from (select (select COUNT(*) from task_expert where expert_id = e.id and container_type = 1) as taskAuditCount,
|
||||
(select COUNT(*)
|
||||
from task_expert
|
||||
where expert_id = e.id
|
||||
and container_type = 2) as competitionAuditCount
|
||||
from experts e where is_delete = '0' and status = 1) tmp
|
||||
where tmp.taskAuditCount > 0
|
||||
OR tmp.competitionAuditCount > 0
|
||||
</select>
|
||||
|
||||
<select id="competitionAuditCount" resultType="java.lang.Long">
|
||||
select IFNULL(SUM(competitionAuditCount), 0)
|
||||
from (select (select COUNT(*)
|
||||
from task_expert
|
||||
where expert_id = e.id and container_type = 2) as competitionAuditCount
|
||||
from experts e) tmp
|
||||
</select>
|
||||
<select id="taskAuditCount" resultType="java.lang.Long">
|
||||
select IFNULL(SUM(taskAuditCount), 0)
|
||||
from (select (select COUNT(*) from task_expert where expert_id = e.id and container_type = 1) as taskAuditCount
|
||||
from experts e) tmp
|
||||
</select>
|
||||
<select id="auditCompetitionAuditExpertCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from expert_resource_library erl
|
||||
join
|
||||
(select expert_id from task_expert where container_type = 2 group by expert_id having count(*) > 0) as tmp
|
||||
on erl.expert_id = tmp.expert_id
|
||||
</select>
|
||||
<select id="expertResourceCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from expert_resource_library
|
||||
</select>
|
||||
<select id="auditTaskAuditExpertCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from expert_resource_library erl
|
||||
join
|
||||
(select expert_id from task_expert where container_type = 1 group by expert_id having count(*) > 0) as tmp
|
||||
on erl.expert_id = tmp.expert_id
|
||||
</select>
|
||||
|
||||
<insert id="insertExpertResourceLibrary" parameterType="ExpertResourceLibrary" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into expert_resource_library
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="expertId != null">expert_id,</if>
|
||||
<if test="expertName != null and expertName != ''">expert_name,</if>
|
||||
<if test="highestDegree != null and highestDegree != ''">highest_degree,</if>
|
||||
<if test="graduatedFrom != null">graduated_from,</if>
|
||||
<if test="idNumber != null">id_number,</if>
|
||||
<if test="major != null">major,</if>
|
||||
<if test="workplace != null and workplace != ''">workplace,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="workplaceType != null and workplaceType != ''">workplace_type,</if>
|
||||
<if test="expertEmail != null">expert_email,</if>
|
||||
<if test="expertSummary != null">expert_summary,</if>
|
||||
<if test="expertDetail != null">expert_detail,</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''">professional_title,</if>
|
||||
<if test="expertType != null and expertType != ''">expert_type,</if>
|
||||
<if test="expertDomain != null and expertDomain != ''">expert_domain,</if>
|
||||
<if test="titleRank != null and titleRank != ''">title_rank,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="reviewAreaOne != null and reviewAreaOne != ''">review_area_one,</if>
|
||||
<if test="reviewAreaTwo != null">review_area_two,</if>
|
||||
<if test="reviewAreaThree != null">review_area_three,</if>
|
||||
<if test="isDelete != null">is_delete,</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="sortNo != null">sort_no,</if>
|
||||
<if test="gender != null">gender,
|
||||
</if>
|
||||
<if test="images != null">images,</if>
|
||||
<if test="attachments != null">attachments,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="expertId != null">#{expertId},</if>
|
||||
<if test="expertName != null and expertName != ''">#{expertName},</if>
|
||||
<if test="highestDegree != null and highestDegree != ''">#{highestDegree},</if>
|
||||
<if test="graduatedFrom != null">#{graduatedFrom},</if>
|
||||
<if test="idNumber != null">#{idNumber},</if>
|
||||
<if test="major != null">#{major},</if>
|
||||
<if test="workplace != null and workplace != ''">#{workplace},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="workplaceType != null and workplaceType != ''">#{workplaceType},</if>
|
||||
<if test="expertEmail != null">#{expertEmail},</if>
|
||||
<if test="expertSummary != null">#{expertSummary},</if>
|
||||
<if test="expertDetail != null">#{expertDetail},</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''">#{professionalTitle},</if>
|
||||
<if test="expertType != null and expertType != ''">#{expertType},</if>
|
||||
<if test="expertDomain != null and expertDomain != ''">#{expertDomain},</if>
|
||||
<if test="titleRank != null and titleRank != ''">#{titleRank},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="reviewAreaOne != null and reviewAreaOne != ''">#{reviewAreaOne},</if>
|
||||
<if test="reviewAreaTwo != null">#{reviewAreaTwo},</if>
|
||||
<if test="reviewAreaThree != null">#{reviewAreaThree},</if>
|
||||
<if test="isDelete != null">#{isDelete},</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="sortNo != null">#{sortNo},</if>
|
||||
<if test="gender != null">#{gender},</if>
|
||||
<if test="images != null">#{images},</if>
|
||||
<if test="attachments != null">#{attachments},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateExpertResourceLibrary" parameterType="ExpertResourceLibrary">
|
||||
update expert_resource_library
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="expertId != null">expert_id = #{expertId},</if>
|
||||
<if test="expertName != null and expertName != ''">expert_name = #{expertName},</if>
|
||||
<if test="highestDegree != null and highestDegree != ''">highest_degree = #{highestDegree},</if>
|
||||
<if test="graduatedFrom != null">graduated_from = #{graduatedFrom},</if>
|
||||
<if test="idNumber != null">id_number = #{idNumber},</if>
|
||||
<if test="major != null">major = #{major},</if>
|
||||
<if test="workplace != null and workplace != ''">workplace = #{workplace},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="workplaceType != null and workplaceType != ''">workplace_type = #{workplaceType},</if>
|
||||
<if test="expertEmail != null">expert_email = #{expertEmail},</if>
|
||||
<if test="expertSummary != null">expert_summary = #{expertSummary},</if>
|
||||
<if test="expertDetail != null">expert_detail = #{expertDetail},</if>
|
||||
<if test="professionalTitle != null and professionalTitle != ''">professional_title =
|
||||
#{professionalTitle},
|
||||
</if>
|
||||
<if test="expertType != null and expertType != ''">expert_type = #{expertType},</if>
|
||||
<if test="expertDomain != null and expertDomain != ''">expert_domain = #{expertDomain},</if>
|
||||
<if test="titleRank != null and titleRank != ''">title_rank = #{titleRank},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="reviewAreaOne != null and reviewAreaOne != ''">review_area_one = #{reviewAreaOne},</if>
|
||||
<if test="reviewAreaTwo != null">review_area_two = #{reviewAreaTwo},</if>
|
||||
<if test="reviewAreaThree != null">review_area_three = #{reviewAreaThree},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</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="sortNo != null">sort_no = #{sortNo},</if>
|
||||
<if test="gender != null">gender = #{gender},
|
||||
<if test="images != null">images = #{images},</if>
|
||||
<if test="attachments != null">attachments = #{attachments},</if></if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteExpertResourceLibraryById" parameterType="Long">
|
||||
delete
|
||||
from expert_resource_library
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteExpertResourceLibraryByIds" parameterType="String">
|
||||
delete from expert_resource_library where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getTitleRankStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select count(1) as "value", title_rank as "name"
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
group by title_rank
|
||||
</select>
|
||||
|
||||
<select id="getExpertTypeStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select count(1) as "value", expert_type as "name"
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
group by expert_type
|
||||
</select>
|
||||
|
||||
<select id="getHighestDegreeStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select count(1) as "value", highest_degree as "name"
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
group by highest_degree
|
||||
</select>
|
||||
|
||||
<select id="getWorkplaceTypeStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select count(1) as "value", workplace_type as "name"
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
group by workplace_type
|
||||
</select>
|
||||
|
||||
<select id="getAuthenticationStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select b.expertTotal as "total", d.expertAuth as "value"
|
||||
from (
|
||||
(select count(1) as "expertTotal" from experts where is_delete = '0' and status = 1) b,
|
||||
(select count(1) as "expertAuth"
|
||||
from experts e
|
||||
inner join users u on e.user_id = u.id
|
||||
where e.is_delete = '0'
|
||||
and e.status = 1
|
||||
and u.authentication = true) d
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getExpertTotal" resultType="long">
|
||||
select count(1) as "value"
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
</select>
|
||||
|
||||
<select id="getExpertTotalByYear" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select DATE_FORMAT(created_on, '%Y') as 'name', count(*) as 'value'
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
group by DATE_FORMAT(created_on, '%Y')
|
||||
order by DATE_FORMAT(created_on, '%Y')
|
||||
</select>
|
||||
|
||||
<select id="getReviewAreasStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select a.domain_value as "name", count(a.domain_value) as "value"
|
||||
from (select review_area_one as domain_value
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
and review_area_one is not null
|
||||
and review_area_one != ''
|
||||
union all
|
||||
select review_area_two as domain_value
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
and review_area_two is not null
|
||||
and review_area_two != ''
|
||||
union all
|
||||
select review_area_three as domain_value
|
||||
from experts
|
||||
where is_delete = '0'
|
||||
and status = 1
|
||||
and review_area_three is not null
|
||||
and review_area_three != '') a
|
||||
group by a.domain_value
|
||||
</select>
|
||||
|
||||
<select id="getExpertAduit" resultType="com.microservices.dms.achievementLibrary.domain.ExpertTotallVo">
|
||||
select tmp.expert_name as "name",
|
||||
tmp.taskAuditCount as "taskAuditSum",
|
||||
tmp.competitionAuditCount as "competitionAuditSum",
|
||||
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
|
||||
from (select e.expert_name,
|
||||
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 1) as taskAuditCount,
|
||||
(select COUNT(*)
|
||||
from task_expert
|
||||
where expert_id = e.id
|
||||
and container_type = 2) as competitionAuditCount
|
||||
from experts e
|
||||
inner join users u on e.user_id = u.id
|
||||
left join expert_resource_library erl on e.id = erl.user_id
|
||||
where e.is_delete = '0'
|
||||
and e.status = 1) tmp
|
||||
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
|
||||
limit 0,9
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getActDataStatisticById"
|
||||
resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||
select a.clickSum, b.watchSum, c.searchSum, d.favoriteSum, e.downloadSum
|
||||
from (
|
||||
(select count(1) as clickSum from clickers where click_type = 'Experts' and click_id = #{id}) a,
|
||||
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id}) b,
|
||||
(select count(1) as searchSum from searchers where search_type = 'Experts' and search_id = #{id}) c,
|
||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id}) d,
|
||||
(select count(1) as downloadSum from downloads where download_type = 'Experts' and download_id = #{id}) e
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||
select b.watchSum, d.favoriteSum
|
||||
from (
|
||||
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id} and user_id=#{userId}) b,
|
||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getMemoAduit" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select a.auditSum as "value",
|
||||
b.allSum as "total",
|
||||
a.auditSum / b.allSum as "result",
|
||||
c.currentYearSum as "value2"
|
||||
from (
|
||||
(select count(1) as "auditSum"
|
||||
from memos
|
||||
where destroy_status is null and hidden = 0 and published_at is not null) a,
|
||||
(select count(1) as "allSum" from memos) b,
|
||||
(select count(1) as "currentYearSum"
|
||||
from memos
|
||||
where destroy_status is null
|
||||
and hidden = 0
|
||||
and published_at is not null
|
||||
and DATE_FORMAT(published_at, '%Y') = YEAR(NOW())) c
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getIsOriginalStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select is_original as "key",count(1) as "value" from memos where destroy_status is null and hidden=0 and published_at is not null
|
||||
group by is_original
|
||||
</select>
|
||||
|
||||
<select id="getMemoTotalByYear" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select DATE_FORMAT(published_at, '%Y') as "key", COUNT(1) as "value"
|
||||
from memos
|
||||
where destroy_status is null
|
||||
and hidden = 0
|
||||
and published_at is not null
|
||||
group by DATE_FORMAT(published_at, '%Y')
|
||||
order by DATE_FORMAT(published_at, '%Y')
|
||||
</select>
|
||||
|
||||
<select id="getForumSectionStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select a.ancestry as "key", fs.title as "name", a.tmp as "value"
|
||||
from (select f.ancestry, count(1) as "tmp"
|
||||
from memos m
|
||||
left join forum_sections f on m.forum_section_id = f.id
|
||||
where m.destroy_status is null
|
||||
and m.hidden = 0
|
||||
and m.published_at is not null
|
||||
group by f.ancestry) a
|
||||
left join forum_sections fs on fs.id = a.ancestry
|
||||
ORDER BY a.ancestry DESC
|
||||
</select>
|
||||
|
||||
<select id="getAddMemoStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||
select a.currentMonth as "name", a.tag_id as "key", sum(a.countTag) as "value"
|
||||
from (select DATE_FORMAT(published_at, '%m') as "currentMonth", tag_id, count(1) as "countTag"
|
||||
from memos
|
||||
where DATE_FORMAT(published_at, '%Y') = YEAR (NOW()) and destroy_status is null and hidden=0 and published_at is not null
|
||||
group by DATE_FORMAT(published_at, '%m'), tag_id
|
||||
) a
|
||||
group by a.currentMonth, a.tag_id
|
||||
order by a.tag_id, a.currentMonth asc
|
||||
</select>
|
||||
|
||||
<select id="getTop5Memos" resultType="com.microservices.dms.achievementLibrary.domain.MemoTotalVo">
|
||||
select id as "id",subject as "subject",published_at as "publishedAt",viewed_count as "viewedCount",praises_count as "praisesCount",replies_count as "repliesCount",(viewed_count+praises_count+replies_count) as "behavioreSum"
|
||||
from memos where destroy_status is null and hidden=0 and published_at is not null and DATE_FORMAT(published_at, '%Y') = YEAR (NOW())
|
||||
order by (viewed_count+praises_count+replies_count) desc
|
||||
limit 0,5
|
||||
</select>
|
||||
|
||||
<select id="get7DayPaise" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select DATE_FORMAT(created_at, '%Y-%m-%d') as 'k', count(*) as 'v'
|
||||
from praise_treads
|
||||
where praise_tread_object_type='Memo'
|
||||
and created_at >= #{s}
|
||||
and created_at <= #{e}
|
||||
group by DATE_FORMAT(created_at, '%Y-%m-%d')
|
||||
order by DATE_FORMAT(created_at, '%Y-%m-%d')
|
||||
</select>
|
||||
|
||||
<select id="getExpertInfoById" resultType="com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo">
|
||||
select honors honorsAttachments, title_certificate as titleCertificateAttachments,
|
||||
resume resumeAttachments, academic_achievements academicAchievementsAttachments
|
||||
from experts
|
||||
where id = #{expertId}
|
||||
</select>
|
||||
<select id="getAttachmentInfo" resultType="java.util.Map">
|
||||
select file_name,id,unique_file_name from busi_attachments where id = #{id} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,359 @@
|
|||
<?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.resourceLibrary.mapper.ProjectResourceLibraryMapper">
|
||||
|
||||
<select id="selectProjectListCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo">
|
||||
select name,id,
|
||||
(select version_releases_count from repositories where project_id=projects.id) as versionReleasesCount,
|
||||
(select name from project_languages where id=project_language_id) as projectLanguages,
|
||||
(select c.name from project_categories c where id = project_category_id) as projectCategories,
|
||||
forked_count,praises_count,watchers_count,issues_count,pull_requests_count,license_id,visits,
|
||||
(select count(*) from searchers where search_type='Project' and search_id=projects.id) as
|
||||
projectSearchCount,created_on,
|
||||
(select count(*) from commit_logs where project_id=projects.id) as commitsCount,
|
||||
(select count(*) from members where project_id=projects.id) as membersCount,
|
||||
(select count(*) from members where (created_on >= NOW() - INTERVAL 1 MONTH ) and project_id=projects.id) as
|
||||
membersMonthAddCount
|
||||
from projects
|
||||
<where>
|
||||
<if test="categoryId != null">
|
||||
AND project_category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="name != null and name.trim() != ''">
|
||||
AND `name` like concat('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCodeCommitCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, project_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from commit_logs
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND project_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectForkCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, fork_project_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from fork_users
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND fork_project_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectIssueCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, project_id as itemId, assigned_to_id as userId, created_on as createAt,
|
||||
(select login from users where id = assigned_to_id) as userName from issues
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND project_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPRCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select '' as itemType, project_id as itemId, user_id as userId, created_on as createAt,
|
||||
(select login from users where id = user_id) as userName from pull_requests
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND project_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPraisesCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select praise_tread_object_type as itemType, project_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from praise_treads
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND project_id = #{itemId}
|
||||
</if>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND praise_tread_object_type = #{itemType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSearchCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select search_type as itemType, search_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from searchers
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND search_id = #{itemId}
|
||||
</if>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND search_type = #{itemType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap type="ProjectResourceLibrary" id="ProjectResourceLibraryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="openSourceProjectId" column="open_source_project_id"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="repositoryId" column="repository_id"/>
|
||||
<result property="versionReleasesId" column="version_releases_id"/>
|
||||
<result property="isPublic" column="is_public"/>
|
||||
<result property="releaseName" column="release_name"/>
|
||||
<result property="releaseDate" column="release_date"/>
|
||||
<result property="releasePerson" column="release_person"/>
|
||||
<result property="releaseType" column="release_type"/>
|
||||
<result property="releaseUnit" column="release_unit"/>
|
||||
<result property="releaseSummary" column="release_summary"/>
|
||||
<result property="releaseDetails" column="release_details"/>
|
||||
<result property="contactPerson" column="contact_person"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="isTransferredToAchievement" column="is_transferred_to_achievement"/>
|
||||
<result property="transferDate" column="transfer_date"/>
|
||||
<result property="isSelectedAchievement" column="is_selected_achievement"/>
|
||||
<result property="images" column="images"/>
|
||||
<result property="attachments" column="attachments"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectProjectResourceLibraryVo">
|
||||
select id,
|
||||
project_id,
|
||||
repository_id,
|
||||
version_releases_id,
|
||||
is_public,
|
||||
release_name,
|
||||
release_date,
|
||||
release_person,
|
||||
release_type,
|
||||
release_unit,
|
||||
release_summary,
|
||||
release_details,
|
||||
contact_person,
|
||||
contact_phone,
|
||||
is_transferred_to_achievement,
|
||||
transfer_date,
|
||||
is_selected_achievement,
|
||||
images,
|
||||
attachments,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from project_resource_library
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectResourceLibraryList" parameterType="ProjectResourceLibrary"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary">
|
||||
select pl.id,
|
||||
p.name as project_name,
|
||||
p.identifier,
|
||||
p.id as project_id,
|
||||
r.id as repository_id,
|
||||
v.id as version_releases_id,
|
||||
p.is_public as is_public,
|
||||
v.name as release_name,
|
||||
v.created_at as release_date,
|
||||
(select login from users where id=v.user_id) as release_person,
|
||||
p.project_category_id as project_domain,
|
||||
pl.release_type,
|
||||
pl.release_unit,
|
||||
p.description as release_summary,
|
||||
p.description as release_details,
|
||||
pl.contact_person,
|
||||
pl.contact_phone,
|
||||
pl.is_transferred_to_achievement,
|
||||
pl.transfer_date,
|
||||
pl.is_selected_achievement,
|
||||
pl.images,
|
||||
v.zipball_url as attachments,
|
||||
pl.create_by,
|
||||
pl.create_time,
|
||||
pl.update_by,
|
||||
pl.update_time
|
||||
from projects p
|
||||
join repositories r on p.id = r.project_id
|
||||
join version_releases v on r.id = v.repository_id
|
||||
left join project_resource_library pl on v.id = pl.version_releases_id
|
||||
<where>
|
||||
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="versionReleasesId != null ">and version_releases_id = #{versionReleasesId}</if>
|
||||
<if test="isPublic != null ">and pl.is_public = #{isPublic}</if>
|
||||
<if test="releaseName != null and releaseName != ''">and release_name like concat('%', #{releaseName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="releaseDate != null ">and release_date = #{releaseDate}</if>
|
||||
<if test="releasePerson != null and releasePerson != ''">and release_person = #{releasePerson}</if>
|
||||
<if test="releaseType != null and releaseType != ''">and release_type = #{releaseType}</if>
|
||||
<if test="releaseUnit != null and releaseUnit != ''">and release_unit = #{releaseUnit}</if>
|
||||
<if test="releaseSummary != null and releaseSummary != ''">and release_summary = #{releaseSummary}</if>
|
||||
<if test="releaseDetails != null and releaseDetails != ''">and release_details = #{releaseDetails}</if>
|
||||
<if test="contactPerson != null and contactPerson != ''">and contact_person = #{contactPerson}</if>
|
||||
<if test="contactPhone != null and contactPhone != ''">and contact_phone = #{contactPhone}</if>
|
||||
<if test="isTransferredToAchievement != null ">and is_transferred_to_achievement =
|
||||
#{isTransferredToAchievement}
|
||||
</if>
|
||||
<if test="transferDate != null ">and transfer_date = #{transferDate}</if>
|
||||
<if test="isSelectedAchievement != null ">and is_selected_achievement = #{isSelectedAchievement}</if>
|
||||
<if test="images != null and images != ''">and images = #{images}</if>
|
||||
<if test="attachments != null and attachments != ''">and attachments = #{attachments}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectResourceLibraryById" parameterType="Long" resultMap="ProjectResourceLibraryResult">
|
||||
<include refid="selectProjectResourceLibraryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProjectResourceLibrary" parameterType="ProjectResourceLibrary" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into project_resource_library
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="repositoryId != null">repository_id,</if>
|
||||
<if test="versionReleasesId != null">version_releases_id,</if>
|
||||
<if test="isPublic != null">is_public,</if>
|
||||
<if test="releaseName != null">release_name,</if>
|
||||
<if test="releaseDate != null">release_date,</if>
|
||||
<if test="releasePerson != null">release_person,</if>
|
||||
<if test="releaseType != null">release_type,</if>
|
||||
<if test="releaseUnit != null">release_unit,</if>
|
||||
<if test="releaseSummary != null">release_summary,</if>
|
||||
<if test="releaseDetails != null">release_details,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="isTransferredToAchievement != null">is_transferred_to_achievement,</if>
|
||||
<if test="transferDate != null">transfer_date,</if>
|
||||
<if test="isSelectedAchievement != null">is_selected_achievement,</if>
|
||||
<if test="images != null">images,</if>
|
||||
<if test="attachments != null">attachments,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="repositoryId != null">#{repositoryId},</if>
|
||||
<if test="versionReleasesId != null">#{versionReleasesId},</if>
|
||||
<if test="isPublic != null">#{isPublic},</if>
|
||||
<if test="releaseName != null">#{releaseName},</if>
|
||||
<if test="releaseDate != null">#{releaseDate},</if>
|
||||
<if test="releasePerson != null">#{releasePerson},</if>
|
||||
<if test="releaseType != null">#{releaseType},</if>
|
||||
<if test="releaseUnit != null">#{releaseUnit},</if>
|
||||
<if test="releaseSummary != null">#{releaseSummary},</if>
|
||||
<if test="releaseDetails != null">#{releaseDetails},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="isTransferredToAchievement != null">#{isTransferredToAchievement},</if>
|
||||
<if test="transferDate != null">#{transferDate},</if>
|
||||
<if test="isSelectedAchievement != null">#{isSelectedAchievement},</if>
|
||||
<if test="images != null">#{images},</if>
|
||||
<if test="attachments != null">#{attachments},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProjectResourceLibrary" parameterType="ProjectResourceLibrary">
|
||||
update project_resource_library
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
|
||||
<if test="versionReleasesId != null">version_releases_id = #{versionReleasesId},</if>
|
||||
<if test="isPublic != null">is_public = #{isPublic},</if>
|
||||
<if test="releaseName != null">release_name = #{releaseName},</if>
|
||||
<if test="releaseDate != null">release_date = #{releaseDate},</if>
|
||||
<if test="releasePerson != null">release_person = #{releasePerson},</if>
|
||||
<if test="releaseType != null">release_type = #{releaseType},</if>
|
||||
<if test="releaseUnit != null">release_unit = #{releaseUnit},</if>
|
||||
<if test="releaseSummary != null">release_summary = #{releaseSummary},</if>
|
||||
<if test="releaseDetails != null">release_details = #{releaseDetails},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="isTransferredToAchievement != null">is_transferred_to_achievement =
|
||||
#{isTransferredToAchievement},
|
||||
</if>
|
||||
<if test="transferDate != null">transfer_date = #{transferDate},</if>
|
||||
<if test="isSelectedAchievement != null">is_selected_achievement = #{isSelectedAchievement},</if>
|
||||
<if test="images != null">images = #{images},</if>
|
||||
<if test="attachments != null">attachments = #{attachments},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectResourceLibraryById" parameterType="Long">
|
||||
delete
|
||||
from project_resource_library
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectResourceLibraryByIds" parameterType="String">
|
||||
delete from project_resource_library where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTotalProjectCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from projects p
|
||||
join repositories r on p.id = r.project_id
|
||||
join version_releases v on r.id = v.repository_id
|
||||
</select>
|
||||
<select id="getPublicProjectCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from projects p
|
||||
join repositories r on p.id = r.project_id
|
||||
join version_releases v on r.id = v.repository_id
|
||||
where p.is_public = 1
|
||||
</select>
|
||||
<select id="getTotalReleaseCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from version_releases
|
||||
</select>
|
||||
<select id="getTotalConversionCount" resultType="java.lang.Long">
|
||||
select COUNT(*)
|
||||
from project_resource_library
|
||||
where is_transferred_to_achievement = 1
|
||||
</select>
|
||||
|
||||
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select uuid as v, filename as k
|
||||
from attachments
|
||||
where container_type = 'VersionRelease'
|
||||
and container_id = #{containerId}
|
||||
union
|
||||
select tarball_url as v,concat(tag_name,'.tar.gz') as k
|
||||
from version_releases
|
||||
where id = #{containerId}
|
||||
union
|
||||
select zipball_url as v,concat(tag_name,'.zip') as k
|
||||
from version_releases
|
||||
where id = #{containerId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<?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.SchoolEnterpriseAchievementsMapper">
|
||||
|
||||
<resultMap type="SchoolEnterpriseAchievements" id="SchoolEnterpriseAchievementsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="achievementName" column="achievement_name" />
|
||||
<result property="field1" column="field_1" />
|
||||
<result property="field2" column="field_2" />
|
||||
<result property="field3" column="field_3" />
|
||||
<result property="achievementType" column="achievement_type" />
|
||||
<result property="source" column="source" />
|
||||
<result property="sourceId" column="source_id" />
|
||||
<result property="sourceLink" column="source_link" />
|
||||
<result property="tags" column="tags" />
|
||||
<result property="summary" column="summary" />
|
||||
<result property="publishingUnit" column="publishing_unit" />
|
||||
<result property="address" column="address" />
|
||||
<result property="isFeatured" column="is_featured" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
<result property="contactNumber" column="contact_number" />
|
||||
<result property="ownerId" column="owner_id" />
|
||||
<result property="ownerName" column="owner_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="details" column="details" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="reviewDate" column="review_date" />
|
||||
<result property="reviewComments" column="review_comments" />
|
||||
<result property="images" column="images" />
|
||||
<result property="attachments" column="attachments" />
|
||||
<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="achievementStatus" column="achievement_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSchoolEnterpriseAchievementsVo">
|
||||
select id, achievement_name, achievement_status,field_1, field_2, field_3, achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address, is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, update_by, update_time from school_enterprise_achievements
|
||||
</sql>
|
||||
|
||||
<select id="selectSchoolEnterpriseAchievementsList" parameterType="SchoolEnterpriseAchievements" resultMap="SchoolEnterpriseAchievementsResult">
|
||||
<include refid="selectSchoolEnterpriseAchievementsVo"/>
|
||||
<where>
|
||||
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
|
||||
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
|
||||
<if test="field3 != null and field3 != ''"> and field_3 = #{field3}</if>
|
||||
<if test="achievementType != null and achievementType != ''"> and achievement_type = #{achievementType}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
|
||||
<if test="sourceLink != null and sourceLink != ''"> and source_link = #{sourceLink}</if>
|
||||
<if test="tags != null and tags != ''"> and tags = #{tags}</if>
|
||||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
<if test="publishingUnit != null and publishingUnit != ''"> and publishing_unit = #{publishingUnit}</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="isFeatured != null "> and is_featured = #{isFeatured}</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
||||
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
|
||||
<if test="ownerName != null and ownerName != ''"> and owner_name like concat('%', #{ownerName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and `status` = #{status}</if>
|
||||
<if test="achievementStatus != null"> and achievement_status = #{achievementStatus}</if>
|
||||
<if test="details != null and details != ''"> and details = #{details}</if>
|
||||
<if test="reviewer != null and reviewer != ''"> and reviewer = #{reviewer}</if>
|
||||
<if test="reviewDate != null "> and review_date = #{reviewDate}</if>
|
||||
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
|
||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSchoolEnterpriseAchievementsById" parameterType="Long" resultMap="SchoolEnterpriseAchievementsResult">
|
||||
<include refid="selectSchoolEnterpriseAchievementsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="topStatistic" resultType="java.lang.Long">
|
||||
select count(*) from school_enterprise_achievements
|
||||
<where>
|
||||
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
|
||||
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
|
||||
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
|
||||
<if test="field3 != null and field3 != ''"> and field_3 = #{field3}</if>
|
||||
<if test="achievementType != null and achievementType != ''"> and achievement_type = #{achievementType}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
|
||||
<if test="sourceLink != null and sourceLink != ''"> and source_link = #{sourceLink}</if>
|
||||
<if test="tags != null and tags != ''"> and tags = #{tags}</if>
|
||||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
<if test="publishingUnit != null and publishingUnit != ''"> and publishing_unit = #{publishingUnit}</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="isFeatured != null "> and is_featured = #{isFeatured}</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
||||
<if test="ownerId != null and ownerId != ''"> and owner_id = #{ownerId}</if>
|
||||
<if test="ownerName != null and ownerName != ''"> and owner_name like concat('%', #{ownerName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="details != null and details != ''"> and details = #{details}</if>
|
||||
<if test="reviewer != null and reviewer != ''"> and reviewer = #{reviewer}</if>
|
||||
<if test="reviewDate != null "> and review_date = #{reviewDate}</if>
|
||||
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
|
||||
<if test="images != null and images != ''"> and images = #{images}</if>
|
||||
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSchoolEnterpriseAchievements" parameterType="SchoolEnterpriseAchievements" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into school_enterprise_achievements
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementName != null">achievement_name,</if>
|
||||
<if test="field1 != null">field_1,</if>
|
||||
<if test="field2 != null">field_2,</if>
|
||||
<if test="field3 != null">field_3,</if>
|
||||
<if test="achievementType != null">achievement_type,</if>
|
||||
<if test="source != null">source,</if>
|
||||
<if test="sourceId != null">source_id,</if>
|
||||
<if test="sourceLink != null">source_link,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="summary != null">summary,</if>
|
||||
<if test="publishingUnit != null">publishing_unit,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="isFeatured != null">is_featured,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactNumber != null">contact_number,</if>
|
||||
<if test="ownerId != null">owner_id,</if>
|
||||
<if test="ownerName != null">owner_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="details != null">details,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="reviewDate != null">review_date,</if>
|
||||
<if test="reviewComments != null">review_comments,</if>
|
||||
<if test="images != null">images,</if>
|
||||
<if test="attachments != null">attachments,</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="achievementStatus != null">achievement_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="achievementName != null">#{achievementName},</if>
|
||||
<if test="field1 != null">#{field1},</if>
|
||||
<if test="field2 != null">#{field2},</if>
|
||||
<if test="field3 != null">#{field3},</if>
|
||||
<if test="achievementType != null">#{achievementType},</if>
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="sourceId != null">#{sourceId},</if>
|
||||
<if test="sourceLink != null">#{sourceLink},</if>
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="summary != null">#{summary},</if>
|
||||
<if test="publishingUnit != null">#{publishingUnit},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="isFeatured != null">#{isFeatured},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactNumber != null">#{contactNumber},</if>
|
||||
<if test="ownerId != null">#{ownerId},</if>
|
||||
<if test="ownerName != null">#{ownerName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="details != null">#{details},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="reviewDate != null">#{reviewDate},</if>
|
||||
<if test="reviewComments != null">#{reviewComments},</if>
|
||||
<if test="images != null">#{images},</if>
|
||||
<if test="attachments != null">#{attachments},</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="achievementStatus != null">#{achievementStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSchoolEnterpriseAchievements" parameterType="SchoolEnterpriseAchievements">
|
||||
update school_enterprise_achievements
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="achievementName != null">achievement_name = #{achievementName},</if>
|
||||
<if test="field1 != null">field_1 = #{field1},</if>
|
||||
<if test="field2 != null">field_2 = #{field2},</if>
|
||||
<if test="field3 != null">field_3 = #{field3},</if>
|
||||
<if test="achievementType != null">achievement_type = #{achievementType},</if>
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="sourceId != null">source_id = #{sourceId},</if>
|
||||
<if test="sourceLink != null">source_link = #{sourceLink},</if>
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="publishingUnit != null">publishing_unit = #{publishingUnit},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="isFeatured != null">is_featured = #{isFeatured},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
|
||||
<if test="ownerId != null">owner_id = #{ownerId},</if>
|
||||
<if test="ownerName != null">owner_name = #{ownerName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="details != null">details = #{details},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="reviewDate != null">review_date = #{reviewDate},</if>
|
||||
<if test="reviewComments != null">review_comments = #{reviewComments},</if>
|
||||
<if test="images != null">images = #{images},</if>
|
||||
<if test="attachments != null">attachments = #{attachments},</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="achievementStatus != null">achievement_status = #{achievementStatus},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSchoolEnterpriseAchievementsById" parameterType="Long">
|
||||
delete from school_enterprise_achievements where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSchoolEnterpriseAchievementsByIds" parameterType="String">
|
||||
delete from school_enterprise_achievements where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?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.referral.mapper.TalentReferralMapper">
|
||||
|
||||
<select id="selectIssuesCondition" resultType="com.microservices.dms.referral.vo.IssuesVo">
|
||||
select project_id,`subject`,description,status_id from issues
|
||||
<where>
|
||||
<if test="id != null ">and id = #{id}</if>
|
||||
<if test="projectId != null ">and project_id = #{projectId}</if>
|
||||
<if test="subject != null ">and `subject` = #{subject}</if>
|
||||
<if test="statusIds != null and statusIds.size() > 0">and status_id in
|
||||
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectIssuesAssigners" resultType="long">
|
||||
select assigner_id from issue_assigners
|
||||
where issue_id = #{issueId} and assigner_id is not null
|
||||
</select>
|
||||
|
||||
<select id="selectRepositoriesUrl" resultType="string">
|
||||
select concat(login, '/', identifier) as url
|
||||
from (select identifier, (select login from users where id = user_id) as login
|
||||
from repositories
|
||||
where project_id = #{id} limit 1) as tmp
|
||||
</select>
|
||||
|
||||
<select id="selectIssuesById" resultType="com.microservices.dms.referral.vo.IssuesVo">
|
||||
select project_id,`subject`,description,status_id from issues
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectPRById" resultType="com.microservices.dms.referral.vo.PullRequestVo">
|
||||
select project_id,`title`,user_id,`status`,gitea_number from pull_requests
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="countIssuesAssigner" resultType="com.microservices.dms.referral.vo.IssuesVo">
|
||||
SELECT ia.assigner_id as `id`,
|
||||
COUNT(ia.assigner_id) AS num
|
||||
FROM issues i
|
||||
JOIN
|
||||
issue_assigners ia ON i.id = ia.issue_id
|
||||
WHERE i.project_id = #{projectId}
|
||||
and i.status_id = 5
|
||||
GROUP BY ia.assigner_id
|
||||
ORDER BY num DESC;
|
||||
</select>
|
||||
|
||||
<select id="countPRUser" resultType="com.microservices.dms.referral.vo.PullRequestVo">
|
||||
SELECT i.id as `id`,
|
||||
COUNT(i.user_id) AS num
|
||||
FROM pull_requests i
|
||||
|
||||
WHERE i.project_id = #{projectId}
|
||||
and i.status = 1
|
||||
GROUP BY i.user_id
|
||||
ORDER BY num DESC;
|
||||
</select>
|
||||
|
||||
<select id="selectIdByLogin" resultType="java.lang.Long">
|
||||
select id from users where login = #{login} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,642 @@
|
|||
<?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.resourceLibrary.mapper.TaskResourceLibraryMapper">
|
||||
|
||||
<insert id="insertClicker" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.microservices.dms.resourceLibrary.domain.Clicker">
|
||||
INSERT INTO clickers
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != clickType and '' != clickType">
|
||||
click_type,
|
||||
</if>
|
||||
<if test="null != clickId ">
|
||||
click_id,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
ext_info
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != clickType and '' != clickType">
|
||||
#{clickType},
|
||||
</if>
|
||||
<if test="null != clickId ">
|
||||
#{clickId},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
#{createdAt},
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
#{extInfo}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countClicker" resultType="java.lang.Long">
|
||||
select count(*) from clickers
|
||||
<where>
|
||||
<if test="null != clickType and '' != clickType">
|
||||
click_type = #{clickType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<insert id="insertSearcher" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.microservices.dms.resourceLibrary.domain.Searcher">
|
||||
INSERT INTO searchers
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != searchType and '' != searchType">
|
||||
search_type,
|
||||
</if>
|
||||
<if test="null != searchId ">
|
||||
search_id,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
ext_info
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != searchType and '' != searchType">
|
||||
#{searchType},
|
||||
</if>
|
||||
<if test="null != searchId ">
|
||||
#{searchId},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
#{createdAt},
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
#{extInfo}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertDownloader" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.microservices.dms.resourceLibrary.domain.Downloader">
|
||||
INSERT INTO downloads
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != downloadType and '' != downloadType">
|
||||
download_type,
|
||||
</if>
|
||||
<if test="null != downloadId ">
|
||||
download_id,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
ext_info
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != downloadType and '' != downloadType">
|
||||
#{downloadType},
|
||||
</if>
|
||||
<if test="null != downloadId ">
|
||||
#{downloadId},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
#{createdAt},
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
#{extInfo}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertFavorite" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.microservices.dms.resourceLibrary.domain.Favorite">
|
||||
INSERT INTO favorites
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != favoriteType and '' != favoriteType">
|
||||
favorite_type,
|
||||
</if>
|
||||
<if test="null != favoriteId ">
|
||||
favorite_id,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
ext_info
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != favoriteType and '' != favoriteType">
|
||||
#{favoriteType},
|
||||
</if>
|
||||
<if test="null != favoriteId ">
|
||||
#{favoriteId},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
#{createdAt},
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
#{extInfo}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertWatcher" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
|
||||
parameterType="com.microservices.dms.resourceLibrary.domain.Favorite">
|
||||
INSERT INTO watchers
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="null != watchableType and '' != watchableType">
|
||||
watchable_type,
|
||||
</if>
|
||||
<if test="null != watchableId ">
|
||||
watchable_id,
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
ext_info
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="null != watchableType and '' != watchableType">
|
||||
#{watchableType},
|
||||
</if>
|
||||
<if test="null != watchableId ">
|
||||
#{watchableId},
|
||||
</if>
|
||||
<if test="null != userId ">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="null != createdAt ">
|
||||
#{createdAt},
|
||||
</if>
|
||||
<if test="null != extInfo and '' != extInfo">
|
||||
#{extInfo}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectClickerCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select click_type as itemType, click_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from clickers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND click_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND click_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectVisitCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select visitable_type as itemType, visitable_id itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from visit_actions
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND visitable_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND visitable_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSearcherCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select search_type as itemType, search_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from searchers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND search_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND search_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectDownloaderCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select download_type as itemType, download_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from downloads
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND download_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND download_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectWatcherCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select watchable_type as itemType, watchable_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from watchers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND watchable_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND watchable_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectTaskJournalsCondition"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select journalized_type as itemType, journalized_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from task_journals
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND journalized_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND journalized_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectPapersCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo">
|
||||
select task_id as itemId, user_id as userId, created_at as createAt,
|
||||
(select login from users where id = user_id) as userName from papers
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND task_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTaskListCondition" resultType="com.microservices.dms.resourceLibrary.domain.vo.TaskListVo">
|
||||
select name,id,bounty,category_id,DATEDIFF(expired_at, published_at) as totalTaskDays,
|
||||
(select c.name from categories c where id = category_id) as categoryName,visits
|
||||
from tasks
|
||||
<where>
|
||||
<if test="categoryId != null">
|
||||
AND category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="name != null and name.trim() != ''">
|
||||
AND `name` like concat('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="countClickerCondition" resultType="long">
|
||||
select count(*) from clickers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND click_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND click_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countVisitCondition" resultType="long">
|
||||
select count(*) from visit_actions
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND visitable_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND visitable_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countSearcherCondition" resultType="long">
|
||||
select count(*) from searchers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND search_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND search_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countDownloaderCondition" resultType="long">
|
||||
select count(*) from downloads
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND download_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND download_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countWatcherCondition" resultType="long">
|
||||
select count(*) from watchers
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND watchable_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND watchable_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countTaskJournalsCondition" resultType="long">
|
||||
select count(*) from task_journals
|
||||
<where>
|
||||
<if test="itemType != null and itemType.trim() != ''">
|
||||
AND journalized_type = #{itemType}
|
||||
</if>
|
||||
<if test="itemId != null">
|
||||
AND journalized_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="countPapersCondition" resultType="long">
|
||||
select count(*) from papers
|
||||
<where>
|
||||
<if test="itemId != null">
|
||||
AND task_id = #{itemId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap type="TaskResourceLibrary" id="TaskResourceLibraryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="paperId" column="paper_id"/>
|
||||
<result property="taskName" column="task_name"/>
|
||||
<result property="taskDomain" column="task_domain"/>
|
||||
<result property="taskAmount" column="task_amount"/>
|
||||
<result property="submissionName" column="submission_name"/>
|
||||
<result property="submissionDate" column="submission_date"/>
|
||||
<result property="submitterName" column="submitter_name"/>
|
||||
<result property="submissionType" column="submission_type"/>
|
||||
<result property="submissionOrganization" column="submission_organization"/>
|
||||
<result property="submissionSummary" column="submission_summary"/>
|
||||
<result property="releaseDetails" column="release_details"/>
|
||||
<result property="contactName" column="contact_name"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="isTransferredToResultsLibrary" column="is_transferred_to_results_library"/>
|
||||
<result property="transferToResultsDate" column="transfer_to_results_date"/>
|
||||
<result property="isSelectedResult" column="is_selected_result"/>
|
||||
<result property="imageUrl" column="image_url"/>
|
||||
<result property="attachmentUrl" column="attachment_url"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTaskResourceLibraryVo">
|
||||
select id,
|
||||
task_id,
|
||||
paper_id,
|
||||
task_name,
|
||||
task_domain,
|
||||
task_amount,
|
||||
submission_name,
|
||||
submission_date,
|
||||
submitter_name,
|
||||
submission_type,
|
||||
submission_organization,
|
||||
submission_summary,
|
||||
release_details,
|
||||
contact_name,
|
||||
contact_phone,
|
||||
is_transferred_to_results_library,
|
||||
transfer_to_results_date,
|
||||
is_selected_result,
|
||||
image_url,
|
||||
attachment_url
|
||||
from task_resource_library
|
||||
</sql>
|
||||
|
||||
<select id="selectTaskResourceLibraryList" parameterType="TaskResourceLibrary"
|
||||
resultType="com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary">
|
||||
select ts.id,
|
||||
t.id as task_id,
|
||||
pd.paper_id as paper_id,
|
||||
t.name as task_name,
|
||||
t.category_id as task_domain,
|
||||
t.bounty as task_amount,
|
||||
(select u.login from users u where u.id = p.user_id) as submission_name,
|
||||
p.created_at as submission_date,
|
||||
(select u.login from users u where u.id = p.user_id) as submitter_name,
|
||||
submission_type,
|
||||
submission_organization,
|
||||
pd.content as submission_summary,
|
||||
pd.content as release_details,
|
||||
t.contact_name,
|
||||
t.contact_phone,
|
||||
is_transferred_to_results_library,
|
||||
transfer_to_results_date,
|
||||
is_selected_result,
|
||||
image_url,
|
||||
attachment_url,
|
||||
t.expert_review,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
join paper_details pd on p.id = pd.paper_id
|
||||
left join task_resource_library ts on p.id = ts.paper_id
|
||||
<where>
|
||||
|
||||
<if test="taskName != null and taskName != ''">and t.name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="taskDomain != null and taskDomain != ''">and task_domain = #{taskDomain}</if>
|
||||
<if test="taskAmount != null ">and task_amount = #{taskAmount}</if>
|
||||
<if test="submissionName != null and submissionName != ''">and submission_name like concat('%',
|
||||
#{submissionName}, '%')
|
||||
</if>
|
||||
<if test="submissionDate != null ">and submission_date = #{submissionDate}</if>
|
||||
<if test="submitterName != null and submitterName != ''">and submitter_name like concat('%',
|
||||
#{submitterName}, '%')
|
||||
</if>
|
||||
<if test="submissionType != null and submissionType != ''">and submission_type = #{submissionType}</if>
|
||||
<if test="submissionOrganization != null and submissionOrganization != ''">and submission_organization =
|
||||
#{submissionOrganization}
|
||||
</if>
|
||||
<if test="submissionSummary != null and submissionSummary != ''">and submission_summary =
|
||||
#{submissionSummary}
|
||||
</if>
|
||||
<if test="releaseDetails != null and releaseDetails != ''">and release_details = #{releaseDetails}</if>
|
||||
<if test="contactName != null and contactName != ''">and t.contact_name like concat('%', #{contactName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="contactPhone != null and contactPhone != ''">and t.contact_phone = #{contactPhone}</if>
|
||||
<if test="isTransferredToResultsLibrary != null ">and is_transferred_to_results_library =
|
||||
#{isTransferredToResultsLibrary}
|
||||
</if>
|
||||
<if test="transferToResultsDate != null ">and transfer_to_results_date = #{transferToResultsDate}</if>
|
||||
<if test="isSelectedResult != null ">and is_selected_result = #{isSelectedResult}</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">and image_url = #{imageUrl}</if>
|
||||
<if test="attachmentUrl != null and attachmentUrl != ''">and attachment_url = #{attachmentUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTaskResourceLibraryById" parameterType="Long" resultMap="TaskResourceLibraryResult">
|
||||
<include refid="selectTaskResourceLibraryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
|
||||
select b.file_name as k, b.id as v
|
||||
from paper_details pd
|
||||
join busi_attachments b on pd.files = b.id
|
||||
where pd.paper_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getTotalTasks" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
</select>
|
||||
|
||||
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
|
||||
select IFNULL(sum(t.bounty), 0)
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
join task_resource_library on t.id = task_resource_library.task_id
|
||||
where is_transferred_to_results_library = 1
|
||||
</select>
|
||||
|
||||
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
join task_resource_library on t.id = task_resource_library.task_id
|
||||
where is_transferred_to_results_library = 1
|
||||
</select>
|
||||
|
||||
<select id="getTaskAmount" resultType="java.lang.Long">
|
||||
select IFNULL(sum(t.bounty), 0)
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
</select>
|
||||
|
||||
<select id="getReviewTaskCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from tasks t
|
||||
join (select * from papers where status = 2) p on t.id = p.task_id
|
||||
where expert_review = 1
|
||||
</select>
|
||||
|
||||
<insert id="insertTaskResourceLibrary" parameterType="TaskResourceLibrary" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into task_resource_library
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="paperId != null">paper_id,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="taskDomain != null">task_domain,</if>
|
||||
<if test="taskAmount != null">task_amount,</if>
|
||||
<if test="submissionName != null">submission_name,</if>
|
||||
<if test="submissionDate != null">submission_date,</if>
|
||||
<if test="submitterName != null">submitter_name,</if>
|
||||
<if test="submissionType != null">submission_type,</if>
|
||||
<if test="submissionOrganization != null">submission_organization,</if>
|
||||
<if test="submissionSummary != null">submission_summary,</if>
|
||||
<if test="releaseDetails != null">release_details,</if>
|
||||
<if test="contactName != null">contact_name,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="isTransferredToResultsLibrary != null">is_transferred_to_results_library,</if>
|
||||
<if test="transferToResultsDate != null">transfer_to_results_date,</if>
|
||||
<if test="isSelectedResult != null">is_selected_result,</if>
|
||||
<if test="imageUrl != null">image_url,</if>
|
||||
<if test="attachmentUrl != null">attachment_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="paperId != null">#{paperId},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="taskDomain != null">#{taskDomain},</if>
|
||||
<if test="taskAmount != null">#{taskAmount},</if>
|
||||
<if test="submissionName != null">#{submissionName},</if>
|
||||
<if test="submissionDate != null">#{submissionDate},</if>
|
||||
<if test="submitterName != null">#{submitterName},</if>
|
||||
<if test="submissionType != null">#{submissionType},</if>
|
||||
<if test="submissionOrganization != null">#{submissionOrganization},</if>
|
||||
<if test="submissionSummary != null">#{submissionSummary},</if>
|
||||
<if test="releaseDetails != null">#{releaseDetails},</if>
|
||||
<if test="contactName != null">#{contactName},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="isTransferredToResultsLibrary != null">#{isTransferredToResultsLibrary},</if>
|
||||
<if test="transferToResultsDate != null">#{transferToResultsDate},</if>
|
||||
<if test="isSelectedResult != null">#{isSelectedResult},</if>
|
||||
<if test="imageUrl != null">#{imageUrl},</if>
|
||||
<if test="attachmentUrl != null">#{attachmentUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTaskResourceLibrary" parameterType="TaskResourceLibrary">
|
||||
update task_resource_library
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="paperId != null">paper_id = #{paperId},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="taskDomain != null">task_domain = #{taskDomain},</if>
|
||||
<if test="taskAmount != null">task_amount = #{taskAmount},</if>
|
||||
<if test="submissionName != null">submission_name = #{submissionName},</if>
|
||||
<if test="submissionDate != null">submission_date = #{submissionDate},</if>
|
||||
<if test="submitterName != null">submitter_name = #{submitterName},</if>
|
||||
<if test="submissionType != null">submission_type = #{submissionType},</if>
|
||||
<if test="submissionOrganization != null">submission_organization = #{submissionOrganization},</if>
|
||||
<if test="submissionSummary != null">submission_summary = #{submissionSummary},</if>
|
||||
<if test="releaseDetails != null">release_details = #{releaseDetails},</if>
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="isTransferredToResultsLibrary != null">is_transferred_to_results_library =
|
||||
#{isTransferredToResultsLibrary},
|
||||
</if>
|
||||
<if test="transferToResultsDate != null">transfer_to_results_date = #{transferToResultsDate},</if>
|
||||
<if test="isSelectedResult != null">is_selected_result = #{isSelectedResult},</if>
|
||||
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
||||
<if test="attachmentUrl != null">attachment_url = #{attachmentUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTaskResourceLibraryById" parameterType="Long">
|
||||
delete
|
||||
from task_resource_library
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTaskResourceLibraryByIds" parameterType="String">
|
||||
delete from task_resource_library where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="delFavorite">
|
||||
delete
|
||||
from favorites
|
||||
where user_id = #{userId}
|
||||
and favorite_id = #{favoriteId}
|
||||
and favorite_type = #{favoriteType}
|
||||
</delete>
|
||||
|
||||
<delete id="delWatcher">
|
||||
delete
|
||||
from watchers
|
||||
where user_id = #{userId}
|
||||
and watchable_id = #{watchableId}
|
||||
and watchable_type = #{watchableType}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.microservices.pms.test;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.microservices.pms.enums.TestCaseStatus;
|
||||
import com.microservices.pms.project.domain.PmsProjectTestsheetCases;
|
||||
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseStepDataVo;
|
||||
import com.microservices.pms.project.domain.vo.PmsProjectTestsheetCaseStepVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class PmsProjectTestSheetTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<PmsProjectTestsheetCases> testsheetCasesList= new ArrayList<PmsProjectTestsheetCases>();
|
||||
PmsProjectTestsheetCases a = new PmsProjectTestsheetCases();
|
||||
a.setTestStatus(1l);
|
||||
PmsProjectTestsheetCases b = new PmsProjectTestsheetCases();
|
||||
b.setTestStatus(1l);
|
||||
PmsProjectTestsheetCases c = new PmsProjectTestsheetCases();
|
||||
c.setTestStatus(3l);
|
||||
PmsProjectTestsheetCases d = new PmsProjectTestsheetCases();
|
||||
d.setTestStatus(3l);
|
||||
|
||||
testsheetCasesList.add(a);
|
||||
testsheetCasesList.add(b);
|
||||
testsheetCasesList.add(c);
|
||||
testsheetCasesList.add(d);
|
||||
Map<Long, Integer> listMap = Optional.ofNullable(testsheetCasesList).orElse(Collections.emptyList()).stream()
|
||||
.collect(Collectors.groupingBy(PmsProjectTestsheetCases::getTestStatus, Collectors.summingInt(value -> 1)));
|
||||
listMap.forEach((key, value) -> System.out.println("" + key + ":" + value));
|
||||
|
||||
Long passCount = Optional.ofNullable(testsheetCasesList).orElse(Collections.emptyList()).stream()
|
||||
.filter(testCase -> testCase.getTestStatus().intValue() == 1).count();
|
||||
// 总 = 失败+通过+阻塞+未执行(或者排除跳过的)
|
||||
Long execTotalCount = Optional.ofNullable(testsheetCasesList).orElse(Collections.emptyList()).stream()
|
||||
.filter(testCase -> testCase.getTestStatus().intValue() != 2).count();
|
||||
//Long execTotalCount = testsheetCasesList.stream().filter(testCase -> new HashSet<>(Arrays.asList(0L, 1L, 2L, 3L)).contains(testCase.getTestStatus())).count();
|
||||
// 通过率s
|
||||
System.out.println(passCount);
|
||||
System.out.println(execTotalCount);
|
||||
System.out.println(BigDecimal.valueOf(passCount / execTotalCount.doubleValue()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
// System.out.println(BigDecimal.valueOf(0 / 0d).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
System.out.println(BigDecimal.valueOf(new Double("0.1114")));
|
||||
|
||||
List<PmsProjectTestsheetCaseStepVo> testcaseStepList = new ArrayList<>();
|
||||
PmsProjectTestsheetCaseStepVo aaa = new PmsProjectTestsheetCaseStepVo();
|
||||
aaa.setStepId(1l);
|
||||
aaa.setStepStatus(1);
|
||||
PmsProjectTestsheetCaseStepVo bbb = new PmsProjectTestsheetCaseStepVo();
|
||||
bbb.setStepId(2l);
|
||||
bbb.setStepStatus(1);
|
||||
testcaseStepList.add(aaa);
|
||||
testcaseStepList.add(bbb);
|
||||
|
||||
System.out.println(JSON.toJSONString(Optional.ofNullable(testcaseStepList).orElse(Collections.emptyList())));
|
||||
System.out.println(JSON.parseArray("[{\"stepId\":1,\"stepStatus\":1},{\"stepId\":2,\"stepStatus\":1}]", PmsProjectTestcaseStepDataVo.class));
|
||||
System.out.println(JSON.parseArray("[{\"stepId\":1,\"stepStatus\":1},{\"stepId\":2,\"stepStatus\":1}]", HashMap.class));
|
||||
|
||||
Long[] testsheetCasesIds = testsheetCasesList.stream().map(PmsProjectTestsheetCases::getTestStatus).toArray(Long[]::new);
|
||||
}
|
||||
}
|
||||
|
|
@ -408,6 +408,13 @@ public class SysFileInfoServiceImpl implements ISysFileInfoService {
|
|||
isCommonFileType = false;
|
||||
break;
|
||||
}
|
||||
case "dms": {
|
||||
// 项目管理下需生成唯一标识,防止用户通过id递增访问
|
||||
sysFileInfo.setFileIdentifier(genFileIdentifier());
|
||||
baseFilePath += "/" + fileType + "/";
|
||||
isCommonFileType = false;
|
||||
break;
|
||||
}
|
||||
case "resource": {
|
||||
baseFilePath += "/" + fileType + "/";
|
||||
isCommonFileType = false;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 查询代码生成列表
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:list")
|
||||
//@RequiresPermissions("tool:gen:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo genList(GenTable genTable)
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 修改代码生成业务
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:query")
|
||||
//@RequiresPermissions("tool:gen:query")
|
||||
@GetMapping(value = "/{tableId}")
|
||||
public AjaxResult getInfo(@PathVariable Long tableId)
|
||||
{
|
||||
|
|
@ -69,7 +69,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 查询数据库列表
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:list")
|
||||
//@RequiresPermissions("tool:gen:list")
|
||||
@GetMapping("/db/list")
|
||||
public TableDataInfo dataList(GenTable genTable)
|
||||
{
|
||||
|
|
@ -94,7 +94,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 导入表结构(保存)
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:import")
|
||||
//@RequiresPermissions("tool:gen:import")
|
||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importTable")
|
||||
public AjaxResult importTableSave(String tables)
|
||||
|
|
@ -109,7 +109,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 修改保存代码生成业务
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:edit")
|
||||
//@RequiresPermissions("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
|
||||
|
|
@ -122,7 +122,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 删除代码生成
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:remove")
|
||||
//@RequiresPermissions("tool:gen:remove")
|
||||
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tableIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] tableIds)
|
||||
|
|
@ -134,7 +134,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 预览代码
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:preview")
|
||||
//@RequiresPermissions("tool:gen:preview")
|
||||
@GetMapping("/preview/{tableId}")
|
||||
public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
|
||||
{
|
||||
|
|
@ -145,7 +145,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 生成代码(下载方式)
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
//@RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/download/{tableName}")
|
||||
public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
||||
|
|
@ -157,7 +157,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 生成代码(自定义路径)
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
//@RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
||||
|
|
@ -169,7 +169,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 同步数据库
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:edit")
|
||||
//@RequiresPermissions("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/synchDb/{tableName}")
|
||||
public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
||||
|
|
@ -181,7 +181,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 批量生成代码
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
//@RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/batchGenCode")
|
||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
<module>microservices-modules-pms</module>
|
||||
<module>microservices-modules-wiki</module>
|
||||
<module>microservices-modules-dss</module>
|
||||
<module>microservices-modules-dms</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>microservices-modules</artifactId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue