Browse Source

[feat]

1、增加查询获取飞行架次、飞行时长方法,优化统计查询
pull/1/head
杨威 3 months ago
parent
commit
9de4d8dfdf
  1. 6
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertStatisticsController.java
  2. 25
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertStatisticsServiceImpl.java
  3. 2
      dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
  4. 1
      dk-modules/system/src/main/java/org/dromara/system/controller/system/AiLabelController.java

6
dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertStatisticsController.java

@ -101,7 +101,7 @@ public class BusinessAlertStatisticsController extends BaseController {
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@Operation(summary="综治管理-资规/农水/环保(高发分析)", description="综治管理-资规/农水/环保(高发分析)") @Operation(summary="综治管理-资规/农水/环保(高发分析)/住建(高发分析)", description="综治管理-资规/农水/环保(高发分析)/住建(高发分析)")
@GetMapping(value = "/comprehensive/manage") @GetMapping(value = "/comprehensive/manage")
public R<Map<String,Object>> comprehensiveManage(BusinessAlertBo businessAlertBo) { public R<Map<String,Object>> comprehensiveManage(BusinessAlertBo businessAlertBo) {
return R.ok(statisticsService.comprehensiveManage(businessAlertBo)); return R.ok(statisticsService.comprehensiveManage(businessAlertBo));
@ -124,7 +124,7 @@ public class BusinessAlertStatisticsController extends BaseController {
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@Operation(summary="综治管理-城管/环保(事件处理情况)", description="综治管理-城管/环保(事件处理情况)") @Operation(summary="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)", description="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)")
@GetMapping(value = "/city/comprehensive/manage") @GetMapping(value = "/city/comprehensive/manage")
public R<List<Map<String,Object>>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) { public R<List<Map<String,Object>>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) {
return R.ok(statisticsService.cityComprehensiveManage(businessAlertBo)); return R.ok(statisticsService.cityComprehensiveManage(businessAlertBo));
@ -136,7 +136,7 @@ public class BusinessAlertStatisticsController extends BaseController {
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@Operation(summary="预警信息-城管/环保", description="预警信息-城管/环保") @Operation(summary="预警信息-城管/环保/住建", description="预警信息-城管/环保/住建")
@GetMapping(value = "/city/alert/list") @GetMapping(value = "/city/alert/list")
public R<List<Map<String,Object>>> cityListAlert(BusinessAlertBo businessAlertBo) { public R<List<Map<String,Object>>> cityListAlert(BusinessAlertBo businessAlertBo) {
return R.ok(businessAlertService.cityListAlert(businessAlertBo)); return R.ok(businessAlertService.cityListAlert(businessAlertBo));

25
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertStatisticsServiceImpl.java

@ -9,9 +9,8 @@ import org.dromara.business.domain.model.StatObj;
import org.dromara.business.mapper.BusinessAlertMapper; import org.dromara.business.mapper.BusinessAlertMapper;
import org.dromara.business.service.IBusinessAlertStatisticsService; import org.dromara.business.service.IBusinessAlertStatisticsService;
import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.redis.utils.RedisOpsUtils; import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.api.RemoteDeptService; import org.dromara.system.api.RemoteDeptService;
import org.dromara.system.api.RemoteLabelPostService; import org.dromara.system.api.RemoteLabelPostService;
import org.dromara.system.api.RemotePostService; import org.dromara.system.api.RemotePostService;
@ -19,7 +18,7 @@ import org.dromara.system.api.domain.vo.RemoteAiLabelPostVo;
import org.dromara.system.api.domain.vo.RemoteDeptVo; import org.dromara.system.api.domain.vo.RemoteDeptVo;
import org.dromara.system.api.domain.vo.RemotePostVo; import org.dromara.system.api.domain.vo.RemotePostVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.common.redis.utils.RedisUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.LocalDate; import java.time.LocalDate;
@ -55,7 +54,7 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
/** /**
* 按照月份分类预警数量(包含权限) * 按照月份分类预警数量
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@ -157,11 +156,13 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList())); businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList()));
} }
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
//获取飞行总架次、总时长 //获取飞行总架次、总时长
Map<String, Object> countMap = RedisUtils.getCacheMap(FLY_COUNT); Map<String, Object> countMap = RedisUtils.getCacheMap(FLY_COUNT);
int flyCount;
if (ObjectUtil.isNotEmpty(countMap)){
int flyCount = countMap.values().stream() flyCount = countMap.values().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.mapToInt(value -> { .mapToInt(value -> {
if (value instanceof Number) { if (value instanceof Number) {
@ -170,11 +171,15 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
return 0; return 0;
}) })
.sum(); .sum();
} else {
flyCount = 0;
}
Map<String, Object> accTimeMap = RedisUtils.getCacheMap(FLY_ACC_TIME); Map<String, Object> accTimeMap = RedisUtils.getCacheMap(FLY_ACC_TIME);
double flyAccTime;
double flyAccTime = accTimeMap.values().stream() if (ObjectUtil.isNotEmpty(accTimeMap)) {
flyAccTime = accTimeMap.values().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.mapToDouble(value -> { .mapToDouble(value -> {
if (value instanceof Number) { if (value instanceof Number) {
@ -183,7 +188,11 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
return 0.0; return 0.0;
}) })
.sum(); .sum();
} else {
flyAccTime = 0.0;
}
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
List<Map<String, Object>> mapList = baseMapper.countPanelAlert(businessAlertBo); List<Map<String, Object>> mapList = baseMapper.countPanelAlert(businessAlertBo);

2
dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml

@ -510,7 +510,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select select
ba.label_en labelEn, ba.label_en labelEn,
ba.label_cn labelCn, ba.label_cn labelCn,
ba.create_time createTime ba.create_time createTime,
b.flow_status flowStatus, b.flow_status flowStatus,
b.business_id businessId, b.business_id businessId,
b.id instanceId b.id instanceId

1
dk-modules/system/src/main/java/org/dromara/system/controller/system/AiLabelController.java

@ -43,6 +43,7 @@ public class AiLabelController extends BaseController {
@SaCheckPermission("system:label:list") @SaCheckPermission("system:label:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<AiLabelVo> list(AiLabelBo bo, PageQuery pageQuery) { public TableDataInfo<AiLabelVo> list(AiLabelBo bo, PageQuery pageQuery) {
pageQuery.setPageSize(30);
return aiLabelService.queryPageList(bo, pageQuery); return aiLabelService.queryPageList(bo, pageQuery);
} }

Loading…
Cancel
Save