Commit a60c5184 authored by 李腾威's avatar 李腾威

1002 APP首页优化--领导角色

parent fb7a77a0
package com.yeejoin.amos.boot.module.common.api.feign; package com.yeejoin.amos.boot.module.common.api.feign;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.PageDto;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto; import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -280,4 +279,28 @@ public interface EquipFeignClient { ...@@ -280,4 +279,28 @@ public interface EquipFeignClient {
@RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET) @RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code); ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code);
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getFireAlarm", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getFireAlarm();
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getFaultAlarm", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getFaultAlarm();
/**
* 未处理消防告警 by litw 2021年10月25日
*
* @return
*/
@RequestMapping(value = "/confirmAlarm/getMonitorEvent", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getMonitorEvent();
} }
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author litw
* @date 2021-10-25.
*/
@Data
@ApiModel(value="AlertCalledDto", description="app领导统计")
public class AlarmGiveStatisticsDto {
/**
* 异常总数
* */
Integer allNum;
/**
* 119接警未结案警情数量
* */
Integer alarmNum;
/**
* 未处置的消防报警+未处置的故障告警+未处置的物联报警数量
* */
Integer iotDetection;
/**
* 消防巡查未关闭隐患数量+ 消防监督检查未关闭隐患数量
* */
Integer currentHiddenDanger;
}
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.lang.reflect.Field; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Arrays; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.Collection; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Map; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import java.util.stream.Collectors; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.stream.Stream;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.*; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.LatentDangerFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlarmGiveStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.event.RestEventTrigger; import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -28,23 +47,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -28,23 +47,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import java.lang.reflect.Field;
import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.Arrays;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import java.util.stream.Stream;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.swing.plaf.basic.BasicViewportUI;
/** /**
* 警情接警记录 * 警情接警记录
...@@ -58,6 +68,10 @@ import javax.swing.plaf.basic.BasicViewportUI; ...@@ -58,6 +68,10 @@ import javax.swing.plaf.basic.BasicViewportUI;
public class AlertCalledController extends BaseController { public class AlertCalledController extends BaseController {
@Autowired @Autowired
LatentDangerFeignClient latentDangerFeignClient;
@Autowired
EquipFeignClient equipFeignClient;
@Autowired
AlertCalledServiceImpl iAlertCalledService; AlertCalledServiceImpl iAlertCalledService;
@Autowired @Autowired
AlertFormValueServiceImpl iAlertFormValueService; AlertFormValueServiceImpl iAlertFormValueService;
...@@ -389,4 +403,44 @@ public class AlertCalledController extends BaseController { ...@@ -389,4 +403,44 @@ public class AlertCalledController extends BaseController {
} }
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/ /*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
/**
* 警情填报地址模糊查询
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAlarmGiveStatistics", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "app领导统计", notes = "app领导统计")
public ResponseModel<AlarmGiveStatisticsDto> getAlarmGiveStatistics () {
AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto();
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNull(AlertCalled::getFatherAlert);
queryWrapper.eq(AlertCalled::getAlertStatus,true);
queryWrapper.eq(AlertCalled::getIsDelete,false);
Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper);
dto.setAlarmNum(alertNum);
ResponseModel<Map<String, Object>> fireAlarm = equipFeignClient.getFireAlarm();
Map<String, Object> map = fireAlarm.getResult();
int fireAlarmNum = !ValidationUtil.isEmpty(map.get("FireAlarmNum")) ? Integer.valueOf(map.get("FireAlarmNum").toString()) : 0;
ResponseModel<Map<String, Object>> faultAlarm = equipFeignClient.getFaultAlarm();
map = faultAlarm.getResult();
int faultAlarmNum = !ValidationUtil.isEmpty(map.get("FaultAlarmNum")) ? Integer.valueOf(map.get("FaultAlarmNum").toString()) : 0;
ResponseModel<Map<String, Object>> monitorEvent = equipFeignClient.getMonitorEvent();
map = monitorEvent.getResult();
int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0;
dto.setIotDetection(fireAlarmNum+faultAlarmNum+monitorEventNum);
ResponseModel<Object> currentHiddenDanger = latentDangerFeignClient.getUnFinishedDangerCount();
Integer currentHiddenDangerNum = (Integer) currentHiddenDanger.getResult();
dto.setCurrentHiddenDanger(currentHiddenDangerNum);
dto.setAllNum(dto.getAlarmNum()+dto.getIotDetection()+currentHiddenDangerNum);
return ResponseHelper.buildResponse(dto);
}
} }
\ No newline at end of file
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