mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
aea60b4827
@ -1,9 +1,7 @@
|
|||||||
package io.metersphere.notice.service;
|
package io.metersphere.notice.service;
|
||||||
|
|
||||||
import io.metersphere.base.domain.ApiTestReport;
|
import io.metersphere.base.domain.*;
|
||||||
import io.metersphere.base.domain.LoadTestReportWithBLOBs;
|
import io.metersphere.base.mapper.UserMapper;
|
||||||
import io.metersphere.base.domain.SystemParameter;
|
|
||||||
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
|
||||||
import io.metersphere.commons.constants.APITestStatus;
|
import io.metersphere.commons.constants.APITestStatus;
|
||||||
import io.metersphere.commons.constants.NoticeConstants;
|
import io.metersphere.commons.constants.NoticeConstants;
|
||||||
import io.metersphere.commons.constants.ParamConstants;
|
import io.metersphere.commons.constants.ParamConstants;
|
||||||
@ -46,6 +44,8 @@ public class MailService {
|
|||||||
private UserService userService;
|
private UserService userService;
|
||||||
@Resource
|
@Resource
|
||||||
private SystemParameterService systemParameterService;
|
private SystemParameterService systemParameterService;
|
||||||
|
@Resource
|
||||||
|
private UserMapper userMapper;
|
||||||
|
|
||||||
//接口和性能测试
|
//接口和性能测试
|
||||||
public void sendLoadNotification(MessageDetail messageDetail, LoadTestReportWithBLOBs loadTestReport, String eventType) {
|
public void sendLoadNotification(MessageDetail messageDetail, LoadTestReportWithBLOBs loadTestReport, String eventType) {
|
||||||
@ -297,7 +297,8 @@ public class MailService {
|
|||||||
Map<String, String> context = new HashMap<>();
|
Map<String, String> context = new HashMap<>();
|
||||||
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
|
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
|
||||||
context.put("url", baseSystemConfigDTO.getUrl());
|
context.put("url", baseSystemConfigDTO.getUrl());
|
||||||
context.put("creator", reviewRequest.getCreator());
|
User user = userMapper.selectByPrimaryKey(reviewRequest.getCreator());
|
||||||
|
context.put("creator", user.getName());
|
||||||
context.put("reviewName", reviewRequest.getName());
|
context.put("reviewName", reviewRequest.getName());
|
||||||
context.put("start", start);
|
context.put("start", start);
|
||||||
context.put("end", end);
|
context.put("end", end);
|
||||||
@ -328,6 +329,8 @@ public class MailService {
|
|||||||
context.put("start", start);
|
context.put("start", start);
|
||||||
context.put("end", end);
|
context.put("end", end);
|
||||||
context.put("id", testPlan.getId());
|
context.put("id", testPlan.getId());
|
||||||
|
User user = userMapper.selectByPrimaryKey(testPlan.getCreator());
|
||||||
|
context.put("creator", user.getName());
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,6 @@ public class PerformanceTestService {
|
|||||||
startEngine(loadTest, engine, request.getTriggerMode());
|
startEngine(loadTest, engine, request.getTriggerMode());
|
||||||
|
|
||||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(engine.getReportId());
|
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(engine.getReportId());
|
||||||
loadTestReport.setTriggerMode("API");
|
|
||||||
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
|
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
|
||||||
performanceNoticeTask.registerNoticeTask(loadTestReport);
|
performanceNoticeTask.registerNoticeTask(loadTestReport);
|
||||||
}
|
}
|
||||||
|
@ -561,7 +561,9 @@ public class TestCaseReviewService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*编辑,新建,完成,删除通知内容*/
|
/*编辑,新建,完成,删除通知内容*/
|
||||||
private static String getReviewContext(SaveTestCaseReviewRequest reviewRequest, String type) {
|
private String getReviewContext(SaveTestCaseReviewRequest reviewRequest, String type) {
|
||||||
|
|
||||||
|
User user = userMapper.selectByPrimaryKey(reviewRequest.getCreator());
|
||||||
Long startTime = reviewRequest.getCreateTime();
|
Long startTime = reviewRequest.getCreateTime();
|
||||||
Long endTime = reviewRequest.getEndTime();
|
Long endTime = reviewRequest.getEndTime();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
@ -577,11 +579,11 @@ public class TestCaseReviewService {
|
|||||||
}
|
}
|
||||||
String context = "";
|
String context = "";
|
||||||
if (StringUtils.equals(NoticeConstants.CREATE, type)) {
|
if (StringUtils.equals(NoticeConstants.CREATE, type)) {
|
||||||
context = "测试评审任务通知:" + reviewRequest.getCreator() + "发起的" + "'" + reviewRequest.getName() + "'" + "待开始,计划开始时间是" + start + "计划结束时间为" + end + "请跟进";
|
context = "测试评审任务通知:" + user.getName() + "发起的" + "'" + reviewRequest.getName() + "'" + "待开始,计划开始时间是" + start + "计划结束时间为" + end + "请跟进";
|
||||||
} else if (StringUtils.equals(NoticeConstants.UPDATE, type)) {
|
} else if (StringUtils.equals(NoticeConstants.UPDATE, type)) {
|
||||||
context = "测试评审任务通知:" + reviewRequest.getCreator() + "发起的" + "'" + reviewRequest.getName() + "'" + "已完成,计划开始时间是" + start + "计划结束时间为" + end + "已完成";
|
context = "测试评审任务通知:" + user.getName() + "发起的" + "'" + reviewRequest.getName() + "'" + "已完成,计划开始时间是" + start + "计划结束时间为" + end + "已完成";
|
||||||
} else if (StringUtils.equals(NoticeConstants.DELETE, type)) {
|
} else if (StringUtils.equals(NoticeConstants.DELETE, type)) {
|
||||||
context = "测试评审任务通知:" + reviewRequest.getCreator() + "发起的" + "'" + reviewRequest.getName() + "'" + "计划开始时间是" + start + "计划结束时间为" + end + "已删除";
|
context = "测试评审任务通知:" + user.getName() + "发起的" + "'" + reviewRequest.getName() + "'" + "计划开始时间是" + start + "计划结束时间为" + end + "已删除";
|
||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
|
@ -93,6 +93,8 @@ public class TestPlanService {
|
|||||||
DingTaskService dingTaskService;
|
DingTaskService dingTaskService;
|
||||||
@Resource
|
@Resource
|
||||||
WxChatTaskService wxChatTaskService;
|
WxChatTaskService wxChatTaskService;
|
||||||
|
@Resource
|
||||||
|
UserMapper userMapper;
|
||||||
|
|
||||||
public void addTestPlan(AddTestPlanRequest testPlan) {
|
public void addTestPlan(AddTestPlanRequest testPlan) {
|
||||||
if (getTestPlanByName(testPlan.getName()).size() > 0) {
|
if (getTestPlanByName(testPlan.getName()).size() > 0) {
|
||||||
@ -534,7 +536,8 @@ public class TestPlanService {
|
|||||||
return projectName;
|
return projectName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getTestPlanContext(AddTestPlanRequest testPlan, String type) {
|
private String getTestPlanContext(AddTestPlanRequest testPlan, String type) {
|
||||||
|
User user = userMapper.selectByPrimaryKey(testPlan.getCreator());
|
||||||
Long startTime = testPlan.getPlannedStartTime();
|
Long startTime = testPlan.getPlannedStartTime();
|
||||||
Long endTime = testPlan.getPlannedEndTime();
|
Long endTime = testPlan.getPlannedEndTime();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
@ -554,11 +557,11 @@ public class TestPlanService {
|
|||||||
}
|
}
|
||||||
String context = "";
|
String context = "";
|
||||||
if (StringUtils.equals(NoticeConstants.CREATE, type)) {
|
if (StringUtils.equals(NoticeConstants.CREATE, type)) {
|
||||||
context = "测试计划任务通知:" + testPlan.getCreator() + "创建的" + "'" + testPlan.getName() + "'" + "待开始,计划开始时间是" + start + "计划结束时间为" + end + "请跟进";
|
context = "测试计划任务通知:" + user.getName() + "创建的" + "'" + testPlan.getName() + "'" + "待开始,计划开始时间是" + start + "计划结束时间为" + end + "请跟进";
|
||||||
} else if (StringUtils.equals(NoticeConstants.UPDATE, type)) {
|
} else if (StringUtils.equals(NoticeConstants.UPDATE, type)) {
|
||||||
context = "测试计划任务通知:" + testPlan.getCreator() + "创建的" + "'" + testPlan.getName() + "'" + "已完成,计划开始时间是" + start + "计划结束时间为" + end + "已完成";
|
context = "测试计划任务通知:" + user.getName() + "创建的" + "'" + testPlan.getName() + "'" + "已完成,计划开始时间是" + start + "计划结束时间为" + end + "已完成";
|
||||||
} else if (StringUtils.equals(NoticeConstants.DELETE, type)) {
|
} else if (StringUtils.equals(NoticeConstants.DELETE, type)) {
|
||||||
context = "测试计划任务通知:" + testPlan.getCreator() + "创建的" + "'" + testPlan.getName() + "'" + "计划开始时间是" + start + "计划结束时间为" + end + "已删除";
|
context = "测试计划任务通知:" + user.getName() + "创建的" + "'" + testPlan.getName() + "'" + "计划开始时间是" + start + "计划结束时间为" + end + "已删除";
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user