fix: 创建测试计划报错

This commit is contained in:
chenjianxing 2021-10-12 16:12:41 +08:00 committed by jianxing
parent 83ef71276a
commit fd6bd5dd7c
1 changed files with 7 additions and 5 deletions

View File

@ -202,11 +202,13 @@ public class TestPlanService {
String planId = testPlan.getId();
List<String> principals = testPlan.getPrincipals();
for (String principal : principals) {
TestPlanPrincipal testPlanPrincipal = new TestPlanPrincipal();
testPlanPrincipal.setTestPlanId(planId);
testPlanPrincipal.setPrincipalId(principal);
testPlanPrincipalService.insert(testPlanPrincipal);
if (!CollectionUtils.isEmpty(principals)) {
for (String principal : principals) {
TestPlanPrincipal testPlanPrincipal = new TestPlanPrincipal();
testPlanPrincipal.setTestPlanId(planId);
testPlanPrincipal.setPrincipalId(principal);
testPlanPrincipalService.insert(testPlanPrincipal);
}
}
if (StringUtils.isBlank(testPlan.getProjectId())) {