【资源库-成果库】一些调整
This commit is contained in:
parent
5ae151e360
commit
e77576f085
|
@ -0,0 +1,31 @@
|
||||||
|
package com.microservices.dms.achievementLibrary.controller;
|
||||||
|
|
||||||
|
import com.microservices.common.core.web.controller.BaseController;
|
||||||
|
import com.microservices.common.core.web.page.TableDataInfo;
|
||||||
|
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||||
|
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/blockChain")
|
||||||
|
@Api(tags = "数据产权子系统")
|
||||||
|
public class BlockChainController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAchievementsService achievementsService;
|
||||||
|
|
||||||
|
@GetMapping("/projectTokenList")
|
||||||
|
@ApiOperation(value = "项目token列表")
|
||||||
|
public TableDataInfo projectTokenList() {
|
||||||
|
startPage();
|
||||||
|
List<TokenListVo> list = achievementsService.projectTokenList();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.microservices.dms.achievementLibrary.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||||
|
@ -185,6 +186,15 @@ public class Achievements extends BaseEntity {
|
||||||
private String userNickName;
|
private String userNickName;
|
||||||
public String gender;
|
public String gender;
|
||||||
private String userLogin;
|
private String userLogin;
|
||||||
|
private List<Map<String,Object>> dockingUserInfo;
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getDockingUserInfo() {
|
||||||
|
return dockingUserInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
|
||||||
|
this.dockingUserInfo = dockingUserInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getShowAchievementName() {
|
public String getShowAchievementName() {
|
||||||
return showAchievementName;
|
return showAchievementName;
|
||||||
|
@ -492,38 +502,4 @@ public class Achievements extends BaseEntity {
|
||||||
return attachments;
|
return attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("achievementName", getAchievementName())
|
|
||||||
.append("field1", getField1())
|
|
||||||
.append("field2", getField2())
|
|
||||||
.append("field3", getField3())
|
|
||||||
.append("achievementType", getAchievementType())
|
|
||||||
.append("source", getSource())
|
|
||||||
.append("sourceId", getSourceId())
|
|
||||||
.append("sourceLink", getSourceLink())
|
|
||||||
.append("tags", getTags())
|
|
||||||
.append("summary", getSummary())
|
|
||||||
.append("publishingUnit", getPublishingUnit())
|
|
||||||
.append("address", getAddress())
|
|
||||||
.append("isFeatured", getIsFeatured())
|
|
||||||
.append("contactPerson", getContactPerson())
|
|
||||||
.append("contactNumber", getContactNumber())
|
|
||||||
.append("ownerId", getOwnerId())
|
|
||||||
.append("ownerName", getOwnerName())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.append("details", getDetails())
|
|
||||||
.append("reviewer", getReviewer())
|
|
||||||
.append("reviewDate", getReviewDate())
|
|
||||||
.append("reviewComments", getReviewComments())
|
|
||||||
.append("images", getImages())
|
|
||||||
.append("attachments", getAttachments())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,4 +156,6 @@ public interface AchievementsMapper {
|
||||||
|
|
||||||
List<KeyValueVo> getAchievementActDataD(@Param("s") Date s, @Param("e") Date e);
|
List<KeyValueVo> getAchievementActDataD(@Param("s") Date s, @Param("e") Date e);
|
||||||
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
|
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
|
||||||
|
|
||||||
|
List<Map<String, Object>> getDockingUserInfo(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||||
|
|
||||||
|
import static com.microservices.dms.constant.BlockChainFunConstants.QUERY_REPO;
|
||||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +67,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
@Value("${http.gatewayUrl}")
|
@Value("${http.gatewayUrl}")
|
||||||
public String gatewayUrl;
|
public String gatewayUrl;
|
||||||
|
|
||||||
@Value("${gitlink.fiscobcosUrl}")
|
// @Value("${gitlink.fiscobcosUrl}")
|
||||||
public String fiscobcosUrl;
|
public String fiscobcosUrl;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -131,6 +132,10 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
}
|
}
|
||||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||||
|
|
||||||
|
//拼接对接的用户信息
|
||||||
|
List<Map<String,Object>> dockingUserInfo = achievementsMapper.getDockingUserInfo(achievements.getId());
|
||||||
|
achievements.setDockingUserInfo(dockingUserInfo);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -568,15 +573,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
||||||
|
|
||||||
private Long queryTotalToken(TokenListVo v) {
|
private Long queryTotalToken(TokenListVo v) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("request-type","query repo basic info");
|
param.put("request-type",QUERY_REPO);
|
||||||
param.put("token_name",v.getId());
|
param.put("token_name",v.getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONObject reps = httpAPIService.doPost(fiscobcosUrl,param);
|
JSONObject reps = httpAPIService.doPost(fiscobcosUrl,param);
|
||||||
if (reps.containsKey("status") && reps.getString("status").equals("0")) {
|
if (reps.containsKey("status") && reps.getString("status").equals("0")) {
|
||||||
Long totalSupply = reps.getLong("total_supply");
|
// Long curSupply = reps.getLong("cur_supply");
|
||||||
// Long curSupply = reps.getLong("cur_supply");
|
return reps.getLong("total_supply");
|
||||||
return totalSupply;
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("区块链信息查询失败", e);
|
log.error("区块链信息查询失败", e);
|
||||||
|
|
|
@ -11,6 +11,16 @@ public class AchievementBehaviorSumVo {
|
||||||
private Long favoriteSum;
|
private Long favoriteSum;
|
||||||
//下载量
|
//下载量
|
||||||
private Long downloadSum;
|
private Long downloadSum;
|
||||||
|
//成果用户对接
|
||||||
|
private Long userDockingSum;
|
||||||
|
|
||||||
|
public Long getUserDockingSum() {
|
||||||
|
return userDockingSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserDockingSum(Long userDockingSum) {
|
||||||
|
this.userDockingSum = userDockingSum;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getClickSum() {
|
public Long getClickSum() {
|
||||||
return clickSum;
|
return clickSum;
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class CollectUserActDataController {
|
||||||
|
|
||||||
@PostMapping("/addClicker")
|
@PostMapping("/addClicker")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise)", paramType = "query", dataTypeClass = String.class),
|
@ApiImplicitParam(name = "clickType", value = "点击类型(任务:makerSpaceTask、竞赛:CompetitionInfo、项目:Project、成果:Achievements、专家:Experts,校企:schoolEnterprise,成果用户对接:userDocking)", paramType = "query", dataTypeClass = String.class),
|
||||||
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
|
||||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
|
||||||
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)
|
||||||
|
|
|
@ -700,4 +700,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
|
||||||
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at >= #{s} and created_at <= #{e} group by DATE_FORMAT(created_at, '%m-%d')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDockingUserInfo" resultType="java.util.Map">
|
||||||
|
select u.id,u.login,u.nickname,u.phone,u.company_name
|
||||||
|
from users u
|
||||||
|
inner join (select distinct user_id from clickers where click_id = #{id} and click_type ='userDocking') c on u.id = c.user_id
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -452,10 +452,11 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
|
||||||
select b.watchSum, d.favoriteSum
|
select b.watchSum, d.favoriteSum,c.userDockingSum
|
||||||
from (
|
from (
|
||||||
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id} and user_id=#{userId}) b,
|
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id} and user_id=#{userId}) b,
|
||||||
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d
|
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d,
|
||||||
|
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
from tasks t
|
from tasks t
|
||||||
join task_details td on t.id = td.task_id
|
join task_details td on t.id = td.task_id
|
||||||
where status in
|
where status in
|
||||||
<foreach collection="list" item="item" close=")" index="idx" open="(" separator=",">
|
<foreach collection="statusIds" item="item" close=")" index="idx" open="(" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue