fix:数据总览编辑任务
This commit is contained in:
@@ -1,100 +1,215 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
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.ProjectNodeExtraPo;
|
||||
import com.sdm.project.model.po.TaskNodeMemberPo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SpdmEditTaskForDataReq {
|
||||
|
||||
/**
|
||||
* simulation_node关联的节点id
|
||||
* 父节点id,第一级节点的pid为0
|
||||
*/
|
||||
@NotBlank(message = "relatedResourceUuid不能为空")
|
||||
private String relatedResourceUuid;
|
||||
private String pid;
|
||||
|
||||
private Integer id;
|
||||
/**
|
||||
* 当前节点id
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
private String taskName;
|
||||
private String ownRootNodeUuid;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
private String taskCode;
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
private String nodeCode;
|
||||
|
||||
private String taskPoolName;
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
private String taskPoolVersion;
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
private String nodeSubType;
|
||||
|
||||
/**
|
||||
* 父节点id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
private String nodeId;
|
||||
|
||||
/**
|
||||
* 项目进度状态(未开始、进行中、已完成)
|
||||
*/
|
||||
private String exeStatus;
|
||||
|
||||
private String exeStatusValue;
|
||||
|
||||
/**
|
||||
* 项目进度状态
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
private String progressStatusValue;
|
||||
|
||||
/**
|
||||
* 项目达成状态(红黄绿灯)
|
||||
*/
|
||||
private Integer achieveStatus;
|
||||
|
||||
private String achieveStatusValue;
|
||||
|
||||
/**
|
||||
* 计划开始(精确到秒)
|
||||
*/
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 计划结束(精确到秒)
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 标准工时
|
||||
*/
|
||||
private Integer days;
|
||||
|
||||
/**
|
||||
* 实际完成时间(精确到秒)
|
||||
*/
|
||||
private String finishTime;
|
||||
|
||||
/**
|
||||
* 实际工时
|
||||
*/
|
||||
private Integer realDays;
|
||||
|
||||
/**
|
||||
* 难度系数
|
||||
*/
|
||||
private Float difficult;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 确认状态
|
||||
*/
|
||||
private String confirmStatus;
|
||||
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String managers;
|
||||
|
||||
/**
|
||||
* 拓展属性集合
|
||||
*/
|
||||
private List<ProjectNodeExtraPo> extraList;
|
||||
|
||||
/**
|
||||
* 项目详情图片
|
||||
*/
|
||||
private String detailImgUrl;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 达标方式
|
||||
*/
|
||||
private String method;
|
||||
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 目标值
|
||||
*/
|
||||
private String targetValue;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
private List<TaskNode> children = new ArrayList<>(); //适配前端组件
|
||||
|
||||
private String nodeVersion;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private List<TaskExtraNode> taskExtraNodeList;
|
||||
|
||||
private List<TaskMemberNode> memberList;
|
||||
|
||||
private List<TaskExtraNode> extras;
|
||||
|
||||
private List<TaskNodeMemberPo> members;
|
||||
|
||||
private String levelType;
|
||||
|
||||
private String nodeLevel;
|
||||
|
||||
/**
|
||||
* 仿真负责人
|
||||
*/
|
||||
@JsonProperty(value = "pMemberList")
|
||||
private String pMemberList;
|
||||
|
||||
/**
|
||||
* 仿真执行人
|
||||
*/
|
||||
@JsonProperty(value = "eMemberList")
|
||||
private String eMemberList;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
private String standard;
|
||||
|
||||
private String foldId;
|
||||
|
||||
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 englishName;
|
||||
private String analyseTarget;
|
||||
|
||||
private String confidence;
|
||||
private String analyseSoftware;
|
||||
|
||||
private String approvalStatus;
|
||||
|
||||
private String comfirmStatus;
|
||||
|
||||
private String description;
|
||||
|
||||
private Float difficult;
|
||||
|
||||
private String tenantId;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private Long creator;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private Long updater;
|
||||
|
||||
|
||||
private String updateTime;
|
||||
|
||||
|
||||
private String department;
|
||||
|
||||
|
||||
@JsonProperty(value = "section")
|
||||
private String sectionName;
|
||||
|
||||
|
||||
@JsonProperty(value = "group")
|
||||
private String groupName;
|
||||
|
||||
|
||||
@JsonProperty(value = "bCapacity")
|
||||
private String bCapacity;
|
||||
|
||||
|
||||
private String flowTemplate;
|
||||
|
||||
private String englishName;
|
||||
|
||||
private String demandId;
|
||||
/*
|
||||
* 3D图示
|
||||
*/
|
||||
private Long imageFileId;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ public class SpdmTaskVo extends BaseEntity {
|
||||
* 当前节点名称(=任务名称)
|
||||
*/
|
||||
private String nodeName;
|
||||
/**
|
||||
* 当前节点类型
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,18 +5,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.utils.RandomUtil;
|
||||
import com.sdm.project.common.MemberTypeEnum;
|
||||
import com.sdm.project.model.bo.TaskExtraNode;
|
||||
import com.sdm.project.model.bo.TaskNode;
|
||||
import com.sdm.project.model.entity.SimulationNode;
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import com.sdm.project.dao.SimulationTaskMapper;
|
||||
import com.sdm.project.model.entity.SimulationTaskMember;
|
||||
import com.sdm.project.model.req.SpdmEditNodeForDataReq;
|
||||
import com.sdm.project.model.req.SpdmEditTaskForDataReq;
|
||||
import com.sdm.project.model.req.SpdmTaskOprReq;
|
||||
import com.sdm.project.service.ISimulationTaskMemberService;
|
||||
import com.sdm.project.service.ISimulationTaskService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -29,6 +41,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper, SimulationTask> implements ISimulationTaskService {
|
||||
|
||||
@Autowired
|
||||
private ISimulationTaskMemberService simulationTaskMemberService;
|
||||
|
||||
@Override
|
||||
public boolean updateSimulationTask(SpdmTaskOprReq req) {
|
||||
LambdaUpdateWrapper<SimulationTask> wrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -66,8 +81,22 @@ public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper,
|
||||
public SdmResponse editTaskForData(SpdmEditTaskForDataReq req) {
|
||||
SimulationTask simulationTask = new SimulationTask();
|
||||
BeanUtils.copyProperties(req,simulationTask);
|
||||
LambdaUpdateWrapper<SimulationTask> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
this.update(updateWrapper.setEntity(simulationTask));
|
||||
this.updateById(simulationTask);
|
||||
|
||||
// 设置仿真执行人
|
||||
if (StringUtils.isNotBlank(req.getEMemberList())) {
|
||||
String[] userIdArr = req.getEMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.deleteTaskMemberList(req.getUuid(), MemberTypeEnum.EXECUTOR.getCode());
|
||||
simulationTaskMemberService.saveTaskMemberList(req.getUuid(), MemberTypeEnum.EXECUTOR.getCode(), longUserIdList);
|
||||
}
|
||||
// 设置仿真负责人
|
||||
if (StringUtils.isNotBlank(req.getPMemberList())) {
|
||||
String[] userIdArr = req.getPMemberList().split(",");
|
||||
List<Long> longUserIdList = Arrays.stream(userIdArr).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
|
||||
simulationTaskMemberService.deleteTaskMemberList(req.getUuid(), MemberTypeEnum.PRINCIPAL.getCode());
|
||||
simulationTaskMemberService.saveTaskMemberList(req.getUuid(), MemberTypeEnum.PRINCIPAL.getCode(), longUserIdList);
|
||||
}
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -1365,6 +1365,7 @@ public class TaskServiceImpl implements ITaskService {
|
||||
return SdmResponse.failed("未查询到任务");
|
||||
}
|
||||
taskVo.setNodeName(taskVo.getTaskName());
|
||||
taskVo.setNodeType("task");
|
||||
List<SpdmTaskMemberVo> memberList = mapper.getMemberList(Collections.singletonList(taskVo.getUuid()), null);
|
||||
if (CollectionUtils.isNotEmpty(memberList)) {
|
||||
List<Long> userIdList = memberList.stream().map(SpdmTaskMemberVo::getUserId).toList();
|
||||
|
||||
Reference in New Issue
Block a user