Commit 78dbe992 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents 8c3495a5 5396937a
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;
}
......@@ -14,10 +14,10 @@ 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.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
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.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.api.dto.*;
import com.yeejoin.amos.boot.module.elevator.api.entity.*;
......@@ -865,20 +865,4 @@ public class AlertCalledController extends BaseController {
page.setSize(pageSize);
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);
}
}
......@@ -18,6 +18,7 @@ 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.dto.AttachmentDto;
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.common.api.enums.ReginStepEnum;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.elevator.api.dto.*;
......@@ -37,7 +38,6 @@ 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.IRescueStationService;
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.feign.privilege.model.AgencyUserModel;
......@@ -1318,70 +1318,4 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
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
......@@ -58,4 +58,19 @@ public class DPFilterParamForDetailDto {
*/
private String companyName;
/**
* 报警类型code
*/
private String typeCode;
/**
* 警情来源code
*/
private String alertSourceCode;
/**
* 警情类型code
*/
private String alertTypeCode;
}
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.DPFilterParamForDetailDto;
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.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
......@@ -31,7 +34,7 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
List<CountDto>countEmergencyEventsByOrgCodeAndDate2(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto);
Long countAlertRecordByOrgCodeAndDate(@Param("orgCode") String orgCode, @Param("dto") DPAlertRecordFilterVo filterParamDto);
Long countAlertRecordByOrgCodeAndDate(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamForDetailDto filterParamDto);
/**
* 统计被困人数
......@@ -40,4 +43,9 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
* @return 被困人数
*/
Long countRescuedPersonNum(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto);
@MapKey(value = "alertRecordForPage")
Page<Map<String, Object>> alertRecordForPage(@Param("page") Page<Map<String, Object>> page,
@Param("dto") DPFilterParamForDetailDto dto,
@Param("orgCode") String 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;
}
......@@ -386,10 +386,10 @@
<if test="problemModel.problemTypeCode != null and problemModel.problemTypeCode != ''">
and spt.problem_type_code = #{problemModel.problemTypeCode}
</if>
<if test="problemModel.problemTimeStart != null ">
<if test="problemModel.problemTimeStart != null and problemModel.problemTimeStart != ''">
and cast(spt.problem_time AS DATE) >= #{problemModel.problemTimeStart}
</if>
<if test="problemModel.problemTimeEnd != null">
<if test="problemModel.problemTimeEnd != null and problemModel.problemTimeEnd != ''">
and cast(spt.problem_time AS DATE) <![CDATA[<=]]> #{problemModel.problemTimeEnd}
</if>
<if test="problemModel.problemDesc != null and problemModel.problemDesc != ''">
......
......@@ -179,18 +179,20 @@
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 test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.beginDate != null and dto.timeSearchOne.beginDate != ''">
and date_ge(CAST(call_time as date), #{dto.timeSearchOne.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 test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.endDate != null and dto.timeSearchOne.endDate != ''">
and date_le(CAST(call_time as date), #{dto.timeSearchOne.endDate})
</if>
<if test="dto.alertTypeCode !=null and dto.alertTypeCode !=''">
<choose>
<when test="dto.alertTypeCode != null and dto.alertTypeCode != ''">
and alarm_type_code = #{dto.alertTypeCode}
</if>
<if test="dto.alertTypeCode == null or dto.alertTypeCode == ''">
</when>
<otherwise>
and (alarm_type_code = '960' or alarm_type_code = '961' or alarm_type_code = '962')
</if>
</otherwise>
</choose>
<if test="dto.typeCode !=null and dto.typeCode !=''">
and type_code = #{dto.typeCode}
</if>
......@@ -198,4 +200,40 @@
and alert_source_code = #{dto.alertSourceCode}
</if>
</select>
<select id="alertRecordForPage" resultType="java.util.Map">
SELECT *
FROM tz_alert_called
<where>
is_delete = 0
and biz_org_code like concat(#{orgCode}, '%')
<if test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.beginDate != null and dto.timeSearchOne.beginDate != ''">
and date_ge(CAST(call_time as date), #{dto.timeSearchOne.beginDate})
</if>
<if test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.endDate != null and dto.timeSearchOne.endDate != ''">
and date_le(CAST(call_time as date), #{dto.timeSearchOne.endDate})
</if>
<choose>
<when test="dto.alertTypeCode != null and dto.alertTypeCode != ''">
and alarm_type_code = #{dto.alertTypeCode}
</when>
<otherwise>
and (alarm_type_code = '960' or alarm_type_code = '961' or alarm_type_code = '962')
</otherwise>
</choose>
<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>
</where>
ORDER BY rec_date DESC
</select>
</mapper>
......@@ -317,4 +317,12 @@ public class AQZSDPStatisticsController {
return ResponseHelper.buildResponse(statisticsService.getProblemRecords(page, problemModel));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "安全追溯-详情-隐患类型", notes = "安全追溯-详情-隐患类型")
@PostMapping(value = "/dict/yh/type")
public ResponseModel<List<Map<String, Object>>> getYhType() {
return ResponseHelper.buildResponse(statisticsService.getYhType());
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.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.enums.AlertStageEnums;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
......@@ -19,6 +20,7 @@ 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.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -164,7 +166,31 @@ public class YJDPStatisticsController {
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-地市应急事件总数柱状图",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-地市应急事件总数柱状图")
@PostMapping("/alertRecordBarChart/dp")
public ResponseModel<Object> alertRecordBarChartForDP(@RequestBody DPAlertRecordFilterVo recordFilterVo) {
public ResponseModel<Object> alertRecordBarChartForDP(@RequestBody DPFilterParamForDetailDto recordFilterVo) {
return ResponseHelper.buildResponse(statisticsService.alertRecordBarChartForDP(recordFilterVo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-警情类型", notes = "应急大屏使用-警情类型")
@GetMapping("/alertOperations/dp")
public ResponseModel<Object> alertOperations() {
return ResponseHelper.buildResponse(statisticsService.alertOperations());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-报警类型", notes = "应急大屏使用-报警类型")
@GetMapping("/alertTypeOperations/dp")
public ResponseModel<Object> alertTypeOperations() {
HashMap<String, String> map = new HashMap<>();
map.put(AlertStageEnums.JQCB.getId(),AlertStageEnums.JQCB.getValue());
map.put(AlertStageEnums.JQGB.getId(), AlertStageEnums.JQGB.getValue());
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格")
@PostMapping("/alertRecordTable/dp")
public ResponseModel<IPage<Map<String, Object>>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
return statisticsService.alertRecordTableForDP(recordFilterVo);
}
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.ZLDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistics.api.vo.EquCategoryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
......@@ -119,4 +120,16 @@ public class ZLDPStatisticsController {
return ResponseHelper.buildResponse(statisticsService.viewEquipPage(paramDto));
}
/**
* 根据设备种类code获取设备类别下拉
*
* @param equListCode 设备种类code
* @return 设备类别列表
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEquCategoryList")
@ApiOperation(httpMethod = "GET", value = "根据设备种类code获取设备类别下拉", notes = "根据设备种类code获取设备类别下拉")
public ResponseModel<List<EquCategoryVo>> getEquCategoryTree(String equListCode){
return ResponseHelper.buildResponse(statisticsService.getEquCategoryList(equListCode));
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
......@@ -1107,7 +1108,7 @@ public class AQZSDPStatisticsServiceImpl {
}
public Page<SafetyProblemTracingDto> getProblemRecords(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel) {
String orgCode = stCommonService.getAndSetOrgCode(problemModel.getRegionCode());
String orgCode = stCommonService.getAndSetOrgCode(problemModel.getCityCode());
if (orgCode == null){
return new Page<>();
}
......@@ -1129,4 +1130,14 @@ public class AQZSDPStatisticsServiceImpl {
}
return statisticsMapper.queryForSafetyProblemTracingPage(page, problemModel);
}
public List<Map<String,Object>> getYhType() {
List<DataDictionary> dictionaries = dataDictionaryMapper.selectList(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getType, "ISSUE_TYPE"));
return dictionaries.stream().map(d->{
Map<String,Object> item = new HashMap<>();
item.put("value",d.getCode());
item.put("label",d.getName());
return item;
}).collect(Collectors.toList());
}
}
\ No newline at end of file
......@@ -709,7 +709,7 @@ public class JYJCDPStatisticsServiceImpl {
List<Map<String, Object>> result = new ArrayList<>();
for (FlowStatusEnum value : values) {
Map<String, Object> map = new HashMap<>();
if (value.getCode() != 6610 && value.getCode() != 6615 && value.getCode() != 6612) {
if (value.getCode() != 6617 && value.getCode() != 6621 && value.getCode() != 6610 && value.getCode() != 6615 && value.getCode() != 6612) {
map.put("name", value.getName());
map.put("code", value.getCode());
result.add(map);
......
......@@ -4,6 +4,8 @@ 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.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.service.impl.DataDictionaryServiceImpl;
......@@ -16,7 +18,6 @@ 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.AlertStatisticsMapper;
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.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
......@@ -43,6 +44,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.time.LocalDate;
......@@ -465,7 +468,7 @@ public class YJDPStatisticsServiceImpl {
return countMap;
}
public JSONObject alertRecordBarChartForDP(DPAlertRecordFilterVo recordFilterVo) {
public JSONObject alertRecordBarChartForDP(DPFilterParamForDetailDto recordFilterVo) {
JSONObject res = new JSONObject();
JSONArray legendData = new JSONArray();
......@@ -485,8 +488,11 @@ public class YJDPStatisticsServiceImpl {
if (ValidationUtil.isEmpty(orgCode)) {
return 0L;
}
if (recordFilterVo.getAlertStartAndEndTime() == null) {
recordFilterVo.setAlertStartAndEndTime(new DPFilterParamForDateDto());
if (recordFilterVo.getTimeSearchOne() == null) {
recordFilterVo.setTimeSearchOne(new DPFilterParamForDateDto());
}
if (!ValidationUtil.isEmpty(recordFilterVo.getTreeValue())){
recordFilterVo.setAlertTypeCode(recordFilterVo.getTreeValue());
}
return alertStatisticsMapper.countAlertRecordByOrgCodeAndDate(orgCode, recordFilterVo);
}).collect(Collectors.toList());
......@@ -503,4 +509,36 @@ public class YJDPStatisticsServiceImpl {
legendSubData.put("chartType", "bar");
return legendSubData;
}
public JSONObject alertOperations() {
Collection<DataDictionary> JQLXList = dataDictionaryService.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<Map<String, Object>>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
String orgCode = stCommonService.getAndSetOrgCode(recordFilterVo.getCityCode());
if (!ValidationUtil.isEmpty(recordFilterVo.getTreeValue())){
recordFilterVo.setAlertTypeCode(recordFilterVo.getTreeValue());
}
Page<Map<String, Object>> mapPage = alertStatisticsMapper.alertRecordForPage(new Page<>(recordFilterVo.getCurrent(), recordFilterVo.getSize()),recordFilterVo,orgCode);
return ResponseHelper.buildResponse(mapPage);
}
}
......@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.common.api.entity.AlertStatistics;
......@@ -14,9 +14,13 @@ import com.yeejoin.amos.boot.module.common.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.UserPostEnum;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.vo.EquCategoryVo;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
......@@ -37,6 +41,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -51,30 +56,28 @@ public class ZLDPStatisticsServiceImpl {
private static final String EQU_STATE = "EQU_STATE";
private static final String LEVEL = "company";
private ZLStatisticsMapper screenMapper;
private final ZLStatisticsMapper screenMapper;
private DataDictionaryServiceImpl iDataDictionaryService;
private final DataDictionaryServiceImpl iDataDictionaryService;
private AlertStatisticsMapper alertStatisticsMapper;
private final AlertStatisticsMapper alertStatisticsMapper;
private RestHighLevelClient restHighLevelClient;
private final RestHighLevelClient restHighLevelClient;
private StCommonServiceImpl stCommonService;
private final StCommonServiceImpl stCommonService;
private RedisUtils redisUtils;
private final EquipmentCategoryMapper equipmentCategoryMapper;
// 设备纳管 纳管:true 未纳管:false
public static final String IS_INTO_MANAGEMENT = "IS_INTO_MANAGEMENT";
public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, RedisUtils redisUtils) {
public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService, EquipmentCategoryMapper equipmentCategoryMapper) {
this.screenMapper = screenMapper;
this.iDataDictionaryService = iDataDictionaryService;
this.alertStatisticsMapper = alertStatisticsMapper;
this.restHighLevelClient = restHighLevelClient;
this.stCommonService = stCommonService;
this.redisUtils = redisUtils;
this.equipmentCategoryMapper = equipmentCategoryMapper;
}
......@@ -682,8 +685,8 @@ public class ZLDPStatisticsServiceImpl {
public Map<String, Object> getEquipManagementRateStatistics(DPFilterParamForDetailDto paramDto) {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> legendData = new ArrayList<>();
legendData.add(createLegend("设备认领总数", "equipTotal", "bar"));
legendData.add(createLegend("设备认领率", "claimRate", "line"));
legendData.add(createLegend("设备总数", "equipTotal", "bar"));
legendData.add(createLegend("纳管率", "claimRate", "line"));
List<RegionModel> regionList = stCommonService.setRegionIfRootParentAndNoAccessIf3Level("610000");
// 获取区域名称并过滤
......@@ -999,4 +1002,18 @@ public class ZLDPStatisticsServiceImpl {
}
return result;
}
public List<EquCategoryVo> getEquCategoryList(String equListCode) {
EquipmentCategory equList = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, equListCode));
if (ValidationUtil.isEmpty(equList)) {
return Lists.newArrayList();
}
List<EquipmentCategory> equipmentCategoryList = equipmentCategoryMapper.selectList(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getParentId, equList.getId()));
if (ValidationUtil.isEmpty(equipmentCategoryList)) {
return Lists.newArrayList();
}
return equipmentCategoryList.stream()
.map(dto -> new EquCategoryVo(dto.getName(), dto.getCode()))
.collect(Collectors.toList());
}
}
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