修改:只有知识库文件列表增加上传人名称;common模块项目信息feign接口增加
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.sdm.common.entity.req.project;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SpdmNodeListReq {
|
||||
|
||||
@NotNull(message = "current不能为空")
|
||||
private Integer current;
|
||||
|
||||
@NotNull(message = "size不能为空")
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 节点子类型
|
||||
*/
|
||||
private String nodeSubType;
|
||||
|
||||
/**
|
||||
* 项目进度状态(未开始、进行中、已完成)
|
||||
*/
|
||||
private Integer progressStatus;
|
||||
|
||||
/**
|
||||
* 产品代号
|
||||
*/
|
||||
private String nodeCode;
|
||||
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String manager;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.sdm.common.feign.impl.project;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.RenameNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationNodeFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -77,4 +77,21 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse list(SpdmNodeListReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = ISimulationNodeFeignClient.list(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询失败", e);
|
||||
return SdmResponse.failed("查询失败");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@ package com.sdm.common.feign.inter.project;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.RenameNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -35,4 +34,10 @@ public interface ISimulationNodeFeignClient {
|
||||
|
||||
@PostMapping("node/delteNode")
|
||||
SdmResponse delteNode(@RequestBody DelNodeReq req);
|
||||
|
||||
// 项目列表
|
||||
@GetMapping("/list")
|
||||
SdmResponse list(@RequestBody SpdmNodeListReq req);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.sdm.common.utils;
|
||||
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CidSysUserUtil {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CidSysUserUtil.class);
|
||||
|
||||
// List<CIDUserResp> cidUserRespList ---> Map<userId,CIDUserResp>
|
||||
public static Map<Long,CIDUserResp> getCidUserToMap(List<CIDUserResp> cidUserRespList) {
|
||||
try {
|
||||
if(CollectionUtils.isEmpty(cidUserRespList)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
Map<Long, CIDUserResp> userMap = cidUserRespList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CIDUserResp::getUserId,
|
||||
user -> user
|
||||
));
|
||||
return userMap;
|
||||
} catch (Exception e) {
|
||||
LOG.error("getCidUserToMap error", e);
|
||||
}
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user