Commit 1e61a8d2 authored by liqin's avatar liqin 💬

Merge branch 'dev' of http://111.203.232.171:8888/lee/chnmuseum-party into dev

parents 199578be 7e4b6133
......@@ -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,36 @@ public class TBoardStatisticServiceImpl extends ServiceImpl<TBoardStatisticMappe
return list;
}
@Override
public List getBoardCityPlayTotalList(String areaCode, String orgCode) {
if (areaCode.equals("110000")||areaCode.equals("120000")||areaCode.equals("310000")||areaCode.equals("500000")){
areaCode=areaCode.substring(0,2)+"0100";
}
QueryWrapper qw = new QueryWrapper();
qw.eq("parent_id", areaCode);
List<TArea> provlist = areaService.list(qw);
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