Commit 1b5db157 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715
parents f4ab6f96 18531be6
package com.yeejoin.amos.boot.module.elevator.api.vo;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDateDto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 大屏筛选过滤对象
*
* @author Administrator
*/
@Data
public class DPAlertRecordFilterVo {
/**
* 区域
*/
@NotBlank(message = "区域编码不能为空!")
private String cityCode;
/**
* 警情来源
*/
private String alertSource;
/**
* 警情来源code
*/
private String alertSourceCode;
/**
* 警情类型
*/
private String alertType;
/**
* 警情类型code
*/
private String alertTypeCode;
/**
* 报警类型
*/
private String type;
/**
* 报警类型code
*/
private String typeCode;
/**
* 警情起止时间
*/
private DPFilterParamForDateDto alertStartAndEndTime;
/**
* 当前页
*/
private int current;
/**
* 每页大小
*/
private int size;
}
...@@ -10,12 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,12 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.annotation.ResubmitCheck; import com.yeejoin.amos.boot.biz.common.annotation.ResubmitCheck;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
import com.yeejoin.amos.boot.module.elevator.api.enums.SourcesInfoEnum; import com.yeejoin.amos.boot.module.elevator.api.enums.SourcesInfoEnum;
import com.yeejoin.amos.boot.module.elevator.api.vo.DPAlertRecordFilterVo;
import com.yeejoin.amos.boot.module.elevator.biz.service.impl.*; import com.yeejoin.amos.boot.module.elevator.biz.service.impl.*;
import com.yeejoin.amos.boot.module.elevator.api.dto.*; import com.yeejoin.amos.boot.module.elevator.api.dto.*;
import com.yeejoin.amos.boot.module.elevator.api.entity.*; import com.yeejoin.amos.boot.module.elevator.api.entity.*;
...@@ -57,6 +59,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -57,6 +59,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 警情接警填报记录 * 警情接警填报记录
...@@ -863,4 +866,19 @@ public class AlertCalledController extends BaseController { ...@@ -863,4 +866,19 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.getAlertCalledRecords(page, alertCalledQueryDto, cityCode)); return ResponseHelper.buildResponse(iAlertCalledService.getAlertCalledRecords(page, alertCalledQueryDto, cityCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-警情类型", notes = "应急大屏使用-警情类型")
@GetMapping("/alertOperations/dp")
public ResponseModel<Object> alertOperations() {
return ResponseHelper.buildResponse(iAlertCalledService.alertOperations());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格")
@PostMapping("/alertRecordTable/dp")
public ResponseModel<IPage<AlertCalledDto>> alertRecordTableForDP(DPAlertRecordFilterVo recordFilterVo) {
return iAlertCalledService.alertRecordTableForDP(recordFilterVo);
}
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.elevator.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -10,12 +11,14 @@ import com.baomidou.mybatisplus.core.toolkit.SystemClock; ...@@ -10,12 +11,14 @@ import com.baomidou.mybatisplus.core.toolkit.SystemClock;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
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.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.elevator.api.dto.*; import com.yeejoin.amos.boot.module.elevator.api.dto.*;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.elevator.api.entity.AlertCalled;
...@@ -34,11 +37,15 @@ import com.yeejoin.amos.boot.module.elevator.api.mapper.AlertCalledMapper; ...@@ -34,11 +37,15 @@ import com.yeejoin.amos.boot.module.elevator.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.elevator.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.elevator.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.elevator.api.service.IRescueStationService; import com.yeejoin.amos.boot.module.elevator.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.elevator.api.service.TzsAuthService; import com.yeejoin.amos.boot.module.elevator.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.elevator.api.vo.DPAlertRecordFilterVo;
import com.yeejoin.amos.boot.module.elevator.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.text.StrBuilder; import org.apache.commons.lang.text.StrBuilder;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.redisson.api.RAtomicLong; import org.redisson.api.RAtomicLong;
...@@ -54,6 +61,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -54,6 +61,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
...@@ -1308,4 +1317,71 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -1308,4 +1317,71 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
} }
return parseArray(json, FormValue.class); return parseArray(json, FormValue.class);
} }
public JSONObject alertOperations() {
Collection<DataDictionary> JQLXList = iDataDictionaryService.list(
new QueryWrapper<DataDictionary>()
.eq("type", "JQLX")
.eq("is_delete", false)
.orderByAsc("sort_num")
);
List<JSONObject> subList = JQLXList.stream()
.map(jq -> {
JSONObject obj = new JSONObject();
obj.put("value", jq.getCode());
obj.put("title", jq.getName());
return obj;
}).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("title", "应急事件");
jsonObject.put("value", "yjsj");
jsonObject.put("children", subList);
return jsonObject;
}
public ResponseModel<IPage<AlertCalledDto>> alertRecordTableForDP(DPAlertRecordFilterVo recordFilterVo) {
String orgCode = getAndSetOrgCode(recordFilterVo.getCityCode());
QueryWrapper<AlertCalled> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_delete", 0);
queryWrapper.orderByDesc("rec_date");
// 组织机构
if (!ValidationUtil.isEmpty(orgCode)) {
queryWrapper.likeRight("biz_org_code", orgCode);
}
// 分页参数
if (ValidationUtil.isEmpty(recordFilterVo.getCurrent()) || ValidationUtil.isEmpty(recordFilterVo.getSize())) {
recordFilterVo.setCurrent(0);
recordFilterVo.setSize(Integer.MAX_VALUE);
}
// 警情类型
if (!ValidationUtil.isEmpty(recordFilterVo.getAlertTypeCode()) && !"yjsj".equals(recordFilterVo.getAlertTypeCode())) {
queryWrapper.eq("alarm_type_code", recordFilterVo.getAlertTypeCode());
}
// 报警类型
if (!ValidationUtil.isEmpty(recordFilterVo.getTypeCode())) {
queryWrapper.eq("type_code", recordFilterVo.getTypeCode());
}
// 警情来源
if (!ValidationUtil.isEmpty(recordFilterVo.getAlertSourceCode())) {
queryWrapper.eq("alert_source_code", recordFilterVo.getAlertSourceCode());
}
// 警情起止时间
if (!ValidationUtil.isEmpty(recordFilterVo.getAlertStartAndEndTime())){
if (!ValidationUtil.isEmpty(recordFilterVo.getAlertStartAndEndTime().getBeginDate()) && !ValidationUtil.isEmpty(recordFilterVo.getAlertStartAndEndTime().getEndDate())) {
queryWrapper.between("call_time", recordFilterVo.getAlertStartAndEndTime().getBeginDate(), recordFilterVo.getAlertStartAndEndTime().getEndDate());
}
}
IPage<AlertCalled> page = this.page(new Page<>(recordFilterVo.getCurrent(), recordFilterVo.getSize()), queryWrapper);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
return ResponseHelper.buildResponse(calledVoIPage);
}
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.biz.common.dto.CountDto; import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics;
import com.yeejoin.amos.boot.module.statistics.api.vo.DPAlertRecordFilterVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -30,6 +31,8 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> { ...@@ -30,6 +31,8 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
List<CountDto>countEmergencyEventsByOrgCodeAndDate2(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto); List<CountDto>countEmergencyEventsByOrgCodeAndDate2(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto);
Long countAlertRecordByOrgCodeAndDate(@Param("orgCode") String orgCode, @Param("dto") DPAlertRecordFilterVo filterParamDto);
/** /**
* 统计被困人数 * 统计被困人数
* @param orgCode 区域对应的orgCode * @param orgCode 区域对应的orgCode
......
package com.yeejoin.amos.boot.module.statistics.api.vo;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDateDto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 大屏筛选过滤对象
*
* @author Administrator
*/
@Data
public class DPAlertRecordFilterVo {
/**
* 区域
*/
@NotBlank(message = "区域编码不能为空!")
private String cityCode;
/**
* 警情来源
*/
private String alertSource;
/**
* 警情来源code
*/
private String alertSourceCode;
/**
* 警情类型
*/
private String alertType;
/**
* 警情类型code
*/
private String alertTypeCode;
/**
* 报警类型
*/
private String type;
/**
* 报警类型code
*/
private String typeCode;
/**
* 警情起止时间
*/
private DPFilterParamForDateDto alertStartAndEndTime;
/**
* 当前页
*/
private int current;
/**
* 每页大小
*/
private int size;
}
...@@ -169,4 +169,33 @@ ...@@ -169,4 +169,33 @@
</if> </if>
group by alarm_type_code group by alarm_type_code
</select> </select>
<select id="countAlertRecordByOrgCodeAndDate" resultType="java.lang.Long">
SELECT
count(1)
FROM
tz_alert_called
WHERE
is_delete = 0
and (father_alert IS NULL or father_alert = '')
and biz_org_code like concat(#{orgCode}, '%')
<if test="dto != null and dto.alertStartAndEndTime != null and dto.alertStartAndEndTime.beginDate != null and dto.alertStartAndEndTime.beginDate != ''">
and date_ge(CAST(call_time as date), #{dto.alertStartAndEndTime.beginDate})
</if>
<if test="dto != null and dto.alertStartAndEndTime != null and dto.alertStartAndEndTime.endDate != null and dto.alertStartAndEndTime.endDate != ''">
and date_le(CAST(call_time as date), #{dto.alertStartAndEndTime.endDate})
</if>
<if test="dto.alertTypeCode !=null and dto.alertTypeCode !=''">
and alarm_type_code = #{dto.alertTypeCode}
</if>
<if test="dto.alertTypeCode == null or dto.alertTypeCode == ''">
and (alarm_type_code = '960' or alarm_type_code = '961' or alarm_type_code = '962')
</if>
<if test="dto.typeCode !=null and dto.typeCode !=''">
and type_code = #{dto.typeCode}
</if>
<if test="dto.alertSourceCode !=null and dto.alertSourceCode !=''">
and alert_source_code = #{dto.alertSourceCode}
</if>
</select>
</mapper> </mapper>
...@@ -2,18 +2,17 @@ package com.yeejoin.amos.boot.module.statistcs.biz.controller; ...@@ -2,18 +2,17 @@ package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.YJDPStatisticsServiceImpl; import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.YJDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto; import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.statistics.api.vo.DPAlertRecordFilterVo;
import com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -160,4 +159,12 @@ public class YJDPStatisticsController { ...@@ -160,4 +159,12 @@ public class YJDPStatisticsController {
} }
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto)); return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-地市应急事件总数柱状图",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-地市应急事件总数柱状图")
@PostMapping("/alertRecordBarChart/dp")
public ResponseModel<Object> alertRecordBarChartForDP(@RequestBody DPAlertRecordFilterVo recordFilterVo) {
return ResponseHelper.buildResponse(statisticsService.alertRecordBarChartForDP(recordFilterVo));
}
} }
...@@ -111,4 +111,12 @@ public class ZLDPStatisticsController { ...@@ -111,4 +111,12 @@ public class ZLDPStatisticsController {
JSONObject jsonObject = new JSONObject(map); JSONObject jsonObject = new JSONObject(map);
return ResponseHelper.buildResponse(statisticsService.queryByKeys(jsonObject)); return ResponseHelper.buildResponse(statisticsService.queryByKeys(jsonObject));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/viewEquipPage")
@ApiOperation(httpMethod = "POST", value = "查询设备管理列表", notes = "查询设备管理列表")
public ResponseModel<Page<JSONObject>> viewEquipPage(@RequestBody DPFilterParamForDetailDto paramDto) {
return ResponseHelper.buildResponse(statisticsService.viewEquipPage(paramDto));
}
} }
...@@ -8,15 +8,17 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto; ...@@ -8,15 +8,17 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto;
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.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics;
import com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics;
import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto; import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertUseUnitStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertUseUnitStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.vo.DPAlertRecordFilterVo;
import com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.DispatchPaperEnums; import com.yeejoin.amos.boot.module.ymt.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.AlertCalledMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.DispatchTaskMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.DispatchTaskMapper;
...@@ -212,8 +214,8 @@ public class YJDPStatisticsServiceImpl { ...@@ -212,8 +214,8 @@ public class YJDPStatisticsServiceImpl {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("xdata", Arrays.asList("30分钟内到达次数", "超过30分钟到次数", "一级救援次数", "二级救援次数", "三级救援次数")); jsonObject.put("xdata", Arrays.asList("30分钟内到达次数", "超过30分钟到次数", "一级救援次数", "二级救援次数", "三级救援次数"));
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode == null){ if (orgCode == null) {
jsonObject.put("ydata", Arrays.asList(0L,0L,0L,0L,0L)); jsonObject.put("ydata", Arrays.asList(0L, 0L, 0L, 0L, 0L));
return jsonObject; return jsonObject;
} }
String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM"); String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM");
...@@ -234,7 +236,7 @@ public class YJDPStatisticsServiceImpl { ...@@ -234,7 +236,7 @@ public class YJDPStatisticsServiceImpl {
public List<AlertUseUnitStatisticsDto> trappedUserHighCompanyCount(DPFilterParamDto dpFilterParamDto) throws Exception { public List<AlertUseUnitStatisticsDto> trappedUserHighCompanyCount(DPFilterParamDto dpFilterParamDto) throws Exception {
String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM"); String date = DateUtil.formatDate(DateTimeUtil.addMonths(new Date(), -1), "yyyy-MM");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto);
if(orgCode == null){ if (orgCode == null) {
return new ArrayList<>(); return new ArrayList<>();
} }
LambdaQueryWrapper<AlertUseUnitStatistics> lambda = new QueryWrapper<AlertUseUnitStatistics>().lambda(); LambdaQueryWrapper<AlertUseUnitStatistics> lambda = new QueryWrapper<AlertUseUnitStatistics>().lambda();
...@@ -462,4 +464,43 @@ public class YJDPStatisticsServiceImpl { ...@@ -462,4 +464,43 @@ public class YJDPStatisticsServiceImpl {
} }
return countMap; return countMap;
} }
public JSONObject alertRecordBarChartForDP(DPAlertRecordFilterVo recordFilterVo) {
JSONObject res = new JSONObject();
JSONArray legendData = new JSONArray();
legendData.add(createLegendData());
List<RegionModel> regionList = stCommonService.setRegionIfRootParentAndNoAccessIf3Level(ValidationUtil.isEmpty(recordFilterVo.getCityCode()) ? "610000" : recordFilterVo.getCityCode());
// 获取区域名称并过滤
List<String> xData = regionList.stream()
.map(RegionModel::getRegionName)
.filter(regionName -> !"西咸新区".equals(regionName))
.collect(Collectors.toList());
List<Long> alertRecordTotal = regionList.stream().map(region -> {
String orgCode = stCommonService.getAndSetOrgCode(String.valueOf(region.getRegionCode()));
if (ValidationUtil.isEmpty(orgCode)) {
return 0L;
}
if (recordFilterVo.getAlertStartAndEndTime() == null) {
recordFilterVo.setAlertStartAndEndTime(new DPFilterParamForDateDto());
}
return alertStatisticsMapper.countAlertRecordByOrgCodeAndDate(orgCode, recordFilterVo);
}).collect(Collectors.toList());
res.put("legendData", legendData);
res.put("xdata", xData);
res.put("alertRecordTotal", alertRecordTotal);
return res;
}
private JSONObject createLegendData() {
JSONObject legendSubData = new JSONObject();
legendSubData.put("dataKey", "alertRecordTotal");
legendSubData.put("value", "应急事件总数");
legendSubData.put("chartType", "bar");
return legendSubData;
}
} }
...@@ -924,4 +924,79 @@ public class ZLDPStatisticsServiceImpl { ...@@ -924,4 +924,79 @@ public class ZLDPStatisticsServiceImpl {
} }
return result; return result;
} }
public Page<JSONObject> viewEquipPage(DPFilterParamForDetailDto paramDto) {
Page<JSONObject> result = new Page<>(paramDto.getCurrent(), paramDto.getSize());
SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all");
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
if (!ObjectUtils.isEmpty(paramDto.getCityCode())) {
String orgCode = stCommonService.getAndSetOrgCode(paramDto.getCityCode());
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
}
if (!ObjectUtils.isEmpty(paramDto.getSuperviseUnitName())) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
String test = QueryParser.escape(paramDto.getSuperviseUnitName());
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*" + test + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(paramDto.getCompanyName())) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
String test = QueryParser.escape(paramDto.getCompanyName());
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*" + test + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(paramDto.getTreeValue())) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(paramDto.getTreeValue());
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST_CODE", test));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(paramDto.getEquCategoryCode())) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(paramDto.getEquCategoryCode());
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY_CODE", test));
boolMust.must(meBuilder);
}
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape("true");
pBuilder.must(QueryBuilders.matchQuery(IS_INTO_MANAGEMENT, param));
boolMust.must(pBuilder);
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
builder.from((paramDto.getCurrent() - 1) * paramDto.getSize());
builder.size(paramDto.getSize());
request.source(builder);
List<JSONObject> list = new LinkedList<>();
long totle = 0;
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
for (SearchHit hit : response.getHits().getHits()) {
System.out.println(hit);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit);
JSONObject dto2 = jsonObject.getJSONObject("sourceAsMap");
if (!ValidationUtil.isEmpty(dto2.get(EQU_STATE))) {
Integer integer = Integer.valueOf(dto2.get(EQU_STATE).toString());
String status = EquimentEnum.getName.get(integer);
dto2.put(EQU_STATE, status);
}
list.add(dto2);
}
totle = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list);
result.setTotal(totle);
} catch (IOException e) {
throw new RuntimeException(e);
}
return result;
}
} }
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