1、项目导出时,将工号转为昵称
This commit is contained in:
@@ -1785,6 +1785,18 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
if(taskRespond.isSuccess()) {
|
||||
JSONObject dataObj = (JSONObject) taskRespond.getData();
|
||||
List<SpdmNodeVo> taskVoList = (List<SpdmNodeVo>) dataObj.get("data");
|
||||
if (CollectionUtils.isEmpty(taskVoList)) {
|
||||
return SdmResponse.success();
|
||||
}
|
||||
List<Long> creatorIdList = taskVoList.stream().map(SpdmNodeVo::getCreator).filter(ObjectUtils::isNotEmpty).toList();
|
||||
Map<Long, String> userMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(creatorIdList)) {
|
||||
SdmResponse<List<CIDUserResp>> cidUserResp = sysUserFeignClient.listUserByIds(UserQueryReq.builder().userIds(creatorIdList).build());
|
||||
List<CIDUserResp> userList = cidUserResp.getData();
|
||||
if (CollectionUtils.isNotEmpty(userList)) {
|
||||
userMap = userList.stream().collect(Collectors.toMap(CIDUserResp::getUserId,CIDUserResp::getNickname));
|
||||
}
|
||||
}
|
||||
List<SpdmExportNodeVo> exportNodeVoList = new ArrayList<>();
|
||||
List<CIDUserResp> memberList;
|
||||
String memberName = "";
|
||||
@@ -1796,6 +1808,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
SpdmExportNodeVo spdmExportNodeVo = new SpdmExportNodeVo();
|
||||
BeanUtils.copyProperties(spdmNodeVo,spdmExportNodeVo);
|
||||
spdmExportNodeVo.setMemberList(memberName);
|
||||
spdmExportNodeVo.setCreatorName(userMap.get(spdmNodeVo.getCreator()));
|
||||
exportNodeVoList.add(spdmExportNodeVo);
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(exportNodeVoList),exportExcelFormats,httpServletResponse);
|
||||
|
||||
Reference in New Issue
Block a user