Commit 30d83558 authored by wzp's avatar wzp

修改bug

parent b317c6ec
......@@ -75,4 +75,6 @@ public interface TBoardStatisticService extends IService<TBoardStatistic> {
List getBoardProvincePlayTotalList(String organId,String orgCode);
Page<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend);
List getBoardCityPlayTotalList(String areaCode, String orgCode);
}
......@@ -166,6 +166,37 @@ public class TBoardStatisticServiceImpl extends ServiceImpl<TBoardStatisticMappe
return list;
}
@Override
public List getBoardCityPlayTotalList(String areaCode, String orgCode) {
// 获取省份信息
QueryWrapper qw = new QueryWrapper();
qw.eq("parent_id", areaCode);
List<TArea> provlist = areaService.list(qw);
provlist.stream().forEach(l -> l.setName(l.getName().replace("省", "").replace("市", "").
replace("自治区", "").replace("特别行政区", "").replace("壮族", "").replace("回族", "").replace("维吾尔", "")));
// 遍历省份,统计各省播放量
TBoardSurvey survey = new TBoardSurvey();
String dateStr = DateUtil.getCurrentDate("yyyyMM");
survey.setStatisticDate(dateStr);
survey.setOrganCode(orgCode);
List list = new ArrayList();
// 根据省份查询播放量
for (TArea prov : provlist) {
Map map = new HashMap();
if (areaCode.endsWith("0000")) {
survey.setAreaId(prov.getId().toString().substring(0, 4));
}else {
survey.setAreaId(prov.getId().toString());
}
Integer cnt = boardStatisticMapper.getBoardPlayTotal(survey);
map.put("name", prov.getName());
map.put("value", cnt == null ? 0 : cnt);
list.add(map);
}
return list;
}
@Override
public Page<TBoardPlayTrend> getBoardPageList(Page<TBoardPlayTrend> page, TBoardPlayTrend trend) {
HashMap<String, Integer> map = new HashMap<>();
......
......@@ -219,6 +219,27 @@ public class TBoardStatisticController extends BaseController {
return getResult(list);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "areaCode", value = "区域编码", paramType = "query", dataType = "String")
})
@PostMapping("/getBoardCityPlayTotalList")
// @RequiresAuthentication //@RequiresPermissions("t:board:statistic:provPlayList")
@ApiOperation(value = "获取下级区域展板播放统计", notes = "获取下级展板播放统计")
public Map<String, Object> getBoardCityPlayTotalList(String areaCode) {
String orgCode = null;
try {
TUser user = getcurUser();
if (user.getRoleList().size()>0&&!user.getRoleList().contains("1")) {
orgCode = user.getOrgCode();
}
} catch (Exception e) {
orgCode = null;
}
List list = this.tBoardStatisticService.getBoardCityPlayTotalList(areaCode,orgCode);
return getResult(list);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
......
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