fix_用例评审_关注人报错 --bug=1007510 --user=王孝刚 【测试跟踪】编辑用例评审报错 https://www.tapd.cn/55049933/s/1059880
This commit is contained in:
parent
23a0745cb4
commit
9242700b93
|
@ -266,13 +266,12 @@ public class TestCaseReviewService {
|
|||
private void editCaseRevieweFollow(SaveTestCaseReviewRequest testCaseReview) {
|
||||
// 要更新的follows
|
||||
List<String> follows = testCaseReview.getFollowIds();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(follows)) {
|
||||
String id = testCaseReview.getId();
|
||||
TestCaseReviewFollowExample testCaseReviewfollowExample = new TestCaseReviewFollowExample();
|
||||
testCaseReviewfollowExample.createCriteria().andReviewIdEqualTo(id);
|
||||
List<TestCaseReviewFollow> testCaseReviewFollows = testCaseReviewFollowMapper.selectByExample(testCaseReviewfollowExample);
|
||||
List<String> dbReviewIds = testCaseReviewFollows.stream().map(TestCaseReviewFollow::getFollowId).collect(Collectors.toList());
|
||||
|
||||
follows.forEach(followId -> {
|
||||
if (!dbReviewIds.contains(followId)) {
|
||||
TestCaseReviewFollow caseReviewFollow = new TestCaseReviewFollow();
|
||||
|
@ -281,10 +280,15 @@ public class TestCaseReviewService {
|
|||
testCaseReviewFollowMapper.insertSelective(caseReviewFollow);
|
||||
}
|
||||
});
|
||||
|
||||
TestCaseReviewFollowExample example = new TestCaseReviewFollowExample();
|
||||
example.createCriteria().andReviewIdEqualTo(id).andFollowIdNotIn(follows);
|
||||
testCaseReviewFollowMapper.deleteByExample(example);
|
||||
}else {
|
||||
TestCaseReviewFollowExample example = new TestCaseReviewFollowExample();
|
||||
example.createCriteria().andReviewIdEqualTo(testCaseReview.getId());
|
||||
testCaseReviewFollowMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void checkCaseReviewExist(TestCaseReview testCaseReview) {
|
||||
|
|
|
@ -255,7 +255,6 @@ public class TestPlanService {
|
|||
}
|
||||
}
|
||||
List<String> follows = request.getFollows();
|
||||
if (!CollectionUtils.isEmpty(follows)) {
|
||||
if (StringUtils.isNotBlank(request.getId())) {
|
||||
testPlanFollowService.deleteTestPlanFollowByPlanId(request.getId());
|
||||
for (String follow : follows) {
|
||||
|
@ -265,7 +264,7 @@ public class TestPlanService {
|
|||
testPlanFollowService.insert(testPlanFollow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.editTestPlan(request);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue