首页推荐案例查询bug修复

This commit is contained in:
buerjun
2023-06-29 10:46:03 +08:00
parent 995d3e1787
commit f353116ce2
2 changed files with 5 additions and 10 deletions

View File

@@ -934,11 +934,11 @@ public class CasesServiceImpl implements ICasesService {
List<Cases> result = new ArrayList<>(); List<Cases> result = new ArrayList<>();
try { try {
String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and b.deleted = false group by a.caseId ORDER By a.pushTime DESC"; String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and b.deleted = false group by a.caseId ORDER By a.pushTime DESC";
List<Object[]> listFields = casesRecommendDao.findListFields(hql, CASE_LEN, accountId); List<String> listFields = casesRecommendDao.findListFields(hql, CASE_LEN, ListUtil.toList(accountId));
List<Long> caseIds = new ArrayList<>(); List<String> caseIds = new ArrayList<>();
if (CollUtil.isNotEmpty(listFields)) { if (CollUtil.isNotEmpty(listFields)) {
for (Object[] objs : listFields) { for (String objs : listFields) {
caseIds.add(resultToVo(objs)); caseIds.add(objs);
} }
} }
int caseIdLen = caseIds.size(); int caseIdLen = caseIds.size();
@@ -983,11 +983,6 @@ public class CasesServiceImpl implements ICasesService {
return casesVos; return casesVos;
} }
private Long resultToVo(Object[] objs) {
Long caseId = (Long) objs[0];
return caseId;
}
@Override @Override
public void excellent(String id, Boolean excellent) { public void excellent(String id, Boolean excellent) {
//取消时,把时间清空 //取消时,把时间清空

View File

@@ -53,7 +53,7 @@ class CasesServiceImplTest {
@Test @Test
void queryCaseV2() { void queryCaseV2() {
CurrentUser currentUser = new CurrentUser(); CurrentUser currentUser = new CurrentUser();
currentUser.setAccountId("12323"); currentUser.setAccountId("965342027497607168");
List<CasesVo> list = casesService.caseIndexV2(currentUser); List<CasesVo> list = casesService.caseIndexV2(currentUser);
System.out.println(list); System.out.println(list);
} }