fix(接口测试): 缺陷修改状态不生效

--bug=1045011 --user=陈建星 [项目管理]GitHub#32558在缺陷模板中,对状态字段进行修改新增了枚举值,保存模版后。缺陷管理中已提交缺陷的状态字段全部失效。 https://www.tapd.cn/55049933/s/1565876
This commit is contained in:
AgAngle 2024-08-20 16:43:43 +08:00 committed by jianxing
parent 2846e8461b
commit 655bc5c7da
1 changed files with 16 additions and 13 deletions

View File

@ -763,14 +763,15 @@ public class IssuesService {
Map<String, String> globalProjectIdMap = getGlobalProjectIdMap(data.get(0).getProjectId());
fieldMap.values().forEach(fields ->
fieldMap.values().forEach(fields -> {
Set<String> fileIdSet = fields.stream().map(CustomFieldDao::getId).collect(Collectors.toSet());
fields.forEach(field -> {
// 如果是全局字段, 并且项目中有对应的字段, 则替换为项目字段
if (globalProjectIdMap.containsKey(field.getId())) {
if (globalProjectIdMap.containsKey(field.getId()) && !fileIdSet.contains(globalProjectIdMap.get(field.getId()))) {
field.setId(globalProjectIdMap.get(field.getId()));
}
})
);
});
});
data.forEach(i -> i.setFields(fieldMap.get(i.getId())));
}
@ -814,7 +815,8 @@ public class IssuesService {
customFieldDao.setId(i.getFieldId());
customFieldDao.setValue(i.getValue());
customFieldDao.setTextValue(i.getTextValue());
if (globalProjectIdMap.containsKey(i.getFieldId())) {
Set<String> fileIdSet = fields.stream().map(CustomFieldDao::getId).collect(Collectors.toSet());
if (globalProjectIdMap.containsKey(i.getFieldId()) && !fileIdSet.contains(globalProjectIdMap.get(i.getFieldId()))) {
// 如果是全局字段, 并且项目中有对应的字段, 则替换为项目字段
customFieldDao.setId(globalProjectIdMap.get(i.getFieldId()));
}
@ -891,14 +893,15 @@ public class IssuesService {
}
Map<String, String> globalProjectIdMap = getGlobalProjectIdMap(data.get(0).getProjectId());
fieldMap.values().forEach(fields ->
fields.forEach(field -> {
// 如果是全局字段, 并且项目中有对应的字段, 则替换为项目字段
if (globalProjectIdMap.containsKey(field.getId())) {
field.setId(globalProjectIdMap.get(field.getId()));
}
})
);
fieldMap.values().forEach(fields -> {
Set<String> fileIdSet = fields.stream().map(CustomFieldDao::getId).collect(Collectors.toSet());
fields.forEach(field -> {
// 如果是全局字段, 并且项目中有对应的字段, 则替换为项目字段
if (globalProjectIdMap.containsKey(field.getId()) && !fileIdSet.contains(globalProjectIdMap.get(field.getId()))) {
field.setId(globalProjectIdMap.get(field.getId()));
}
});
});
data.forEach(i -> i.setFields(fieldMap.get(i.getId())));
} catch (Exception e) {