fix: 修复创建测试计划时重复提交,成功创建多个相同的计划

This commit is contained in:
Captain.B 2020-11-23 18:36:56 +08:00
parent 6d3b3ccfa4
commit c0b4b813f3

View File

@ -141,7 +141,7 @@ public class TestPlanService {
} }
} }
public List<TestPlan> getTestPlanByName(String name) { public synchronized List<TestPlan> getTestPlanByName(String name) {
TestPlanExample example = new TestPlanExample(); TestPlanExample example = new TestPlanExample();
example.createCriteria().andWorkspaceIdEqualTo(SessionUtils.getCurrentWorkspaceId()) example.createCriteria().andWorkspaceIdEqualTo(SessionUtils.getCurrentWorkspaceId())
.andNameEqualTo(name); .andNameEqualTo(name);