fix: --bug=1007733 --user=陈建星 【功能用例】在功能用例模块下,批量修改责任人后,所有用例的自定义字段被随机重置为相同值、用例状态被重置为未开始、用例等级被重置为P0 https://www.tapd.cn/55049933/s/1064242

This commit is contained in:
chenjianxing 2021-11-04 16:21:31 +08:00 committed by jianxing
parent 631f84a9ce
commit f27134e403
1 changed files with 4 additions and 4 deletions

View File

@ -1230,9 +1230,6 @@ public class TestCaseService {
if (CollectionUtils.isEmpty(ids)) {
return;
}
TestCaseExample example = new TestCaseExample();
example.createCriteria().andIdIn(request.getIds());
if (request.getCustomField() != null) {
List<TestCaseWithBLOBs> testCases = extTestCaseMapper.getCustomFieldsByIds(ids);
testCases.forEach((testCase) -> {
@ -1261,7 +1258,8 @@ public class TestCaseService {
}
testCase.setCustomFields(JSONObject.toJSONString(fields));
testCase.setUpdateTime(System.currentTimeMillis());
testCase.setId(null);
TestCaseExample example = new TestCaseExample();
example.createCriteria().andIdEqualTo(testCase.getId());
testCaseMapper.updateByExampleSelective(testCase, example);
});
} else {
@ -1269,6 +1267,8 @@ public class TestCaseService {
TestCaseWithBLOBs batchEdit = new TestCaseWithBLOBs();
BeanUtils.copyBean(batchEdit, request);
batchEdit.setUpdateTime(System.currentTimeMillis());
TestCaseExample example = new TestCaseExample();
example.createCriteria().andIdIn(request.getIds());
testCaseMapper.updateByExampleSelective(batchEdit, example);
}
}