fix: 接口自动化定时任务和api调用发送通知操作人变量不能获取

This commit is contained in:
Captain.B 2021-10-12 17:30:57 +08:00 committed by 刘瑞斌
parent c040beae79
commit 2df546cfd0
1 changed files with 1 additions and 6 deletions

View File

@ -9,12 +9,10 @@ import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.DateUtils;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.dto.BaseSystemConfigDTO;
import io.metersphere.dto.UserDTO;
import io.metersphere.i18n.Translator;
import io.metersphere.notice.sender.NoticeModel;
import io.metersphere.notice.service.NoticeSendService;
import io.metersphere.service.SystemParameterService;
import io.metersphere.service.UserService;
import io.metersphere.track.request.testcase.TrackCount;
import io.metersphere.track.service.TestPlanApiCaseService;
import io.metersphere.track.service.TestPlanScenarioCaseService;
@ -52,8 +50,6 @@ public class TestResultService {
private TestPlanApiCaseService testPlanApiCaseService;
@Resource
private TestPlanTestCaseService testPlanTestCaseService;
@Resource
private UserService userService;
public void saveResult(TestResult testResult, String runMode, String debugReportId, String testId) {
try {
@ -236,11 +232,10 @@ public class TestResultService {
if (StringUtils.equals("error", report.getStatus())) {
event = NoticeConstants.Event.EXECUTE_FAILED;
}
UserDTO userDTO = userService.getUserDTO(report.getUserId());
Map paramMap = new HashMap<>();
paramMap.put("type", "api");
paramMap.put("url", baseSystemConfigDTO.getUrl());
paramMap.put("operator", userDTO.getName());
paramMap.put("operator", report.getExecutor());
paramMap.putAll(new BeanMap(report));
NoticeModel noticeModel = NoticeModel.builder()
.operator(report.getUserId())