getCompanyCount
This commit is contained in:
parent
25e213e9d8
commit
cc906040ba
|
|
@ -30,6 +30,7 @@ import javax.validation.Valid;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +59,13 @@ public class DevInfoController extends BaseController {
|
|||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计公司上架数")
|
||||
@PostMapping("/getCompanyCount")
|
||||
public AjaxResult getCompanyCount(@RequestBody DevInfoVo devInfo) {
|
||||
Map<String, Long> map = devInfoService.getCompanyCount(devInfo);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司列表(供装备新增及首页所属公司筛选使用)
|
||||
* @param obj
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public interface DevInfoService {
|
|||
*/
|
||||
List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo);
|
||||
|
||||
Map<String, Long> getCompanyCount(DevInfoVo devInfo);
|
||||
|
||||
List<DevInfoVo> selectUserCollectList(DevInfoVo devInfo);
|
||||
|
||||
AjaxResult selectDevInfoHotList(DevInfoVo devInfo);
|
||||
|
|
|
|||
|
|
@ -171,6 +171,13 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> getCompanyCount(DevInfoVo devInfo) {
|
||||
List<DevInfoVo> voList = devInfoMapper.selectDevInfoList(devInfo);
|
||||
Map<String, Long> map = voList.stream().collect(Collectors.groupingBy(DevInfoVo::getCompanyId, Collectors.counting()));
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备收藏列表
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue