fix(测试跟踪): 缺陷自定义字段排序有误

--bug=1025923 --user=陈建星 【测试跟踪】github#24032,【模板设置】模板设置处设置时间选择器的字段,在缺陷管理页面,点击该字段进行排序,排序后的结果还是乱的 https://www.tapd.cn/55049933/s/1367681
This commit is contained in:
chenjianxing 2023-04-27 15:59:34 +08:00 committed by jianxing
parent d6a6cf10a2
commit e9e0e54cf1
1 changed files with 16 additions and 8 deletions

View File

@ -659,14 +659,7 @@ public class IssuesService {
public List<IssuesDao> list(IssuesRequest request) { public List<IssuesDao> list(IssuesRequest request) {
request.setOrders(ServiceUtils.getDefaultOrderByField(request.getOrders(), "create_time")); request.setOrders(ServiceUtils.getDefaultOrderByField(request.getOrders(), "create_time"));
request.getOrders().forEach(order -> { setCustomFieldsOrder(request);
if (StringUtils.isNotEmpty(order.getName()) && order.getName().startsWith("custom")) {
request.setIsCustomSorted(true);
request.setCustomFieldId(order.getName().replace("custom_", StringUtils.EMPTY));
order.setPrefix("cfi");
order.setName("value");
}
});
ServiceUtils.setBaseQueryRequestCustomMultipleFields(request); ServiceUtils.setBaseQueryRequestCustomMultipleFields(request);
List<IssuesDao> issues = extIssuesMapper.getIssues(request); List<IssuesDao> issues = extIssuesMapper.getIssues(request);
@ -696,6 +689,21 @@ public class IssuesService {
return issues; return issues;
} }
private void setCustomFieldsOrder(IssuesRequest request) {
request.getOrders().forEach(order -> {
if (StringUtils.isNotEmpty(order.getName()) && order.getName().startsWith("custom")) {
request.setIsCustomSorted(true);
String customId = order.getName().replace("custom_multiple-", StringUtils.EMPTY)
.replace("custom_single-", StringUtils.EMPTY)
.replace("custom_", StringUtils.EMPTY)
.replace("custom-", StringUtils.EMPTY);
request.setCustomFieldId(customId);
order.setPrefix("cfi");
order.setName("value");
}
});
}
private void buildDescription(List<IssuesDao> issues) { private void buildDescription(List<IssuesDao> issues) {
issues.forEach(issuesDao -> { issues.forEach(issuesDao -> {
if(!issuesDao.getDescription().contains("filename=")){ if(!issuesDao.getDescription().contains("filename=")){