|
@@ -1,5 +1,6 @@
|
|
|
package com.bizmatics.mhfire.service.impl;
|
|
|
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -12,7 +13,6 @@ import com.bizmatics.common.core.util.DateUtils;
|
|
|
import com.bizmatics.common.core.util.StringUtils;
|
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
import com.bizmatics.mhfire.model.JcjAjxx;
|
|
|
-import com.bizmatics.mhfire.model.JcjZzclxx;
|
|
|
import com.bizmatics.mhfire.persistence.mapper.JcjAjxxMapper;
|
|
|
import com.bizmatics.mhfire.persistence.mapper.po.FireStatisticsPO;
|
|
|
import com.bizmatics.mhfire.persistence.mapper.vo.LocateInfo;
|
|
@@ -37,6 +37,7 @@ import java.util.stream.Collectors;
|
|
|
* @author ya
|
|
|
* @since 2021-11-23
|
|
|
*/
|
|
|
+@DS("mhsystem")
|
|
|
@Service
|
|
|
public class JcjAjxxServiceImpl extends AbstractCrudService<JcjAjxxMapper, JcjAjxx> implements JcjAjxxService {
|
|
|
|
|
@@ -48,7 +49,7 @@ public class JcjAjxxServiceImpl extends AbstractCrudService<JcjAjxxMapper, JcjAj
|
|
|
private JcjZzclxxService jcjZzclxxService;
|
|
|
|
|
|
|
|
|
- private static final String[] ALERT_TYPE = {"火灾","社会救助","抢险救援"};
|
|
|
+ public static final String[] ALERT_TYPE = {"火灾","社会救助","抢险救援","排爆安检"};
|
|
|
|
|
|
@Override
|
|
|
public Map<String, List<AlertStatisticsVO>> getAlertStatisticsByHouse(Date startTime, Date endTime) {
|
|
@@ -155,26 +156,28 @@ public class JcjAjxxServiceImpl extends AbstractCrudService<JcjAjxxMapper, JcjAj
|
|
|
@Override
|
|
|
public JcjAjxx getOne(String id) {
|
|
|
JcjAjxx jcjAjxx = this.getById(id);
|
|
|
- if (jcjAjxx.getAjlx().equals(ALERT_TYPE[0])){
|
|
|
- Date startTime = DateUtils.addMonths(jcjAjxx.getLasj(), -30);
|
|
|
- Date endTime = DateUtils.addMonths(jcjAjxx.getLasj(), 30);
|
|
|
- List<LocateInfo> lonLat = GouldUtil.getLonLat(jcjAjxx.getAfdz());
|
|
|
- LocateInfo locateInfo = lonLat.get(0);
|
|
|
- //计算精度维度在一定范围内的数据和火灾关联
|
|
|
- List<FireStatisticsPO> list = fireStatisticsService.distanceList(locateInfo.getLongitude(), locateInfo.getLatitude(), startTime, endTime);
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
- FireStatisticsPO fireStatisticsPo = list.get(0);
|
|
|
- jcjAjxx.setPropertyLoss(fireStatisticsPo.getPropertyLoss());
|
|
|
- jcjAjxx.setDeathToll(fireStatisticsPo.getDeathToll());
|
|
|
- jcjAjxx.setNonFatal(fireStatisticsPo.getNonFatal());
|
|
|
- }
|
|
|
- }
|
|
|
- //查询车辆和人员信息
|
|
|
- List<JcjZzclxx> carLit = jcjZzclxxService.getByAjId(jcjAjxx.getId());
|
|
|
- jcjAjxx.setCarList(carLit);
|
|
|
+ //查询车辆
|
|
|
+ jcjAjxx.setCarList(jcjZzclxxService.getByAjId(id));
|
|
|
return jcjAjxx;
|
|
|
}
|
|
|
|
|
|
+ @DS("mhfire")
|
|
|
+ @Override
|
|
|
+ public void getFire(JcjAjxx jcjAjxx){
|
|
|
+ Date startTime = DateUtils.addMonths(jcjAjxx.getLasj(), -30);
|
|
|
+ Date endTime = DateUtils.addMonths(jcjAjxx.getLasj(), 30);
|
|
|
+ List<LocateInfo> lonLat = GouldUtil.getLonLat(jcjAjxx.getAfdz());
|
|
|
+ LocateInfo locateInfo = lonLat.get(0);
|
|
|
+ //计算精度维度在一定范围内的数据和火灾关联
|
|
|
+ List<FireStatisticsPO> list = fireStatisticsService.distanceList(locateInfo.getLongitude(), locateInfo.getLatitude(), startTime, endTime);
|
|
|
+ if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ FireStatisticsPO fireStatisticsPo = list.get(0);
|
|
|
+ jcjAjxx.setPropertyLoss(fireStatisticsPo.getPropertyLoss());
|
|
|
+ jcjAjxx.setDeathToll(fireStatisticsPo.getDeathToll());
|
|
|
+ jcjAjxx.setNonFatal(fireStatisticsPo.getNonFatal());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<AlertStatisticsVO> getAlertStatistics(Date startTime, Date endTime) {
|
|
|
|
|
@@ -185,6 +188,7 @@ public class JcjAjxxServiceImpl extends AbstractCrudService<JcjAjxxMapper, JcjAj
|
|
|
list.add(getAsV(startTime, endTime, ALERT_TYPE[0]));
|
|
|
list.add(getAsV(startTime, endTime, ALERT_TYPE[1]));
|
|
|
list.add(getAsV(startTime, endTime, ALERT_TYPE[2]));
|
|
|
+ list.add(getAsV(startTime, endTime, ALERT_TYPE[3]));
|
|
|
list.forEach(alertStatisticsVO -> {
|
|
|
AlertStatisticsVO upAsv = getAsV(upStartTime, upEndTime, alertStatisticsVO.getType());
|
|
|
Integer number = alertStatisticsVO.getNumber();
|