Compare commits
2 Commits
bf2abd1ad8
...
9cba830ad6
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cba830ad6 | |||
| ae0030e1af |
@@ -1,6 +1,7 @@
|
||||
package com.sdm.common.entity.req.task;
|
||||
|
||||
import com.sdm.common.entity.ExportExcelFormat;
|
||||
import com.sdm.common.entity.bo.TaskNodeTag;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -42,4 +43,6 @@ public class TaskExportExcelParam {
|
||||
* 排序顺序 按创建时间 0-先序/1-倒序排序
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
private List<TaskNodeTag> idMap;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.sdm.project.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.project.model.req.SpdmDemandExtraReq;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpdmExportDemandVo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 父节点id,第一级节点的pid为0
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 需求的唯一标识
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
@NotNull(message = "需求名称不能为空")
|
||||
private String demandName;
|
||||
|
||||
/**
|
||||
* 需求编码
|
||||
*/
|
||||
private String demandCode;
|
||||
|
||||
/**
|
||||
* 需求状态:未分配、未开始、进行中、暂停、已关闭、已闭环、已驳回
|
||||
*/
|
||||
private String demandStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 达成状态
|
||||
*/
|
||||
private String achieveStatus;
|
||||
|
||||
/**
|
||||
* 进度
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 计划开始时间(精确到秒)
|
||||
*/
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 计划结束时间(精确到秒)
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 实际结束时间(精确到秒)
|
||||
*/
|
||||
private String finishTime;
|
||||
|
||||
/**
|
||||
* 仿真负责人
|
||||
*/
|
||||
@JsonProperty(value = "pMemberList")
|
||||
private String pMemberList;
|
||||
|
||||
/**
|
||||
* 仿真执行人
|
||||
*/
|
||||
@JsonProperty(value = "eMemberList")
|
||||
private String eMemberList;
|
||||
|
||||
/**
|
||||
* 预留拓展属性
|
||||
*/
|
||||
private List<SpdmDemandExtraReq> extraList;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 阶段名称
|
||||
*/
|
||||
private String phaseId;
|
||||
|
||||
private String phaseName;
|
||||
|
||||
/**
|
||||
* 学科名称
|
||||
*/
|
||||
private String nodeId;
|
||||
|
||||
private String demandType;
|
||||
|
||||
private String simType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.sdm.project.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Data
|
||||
public class SpdmExportNewTaskVo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 父节点id,第一级节点的pid为0
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
private String pUuid;
|
||||
|
||||
|
||||
/**
|
||||
* 当前节点id
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
|
||||
/**
|
||||
* 标准工时
|
||||
*/
|
||||
private Integer days;
|
||||
|
||||
/**
|
||||
* 实际工时
|
||||
*/
|
||||
private Integer realDays;
|
||||
|
||||
private String standard;
|
||||
|
||||
private String folderId;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String achieveStatus;
|
||||
|
||||
/**
|
||||
* 计划开始(精确到秒)
|
||||
*/
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 计划结束(精确到秒)项目详情图片
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 实际完成时间(精确到秒)
|
||||
*/
|
||||
private String finishTime;
|
||||
|
||||
/**
|
||||
* 项目进度状态
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
|
||||
/**
|
||||
* 项目进度状态(未开始、进行中、已完成)
|
||||
*/
|
||||
private String exeStatus;
|
||||
|
||||
private String confidence;
|
||||
|
||||
private String analyseTarget;
|
||||
private String analyseSoftware;
|
||||
private String approvalStatus;
|
||||
private String comfirmStatus;
|
||||
private String description;
|
||||
/**
|
||||
* 难度系数
|
||||
*/
|
||||
private Float difficult;
|
||||
|
||||
private String department;
|
||||
private String sectionName;
|
||||
private String groupName;
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
private String flowTemplate;
|
||||
private String englishName;
|
||||
|
||||
|
||||
/**
|
||||
* 关联的需求id
|
||||
*/
|
||||
private String demandId;
|
||||
|
||||
/**
|
||||
* 仿真负责人
|
||||
*/
|
||||
@JsonProperty(value = "pMemberList")
|
||||
private String pMemberList;
|
||||
|
||||
/**
|
||||
* 仿真执行人
|
||||
*/
|
||||
@JsonProperty(value = "eMemberList")
|
||||
private String eMemberList;
|
||||
|
||||
/**
|
||||
* 0:未关注 1:已关注
|
||||
*/
|
||||
private Integer attentionFlag;
|
||||
|
||||
@JsonProperty(value = "tag1")
|
||||
private String tag1;
|
||||
@JsonProperty(value = "tag2")
|
||||
private String tag2;
|
||||
@JsonProperty(value = "tag3")
|
||||
private String tag3;
|
||||
@JsonProperty(value = "tag4")
|
||||
private String tag4;
|
||||
@JsonProperty(value = "tag5")
|
||||
private String tag5;
|
||||
@JsonProperty(value = "tag6")
|
||||
private String tag6;
|
||||
@JsonProperty(value = "tag7")
|
||||
private String tag7;
|
||||
@JsonProperty(value = "tag8")
|
||||
private String tag8;
|
||||
@JsonProperty(value = "tag9")
|
||||
private String tag9;
|
||||
@JsonProperty(value = "tag10")
|
||||
private String tag10;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.sdm.project.model.vo;
|
||||
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpdmExportNodeVo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 父节点id,第一级节点的pid为0
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 当前节点id
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
private String nodeCode;
|
||||
|
||||
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
private String nodeSubType;
|
||||
|
||||
/**
|
||||
* 项目进度状态(未开始、进行中、已完成)
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
private String progressStatusValue;
|
||||
|
||||
/**
|
||||
* 项目达成状态(红黄绿灯)
|
||||
*/
|
||||
private Integer achieveStatus;
|
||||
|
||||
private String achieveStatusValue;
|
||||
|
||||
/**
|
||||
* 计划开始(精确到秒)
|
||||
*/
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 计划结束(精确到秒)项目详情图片
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 实际完成时间(精确到秒)
|
||||
*/
|
||||
private String finishTime;
|
||||
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String memberList;
|
||||
|
||||
/**
|
||||
* 拓展属性集合
|
||||
*/
|
||||
private List<SpdmNodeExtraVo> extraList;
|
||||
|
||||
/**
|
||||
* 项目详情图片
|
||||
*/
|
||||
private String detailImgUrl;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
private CIDUserResp creatorObj;
|
||||
|
||||
private String exeStatus;
|
||||
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import com.sdm.project.dao.SimulationTaskMapper;
|
||||
import com.sdm.project.model.bo.TaskExtraNode;
|
||||
import com.sdm.project.model.bo.TaskMemberNode;
|
||||
import com.sdm.project.model.bo.TaskNode;
|
||||
import com.sdm.project.model.po.ProjectNodePo;
|
||||
import com.sdm.project.model.po.TaskNodePo;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.vo.*;
|
||||
@@ -249,21 +250,23 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
log.error("公司和工号都不能为空");
|
||||
return SdmResponse.failed("公司和工号都不能为空");
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
List<SpdmDemandVo> demandList = mapper.getDemandList(tenantId, req);
|
||||
if (CollectionUtils.isEmpty(demandList)) {
|
||||
log.error("根据tenantId:{},未查询到需求", tenantId);
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
// 0:我发起的 1:我确认的
|
||||
Integer type = req.getType();
|
||||
if (type != 0 && type != 1) {
|
||||
log.error("type必须为0或1");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<SpdmDemandMemberVo> demandMemberVoList = mapper.getMemberList(demandList.stream().map(SpdmDemandVo::getUuid).toList(), null);
|
||||
if (CollectionUtils.isEmpty(demandMemberVoList)) {
|
||||
log.error("demandList0为空");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
if (type == 0) {
|
||||
// 创建人是当前用户
|
||||
@@ -278,7 +281,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
}
|
||||
if (CollectionUtils.isEmpty(demandList)) {
|
||||
log.error("demandList1为空");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<SpdmTaskVo> taskList = taskMapper.getTaskListByDemandIdList(demandList.stream().map(SpdmDemandVo::getUuid).toList());
|
||||
Map<String, List<SpdmTaskVo>> taskMap = Map.of();
|
||||
@@ -320,7 +323,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
|
||||
if (CollectionUtils.isEmpty(demandList)) {
|
||||
log.error("demandList2为空");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(req.getDemandStatus())) {
|
||||
@@ -378,16 +381,16 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
}
|
||||
if (CollectionUtils.isEmpty(demandList)) {
|
||||
log.error("demandList3为空");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
jsonObject.put("currentPage", req.getCurrent());
|
||||
jsonObject.put("pageSize", req.getSize());
|
||||
jsonObject.put("total", demandList.size());
|
||||
demandList = demandList.stream().skip((long) (req.getCurrent() - 1) * req.getSize()).limit(req.getSize()).toList();
|
||||
if (CollectionUtils.isEmpty(demandList)) {
|
||||
log.error("demandList4为空");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
Map<String, List<SpdmDemandMemberVo>> demandMemberMap = Map.of();
|
||||
if (CollectionUtils.isNotEmpty(demandMemberVoList)) {
|
||||
@@ -633,8 +636,61 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
SdmResponse taskRespond = list(req);
|
||||
if(taskRespond.isSuccess()) {
|
||||
JSONObject dataObj = (JSONObject) taskRespond.getData();
|
||||
JSONArray jsonArray = dataObj.getJSONArray("data");
|
||||
ExcelUtil.exportExcelNoMerge(jsonArray,exportExcelFormats,httpServletResponse);
|
||||
List<SpdmDemandVo> demandVoList = (List<SpdmDemandVo>) dataObj.get("data");
|
||||
List<SpdmExportDemandVo> exportDemandVoList = new ArrayList<>();
|
||||
List<CIDUserResp> pMemberList;
|
||||
String pMemberName = "";
|
||||
List<CIDUserResp> eMemberList;
|
||||
String eMemberName = "";
|
||||
String projectId;
|
||||
String phaseId;
|
||||
List<String> nodeIdList = new ArrayList<>();
|
||||
List<String> projectIdList = demandVoList.stream().map(SpdmDemandVo::getProjectId).distinct().toList();
|
||||
if (CollectionUtils.isNotEmpty(projectIdList)) {
|
||||
nodeIdList.addAll(projectIdList);
|
||||
}
|
||||
List<String> phaseIdList = demandVoList.stream().map(SpdmDemandVo::getPhaseId).distinct().toList();
|
||||
if (CollectionUtils.isNotEmpty(phaseIdList)) {
|
||||
nodeIdList.addAll(phaseIdList);
|
||||
}
|
||||
Map<String, ProjectNodePo> nodeMap = Map.of();
|
||||
if (CollectionUtils.isNotEmpty(nodeIdList)) {
|
||||
List<ProjectNodePo> nodeList = projectMapper.getNodeListByNodeIdList(nodeIdList);
|
||||
if (CollectionUtils.isNotEmpty(nodeList)) {
|
||||
nodeMap = nodeList.stream().collect(Collectors.groupingBy(
|
||||
ProjectNodePo::getUuid,
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toList(),
|
||||
list -> list.get(0)
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
for (SpdmDemandVo spdmDemandVo : demandVoList) {
|
||||
// 转换项目、阶段
|
||||
projectId = spdmDemandVo.getProjectId();
|
||||
if (StringUtils.isNotBlank(projectId) && ObjectUtils.isNotEmpty(nodeMap.get(projectId))) {
|
||||
spdmDemandVo.setProjectId(nodeMap.get(projectId).getNodeName());
|
||||
}
|
||||
phaseId = spdmDemandVo.getPhaseId();
|
||||
if (StringUtils.isNotBlank(phaseId) && ObjectUtils.isNotEmpty(nodeMap.get(phaseId))) {
|
||||
spdmDemandVo.setPhaseId(nodeMap.get(phaseId).getNodeName());
|
||||
}
|
||||
pMemberList = spdmDemandVo.getPMemberList();
|
||||
if (CollectionUtils.isNotEmpty(pMemberList)) {
|
||||
pMemberName = pMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
eMemberList = spdmDemandVo.getPMemberList();
|
||||
if (CollectionUtils.isNotEmpty(eMemberList)) {
|
||||
eMemberName = eMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
SpdmExportDemandVo spdmExportDemandVo = new SpdmExportDemandVo();
|
||||
BeanUtils.copyProperties(spdmDemandVo,spdmExportDemandVo);
|
||||
spdmExportDemandVo.setPMemberList(pMemberName);
|
||||
spdmExportDemandVo.setEMemberList(eMemberName);
|
||||
exportDemandVoList.add(spdmExportDemandVo);
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(exportDemandVoList),exportExcelFormats,httpServletResponse);
|
||||
} else {
|
||||
response = SdmResponse.failed(taskRespond.getMessage());
|
||||
}
|
||||
@@ -642,19 +698,13 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
}
|
||||
|
||||
private String getLastNodeId(TaskNode taskNode) {
|
||||
// List<String> tag1 = taskNode.getTag1();
|
||||
// if (CollectionUtils.isNotEmpty(tag1)) {
|
||||
// tag1.get(tag1.size() - 1);
|
||||
// }
|
||||
String tagListProperty;
|
||||
List<String> tagListProperty;
|
||||
String lastNodeId = "";
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
try {
|
||||
tagListProperty = getTagListProperty(taskNode, "tag" + i);
|
||||
if (StringUtils.isNotBlank(tagListProperty)) {
|
||||
// lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
|
||||
String[] lastNodeIdArr = tagListProperty.split(",");
|
||||
lastNodeId = lastNodeIdArr[lastNodeIdArr.length - 1];
|
||||
if (CollectionUtils.isNotEmpty(tagListProperty)) {
|
||||
lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -816,11 +816,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
return (String) field.get(obj);
|
||||
}
|
||||
|
||||
public static String getTagListProperty(Object obj, String propertyName) throws Exception {
|
||||
public static List<String> getTagListProperty(Object obj, String propertyName) throws Exception {
|
||||
Class<?> clazz = obj.getClass();
|
||||
Field field = clazz.getDeclaredField(propertyName);
|
||||
field.setAccessible(true);
|
||||
return (String) field.get(obj);
|
||||
return (List<String>) field.get(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1275,7 +1275,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
String tagListProperty;
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
try {
|
||||
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
||||
tagListProperty = getTagProperty(parentNode, "tag" + i);
|
||||
if (StringUtils.isBlank(tagListProperty)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1287,7 +1287,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
if (addNodeTag.equals(parentNodeTag)) {
|
||||
// 如果新增节点与父节点的类型相同,需要将当前新增节点的uuid追加到该类型标签中
|
||||
try {
|
||||
tagListProperty = getTagListProperty(parentNode, parentNodeTag);
|
||||
tagListProperty = getTagProperty(parentNode, parentNodeTag);
|
||||
tagListProperty = tagListProperty + "," + addNode.getUuid();
|
||||
// tagListProperty.add(addNode.getUuid());
|
||||
setTagProperty(addNode, addNodeTag, tagListProperty);
|
||||
@@ -1384,7 +1384,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
String tagListProperty;
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
try {
|
||||
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
||||
tagListProperty = getTagProperty(parentNode, "tag" + i);
|
||||
if (StringUtils.isBlank(tagListProperty)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1414,7 +1414,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
SpdmNodeListReq req = new SpdmNodeListReq();
|
||||
ProjectExportExcelParam params = projectExportExcelFormat.getParams();
|
||||
if (ObjectUtils.isNotEmpty(params)) {
|
||||
BeanUtils.copyProperties(projectExportExcelFormat,req);
|
||||
BeanUtils.copyProperties(params,req);
|
||||
}
|
||||
req.setCurrent(1);
|
||||
req.setSize(10000);
|
||||
@@ -1422,8 +1422,21 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
SdmResponse taskRespond = list(req);
|
||||
if(taskRespond.isSuccess()) {
|
||||
JSONObject dataObj = (JSONObject) taskRespond.getData();
|
||||
JSONArray jsonArray = dataObj.getJSONArray("data");
|
||||
ExcelUtil.exportExcelNoMerge(jsonArray,exportExcelFormats,httpServletResponse);
|
||||
List<SpdmNodeVo> taskVoList = (List<SpdmNodeVo>) dataObj.get("data");
|
||||
List<SpdmExportNodeVo> exportNodeVoList = new ArrayList<>();
|
||||
List<CIDUserResp> memberList;
|
||||
String memberName = "";
|
||||
for (SpdmNodeVo spdmNodeVo : taskVoList) {
|
||||
memberList = spdmNodeVo.getMemberList();
|
||||
if (CollectionUtils.isNotEmpty(memberList)) {
|
||||
memberName = memberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
SpdmExportNodeVo spdmExportNodeVo = new SpdmExportNodeVo();
|
||||
BeanUtils.copyProperties(spdmNodeVo,spdmExportNodeVo);
|
||||
spdmExportNodeVo.setMemberList(memberName);
|
||||
exportNodeVoList.add(spdmExportNodeVo);
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(exportNodeVoList),exportExcelFormats,httpServletResponse);
|
||||
} else {
|
||||
response = SdmResponse.failed(taskRespond.getMessage());
|
||||
}
|
||||
|
||||
@@ -1975,6 +1975,10 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
SdmResponse taskRespond = getTaskTree(req);
|
||||
SdmResponse response = new SdmResponse();
|
||||
if(taskRespond.isSuccess()) {
|
||||
List<ProjectNodePo> realTopProjectNodeList = (List<ProjectNodePo>) taskRespond.getData();
|
||||
if (CollectionUtils.isEmpty(realTopProjectNodeList)) {
|
||||
return response;
|
||||
}
|
||||
ExcelUtil.exportExcelWithMerge(JSONArray.from(taskRespond.getData()),exportExcelFormats,httpServletResponse);
|
||||
} else {
|
||||
response = SdmResponse.failed(taskRespond.getMessage());
|
||||
|
||||
@@ -88,8 +88,8 @@ public class TaskServiceImpl implements ITaskService {
|
||||
|
||||
@Override
|
||||
public SdmResponse list(SpdmTaskListReq req) {
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
Long tenantId = 1979091834410176514L;
|
||||
Long userId = 1979078323595476993L;
|
||||
if (Objects.isNull(tenantId) || Objects.isNull(userId)) {
|
||||
log.error("公司和工号都不能为空");
|
||||
return SdmResponse.failed("公司和工号都不能为空");
|
||||
@@ -104,9 +104,11 @@ public class TaskServiceImpl implements ITaskService {
|
||||
req.setAchieveStatusList(Arrays.stream(req.getAchieveStatus().split(",")).toList());
|
||||
}
|
||||
List<SpdmTaskVo> allTaskList = mapper.getTaskList(tenantId, req);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
if (CollectionUtils.isEmpty(allTaskList)) {
|
||||
log.error("根据tenantId:{},未查询到任务", tenantId);
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<SpdmTaskVo> taskList = new ArrayList<>();
|
||||
List<TaskNodeTag> idMapList = req.getIdMap();
|
||||
@@ -134,9 +136,8 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
log.info("未查询到任务");
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("currentPage", req.getCurrent());
|
||||
jsonObject.put("pageSize", req.getSize());
|
||||
List<String> taskIdList = taskList.stream().map(SpdmTaskVo::getUuid).toList();
|
||||
@@ -165,7 +166,6 @@ public class TaskServiceImpl implements ITaskService {
|
||||
if (CollectionUtils.isEmpty(taskMemberVoList)) {
|
||||
log.error("taskMemberVoList为空");
|
||||
jsonObject.put("total", 0);
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
memberMap = taskMemberVoList.stream().collect(Collectors.groupingBy(SpdmTaskMemberVo::getTaskId));
|
||||
@@ -175,7 +175,6 @@ public class TaskServiceImpl implements ITaskService {
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
log.error("taskList为空");
|
||||
jsonObject.put("total", 0);
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
}
|
||||
@@ -188,7 +187,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
SpdmNodeVo eachNodeVo;
|
||||
if (type == 2) {
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<SpdmTaskAttentionMemberVo> attentionMemberList = mapper.getAttentionMemberList(taskList.stream().map(SpdmTaskVo::getUuid).toList());
|
||||
Map<String, List<SpdmTaskAttentionMemberVo>> attentionMap = Map.of();
|
||||
@@ -978,20 +977,57 @@ public class TaskServiceImpl implements ITaskService {
|
||||
|
||||
@Override
|
||||
public SdmResponse exportTask(TaskExportExcelFormat taskExportExcelFormat, HttpServletResponse httpServletResponse) {
|
||||
SdmResponse response = new SdmResponse();
|
||||
SpdmTaskListReq req = new SpdmTaskListReq();
|
||||
TaskExportExcelParam params = taskExportExcelFormat.getParams();
|
||||
List<com.sdm.common.entity.bo.TaskNodeTag> originIdMap = params.getIdMap();
|
||||
if (ObjectUtils.isEmpty(params.getType())) {
|
||||
log.error("type不能为空");
|
||||
return SdmResponse.failed("type不能为空");
|
||||
}
|
||||
if (CollectionUtils.isEmpty(originIdMap)) {
|
||||
log.error("idMap不能为空");
|
||||
return SdmResponse.failed("idMap不能为空");
|
||||
}
|
||||
List<TaskNodeTag> currentIdMapList = new ArrayList<>();
|
||||
for (com.sdm.common.entity.bo.TaskNodeTag originTaskNodeTag : originIdMap) {
|
||||
TaskNodeTag taskNodeTag = new TaskNodeTag();
|
||||
taskNodeTag.setKey(originTaskNodeTag.getKey());
|
||||
taskNodeTag.setValue(originTaskNodeTag.getValue());
|
||||
currentIdMapList.add(taskNodeTag);
|
||||
}
|
||||
req.setIdMap(currentIdMapList);
|
||||
if (ObjectUtils.isNotEmpty(params)) {
|
||||
BeanUtils.copyProperties(taskExportExcelFormat,req);
|
||||
BeanUtils.copyProperties(params,req);
|
||||
}
|
||||
req.setCurrent(1);
|
||||
req.setSize(10000);
|
||||
List<ExportExcelFormat> exportExcelFormats = taskExportExcelFormat.getExcelHeaders();
|
||||
SdmResponse taskRespond = list(req);
|
||||
SdmResponse response = new SdmResponse();
|
||||
if(taskRespond.isSuccess()) {
|
||||
JSONObject dataObj = (JSONObject) taskRespond.getData();
|
||||
JSONArray jsonArray = dataObj.getJSONArray("data");
|
||||
ExcelUtil.exportExcelNoMerge(jsonArray,exportExcelFormats,httpServletResponse);
|
||||
List<SpdmNewTaskVo> taskVoList = (List<SpdmNewTaskVo>) dataObj.get("data");
|
||||
List<SpdmExportNewTaskVo> exportNewTaskVoList = new ArrayList<>();
|
||||
List<CIDUserResp> pMemberList;
|
||||
String pMemberName = "";
|
||||
List<CIDUserResp> eMemberList;
|
||||
String eMemberName = "";
|
||||
for (SpdmNewTaskVo spdmNewTaskVo : taskVoList) {
|
||||
pMemberList = spdmNewTaskVo.getPMemberList();
|
||||
if (CollectionUtils.isNotEmpty(pMemberList)) {
|
||||
pMemberName = pMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
eMemberList = spdmNewTaskVo.getPMemberList();
|
||||
if (CollectionUtils.isNotEmpty(eMemberList)) {
|
||||
eMemberName = eMemberList.stream().map(CIDUserResp::getNickname).collect(Collectors.joining(","));
|
||||
}
|
||||
SpdmExportNewTaskVo spdmExportNewTaskVo = new SpdmExportNewTaskVo();
|
||||
BeanUtils.copyProperties(spdmNewTaskVo,spdmExportNewTaskVo);
|
||||
spdmExportNewTaskVo.setPMemberList(pMemberName);
|
||||
spdmExportNewTaskVo.setEMemberList(eMemberName);
|
||||
exportNewTaskVoList.add(spdmExportNewTaskVo);
|
||||
}
|
||||
ExcelUtil.exportExcelNoMerge(JSONArray.from(exportNewTaskVoList),exportExcelFormats,httpServletResponse);
|
||||
} else {
|
||||
response = SdmResponse.failed(taskRespond.getMessage());
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
values
|
||||
<foreach collection='addNodeList' item='addNode' index='index' separator=','>
|
||||
(#{addNode.uuid},#{addNode.ownRootNodeUuid},#{addNode.nodeName},#{addNode.nodeCode},'',#{addNode.nodeType},#{addNode.nodeSubType},'0',#{addNode.pid},
|
||||
'',1,#{addNode.beginTime},#{addNode.endTime},'',#{addNode.progressStatus},#{addNode.achieveStatus},'1',#{addNode.tenantId},#{addNode.description},
|
||||
'',1,#{addNode.beginTime},#{addNode.endTime},'',#{addNode.progressStatus},#{addNode.achieveStatus},#{addNode.exeStauts},#{addNode.tenantId},#{addNode.description},
|
||||
#{addNode.detailImgUrl},#{addNode.creator},#{addNode.createTime},#{addNode.tag1},#{addNode.tag2},
|
||||
#{addNode.tag3},#{addNode.tag4},#{addNode.tag5},#{addNode.tag6},#{addNode.tag7},#{addNode.tag8},#{addNode.tag9},#{addNode.tag10})
|
||||
</foreach>
|
||||
|
||||
Reference in New Issue
Block a user