|
@@ -1,9 +1,11 @@
|
|
|
package com.care.bigscreen.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.care.bigscreen.service.BigScreenService;
|
|
|
import com.care.bigscreen.vo.*;
|
|
|
|
|
|
+import com.care.common.enums.OlderLiveTypeEnum;
|
|
|
import com.care.common.vo.PageResVO;
|
|
|
import com.care.common.util.PageResult;
|
|
|
import com.care.common.util.PageUtil;
|
|
@@ -15,7 +17,10 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -248,6 +253,140 @@ public class BigScreenController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 机构大屏的年龄与性别分布查询
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "机构大屏的年龄与性别分布查询 --三期新增", notes = "机构大屏的年龄与性别分布查询 --三期新增")
|
|
|
+ @GetMapping("/selectOrgBigScreenAgeSexList")
|
|
|
+ @ApiImplicitParams(
|
|
|
+ {
|
|
|
+ @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
|
|
|
+ @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ public Result<List<BigScreenAgeSexVO>> selectOrgBigScreenAgeSexList(@RequestHeader("token") String token, Long orgId) {
|
|
|
+ try {
|
|
|
+ List<BigScreenAgeSexVO> result = new ArrayList<>();
|
|
|
+ List<BigScreenAgeSexVO> bigScreenAgeSexVOList = bigScreenService.selectOrgBigScreenAgeSexList(orgId);
|
|
|
+ if(CollUtil.isNotEmpty(bigScreenAgeSexVOList)){
|
|
|
+ BigScreenAgeSexVO vo40_down = new BigScreenAgeSexVO();
|
|
|
+ vo40_down.setAge("40以下");
|
|
|
+ BigScreenAgeSexVO vo41_50 = new BigScreenAgeSexVO();
|
|
|
+ vo41_50.setAge("41-50");
|
|
|
+ BigScreenAgeSexVO vo51_60 = new BigScreenAgeSexVO();
|
|
|
+ vo51_60.setAge("51-60");
|
|
|
+ BigScreenAgeSexVO vo61_70 = new BigScreenAgeSexVO();
|
|
|
+ vo61_70.setAge("61-70");
|
|
|
+ BigScreenAgeSexVO vo71_80 = new BigScreenAgeSexVO();
|
|
|
+ vo71_80.setAge("71-80");
|
|
|
+ BigScreenAgeSexVO vo80_up = new BigScreenAgeSexVO();
|
|
|
+ vo80_up.setAge("80以上");
|
|
|
+
|
|
|
+ for (BigScreenAgeSexVO vo : bigScreenAgeSexVOList) {
|
|
|
+ if((Integer)vo.getAge() <= 40){
|
|
|
+ vo40_down.setManNum(vo40_down.getManNum() + vo.getManNum());
|
|
|
+ vo40_down.setWomanNum(vo40_down.getWomanNum() + vo.getWomanNum());
|
|
|
+ } else if((Integer)vo.getAge() >= 41 && (Integer)vo.getAge() <= 50){
|
|
|
+ vo41_50.setManNum(vo41_50.getManNum() + vo.getManNum());
|
|
|
+ vo41_50.setWomanNum(vo41_50.getWomanNum() + vo.getWomanNum());
|
|
|
+ } else if((Integer)vo.getAge() >= 51 && (Integer)vo.getAge() <= 60){
|
|
|
+ vo51_60.setManNum(vo51_60.getManNum() + vo.getManNum());
|
|
|
+ vo51_60.setWomanNum(vo51_60.getWomanNum() + vo.getWomanNum());
|
|
|
+ } else if((Integer)vo.getAge() >= 61 && (Integer)vo.getAge() <= 70){
|
|
|
+ vo61_70.setManNum(vo61_70.getManNum() + vo.getManNum());
|
|
|
+ vo61_70.setWomanNum(vo61_70.getWomanNum() + vo.getWomanNum());
|
|
|
+ } else if((Integer)vo.getAge() >= 71 && (Integer)vo.getAge() <= 80){
|
|
|
+ vo71_80.setManNum(vo71_80.getManNum() + vo.getManNum());
|
|
|
+ vo71_80.setWomanNum(vo71_80.getWomanNum() + vo.getWomanNum());
|
|
|
+ } else if( (Integer)vo.getAge() >= 80){
|
|
|
+ vo80_up.setManNum(vo80_up.getManNum() + vo.getManNum());
|
|
|
+ vo80_up.setWomanNum(vo80_up.getWomanNum() + vo.getWomanNum());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.add(vo40_down);
|
|
|
+ result.add(vo41_50);
|
|
|
+ result.add(vo51_60);
|
|
|
+ result.add(vo61_70);
|
|
|
+ result.add(vo71_80);
|
|
|
+ result.add(vo80_up);
|
|
|
+ }
|
|
|
+ return Result.success(result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("机构大屏的年龄与性别分布查询出现异常",e);
|
|
|
+ return Result.error("系统错误,机构大屏的年龄与性别分布查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 机构大屏的居住类型比例查询
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "机构大屏的居住类型比例查询 --三期新增", notes = "机构大屏的居住类型比例查询 --三期新增")
|
|
|
+ @GetMapping("/selectOrgBigScreenLiveTypeRateList")
|
|
|
+ @ApiImplicitParams(
|
|
|
+ {
|
|
|
+ @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
|
|
|
+ @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ public Result<List<BigScreenLiveTypeVO>> selectOrgBigScreenLiveTypeRateList(@RequestHeader("token") String token, Long orgId) {
|
|
|
+ try {
|
|
|
+ List<BigScreenLiveTypeVO> list = bigScreenService.selectOrgBigScreenLiveTypeRateList(orgId);
|
|
|
+ if(CollUtil.isNotEmpty(list)){
|
|
|
+ for(BigScreenLiveTypeVO vo : list){
|
|
|
+ vo.setLiveTypeName(OlderLiveTypeEnum.getCodeToName(vo.getLiveType()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Result.success(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("机构大屏的居住类型比例查询出现异常",e);
|
|
|
+ return Result.error("系统错误,机构大屏的居住类型比例查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 机构大屏的上报事件趋势查询
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "机构大屏的上报事件趋势查询 --三期新增", notes = "机构大屏的上报事件趋势查询 --三期新增")
|
|
|
+ @GetMapping("/selectOrgBigScreenEventTrendList")
|
|
|
+ @ApiImplicitParams(
|
|
|
+ {
|
|
|
+ @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
|
|
|
+ @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ public Result<List<BigScreenEnventTrendVO>> selectOrgBigScreenEventTrendList(@RequestHeader("token") String token, Long orgId) {
|
|
|
+ try {
|
|
|
+ List<BigScreenEnventTrendVO> list = bigScreenService.selectOrgBigScreenEventTrendList(orgId);
|
|
|
+
|
|
|
+ return Result.success(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("机构大屏的居住类型比例查询出现异常",e);
|
|
|
+ return Result.error("系统错误,机构大屏的居住类型比例查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 机构大屏的事件数量查询
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "机构大屏的事件数量查询 --三期新增", notes = "机构大屏的事件数量查询 --三期新增")
|
|
|
+ @GetMapping("/selectOrgBigScreenEventCount")
|
|
|
+ @ApiImplicitParams(
|
|
|
+ {
|
|
|
+ @ApiImplicitParam(paramType = "header", required = true, name = "token", dataType = "String", value = "token验证信息"),
|
|
|
+ @ApiImplicitParam(name = "orgId", value = "机构ID", dataTypeClass = Long.class,required = true)
|
|
|
+ }
|
|
|
+ )
|
|
|
+ public Result<BigScreenEnventCountVO> selectOrgBigScreenEventCount(@RequestHeader("token") String token, Long orgId) {
|
|
|
+ try {
|
|
|
+ BigScreenEnventCountVO vo = bigScreenService.selectOrgBigScreenEventCount(orgId);
|
|
|
+
|
|
|
+ return Result.success(vo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("机构大屏的居住类型比例查询出现异常",e);
|
|
|
+ return Result.error("系统错误,机构大屏的居住类型比例查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/////////////////////////////////////////////////////////服务站大屏////////////////////////////////////////////////////
|
|
|
/**
|
|
|
* 服务站大屏的站点统计查询
|