fit: 解决冲突
This commit is contained in:
parent
9a9f8f628b
commit
21f8e54069
|
@ -39,7 +39,6 @@ import io.metersphere.track.request.testplan.LoadCaseRequest;
|
||||||
import io.metersphere.track.request.testplan.RunTestPlanRequest;
|
import io.metersphere.track.request.testplan.RunTestPlanRequest;
|
||||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
@ -171,33 +170,30 @@ public class TestPlanService {
|
||||||
checkTestPlanExist(testPlan);
|
checkTestPlanExist(testPlan);
|
||||||
TestPlan res = testPlanMapper.selectByPrimaryKey(testPlan.getId()); // 先查一次库
|
TestPlan res = testPlanMapper.selectByPrimaryKey(testPlan.getId()); // 先查一次库
|
||||||
if (!res.getStatus().equals(testPlan.getStatus())) { // 若有改变才更新时间
|
if (!res.getStatus().equals(testPlan.getStatus())) { // 若有改变才更新时间
|
||||||
res.setUpdateTime(System.currentTimeMillis());
|
testPlan.setUpdateTime(System.currentTimeMillis());
|
||||||
if (TestPlanStatus.Underway.name().equals(testPlan.getStatus())) {
|
if (TestPlanStatus.Underway.name().equals(testPlan.getStatus())) {
|
||||||
if (res.getStatus().equals(TestPlanStatus.Prepare.name())) {
|
if (res.getStatus().equals(TestPlanStatus.Prepare.name())) {
|
||||||
res.setActualStartTime(System.currentTimeMillis());
|
testPlan.setActualStartTime(System.currentTimeMillis());
|
||||||
} // 未开始->进行中,写入实际开始时间
|
} // 未开始->进行中,写入实际开始时间
|
||||||
else if (res.getStatus().equals(TestPlanStatus.Completed.name())) {
|
else if (res.getStatus().equals(TestPlanStatus.Completed.name())) {
|
||||||
res.setActualEndTime(null);
|
testPlan.setActualEndTime(null);
|
||||||
} // 已完成->进行中,结束时间置空
|
} // 已完成->进行中,结束时间置空
|
||||||
} else if (!StringUtils.equals(res.getStatus(), TestPlanStatus.Prepare.name()) &&
|
} else if (!res.getStatus().equals(TestPlanStatus.Prepare.name()) &&
|
||||||
StringUtils.equals(testPlan.getStatus(), TestPlanStatus.Prepare.name())) {
|
testPlan.getStatus().equals(TestPlanStatus.Prepare.name())) {
|
||||||
res.setActualStartTime(null);
|
testPlan.setActualStartTime(null);
|
||||||
res.setActualEndTime(null);
|
testPlan.setActualEndTime(null);
|
||||||
} // 非未开始->未开始,时间都置空
|
} // 非未开始->未开始,时间都置空
|
||||||
else if (TestPlanStatus.Completed.name().equals(testPlan.getStatus()) &&
|
else if (TestPlanStatus.Completed.name().equals(testPlan.getStatus()) &&
|
||||||
!TestPlanStatus.Completed.name().equals(res.getStatus())) {
|
!TestPlanStatus.Completed.name().equals(res.getStatus())) {
|
||||||
//已完成,写入实际完成时间
|
//已完成,写入实际完成时间
|
||||||
res.setActualEndTime(System.currentTimeMillis());
|
testPlan.setActualEndTime(System.currentTimeMillis());
|
||||||
}
|
|
||||||
if(StringUtils.isNotEmpty(testPlan.getStatus())){
|
|
||||||
res.setStatus(testPlan.getStatus());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> userIds = new ArrayList<>();
|
List<String> userIds = new ArrayList<>();
|
||||||
userIds.add(testPlan.getPrincipal());
|
userIds.add(testPlan.getPrincipal());
|
||||||
AddTestPlanRequest testPlans = new AddTestPlanRequest();
|
AddTestPlanRequest testPlans = new AddTestPlanRequest();
|
||||||
int i = testPlanMapper.updateByPrimaryKey(res); // 更新
|
int i = testPlanMapper.updateByPrimaryKey(testPlan); // 更新
|
||||||
if (!StringUtils.isBlank(testPlan.getStatus())) {
|
if (!StringUtils.isBlank(testPlan.getStatus())) {
|
||||||
BeanUtils.copyBean(testPlans, getTestPlan(testPlan.getId()));
|
BeanUtils.copyBean(testPlans, getTestPlan(testPlan.getId()));
|
||||||
String context = getTestPlanContext(testPlans, NoticeConstants.Event.UPDATE);
|
String context = getTestPlanContext(testPlans, NoticeConstants.Event.UPDATE);
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
},
|
},
|
||||||
setBodyType() {
|
setBodyType() {
|
||||||
if (!this.response.responseResult.headers) {
|
if (!this.response.responseResult || !this.response.responseResult.headers) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.response.responseResult.headers.indexOf("Content-Type: application/json") > 0) {
|
if (this.response.responseResult.headers.indexOf("Content-Type: application/json") > 0) {
|
||||||
|
|
Loading…
Reference in New Issue