作业导出,案例类型处理代码回退版本

This commit is contained in:
yang
2024-09-27 22:38:35 +08:00
parent e3c060b8d9
commit 516225f52e
2 changed files with 20 additions and 2 deletions

View File

@@ -132,7 +132,25 @@ public class CasesApi extends ApiBaseController {
views = casesService.queryPageCasesV2(req); views = casesService.queryPageCasesV2(req);
} }
if (views == null) { if (views != null) {
List<Cases> cases = views.getList();
if (CollUtil.isNotEmpty(cases)) {
for (Cases c : cases) {
StringBuffer stringBuffer = new StringBuffer();
List<CasesMajorType> caseId = casesMajorTypeDao.findList(FieldFilters.eq("caseId", c.getId()));
if (caseId != null && !caseId.isEmpty()) {
for (CasesMajorType cm : caseId) {
stringBuffer.append(cm.getMajorId());
stringBuffer.append(",");
}
}
if (stringBuffer.length() > 0) {
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
c.setMajorType(stringBuffer.toString());
}
}
}
} else {
views = new PageList(); views = new PageList();
views.setList(Collections.emptyList()); views.setList(Collections.emptyList());
views.setPageSize(req.getPageSize()); views.setPageSize(req.getPageSize());

View File

@@ -422,7 +422,7 @@ public class CasesServiceImpl implements ICasesService {
//2.标签处理,添加作者标签和新的案例标签 //2.标签处理,添加作者标签和新的案例标签
addAuthorTagAndCaseNewTag(casesList); addAuthorTagAndCaseNewTag(casesList);
//3.案例类型处理 //3.案例类型处理
majorTypeHandle(casesList); // majorTypeHandle(casesList);
return casesList; return casesList;
} }