update:增加test_plan表插入新增实际字段的逻辑
This commit is contained in:
parent
96dc485e77
commit
399df44978
|
@ -95,6 +95,10 @@ public class TestPlanService {
|
|||
|
||||
testPlan.setId(testPlanId);
|
||||
testPlan.setStatus(TestPlanStatus.Prepare.name());
|
||||
testPlan.setPlannedStartTime(System.currentTimeMillis());
|
||||
testPlan.setPlannedEndTime(System.currentTimeMillis());
|
||||
testPlan.setActualStartTime(System.currentTimeMillis());
|
||||
testPlan.setActualEndTime(System.currentTimeMillis());
|
||||
testPlan.setCreateTime(System.currentTimeMillis());
|
||||
testPlan.setUpdateTime(System.currentTimeMillis());
|
||||
testPlanMapper.insert(testPlan);
|
||||
|
@ -111,11 +115,20 @@ public class TestPlanService {
|
|||
return Optional.ofNullable(testPlanMapper.selectByPrimaryKey(testPlanId)).orElse(new TestPlan());
|
||||
}
|
||||
|
||||
public int editTestPlan(TestPlanDTO testPlan) {
|
||||
editTestPlanProject(testPlan);
|
||||
public int editTestPlan(TestPlan testPlan) {
|
||||
testPlan.setUpdateTime(System.currentTimeMillis());
|
||||
checkTestPlanExist(testPlan);
|
||||
return testPlanMapper.updateByPrimaryKeySelective(testPlan);
|
||||
//进行中状态,写入实际开始时间
|
||||
if ("Underway".equals(testPlan.getStatus())) {
|
||||
testPlan.setActualStartTime(System.currentTimeMillis());
|
||||
return testPlanMapper.updateByPrimaryKeySelective(testPlan);
|
||||
} else if("Completed".equals(testPlan.getStatus())){
|
||||
//已完成,写入实际完成时间
|
||||
testPlan.setActualEndTime(System.currentTimeMillis());
|
||||
return testPlanMapper.updateByPrimaryKeySelective(testPlan);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void editTestPlanProject(TestPlanDTO testPlan) {
|
||||
|
|
Loading…
Reference in New Issue