fix(测试计划): 修改测试计划展开时报错workspase为空的问题

--bug=1026160 --user=宋天阳 【测试跟踪】进入测试计划详情报错
https://www.tapd.cn/55049933/s/1371443
This commit is contained in:
song-tianyang 2023-05-15 15:45:07 +08:00 committed by 建国
parent b87a832882
commit 344a6938bd
1 changed files with 7 additions and 1 deletions

View File

@ -293,7 +293,13 @@ public class TestPlanService {
&& res.getActualStartTime() == null) {
testPlan.setActualStartTime(System.currentTimeMillis());
}
testPlanMapper.updateByPrimaryKeyWithBLOBs(testPlan);
if (testPlan.getName() == null) {
// 若是点击该测试计划则仅更新了updateTime其它字段全为null使用updateByPrimaryKeySelective
testPlanMapper.updateByPrimaryKeySelective(testPlan);
} else {
// 有修改字段的调用为保证将某些时间置null的情况使用updateByPrimaryKey
testPlanMapper.updateByPrimaryKeyWithBLOBs(testPlan); // 更新
}
return testPlanMapper.selectByPrimaryKey(testPlan.getId());
}