refactor(用例管理): 回退用例详情增加更新人和更新时间字段

This commit is contained in:
guoyuqi 2024-05-14 18:28:33 +08:00 committed by Yuki Guo
parent d10f45872f
commit d4b86ac339
2 changed files with 2 additions and 16 deletions

View File

@ -68,15 +68,6 @@ public class FunctionalCaseDetailDTO implements Serializable {
@Schema(description = "创建时间")
private Long createTime;
@Schema(description = "更新人")
private String updateUser;
@Schema(description = "更新人姓名")
private String updateUserName;
@Schema(description = "更新时间")
private Long updateTime;
@Schema(description = "用例步骤JSON)step_model 为 Step 时启用")
private String steps;

View File

@ -36,7 +36,6 @@ import io.metersphere.sdk.util.Translator;
import io.metersphere.system.domain.CustomFieldOption;
import io.metersphere.system.domain.OperationHistoryExample;
import io.metersphere.system.domain.User;
import io.metersphere.system.domain.UserExample;
import io.metersphere.system.dto.OperationHistoryDTO;
import io.metersphere.system.dto.request.OperationHistoryRequest;
import io.metersphere.system.dto.sdk.*;
@ -378,12 +377,8 @@ public class FunctionalCaseService {
String name = functionalCaseModuleService.getModuleName(functionalCaseDetailDTO.getModuleId());
functionalCaseDetailDTO.setModuleName(name);
UserExample userExample = new UserExample();
userExample.createCriteria().andIdIn(List.of(functionalCaseDetailDTO.getCreateUser(), functionalCaseDetailDTO.getUpdateUser()));
List<User> users = userMapper.selectByExample(userExample);
Map<String, String> userMap = users.stream().collect(Collectors.toMap(User::getId, User::getName));
functionalCaseDetailDTO.setCreateUserName(userMap.get(functionalCaseDetailDTO.getCreateUser()));
functionalCaseDetailDTO.setUpdateUserName(userMap.get(functionalCaseDetailDTO.getUpdateUser()));
User user = userMapper.selectByPrimaryKey(functionalCaseDetailDTO.getCreateUser());
functionalCaseDetailDTO.setCreateUserName(user.getName());
}
private void handleCount(FunctionalCaseDetailDTO functionalCaseDetailDTO) {