Commit 4252031c authored by 赵啸非's avatar 赵啸非

添加材料数量统计

parent a0531a61
...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.baseset.service.impl; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.baseset.service.impl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.baseset.dao.BasesetDao; import com.mortals.xhx.module.baseset.dao.BasesetDao;
...@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -36,7 +38,13 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base ...@@ -36,7 +38,13 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base
@Override @Override
protected void findAfter(BasesetEntity params, PageInfo pageInfo, Context context, List<BasesetEntity> list) throws AppException { protected void findAfter(BasesetEntity params, PageInfo pageInfo, Context context, List<BasesetEntity> list) throws AppException {
list.forEach(item -> { list.forEach(item -> {
List<HotwordEntity> hotwordEntities = hotwordService.find(new HotwordQuery().siteId(item.getSiteId())); HotwordQuery hotwordQuery = new HotwordQuery();
hotwordQuery.siteId(item.getSiteId());
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("wordsSource", OrderCol.ASCENDING));
orderColList.add(new OrderCol("searchCount", OrderCol.DESCENDING));
hotwordQuery.setOrderColList(orderColList);
List<HotwordEntity> hotwordEntities = hotwordService.find(hotwordQuery);
item.setHotwordList(hotwordEntities); item.setHotwordList(hotwordEntities);
}); });
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
......
...@@ -192,8 +192,8 @@ public class HomeController extends BaseJsonBodyController { ...@@ -192,8 +192,8 @@ public class HomeController extends BaseJsonBodyController {
HotwordQuery hotwordQuery = new HotwordQuery(); HotwordQuery hotwordQuery = new HotwordQuery();
hotwordQuery.siteId(homeQueryPdu.getSiteId()); hotwordQuery.siteId(homeQueryPdu.getSiteId());
List<OrderCol> orderColList = new ArrayList<>(); List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("searchCount", OrderCol.DESCENDING));
orderColList.add(new OrderCol("wordsSource", OrderCol.ASCENDING)); orderColList.add(new OrderCol("wordsSource", OrderCol.ASCENDING));
orderColList.add(new OrderCol("searchCount", OrderCol.DESCENDING));
hotwordQuery.setOrderColList(orderColList); hotwordQuery.setOrderColList(orderColList);
PageInfo pageInfo = new PageInfo(); PageInfo pageInfo = new PageInfo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment