feat(项目报告(X-Pack)): #1003678 项目报告功能开发

--story=1003678 --user=宋天阳 项目报告(X-Pack)
https://www.tapd.cn/55049933/s/1071047
This commit is contained in:
song-tianyang 2021-11-20 18:24:01 +08:00 committed by song-tianyang
parent c2b3baa414
commit e36a8d9e7d
46 changed files with 2971 additions and 55 deletions

View File

@ -1073,12 +1073,28 @@ public class ApiAutomationService {
for (ApiScenarioWithBLOBs apiScenarioWithBLOBs : apiScenarios) {
try {
TestPlanApiScenario testPlanApiScenario = null;
if (request.getScenarioTestPlanIdMap() != null && request.getScenarioTestPlanIdMap().containsKey(apiScenarioWithBLOBs.getId())) {
testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(request.getScenarioTestPlanIdMap().get(apiScenarioWithBLOBs.getId()));
}
boolean haveEnv = checkScenarioEnv(apiScenarioWithBLOBs, testPlanApiScenario);
if (!haveEnv) {
builder.append(apiScenarioWithBLOBs.getName()).append("; ");
if(MapUtils.isNotEmpty(request.getScenarioTestPlanIdMap())){
List<String> testPlanScenarioIds = new ArrayList<>();
for (Map.Entry<String, String> entry: request.getScenarioTestPlanIdMap().entrySet()){
String testPlanScenarioId = entry.getKey();
String scenarioId = entry.getValue();
if(StringUtils.equalsIgnoreCase(scenarioId,apiScenarioWithBLOBs.getId())){
testPlanScenarioIds.add(testPlanScenarioId);
}
}
for (String testPlanScenarioId : testPlanScenarioIds) {
testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(request.getScenarioTestPlanIdMap().get(testPlanScenarioId));
boolean haveEnv = checkScenarioEnv(apiScenarioWithBLOBs, testPlanApiScenario);
if (!haveEnv) {
builder.append(apiScenarioWithBLOBs.getName()).append("; ");
}
}
}else {
boolean haveEnv = checkScenarioEnv(apiScenarioWithBLOBs, testPlanApiScenario);
if (!haveEnv) {
builder.append(apiScenarioWithBLOBs.getName()).append("; ");
}
}
} catch (Exception e) {
MSException.throwException("场景:" + builder.toString() + "运行环境未配置,请检查!");

View File

@ -1197,6 +1197,7 @@ public class MockConfigService {
if (!isMatch) {
response.setStatus(404);
returnStr = "未找到匹配的Mock期望!";
}
return returnStr;
}
@ -1238,6 +1239,7 @@ public class MockConfigService {
if (!isMatch) {
response.setStatus(404);
returnStr = "未找到匹配的Mock期望!";
}
return returnStr;
}

View File

@ -0,0 +1,31 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class EnterpriseTestReport implements Serializable {
private String id;
private String projectId;
private Long createTime;
private Long updateTime;
private String createUser;
private String updateUser;
private String name;
private String status;
private String sendFreq;
private String sendCron;
private Long lastSendTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,940 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class EnterpriseTestReportExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EnterpriseTestReportExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("create_user is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("create_user =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("create_user <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("create_user >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("create_user >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("create_user <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("create_user <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("create_user like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("create_user not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("create_user not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("create_user between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andUpdateUserIsNull() {
addCriterion("update_user is null");
return (Criteria) this;
}
public Criteria andUpdateUserIsNotNull() {
addCriterion("update_user is not null");
return (Criteria) this;
}
public Criteria andUpdateUserEqualTo(String value) {
addCriterion("update_user =", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotEqualTo(String value) {
addCriterion("update_user <>", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThan(String value) {
addCriterion("update_user >", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
addCriterion("update_user >=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThan(String value) {
addCriterion("update_user <", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThanOrEqualTo(String value) {
addCriterion("update_user <=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLike(String value) {
addCriterion("update_user like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotLike(String value) {
addCriterion("update_user not like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserIn(List<String> values) {
addCriterion("update_user in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> values) {
addCriterion("update_user not in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserBetween(String value1, String value2) {
addCriterion("update_user between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotBetween(String value1, String value2) {
addCriterion("update_user not between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andSendFreqIsNull() {
addCriterion("send_freq is null");
return (Criteria) this;
}
public Criteria andSendFreqIsNotNull() {
addCriterion("send_freq is not null");
return (Criteria) this;
}
public Criteria andSendFreqEqualTo(String value) {
addCriterion("send_freq =", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqNotEqualTo(String value) {
addCriterion("send_freq <>", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqGreaterThan(String value) {
addCriterion("send_freq >", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqGreaterThanOrEqualTo(String value) {
addCriterion("send_freq >=", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqLessThan(String value) {
addCriterion("send_freq <", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqLessThanOrEqualTo(String value) {
addCriterion("send_freq <=", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqLike(String value) {
addCriterion("send_freq like", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqNotLike(String value) {
addCriterion("send_freq not like", value, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqIn(List<String> values) {
addCriterion("send_freq in", values, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqNotIn(List<String> values) {
addCriterion("send_freq not in", values, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqBetween(String value1, String value2) {
addCriterion("send_freq between", value1, value2, "sendFreq");
return (Criteria) this;
}
public Criteria andSendFreqNotBetween(String value1, String value2) {
addCriterion("send_freq not between", value1, value2, "sendFreq");
return (Criteria) this;
}
public Criteria andSendCronIsNull() {
addCriterion("send_cron is null");
return (Criteria) this;
}
public Criteria andSendCronIsNotNull() {
addCriterion("send_cron is not null");
return (Criteria) this;
}
public Criteria andSendCronEqualTo(String value) {
addCriterion("send_cron =", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronNotEqualTo(String value) {
addCriterion("send_cron <>", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronGreaterThan(String value) {
addCriterion("send_cron >", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronGreaterThanOrEqualTo(String value) {
addCriterion("send_cron >=", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronLessThan(String value) {
addCriterion("send_cron <", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronLessThanOrEqualTo(String value) {
addCriterion("send_cron <=", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronLike(String value) {
addCriterion("send_cron like", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronNotLike(String value) {
addCriterion("send_cron not like", value, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronIn(List<String> values) {
addCriterion("send_cron in", values, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronNotIn(List<String> values) {
addCriterion("send_cron not in", values, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronBetween(String value1, String value2) {
addCriterion("send_cron between", value1, value2, "sendCron");
return (Criteria) this;
}
public Criteria andSendCronNotBetween(String value1, String value2) {
addCriterion("send_cron not between", value1, value2, "sendCron");
return (Criteria) this;
}
public Criteria andLastSendTimeIsNull() {
addCriterion("last_send_time is null");
return (Criteria) this;
}
public Criteria andLastSendTimeIsNotNull() {
addCriterion("last_send_time is not null");
return (Criteria) this;
}
public Criteria andLastSendTimeEqualTo(Long value) {
addCriterion("last_send_time =", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeNotEqualTo(Long value) {
addCriterion("last_send_time <>", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeGreaterThan(Long value) {
addCriterion("last_send_time >", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeGreaterThanOrEqualTo(Long value) {
addCriterion("last_send_time >=", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeLessThan(Long value) {
addCriterion("last_send_time <", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeLessThanOrEqualTo(Long value) {
addCriterion("last_send_time <=", value, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeIn(List<Long> values) {
addCriterion("last_send_time in", values, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeNotIn(List<Long> values) {
addCriterion("last_send_time not in", values, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeBetween(Long value1, Long value2) {
addCriterion("last_send_time between", value1, value2, "lastSendTime");
return (Criteria) this;
}
public Criteria andLastSendTimeNotBetween(Long value1, Long value2) {
addCriterion("last_send_time not between", value1, value2, "lastSendTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,19 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class EnterpriseTestReportSendRecord implements Serializable {
private String id;
private String enterpriseTestReportId;
private Long createTime;
private String createUser;
private String status;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,540 @@
package io.metersphere.base.domain;
import java.util.ArrayList;
import java.util.List;
public class EnterpriseTestReportSendRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EnterpriseTestReportSendRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdIsNull() {
addCriterion("enterprise_test_report_id is null");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdIsNotNull() {
addCriterion("enterprise_test_report_id is not null");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdEqualTo(String value) {
addCriterion("enterprise_test_report_id =", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdNotEqualTo(String value) {
addCriterion("enterprise_test_report_id <>", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdGreaterThan(String value) {
addCriterion("enterprise_test_report_id >", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdGreaterThanOrEqualTo(String value) {
addCriterion("enterprise_test_report_id >=", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdLessThan(String value) {
addCriterion("enterprise_test_report_id <", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdLessThanOrEqualTo(String value) {
addCriterion("enterprise_test_report_id <=", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdLike(String value) {
addCriterion("enterprise_test_report_id like", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdNotLike(String value) {
addCriterion("enterprise_test_report_id not like", value, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdIn(List<String> values) {
addCriterion("enterprise_test_report_id in", values, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdNotIn(List<String> values) {
addCriterion("enterprise_test_report_id not in", values, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdBetween(String value1, String value2) {
addCriterion("enterprise_test_report_id between", value1, value2, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andEnterpriseTestReportIdNotBetween(String value1, String value2) {
addCriterion("enterprise_test_report_id not between", value1, value2, "enterpriseTestReportId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("create_user is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("create_user =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("create_user <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("create_user >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("create_user >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("create_user <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("create_user <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("create_user like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("create_user not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("create_user not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("create_user between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("`status` like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("`status` not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,19 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EnterpriseTestReportSendRecordWithBLOBs extends EnterpriseTestReportSendRecord implements Serializable {
private String reportContent;
private String addressee;
private String duplicated;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,19 @@
package io.metersphere.base.domain;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EnterpriseTestReportWithBLOBs extends EnterpriseTestReport implements Serializable {
private String reportContent;
private String addressee;
private String duplicated;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,37 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.EnterpriseTestReport;
import io.metersphere.base.domain.EnterpriseTestReportExample;
import io.metersphere.base.domain.EnterpriseTestReportWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EnterpriseTestReportMapper {
long countByExample(EnterpriseTestReportExample example);
int deleteByExample(EnterpriseTestReportExample example);
int deleteByPrimaryKey(String id);
int insert(EnterpriseTestReportWithBLOBs record);
int insertSelective(EnterpriseTestReportWithBLOBs record);
List<EnterpriseTestReportWithBLOBs> selectByExampleWithBLOBs(EnterpriseTestReportExample example);
List<EnterpriseTestReport> selectByExample(EnterpriseTestReportExample example);
EnterpriseTestReportWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") EnterpriseTestReportWithBLOBs record, @Param("example") EnterpriseTestReportExample example);
int updateByExampleWithBLOBs(@Param("record") EnterpriseTestReportWithBLOBs record, @Param("example") EnterpriseTestReportExample example);
int updateByExample(@Param("record") EnterpriseTestReport record, @Param("example") EnterpriseTestReportExample example);
int updateByPrimaryKeySelective(EnterpriseTestReportWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(EnterpriseTestReportWithBLOBs record);
int updateByPrimaryKey(EnterpriseTestReport record);
}

View File

@ -0,0 +1,407 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.EnterpriseTestReportMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.EnterpriseTestReport">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="send_freq" jdbcType="VARCHAR" property="sendFreq" />
<result column="send_cron" jdbcType="VARCHAR" property="sendCron" />
<result column="last_send_time" jdbcType="BIGINT" property="lastSendTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.EnterpriseTestReportWithBLOBs">
<result column="report_content" jdbcType="LONGVARCHAR" property="reportContent" />
<result column="addressee" jdbcType="LONGVARCHAR" property="addressee" />
<result column="duplicated" jdbcType="LONGVARCHAR" property="duplicated" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, create_time, update_time, create_user, update_user, `name`, `status`,
send_freq, send_cron, last_send_time
</sql>
<sql id="Blob_Column_List">
report_content, addressee, duplicated
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.EnterpriseTestReportExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from enterprise_test_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from enterprise_test_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from enterprise_test_report
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from enterprise_test_report
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportExample">
delete from enterprise_test_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.EnterpriseTestReportWithBLOBs">
insert into enterprise_test_report (id, project_id, create_time,
update_time, create_user, update_user,
`name`, `status`, send_freq,
send_cron, last_send_time, report_content,
addressee, duplicated)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{sendFreq,jdbcType=VARCHAR},
#{sendCron,jdbcType=VARCHAR}, #{lastSendTime,jdbcType=BIGINT}, #{reportContent,jdbcType=LONGVARCHAR},
#{addressee,jdbcType=LONGVARCHAR}, #{duplicated,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.EnterpriseTestReportWithBLOBs">
insert into enterprise_test_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="name != null">
`name`,
</if>
<if test="status != null">
`status`,
</if>
<if test="sendFreq != null">
send_freq,
</if>
<if test="sendCron != null">
send_cron,
</if>
<if test="lastSendTime != null">
last_send_time,
</if>
<if test="reportContent != null">
report_content,
</if>
<if test="addressee != null">
addressee,
</if>
<if test="duplicated != null">
duplicated,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="sendFreq != null">
#{sendFreq,jdbcType=VARCHAR},
</if>
<if test="sendCron != null">
#{sendCron,jdbcType=VARCHAR},
</if>
<if test="lastSendTime != null">
#{lastSendTime,jdbcType=BIGINT},
</if>
<if test="reportContent != null">
#{reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="addressee != null">
#{addressee,jdbcType=LONGVARCHAR},
</if>
<if test="duplicated != null">
#{duplicated,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportExample" resultType="java.lang.Long">
select count(*) from enterprise_test_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update enterprise_test_report
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.sendFreq != null">
send_freq = #{record.sendFreq,jdbcType=VARCHAR},
</if>
<if test="record.sendCron != null">
send_cron = #{record.sendCron,jdbcType=VARCHAR},
</if>
<if test="record.lastSendTime != null">
last_send_time = #{record.lastSendTime,jdbcType=BIGINT},
</if>
<if test="record.reportContent != null">
report_content = #{record.reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="record.addressee != null">
addressee = #{record.addressee,jdbcType=LONGVARCHAR},
</if>
<if test="record.duplicated != null">
duplicated = #{record.duplicated,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update enterprise_test_report
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
update_user = #{record.updateUser,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
send_freq = #{record.sendFreq,jdbcType=VARCHAR},
send_cron = #{record.sendCron,jdbcType=VARCHAR},
last_send_time = #{record.lastSendTime,jdbcType=BIGINT},
report_content = #{record.reportContent,jdbcType=LONGVARCHAR},
addressee = #{record.addressee,jdbcType=LONGVARCHAR},
duplicated = #{record.duplicated,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update enterprise_test_report
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
update_user = #{record.updateUser,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
send_freq = #{record.sendFreq,jdbcType=VARCHAR},
send_cron = #{record.sendCron,jdbcType=VARCHAR},
last_send_time = #{record.lastSendTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.EnterpriseTestReportWithBLOBs">
update enterprise_test_report
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="sendFreq != null">
send_freq = #{sendFreq,jdbcType=VARCHAR},
</if>
<if test="sendCron != null">
send_cron = #{sendCron,jdbcType=VARCHAR},
</if>
<if test="lastSendTime != null">
last_send_time = #{lastSendTime,jdbcType=BIGINT},
</if>
<if test="reportContent != null">
report_content = #{reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="addressee != null">
addressee = #{addressee,jdbcType=LONGVARCHAR},
</if>
<if test="duplicated != null">
duplicated = #{duplicated,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.EnterpriseTestReportWithBLOBs">
update enterprise_test_report
set project_id = #{projectId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
update_user = #{updateUser,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
send_freq = #{sendFreq,jdbcType=VARCHAR},
send_cron = #{sendCron,jdbcType=VARCHAR},
last_send_time = #{lastSendTime,jdbcType=BIGINT},
report_content = #{reportContent,jdbcType=LONGVARCHAR},
addressee = #{addressee,jdbcType=LONGVARCHAR},
duplicated = #{duplicated,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.EnterpriseTestReport">
update enterprise_test_report
set project_id = #{projectId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
update_user = #{updateUser,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
send_freq = #{sendFreq,jdbcType=VARCHAR},
send_cron = #{sendCron,jdbcType=VARCHAR},
last_send_time = #{lastSendTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,37 @@
package io.metersphere.base.mapper;
import io.metersphere.base.domain.EnterpriseTestReportSendRecord;
import io.metersphere.base.domain.EnterpriseTestReportSendRecordExample;
import io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EnterpriseTestReportSendRecordMapper {
long countByExample(EnterpriseTestReportSendRecordExample example);
int deleteByExample(EnterpriseTestReportSendRecordExample example);
int deleteByPrimaryKey(String id);
int insert(EnterpriseTestReportSendRecordWithBLOBs record);
int insertSelective(EnterpriseTestReportSendRecordWithBLOBs record);
List<EnterpriseTestReportSendRecordWithBLOBs> selectByExampleWithBLOBs(EnterpriseTestReportSendRecordExample example);
List<EnterpriseTestReportSendRecord> selectByExample(EnterpriseTestReportSendRecordExample example);
EnterpriseTestReportSendRecordWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") EnterpriseTestReportSendRecordWithBLOBs record, @Param("example") EnterpriseTestReportSendRecordExample example);
int updateByExampleWithBLOBs(@Param("record") EnterpriseTestReportSendRecordWithBLOBs record, @Param("example") EnterpriseTestReportSendRecordExample example);
int updateByExample(@Param("record") EnterpriseTestReportSendRecord record, @Param("example") EnterpriseTestReportSendRecordExample example);
int updateByPrimaryKeySelective(EnterpriseTestReportSendRecordWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(EnterpriseTestReportSendRecordWithBLOBs record);
int updateByPrimaryKey(EnterpriseTestReportSendRecord record);
}

View File

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.EnterpriseTestReportSendRecordMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.EnterpriseTestReportSendRecord">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="enterprise_test_report_id" jdbcType="VARCHAR" property="enterpriseTestReportId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="status" jdbcType="VARCHAR" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs">
<result column="report_content" jdbcType="LONGVARCHAR" property="reportContent" />
<result column="addressee" jdbcType="LONGVARCHAR" property="addressee" />
<result column="duplicated" jdbcType="LONGVARCHAR" property="duplicated" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, enterprise_test_report_id, create_time, create_user, `status`
</sql>
<sql id="Blob_Column_List">
report_content, addressee, duplicated
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from enterprise_test_report_send_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from enterprise_test_report_send_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from enterprise_test_report_send_record
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from enterprise_test_report_send_record
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordExample">
delete from enterprise_test_report_send_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs">
insert into enterprise_test_report_send_record (id, enterprise_test_report_id, create_time,
create_user, `status`, report_content,
addressee, duplicated)
values (#{id,jdbcType=VARCHAR}, #{enterpriseTestReportId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{createUser,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{reportContent,jdbcType=LONGVARCHAR},
#{addressee,jdbcType=LONGVARCHAR}, #{duplicated,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs">
insert into enterprise_test_report_send_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="enterpriseTestReportId != null">
enterprise_test_report_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="status != null">
`status`,
</if>
<if test="reportContent != null">
report_content,
</if>
<if test="addressee != null">
addressee,
</if>
<if test="duplicated != null">
duplicated,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="enterpriseTestReportId != null">
#{enterpriseTestReportId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="reportContent != null">
#{reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="addressee != null">
#{addressee,jdbcType=LONGVARCHAR},
</if>
<if test="duplicated != null">
#{duplicated,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordExample" resultType="java.lang.Long">
select count(*) from enterprise_test_report_send_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update enterprise_test_report_send_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.enterpriseTestReportId != null">
enterprise_test_report_id = #{record.enterpriseTestReportId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.reportContent != null">
report_content = #{record.reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="record.addressee != null">
addressee = #{record.addressee,jdbcType=LONGVARCHAR},
</if>
<if test="record.duplicated != null">
duplicated = #{record.duplicated,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update enterprise_test_report_send_record
set id = #{record.id,jdbcType=VARCHAR},
enterprise_test_report_id = #{record.enterpriseTestReportId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
report_content = #{record.reportContent,jdbcType=LONGVARCHAR},
addressee = #{record.addressee,jdbcType=LONGVARCHAR},
duplicated = #{record.duplicated,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update enterprise_test_report_send_record
set id = #{record.id,jdbcType=VARCHAR},
enterprise_test_report_id = #{record.enterpriseTestReportId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs">
update enterprise_test_report_send_record
<set>
<if test="enterpriseTestReportId != null">
enterprise_test_report_id = #{enterpriseTestReportId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="reportContent != null">
report_content = #{reportContent,jdbcType=LONGVARCHAR},
</if>
<if test="addressee != null">
addressee = #{addressee,jdbcType=LONGVARCHAR},
</if>
<if test="duplicated != null">
duplicated = #{duplicated,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecordWithBLOBs">
update enterprise_test_report_send_record
set enterprise_test_report_id = #{enterpriseTestReportId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
report_content = #{reportContent,jdbcType=LONGVARCHAR},
addressee = #{addressee,jdbcType=LONGVARCHAR},
duplicated = #{duplicated,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.EnterpriseTestReportSendRecord">
update enterprise_test_report_send_record
set enterprise_test_report_id = #{enterpriseTestReportId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -6,6 +6,7 @@ import io.metersphere.controller.request.group.EditGroupRequest;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.dto.RelatedSource;
import io.metersphere.dto.UserGroupDTO;
import io.metersphere.dto.UserGroupInfoDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -27,4 +28,6 @@ public interface ExtUserGroupMapper {
List<User> getGroupUser(@Param("request")EditGroupRequest request);
int checkSourceRole(@Param("sourceId") String sourceId, @Param("userId") String userId, @Param("groupId") String groupId);
List<UserGroupInfoDTO> getUserGroupInfo();
}

View File

@ -71,4 +71,10 @@
AND ug.group_id = #{groupId}
</select>
<select id="getUserGroupInfo" resultType="io.metersphere.dto.UserGroupInfoDTO">
select distinct user.id AS userId, user.name AS userName, user.email AS userEmail, g.`name` AS groupName, g.id AS groupId
from user INNER JOIN user_group ug on user.id = ug.user_id
INNER JOIN `group` g ON ug.group_id = g.id;
</select>
</mapper>

View File

@ -0,0 +1,14 @@
package io.metersphere.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class UserGroupInfoDTO {
private String userId;
private String userName;
private String userEmail;
private String groupId;
private String groupName;
}

View File

@ -23,7 +23,7 @@ public class MailNoticeSender extends AbstractNoticeSender {
@Resource
private MailService mailService;
private void sendMail(String context, NoticeModel noticeModel) throws MessagingException {
public void sendMail(String context, NoticeModel noticeModel) throws MessagingException {
LogUtil.debug("发送邮件开始 ");
JavaMailSenderImpl javaMailSender = mailService.getMailSender();
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
@ -58,6 +58,39 @@ public class MailNoticeSender extends AbstractNoticeSender {
javaMailSender.send(mimeMessage);
}
public void sendExternalMail(String context, NoticeModel noticeModel) throws MessagingException {
LogUtil.debug("发送邮件开始 ");
JavaMailSenderImpl javaMailSender = mailService.getMailSender();
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
if (javaMailSender.getUsername().contains("@")) {
helper.setFrom(javaMailSender.getUsername());
} else {
String mailHost = javaMailSender.getHost();
String domainName = mailHost.substring(mailHost.indexOf(".") + 1, mailHost.length());
helper.setFrom(javaMailSender.getUsername() + "@" + domainName);
}
LogUtil.debug("发件人地址" + javaMailSender.getUsername());
LogUtil.debug("helper" + helper);
helper.setSubject(noticeModel.getSubject());
List<String> userIds = noticeModel.getReceivers().stream()
.map(Receiver::getUserId)
.distinct()
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(userIds)) {
return;
}
String[] users = userIds.stream()
.distinct()
.toArray(String[]::new);
LogUtil.info("收件人地址: {}", userIds);
helper.setText(context, true);
helper.setTo(users);
javaMailSender.send(mimeMessage);
}
@Override
public void send(MessageDetail messageDetail, NoticeModel noticeModel) {
String context = super.getHtmlContext(messageDetail, noticeModel);

View File

@ -27,8 +27,7 @@ public class HistoryReportController {
@PostMapping("/selectByParams")
public List<ReportStatistics> selectByParams(@RequestBody ReportStatisticsSaveRequest request) {
List<ReportStatistics> returnList = reportStatisticsService.selectByProjectIdAndReportType(request.getProjectId(),request.getReportType());
LogUtil.info("报表查询结果:"+JSONArray.toJSONString(returnList));
List<ReportStatistics> returnList = reportStatisticsService.selectByRequest(request);
return returnList;
}

View File

@ -1,5 +1,6 @@
package io.metersphere.reportstatistics.dto;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableDataDTO;
import lombok.Getter;
import lombok.Setter;
@ -8,9 +9,11 @@ import java.util.List;
@Getter
@Setter
public class TestCaseCountResponse {
private String chartType;
private TestAnalysisChartDTO barChartDTO;
private PieChartDTO pieChartDTO;
private List<TestCaseCountTableDTO> tableDTOs;
private TestCaseCountTableDataDTO showTable;
public TestCaseCountResponse() {

View File

@ -0,0 +1,13 @@
package io.metersphere.reportstatistics.dto.table;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestCaseCountTableDataDTO {
List<TestCaseCountTableItemDataDTO> heads;
List<TestCaseCountTableRowDTO> data;
}

View File

@ -0,0 +1,11 @@
package io.metersphere.reportstatistics.dto.table;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestCaseCountTableItemDataDTO {
private String id;
private String value;
}

View File

@ -0,0 +1,12 @@
package io.metersphere.reportstatistics.dto.table;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class TestCaseCountTableRowDTO {
private List<TestCaseCountTableItemDataDTO> tableDatas;
}

View File

@ -1,5 +1,7 @@
package io.metersphere.reportstatistics.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.metersphere.base.domain.ReportStatistics;
import io.metersphere.base.domain.ReportStatisticsExample;
import io.metersphere.base.domain.ReportStatisticsWithBLOBs;
@ -7,11 +9,16 @@ import io.metersphere.base.mapper.ReportStatisticsMapper;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.reportstatistics.dto.ReportStatisticsSaveRequest;
import io.metersphere.reportstatistics.dto.ReportStatisticsType;
import io.metersphere.reportstatistics.dto.TestCaseCountTableDTO;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableDataDTO;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableItemDataDTO;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableRowDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@ -58,15 +65,95 @@ public class ReportStatisticsService {
return reportStatisticsMapper.deleteByPrimaryKey(id);
}
public List<ReportStatistics> selectByProjectIdAndReportType(String projectId, String reportType) {
ReportStatisticsExample example = new ReportStatisticsExample();
example.createCriteria().andProjectIdEqualTo(projectId).andReportTypeEqualTo(reportType);
example.setOrderByClause("create_time DESC");
return reportStatisticsMapper.selectByExample(example);
}
public ReportStatisticsWithBLOBs selectById(String id) {
return reportStatisticsMapper.selectByPrimaryKey(id);
ReportStatisticsWithBLOBs blob = reportStatisticsMapper.selectByPrimaryKey(id);
JSONObject dataOption = JSONObject.parseObject(blob.getDataOption());
JSONObject selectOption = JSONObject.parseObject(blob.getSelectOption());
if(!dataOption.containsKey("showTable")){
List<TestCaseCountTableDTO> dtos = JSONArray.parseArray(dataOption.getString("tableData"),TestCaseCountTableDTO.class);
TestCaseCountTableDataDTO showTable = this.countShowTable(selectOption.getString("xaxis"), JSONArray.parseArray(selectOption.getString("yaxis"),String.class),dtos);
dataOption.put("showTable",showTable);
blob.setDataOption(dataOption.toString());
}
return blob;
}
private TestCaseCountTableDataDTO countShowTable(String groupName, List<String> yaxis, List<TestCaseCountTableDTO> dtos) {
TestCaseCountTableDataDTO returnDTO = new TestCaseCountTableDataDTO();
String [] headers = new String[]{groupName,"总计","testCase","apiCase","scenarioCase","loadCaseCount"};
List<TestCaseCountTableItemDataDTO> heads = new ArrayList<>();
boolean showTestCase = true;
boolean showApi = true;
boolean showScenario = true;
boolean showLoad = true;
for (String head : headers) {
if(StringUtils.equalsAnyIgnoreCase(head,groupName,"总计") || yaxis.contains(head)){
TestCaseCountTableItemDataDTO headData = new TestCaseCountTableItemDataDTO();
headData.setId(UUID.randomUUID().toString());
headData.setValue(head);
heads.add(headData);
}else {
if(StringUtils.equalsIgnoreCase(head,"testCase")){
showTestCase = false;
}else if(StringUtils.equalsIgnoreCase(head,"apiCase")){
showApi = false;
}else if(StringUtils.equalsIgnoreCase(head,"scenarioCase")){
showScenario = false;
}else if(StringUtils.equalsIgnoreCase(head,"loadCaseCount")){
showLoad = false;
}
}
}
List<TestCaseCountTableRowDTO> tableRows = new ArrayList<>();
for (TestCaseCountTableDTO data : dtos) {
TestCaseCountTableRowDTO row = new TestCaseCountTableRowDTO();
List<TestCaseCountTableItemDataDTO> rowDataList = new ArrayList<>();
TestCaseCountTableItemDataDTO nameData = new TestCaseCountTableItemDataDTO();
nameData.setId(UUID.randomUUID().toString());
nameData.setValue(data.getName());
rowDataList.add(nameData);
TestCaseCountTableItemDataDTO countData = new TestCaseCountTableItemDataDTO();
countData.setId(UUID.randomUUID().toString());
countData.setValue(data.getAllCount());
rowDataList.add(countData);
if(showTestCase){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getTestCaseCount());
rowDataList.add(itemData);
}
if(showApi){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getApiCaseCount());
rowDataList.add(itemData);
}
if(showScenario){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getScenarioCaseCount());
rowDataList.add(itemData);
}
if(showLoad){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getLoadCaseCount());
rowDataList.add(itemData);
}
row.setTableDatas(rowDataList);
tableRows.add(row);
}
returnDTO.setHeads(heads);
returnDTO.setData(tableRows);
return returnDTO;
}
public ReportStatisticsWithBLOBs updateByRequest(ReportStatisticsSaveRequest request) {
@ -78,4 +165,20 @@ public class ReportStatisticsService {
reportStatisticsMapper.updateByPrimaryKeySelective(updateModel);
return updateModel;
}
public List<ReportStatistics> selectByRequest(ReportStatisticsSaveRequest request) {
ReportStatisticsExample example = new ReportStatisticsExample();
ReportStatisticsExample.Criteria criteria = example.createCriteria();
if(StringUtils.isNotEmpty(request.getProjectId())){
criteria.andProjectIdEqualTo(request.getProjectId());
}
if(StringUtils.isNotEmpty(request.getReportType())){
criteria.andReportTypeEqualTo(request.getReportType());
}
if(StringUtils.isNotEmpty(request.getName())){
criteria.andNameLike(request.getName());
}
example.setOrderByClause("create_time DESC");
return reportStatisticsMapper.selectByExample(example);
}
}

View File

@ -12,6 +12,9 @@ import io.metersphere.dto.TestCaseTemplateDao;
import io.metersphere.i18n.Translator;
import io.metersphere.reportstatistics.dto.*;
import io.metersphere.reportstatistics.dto.charts.*;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableDataDTO;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableItemDataDTO;
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableRowDTO;
import io.metersphere.service.TestCaseTemplateService;
import io.metersphere.service.UserService;
import org.apache.commons.collections.CollectionUtils;
@ -298,13 +301,96 @@ public class TestCaseCountService {
formatPieChart(pieChartDTO, request.getXaxis(), summaryMap,yAxisSelectTestCase,yAxisSelectApi,yAxisSelectScenarioCase,yAxisSelectLoad);
TestCaseCountTableDataDTO showTable = this.countShowTable(request.getXaxis(),request.getYaxis(),dtos);
TestCaseCountResponse testCaseCountResult = new TestCaseCountResponse();
testCaseCountResult.setBarChartDTO(dto);
testCaseCountResult.setTableDTOs(dtos);
testCaseCountResult.setPieChartDTO(pieChartDTO);
testCaseCountResult.setShowTable(showTable);
return testCaseCountResult;
}
private TestCaseCountTableDataDTO countShowTable(String groupName, List<String> yaxis, List<TestCaseCountTableDTO> dtos) {
TestCaseCountTableDataDTO returnDTO = new TestCaseCountTableDataDTO();
String [] headers = new String[]{groupName,"总计","testCase","apiCase","scenarioCase","loadCaseCount"};
List<TestCaseCountTableItemDataDTO> heads = new ArrayList<>();
boolean showTestCase = true;
boolean showApi = true;
boolean showScenario = true;
boolean showLoad = true;
for (String head : headers) {
if(StringUtils.equalsAnyIgnoreCase(head,groupName,"总计") || yaxis.contains(head)){
TestCaseCountTableItemDataDTO headData = new TestCaseCountTableItemDataDTO();
headData.setId(UUID.randomUUID().toString());
headData.setValue(head);
heads.add(headData);
}else {
if(StringUtils.equalsIgnoreCase(head,"testCase")){
showTestCase = false;
}else if(StringUtils.equalsIgnoreCase(head,"apiCase")){
showApi = false;
}else if(StringUtils.equalsIgnoreCase(head,"scenarioCase")){
showScenario = false;
}else if(StringUtils.equalsIgnoreCase(head,"loadCaseCount")){
showLoad = false;
}
}
}
List<TestCaseCountTableRowDTO> tableRows = new ArrayList<>();
for (TestCaseCountTableDTO data : dtos) {
TestCaseCountTableRowDTO row = new TestCaseCountTableRowDTO();
List<TestCaseCountTableItemDataDTO> rowDataList = new ArrayList<>();
TestCaseCountTableItemDataDTO nameData = new TestCaseCountTableItemDataDTO();
nameData.setId(UUID.randomUUID().toString());
nameData.setValue(data.getName());
rowDataList.add(nameData);
TestCaseCountTableItemDataDTO countData = new TestCaseCountTableItemDataDTO();
countData.setId(UUID.randomUUID().toString());
countData.setValue(data.getAllCount());
rowDataList.add(countData);
if(showTestCase){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getTestCaseCount());
rowDataList.add(itemData);
}
if(showApi){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getApiCaseCount());
rowDataList.add(itemData);
}
if(showScenario){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getScenarioCaseCount());
rowDataList.add(itemData);
}
if(showLoad){
TestCaseCountTableItemDataDTO itemData = new TestCaseCountTableItemDataDTO();
itemData.setId(UUID.randomUUID().toString());
itemData.setValue(data.getLoadCaseCount());
rowDataList.add(itemData);
}
row.setTableDatas(rowDataList);
tableRows.add(row);
}
returnDTO.setHeads(heads);
returnDTO.setData(tableRows);
return returnDTO;
}
private List<TestCaseCountChartResult> checkCountChartResultHasColumn(String xcolumn,List<TestCaseCountChartResult> resultList) {
boolean hasResult = false;
for (TestCaseCountChartResult result: resultList) {

@ -1 +1 @@
Subproject commit 8a66abb2ae670718f65469ba70fc5e3dabdec6c1
Subproject commit b90efefd1312b35dea5c2c1fb3a7f78904a7bcd7

View File

@ -31,3 +31,35 @@ VALUES ('e392af07-fdfe-4475-a459-87d59f0b1625', '测试阶段', 'PLAN', 'select'
1, 1, 'global', unix_timestamp() * 1000, unix_timestamp() * 1000);
ALTER TABLE api_definition_exec_result MODIFY COLUMN name VARCHAR (100);
CREATE TABLE IF NOT EXISTS `enterprise_test_report` (
`id` varchar(50) NOT NULL COMMENT 'Test ID',
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this report belongs to',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
`create_user` varchar(64) DEFAULT NULL COMMENT 'User ID',
`update_user` varchar(64) DEFAULT NULL COMMENT 'User ID',
`name` varchar(255) NOT NULL COMMENT 'report name',
`status` varchar(64) DEFAULT NULL COMMENT 'Status of email',
`send_freq` varchar(64) DEFAULT NULL COMMENT 'send freq',
`send_cron` varchar(64) DEFAULT NULL COMMENT 'send cron',
`last_send_time` bigint(13) DEFAULT NULL COMMENT 'last send time',
`report_content` longtext COMMENT 'report content',
`addressee` longtext COMMENT 'report content',
`duplicated` longtext COMMENT 'report content',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `enterprise_test_report_send_record` (
`id` varchar(50) NOT NULL COMMENT 'Test ID',
`enterprise_test_report_id` varchar(50) NOT NULL COMMENT 'Enterprise report ID this record belongs to',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`create_user` varchar(64) DEFAULT NULL COMMENT 'User ID',
`status` varchar(64) DEFAULT NULL COMMENT 'Status of email',
`report_content` longtext COMMENT 'report content',
`addressee` longtext COMMENT 'report content',
`duplicated` longtext COMMENT 'report content',
PRIMARY KEY (`id`),
INDEX `enterprise_test_report_id` (`enterprise_test_report_id`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_general_ci;

View File

@ -71,7 +71,8 @@
<!--<table tableName="test_plan"/>-->
<!--<table tableName="api_scenario_report"/>-->
<!--<table tableName="test_case_review"/>-->
<table tableName="issue_follow"/>
<table tableName="enterprise_test_report"/>
<table tableName="enterprise_test_report_send_record"/>
<!--<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/>
<table tableName="test_case_review_scenario"/>

View File

@ -0,0 +1,10 @@
<html>
<head>
<meta charset="UTF-8">
<title>MeterSphere</title>
</head>
<body>
#{reportData}
</body>
</html>

View File

@ -838,6 +838,36 @@
"id": "SYSTEM_PLUGIN:READ",
"name": "查看脚本",
"resourceId": "SYSTEM_PLUGIN"
},
{
"id": "ENTERPRISE_REPORT:READ+EXPORT",
"name": "发送邮件",
"resourceId": "ENTERPRISE_REPORT",
"license": true
},
{
"id": "ENTERPRISE_REPORT:READ+CREATE",
"name": "创建报告",
"resourceId": "ENTERPRISE_REPORT",
"license": true
},
{
"id": "ENTERPRISE_REPORT:READ+DELETE",
"name": "删除报告",
"resourceId": "ENTERPRISE_REPORT",
"license": true
},
{
"id": "ENTERPRISE_REPORT:READ+COPY",
"name": "复制报告",
"resourceId": "ENTERPRISE_REPORT",
"license": true
},
{
"id": "ENTERPRISE_REPORT:READ+EDIT",
"name": "修改报告",
"resourceId": "ENTERPRISE_REPORT",
"license": true
}
],
"resource": [
@ -973,6 +1003,10 @@
"id": "PROJECT_REPORT_ANALYSIS",
"name": "报表"
},
{
"id": "ENTERPRISE_REPORT",
"name": "项目报告"
},
{
"id": "SYSTEM_PLUGIN",
"name": "插件管理"

View File

@ -21,7 +21,7 @@
:disabled="readOnly"
class="tag-input el-input"
v-model="newTag"
:placeholder="$t('commons.tag_tip')"
:placeholder=defaultPlaceHolder
@keydown.delete.stop="removeLastTag"
@keydown="addNew"
@blur="addNew"/>
@ -33,6 +33,9 @@
name: 'MsInputTag',
props: {
currentScenario: {},
placeholder: {
type: String,
},
addTagOnKeys: {
type: Array,
default: () => [13, 188, 9]
@ -51,9 +54,13 @@
if (!this.currentScenario[this.prop]) {
this.currentScenario[this.prop] = [];
}
if(this.placeholder){
this.defaultPlaceHolder = this.placeholder;
}
},
data() {
return {
defaultPlaceHolder: this.$t('commons.tag_tip'),
newTag: '',
innerTags: this.currentScenario[this.prop] ? [...this.currentScenario[this.prop]] : []
}

View File

@ -0,0 +1,31 @@
<template>
<el-col>
<report-statistics-header-menus/>
<div>
<transition>
<keep-alive>
<router-view :baseUrl="baseUrl"/>
</keep-alive>
</transition>
</div>
</el-col>
</template>
<script>
import ReportStatisticsHeaderMenus from "@/business/components/reportstatistics/header/ReportStatisticsHeaderMenus";
export default {
name: "ReportStatistics",
components: {ReportStatisticsHeaderMenus},
data() {
return {
baseUrl: "report"
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,76 @@
<template>
<div id="menu-bar" v-if="isRouterAlive">
<el-row type="flex">
<project-change :project-name="currentProject"/>
<el-col :span="14">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
<el-menu-item :index="'/report/projectStatistics'">
{{ $t("commons.report_statistics.menu.project_statistics") }}
</el-menu-item>
<el-menu-item :index="'/report/projectReport'" v-if="licenseCheck" v-permission="['PROJECT_API_DEFINITION:READ']">
{{ $t("commons.report_statistics.menu.project_report") }}
</el-menu-item>
</el-menu>
</el-col>
</el-row>
</div>
</template>
<script>
import ProjectChange from "@/business/components/common/head/ProjectSwitch";
import {hasLicense, hasPermission} from "@/common/js/utils";
export default {
name: "ReportStatisticsHeaderMenus",
components: {ProjectChange},
data() {
return {
licenseCheck: false,
isProjectActivation: true,
isRouterAlive: true,
apiTestProjectPath: '',
currentProject: ''
};
},
methods: {
hasPermission,
hasLicense,
reload() {
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
});
},
},
mounted() {
},
created() {
if(this.hasLicense()){
this.licenseCheck = true;
}
}
};
</script>
<style scoped>
#menu-bar {
border-bottom: 1px solid #E6E6E6;
background-color: #FFF;
}
.menu-divider {
margin: 0;
}
.blank_item {
display: none;
}
.deactivation >>> .el-submenu__title {
border-bottom: white !important;
}
</style>

View File

@ -51,11 +51,12 @@
</template>
<script>
import ReportCard from "./ReportCard";
import TestAnalysisContainer from "./track/TestAnalysisContainer";
import ReportCard from "@/business/components/reportstatistics/projectstatistics/ReportCard";
import TestAnalysisContainer from "@/business/components/reportstatistics/projectstatistics/track/TestAnalysisContainer";
import MsDrawer from "@/business/components/common/components/MsDrawer";
import ReportHeader from './base/ReportHeader';
import TestCaseCountContainer from "./casecount/TestCaseCountContainer";
import ReportHeader from "@/business/components/reportstatistics/base/ReportHeader";
import TestCaseCountContainer from "@/business/components/reportstatistics/projectstatistics/casecount/TestCaseCountContainer";
export default {
name: "ReportAnalysis",

View File

@ -3,7 +3,7 @@
<el-row>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col" @click.native="openCard('trackTestCase')">
<img src="../../../assets/track.jpg" class="image">
<img src="@/assets/track.jpg" class="image">
<div style="padding: 10px;">
<span>{{$t('commons.report_statistics.test_case_analysis')}}</span>
<div class="bottom clearfix">
@ -14,7 +14,7 @@
</el-col>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col" @click.native="openCard('countTestCase')">
<img src="../../../assets/track.jpg" class="image">
<img src="@/assets/track.jpg" class="image">
<div style="padding: 10px;">
<span>{{$t('commons.report_statistics.test_case_count')}}</span>
<div class="bottom clearfix">
@ -25,7 +25,7 @@
</el-col>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col">
<img src="../../../assets/other.png" class="image">
<img src="@/assets/other.png" class="image">
<div style="padding: 10px;">
<span>预留模块敬请期待</span>
<div class="bottom clearfix">
@ -36,7 +36,7 @@
</el-col>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col">
<img src="../../../assets/other.png" class="image">
<img src="@/assets/other.png" class="image">
<div style="padding: 10px;">
<span>预留模块敬请期待</span>
<div class="bottom clearfix">
@ -47,7 +47,7 @@
</el-col>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col">
<img src="../../../assets/other.png" class="image">
<img src="@/assets/other.png" class="image">
<div style="padding: 10px;">
<span>预留模块敬请期待</span>
<div class="bottom clearfix">
@ -58,7 +58,7 @@
</el-col>
<el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col">
<img src="../../../assets/other.png" class="image">
<img src="@/assets/other.png" class="image">
<div style="padding: 10px;">
<span>预留模块敬请期待</span>
<div class="bottom clearfix">

View File

@ -25,11 +25,11 @@
<script>
import TestCaseCountChart from "./chart/TestCaseCountChart";
import TestCaseCountTable from "@/business/components/reportstatistics/casecount/table/TestCaseCountTable";
import TestCaseCountTable from "@/business/components/reportstatistics/projectstatistics/casecount/table/TestCaseCountTable";
import TestCaseCountFilter from "./filter/TestCaseCountFilter";
import {exportPdf,getCurrentProjectID} from "@/common/js/utils";
import html2canvas from 'html2canvas';
import HistoryReportData from "../base/HistoryReportData";
import HistoryReportData from "../../base/HistoryReportData";
export default {
name: "TestCaseCountContainer",

View File

@ -3,7 +3,7 @@
<el-card class="ms-test-chart" :style="{ width: w+'px', height: h + 'px'}" ref="msDrawer">
<el-row class="ms-row">
<p class="tip"><span style="margin-left: 5px"></span> {{$t('commons.report_statistics.chart')}} </p>
<div class="ms-test-chart-header">
<div class="ms-test-chart-header" v-if="!readOnly">
<el-dropdown @command="exportCommand" :hide-on-click="false">
<span class="el-dropdown-link">
{{ $t('commons.export') }}<i class="el-icon-arrow-down el-icon--right"></i>
@ -44,6 +44,8 @@
loadOption: {},
pieOption: {},
chartWidth:Number,
needFullScreen: Boolean,
readOnly:Boolean,
},
data() {
return {
@ -146,6 +148,10 @@
},
created() {
this.dataOption = this.loadOption;
if(this.needFullScreen){
this.w = document.documentElement.clientWidth;
}
this.reload();
},
watch:{
chartWidth(){
@ -153,7 +159,7 @@
},
chartType(){
this.countChartWidth();
}
},
},
methods: {
countChartWidth(){
@ -180,7 +186,7 @@
reload() {
this.loading = true
this.$nextTick(() => {
this.loading = false
this.loading = false;
})
},
fullScreen() {
@ -197,6 +203,22 @@
this.isFullScreen = false;
this.$emit('hidePage', false);
},
getImages(command){
let imageType = 'image/png';
if(command === 'jpg'){
imageType = 'image/jpg';
}
let returnImageDatas = "";
if (document.getElementById('picChart')) {
let chartsCanvas = document.getElementById('picChart').querySelectorAll('canvas')[0];
if (chartsCanvas) {
// toDataURL()canvascanvasbase64
returnImageDatas = chartsCanvas && chartsCanvas.toDataURL(imageType);
}
}
this.$emit("getImage",returnImageDatas);
return returnImageDatas;
},
exportCommand(command){
let fileName = 'report_pic.'+command;
if (document.getElementById('picChart')) {

View File

@ -242,8 +242,6 @@ export default {
this.lineDivHeight = 0;
setTimeout(() => {
let itemOptions = document.getElementsByName("itemOptions");
// let optionTypeDiv = document.getElementById("moreOptionTypeDiv");
// if(optionTypeDiv){
if(itemOptions && itemOptions.length > 1){
let optionTypeHeight = 0;
for(let i = 0; i < itemOptions.length; i ++){
@ -260,17 +258,7 @@ export default {
let divMarginBottom = ((endHeight-32)/2+16);
this.lineDivBottomHeight = ((optionTypeHeight - 32 - this.lineDivTopHeight - this.lineDivMarginTopHeight - divMarginBottom ));
}
// }
}, 100);
// moreOptionTypeDiv
// if(this.option.filters.length > 1){
// let countPageHeight = (this.option.filters.length)* 32 + (this.option.filters.length-1)*5;
// if(countPageHeight > 32){
// this.lineDivHeight = (countPageHeight-32)/2-11;
// }
// }
});
},
deep: true

View File

@ -58,6 +58,12 @@
tableData: Array,
groupName: String,
showColoums: Array,
fullScreen: {
type: Boolean,
default(){
return false;
}
}
},
data() {
return {
@ -68,6 +74,9 @@
},
created() {
this.getTableHeight();
if(this.fullScreen){
this.w = document.documentElement.clientWidth;
}
},
methods: {
isShowColumn(type){

View File

@ -29,7 +29,7 @@
import TestAnalysisFilter from "./filter/TestAnalysisFilter";
import {exportPdf, getCurrentProjectID} from "@/common/js/utils";
import html2canvas from 'html2canvas';
import HistoryReportData from "../base/HistoryReportData";
import HistoryReportData from "../../base/HistoryReportData";
export default {
name: "TestAnalysisContainer",

View File

@ -1,16 +1,20 @@
const reportForm = () => import('./ReportAnalysis');
export default {
path: "/report",
name: "report",
redirect: "/report/home",
redirect: "/report/projectStatistics",
components: {
content: reportForm
content: () => import('@/business/components/reportstatistics/ReportStatistics'),
},
children: [
{
path: 'home',
name: 'reportHome',
path: '/report/projectStatistics',
name: 'projectStatistics',
component: () => import('@/business/components/reportstatistics/projectstatistics/ProjectStatistics'),
},
{
path: "/report/projectReport",
name: "projectReport",
component: () => import('@/business/components/xpack/reportstatistics/projectreport/ProjectReport'),
},
]
}

@ -1 +1 @@
Subproject commit 68864064605120b89411764d12eb23cef5d6d898
Subproject commit 9be7e14d614bebe196904a706b163048f8b9b2d4

View File

@ -279,6 +279,18 @@ export default {
default_module: "Default module",
},
report_statistics: {
menu: {
project_statistics: "Project statistics",
project_report: "Project report",
},
project_report: {
create_report: "Create report",
report_name: "Report name",
report_send_time: "Send time",
report_send_freq: "Send frequence",
report_detail: "Report detail",
show: "Show",
},
title: "Report Statistics",
test_case_analysis: "Test case analysis",
test_case_activity: "Test case activity",
@ -2202,5 +2214,10 @@ export default {
script_entry: "Script execution entry",
plugin_id: "Plug-in id",
script_view: "View script",
},
mail: {
mail_subject: "Subject ",
mail_addressee: "To ",
mail_duplicate: "Cc ",
}
};

View File

@ -280,6 +280,18 @@ export default {
default_module: "默认模块",
},
report_statistics: {
menu: {
project_statistics: "项目报表",
project_report: "项目报告",
},
project_report: {
create_report: "创建报告",
report_name: "报告名称",
report_send_time: "发送时间",
report_send_freq: "发送频率",
report_detail: "报告内容",
show: "查看",
},
title: "报表统计",
test_case_analysis: "测试用例趋势",
test_case_activity: "测试用例活动情况",
@ -2214,5 +2226,10 @@ export default {
script_entry: "脚本执行入口",
plugin_id: "插件ID",
script_view: "查看脚本",
},
mail: {
mail_subject: "邮件主题",
mail_addressee: "收件人",
mail_duplicate: "抄送人",
}
};

View File

@ -280,6 +280,18 @@ export default {
default_module: "默認模塊",
},
report_statistics: {
menu: {
project_statistics: "項目報表",
project_report: "項目報告",
},
project_report: {
create_report: "創建報告",
report_name: "報告名稱",
report_send_time: "發送時間",
report_send_freq: "發送頻率",
report_detail: "報告內容",
show: "查看",
},
title: "報表統計",
test_case_analysis: "測試用例趨勢",
test_case_activity: "測試用例活動情況",
@ -2213,5 +2225,10 @@ export default {
script_entry: "腳本執行入口",
plugin_id: "插件ID",
script_view: "查看腳本",
},
mail: {
mail_subject: "郵件主題",
mail_addressee: "收件人",
mail_duplicate: "抄送人",
}
};