|
@@ -8,8 +8,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.dromara.domain.SenEventsMedia;
|
|
import org.dromara.domain.bo.SenEventsObjectBo;
|
|
import org.dromara.domain.bo.SenEventsObjectBo;
|
|
import org.dromara.domain.SenEventsObject;
|
|
import org.dromara.domain.SenEventsObject;
|
|
|
|
+import org.dromara.domain.vo.SenEventsMediaVo;
|
|
|
|
+import org.dromara.mapper.SenEventsMediaMapper;
|
|
import org.dromara.system.domain.SysDictData;
|
|
import org.dromara.system.domain.SysDictData;
|
|
import org.dromara.system.mapper.SysDictDataMapper;
|
|
import org.dromara.system.mapper.SysDictDataMapper;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -38,6 +41,8 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
|
|
|
|
private final SysDictDataMapper dictMapper;
|
|
private final SysDictDataMapper dictMapper;
|
|
|
|
|
|
|
|
+ private final SenEventsMediaMapper mediaMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询事件信息
|
|
* 查询事件信息
|
|
*
|
|
*
|
|
@@ -154,6 +159,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
result.put("latestData", baseMapper.selectVoPage(pageQuery.build(), lqw).getRecords());
|
|
result.put("latestData", baseMapper.selectVoPage(pageQuery.build(), lqw).getRecords());
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
public LambdaQueryWrapper<SenEvents> buildDateWrapper(String dateType) {
|
|
public LambdaQueryWrapper<SenEvents> buildDateWrapper(String dateType) {
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
Date startDate = null;
|
|
Date startDate = null;
|
|
@@ -179,6 +185,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
.le(SenEvents::getCreateTime, endDate);
|
|
.le(SenEvents::getCreateTime, endDate);
|
|
return queryWrapper;
|
|
return queryWrapper;
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<HashMap<String, Object>> importantEventsStat(String dateType) {
|
|
public List<HashMap<String, Object>> importantEventsStat(String dateType) {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
@@ -197,13 +204,15 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
result.putAll(baseMapper.motorInLanesCount(queryWrapper));
|
|
result.putAll(baseMapper.motorInLanesCount(queryWrapper));
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 事件占比TOP10(%)
|
|
* 事件占比TOP10(%)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<Map<String,Object>> eventPercentTop10() {
|
|
|
|
|
|
+ public List<Map<String, Object>> eventPercentTop10() {
|
|
return baseMapper.eventPercentTop10();
|
|
return baseMapper.eventPercentTop10();
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 近30日事件统计
|
|
* 近30日事件统计
|
|
*/
|
|
*/
|
|
@@ -211,6 +220,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
public List<Map<String, Object>> eventMonthCount() {
|
|
public List<Map<String, Object>> eventMonthCount() {
|
|
return baseMapper.eventMonthCount();
|
|
return baseMapper.eventMonthCount();
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 每日事件统计
|
|
* 每日事件统计
|
|
*/
|
|
*/
|
|
@@ -220,6 +230,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
queryWrapper.eq(SysDictData::getDictType, "event_type");
|
|
queryWrapper.eq(SysDictData::getDictType, "event_type");
|
|
return baseMapper.eventDayCount();
|
|
return baseMapper.eventDayCount();
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 监控点位违反统计
|
|
* 监控点位违反统计
|
|
*/
|
|
*/
|
|
@@ -228,6 +239,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
return baseMapper.pointEventsStat(queryWrapper);
|
|
return baseMapper.pointEventsStat(queryWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 区域违法分布
|
|
* 区域违法分布
|
|
*/
|
|
*/
|
|
@@ -235,15 +247,17 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
public List<HashMap<String, Object>> regionEventsStat(String dateType) {
|
|
public List<HashMap<String, Object>> regionEventsStat(String dateType) {
|
|
return baseMapper.regionEventsStat(dateType);
|
|
return baseMapper.regionEventsStat(dateType);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 每分钟事件统计
|
|
* 每分钟事件统计
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<HashMap<String, Object>> minuteEventsStat(String eventType) {
|
|
public List<HashMap<String, Object>> minuteEventsStat(String eventType) {
|
|
- LambdaQueryWrapper<SenEvents> queryWrapper=new LambdaQueryWrapper<>();
|
|
|
|
|
|
+ LambdaQueryWrapper<SenEvents> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(SenEvents::getEventType, eventType);
|
|
queryWrapper.eq(SenEvents::getEventType, eventType);
|
|
return baseMapper.minuteEventsStat(queryWrapper);
|
|
return baseMapper.minuteEventsStat(queryWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 交通违法数据来源分析
|
|
* 交通违法数据来源分析
|
|
*/
|
|
*/
|
|
@@ -252,6 +266,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
return baseMapper.eventsDatasourceStat(queryWrapper);
|
|
return baseMapper.eventsDatasourceStat(queryWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 交通违法分布式时间
|
|
* 交通违法分布式时间
|
|
*/
|
|
*/
|
|
@@ -260,6 +275,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
return baseMapper.eventsHourStat(queryWrapper);
|
|
return baseMapper.eventsHourStat(queryWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 交通违法处置分析
|
|
* 交通违法处置分析
|
|
*/
|
|
*/
|
|
@@ -268,6 +284,7 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = buildDateWrapper(dateType);
|
|
return baseMapper.eventsDealRateStat(queryWrapper);
|
|
return baseMapper.eventsDealRateStat(queryWrapper);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 骑行违法分析
|
|
* 骑行违法分析
|
|
*/
|
|
*/
|
|
@@ -275,11 +292,12 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
public TableDataInfo<Map<String, Object>> cycleEventStat(SenEventsBo senEventsBo, PageQuery pageQuery) {
|
|
public TableDataInfo<Map<String, Object>> cycleEventStat(SenEventsBo senEventsBo, PageQuery pageQuery) {
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<SenEvents> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.like(StringUtils.isNotBlank(senEventsBo.getPointName()), SenEvents::getPointName, senEventsBo.getPointName());
|
|
queryWrapper.like(StringUtils.isNotBlank(senEventsBo.getPointName()), SenEvents::getPointName, senEventsBo.getPointName());
|
|
- queryWrapper.ge(StringUtils.isNotBlank((CharSequence) senEventsBo.getParams().get("startDate")),SenEvents::getCreateTime, senEventsBo.getParams().get("startDate"))
|
|
|
|
- .le(StringUtils.isNotBlank((CharSequence) senEventsBo.getParams().get("endDate")),SenEvents::getCreateTime, senEventsBo.getParams().get("endDate"));
|
|
|
|
|
|
+ queryWrapper.ge(StringUtils.isNotBlank((CharSequence) senEventsBo.getParams().get("startDate")), SenEvents::getCreateTime, senEventsBo.getParams().get("startDate"))
|
|
|
|
+ .le(StringUtils.isNotBlank((CharSequence) senEventsBo.getParams().get("endDate")), SenEvents::getCreateTime, senEventsBo.getParams().get("endDate"));
|
|
Page<Map<String, Object>> result = baseMapper.cycleEventStat(pageQuery.build(), queryWrapper);
|
|
Page<Map<String, Object>> result = baseMapper.cycleEventStat(pageQuery.build(), queryWrapper);
|
|
- return TableDataInfo.build(result);
|
|
|
|
|
|
+ return TableDataInfo.build(result);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 重点车辆分析
|
|
* 重点车辆分析
|
|
*/
|
|
*/
|
|
@@ -289,15 +307,33 @@ public class SenEventsServiceImpl implements ISenEventsService {
|
|
queryWrapper.like(StringUtils.isNotBlank(bo.getObjectId()), SenEventsObject::getObjectId, bo.getObjectId());
|
|
queryWrapper.like(StringUtils.isNotBlank(bo.getObjectId()), SenEventsObject::getObjectId, bo.getObjectId());
|
|
String startDate = null;
|
|
String startDate = null;
|
|
String endDate = null;
|
|
String endDate = null;
|
|
- if(StringUtils.isNotBlank((CharSequence) bo.getParams().get("startDate"))){
|
|
|
|
- startDate= (String) bo.getParams().get("startDate");
|
|
|
|
|
|
+ if (StringUtils.isNotBlank((CharSequence) bo.getParams().get("startDate"))) {
|
|
|
|
+ startDate = (String) bo.getParams().get("startDate");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank((CharSequence) bo.getParams().get("endDate"))) {
|
|
|
|
+ endDate = (String) bo.getParams().get("endDate");
|
|
}
|
|
}
|
|
- if(StringUtils.isNotBlank((CharSequence) bo.getParams().get("endDate"))){
|
|
|
|
- endDate= (String) bo.getParams().get("endDate");
|
|
|
|
|
|
+ Page<Map<String, Object>> result = baseMapper.keyVehicleEventStat(pageQuery.build(), startDate, endDate, queryWrapper);
|
|
|
|
+ return TableDataInfo.build(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public TableDataInfo<SenEventsVo> eventsMediaList(SenEventsBo bo, PageQuery pageQuery) {
|
|
|
|
+ LambdaQueryWrapper<SenEvents> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(bo.getPointId() != null, SenEvents::getPointId, bo.getPointId());
|
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(bo.getEventCategory()), SenEvents::getEventCategory, bo.getEventCategory());
|
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(bo.getDealStatus()), SenEvents::getDealStatus, bo.getDealStatus());
|
|
|
|
+ queryWrapper.in(StringUtils.isNotBlank(bo.getEventType()), SenEvents::getEventType, bo.getEventType());
|
|
|
|
+ queryWrapper.ge(StringUtils.isNotBlank((CharSequence) bo.getParams().get("startDate")), SenEvents::getCreateTime, bo.getParams().get("startDate"))
|
|
|
|
+ .le(StringUtils.isNotBlank((CharSequence) bo.getParams().get("endDate")), SenEvents::getCreateTime, bo.getParams().get("endDate"));
|
|
|
|
+ queryWrapper.orderByDesc(SenEvents::getCreateTime);
|
|
|
|
+ Page<SenEventsVo> result = baseMapper.selectVoPage(pageQuery.build(), queryWrapper);
|
|
|
|
+ for (SenEventsVo vo : result.getRecords()) {
|
|
|
|
+ LambdaQueryWrapper<SenEventsMedia> mediaWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ mediaWrapper.eq(SenEventsMedia::getEventId, vo.getId());
|
|
|
|
+ List<SenEventsMediaVo> mediaList = mediaMapper.selectVoList(mediaWrapper);
|
|
|
|
+ vo.setMediaList(mediaList);
|
|
}
|
|
}
|
|
-// queryWrapper.ge(StringUtils.isNotBlank((CharSequence) bo.getParams().get("startDate")),SenEventsObject::getCreateTime, bo.getParams().get("startDate"))
|
|
|
|
-// .le(StringUtils.isNotBlank((CharSequence) bo.getParams().get("endDate")),SenEventsObject::getCreateTime, bo.getParams().get("endDate"));
|
|
|
|
- Page<Map<String, Object>> result = baseMapper.keyVehicleEventStat(pageQuery.build(), startDate,endDate,queryWrapper);
|
|
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
}
|
|
}
|
|
}
|
|
}
|