12 Коміти 986d6d4caa ... 06564b39d2

Автор SHA1 Опис Дата
  jichaobo 06564b39d2 Merge branch 'JCB-FIRE' 2 роки тому
  jichaobo 06620c2a27 火灾数据分析 2 роки тому
  jichaobo c888273a4f 城市消防体征 2 роки тому
  jichaobo 27d437db3d 消防水源情况 2 роки тому
  jichaobo c6631e4d24 综合警情-周边资源相关接口开发 2 роки тому
  jichaobo 67d4156cd7 综合警情-周边资源相关接口开发 2 роки тому
  jichaobo e8aab88cca 消防检查信息相关接口开发 2 роки тому
  jichaobo 78dbabe5fb mqtt多余代码注释 2 роки тому
  jichaobo 7db8b8ded7 警情综合和撒点相关接口代码开发 2 роки тому
  jichaobo f8c49e625b 警情综合和撒点相关接口代码开发 2 роки тому
  jichaobo 02ff69774f 警情综合和撒点相关接口代码开发 2 роки тому
  jichaobo 48d02cdb1b 警情综合相关接口代码开发 2 роки тому
55 змінених файлів з 2910 додано та 71 видалено
  1. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java
  2. 70 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireInspectController.java
  3. 88 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireInspectPersonController.java
  4. 117 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireStatisticsAttachController.java
  5. 21 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemOnDutyController.java
  6. 139 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemPoliceInfoController.java
  7. 48 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemWaterSourceController.java
  8. 79 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/UnitBeOnDutyController.java
  9. 80 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireInspect.java
  10. 66 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireInspectPerson.java
  11. 6 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireStatistics.java
  12. 166 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemOnDuty.java
  13. 13 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemWaterSourceMaintain.java
  14. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireInspectMapper.java
  15. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireInspectPersonMapper.java
  16. 10 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireStatisticsMapper.java
  17. 2 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemMicroStationMapper.java
  18. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemOnDutyMapper.java
  19. 30 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireInspectPersonService.java
  20. 23 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireInspectService.java
  21. 6 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireStatisticsAttachService.java
  22. 13 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireStatisticsService.java
  23. 6 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemMicroStationService.java
  24. 20 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemOnDutyService.java
  25. 15 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemPoliceInfoService.java
  26. 4 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemVehicleFightService.java
  27. 6 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemVehicleService.java
  28. 4 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemWaterSourceMaintainService.java
  29. 20 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemWaterSourceService.java
  30. 12 4
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyServiceImpl.java
  31. 92 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireInspectPersonServiceImpl.java
  32. 87 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireInspectServiceImpl.java
  33. 46 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireStatisticsAttachServiceImpl.java
  34. 271 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireStatisticsServiceImpl.java
  35. 70 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemMicroStationServiceImpl.java
  36. 57 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemOnDutyServiceImpl.java
  37. 261 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemPoliceInfoServiceImpl.java
  38. 51 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemVehicleFightServiceImpl.java
  39. 29 14
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemVehicleServiceImpl.java
  40. 48 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemWaterSourceMaintainServiceImpl.java
  41. 229 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemWaterSourceServiceImpl.java
  42. 20 20
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/mqtt/fire/FireStrategy.java
  43. 85 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/FireStatisticsPO.java
  44. 79 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/FireWaterPO.java
  45. 46 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/UnitBeOnDutyPO.java
  46. 69 12
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/util/OnlineMethod.java
  47. 42 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/AlertStatisticsVO.java
  48. 32 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireBubbleVO.java
  49. 23 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireLevelRatioVO.java
  50. 76 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireWaterStatisticsVO.java
  51. 16 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireInspectMapper.xml
  52. 17 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireInspectPersonMapper.xml
  53. 12 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireStatisticsMapper.xml
  54. 37 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemOnDutyMapper.xml
  55. 2 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/DemWaterSourceMaintainMapper.xml

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("dem_grid_memder_vice");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("dem_on_duty");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 70 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireInspectController.java

@@ -0,0 +1,70 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
+import com.usky.fire.domain.DemFireInspect;
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.fire.service.DemFireInspectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 消防检查 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@RestController
+@RequestMapping("/demFireInspect")
+public class DemFireInspectController {
+
+    @Autowired
+    private DemFireInspectService demFireInspectService;
+
+    /**
+     * 消防检查信息-检查计划-列表查询
+     *
+     * @param companyId 单位ID
+     * @param pageNum   当前页
+     * @param pageSize  每页条数
+     * @return
+     */
+    @GetMapping("fireInspectList")
+    public ApiResult<CommonPage<DemFireInspect>> fireInspectList(@RequestParam(value = "companyId") String companyId,
+                                                                 @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
+                                                                 @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+        return ApiResult.success(demFireInspectService.fireInspectList(companyId, pageNum, pageSize));
+    }
+
+    /**
+     * 消防检查信息-检查计划-新增
+     *
+     * @param demFireInspect
+     * @return
+     */
+    @Log(title = "消防检查信息-检查计划-新增", businessType = BusinessType.INSERT)
+    @PostMapping("addFireInspect")
+    public ApiResult<DemFireInspectPerson> addFireInspect(@RequestBody DemFireInspect demFireInspect) {
+        return ApiResult.success(demFireInspectService.addFireInspect(demFireInspect));
+    }
+
+    /**
+     * 消防检查信息-检查计划-修改
+     *
+     * @param demFireInspect
+     * @return
+     */
+    @Log(title = "消防检查信息-检查计划-修改", businessType = BusinessType.UPDATE)
+    @PutMapping("updateFireInspect")
+    public ApiResult<Void> updateFireInspect(@RequestBody DemFireInspect demFireInspect) {
+        demFireInspectService.updateFireInspect(demFireInspect);
+        return ApiResult.success();
+    }
+
+}
+

+ 88 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireInspectPersonController.java

@@ -0,0 +1,88 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.fire.service.DemFireInspectPersonService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 消防检查人员 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@RestController
+@RequestMapping("/demFireInspectPerson")
+public class DemFireInspectPersonController {
+
+    @Autowired
+    private DemFireInspectPersonService demFireInspectPersonService;
+
+    /**
+     * 消防检查信息-检查人员信息-列表查询
+     *
+     * @param personName     检查员名称
+     * @param personPosition 检查员职位
+     * @param id             主键ID
+     * @param pageNum        当前页
+     * @param pageSize       每页条数
+     * @return
+     */
+    @GetMapping("fireInspectPersonList")
+    public ApiResult<CommonPage<DemFireInspectPerson>> fireInspectPersonList(@RequestParam(value = "personName", required = false) String personName,
+                                                                             @RequestParam(value = "personPosition", required = false) String personPosition,
+                                                                             @RequestParam(value = "id", required = false, defaultValue = "0") Integer id,
+                                                                             @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
+                                                                             @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+        return ApiResult.success(demFireInspectPersonService.fireInspectPersonList(personName, personPosition, id, pageNum, pageSize));
+    }
+
+    /**
+     * 消防检查信息-检查人员信息-新增
+     *
+     * @param demFireInspectPerson
+     * @return
+     */
+    @Log(title = "消防检查信息-检查人员信息-新增", businessType = BusinessType.INSERT)
+    @PostMapping("addFireInspectPerson")
+    public ApiResult<Void> addFireInspectPerson(@RequestBody DemFireInspectPerson demFireInspectPerson) {
+        demFireInspectPersonService.addFireInspectPerson(demFireInspectPerson);
+        return ApiResult.success();
+    }
+
+    /**
+     * 消防检查信息-检查人员信息-修改
+     *
+     * @param demFireInspectPerson
+     * @return
+     */
+    @Log(title = "消防检查信息-检查人员信息-修改", businessType = BusinessType.UPDATE)
+    @PutMapping("updateFireInspectPerson")
+    public ApiResult<Void> updateFireInspectPerson(@RequestBody DemFireInspectPerson demFireInspectPerson) {
+        demFireInspectPersonService.updateFireInspectPerson(demFireInspectPerson);
+        return ApiResult.success();
+    }
+
+
+    /**
+     * 消防检查信息-检查人员信息-删除
+     *
+     * @param id 主键ID
+     * @return
+     */
+    @Log(title = "消防检查信息-检查人员信息-删除", businessType = BusinessType.DELETE)
+    @DeleteMapping("delFireInspectPerson")
+    public ApiResult<Void> delFireInspectPerson(@RequestParam(value = "id") Integer id) {
+        demFireInspectPersonService.delFireInspectPerson(id);
+        return ApiResult.success();
+    }
+
+}
+

+ 117 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemFireStatisticsAttachController.java

@@ -0,0 +1,117 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.service.DemFireStatisticsAttachService;
+import com.usky.fire.service.DemFireStatisticsService;
+import com.usky.fire.service.po.FireStatisticsPO;
+import com.usky.fire.service.vo.FireBubbleVO;
+import com.usky.fire.service.vo.FireLevelRatioVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 消防检查人员 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@RestController
+@RequestMapping("/demFireStatisticsAttach")
+public class DemFireStatisticsAttachController {
+
+    @Autowired
+    private DemFireStatisticsAttachService demFireStatisticsAttachService;
+
+    @Autowired
+    private DemFireStatisticsService demFireStatisticsService;
+
+    /**
+     * 城市消防体征-火灾类型
+     *
+     * @return
+     */
+    @GetMapping("fireType")
+    public ApiResult<List<String>> fireType() {
+        return ApiResult.success(demFireStatisticsAttachService.getFireType());
+    }
+
+    /**
+     * 城市消防体征-火灾趋势图
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @param address   地址
+     * @param fireType  火灾类型
+     * @return
+     */
+    @GetMapping("fireCountByData")
+    public ApiResult<List<Object>> getFireCountByData(@RequestParam(value = "startTime") String startTime,
+                                                      @RequestParam(value = "endTime") String endTime,
+                                                      @RequestParam(value = "address", required = false) String address,
+                                                      @RequestParam(value = "fireType", required = false) String fireType) {
+        return ApiResult.success(demFireStatisticsService.getFireCountByData(startTime, endTime, address, fireType));
+    }
+
+
+    /**
+     * 火灾数据分析-火灾原因占比
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @param address   火灾地址
+     * @return
+     */
+    @GetMapping("fireCauseRatio")
+    public ApiResult<List<FireLevelRatioVO>> getGroupByLevel(@RequestParam(value = "startTime", required = false) String startTime,
+                                                             @RequestParam(value = "endTime", required = false) String endTime,
+                                                             @RequestParam(value = "address", required = false) String address) {
+        return ApiResult.success(demFireStatisticsService.getGroupByLevel(startTime, endTime, address));
+    }
+
+    /**
+     * 火灾数据分析-详细火灾情况
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @param address   地址
+     * @param current   当前页
+     * @param size      每页条数
+     * @return
+     */
+    @GetMapping("page")
+    public ApiResult<CommonPage<FireStatisticsPO>> page(@RequestParam(value = "startTime", required = false) String startTime,
+                                                        @RequestParam(value = "endTime", required = false) String endTime,
+                                                        @RequestParam(value = "address", required = false) String address,
+                                                        @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                        @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
+        return ApiResult.success(demFireStatisticsService.page(current, size, startTime, endTime, address));
+    }
+
+    /**
+     * 火灾数据分析-火灾情况分析
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @param fireType  火灾类型
+     * @param unitId    单位代码
+     * @return
+     */
+    @GetMapping("fireBubble")
+    public ApiResult<List<FireBubbleVO>> getFireBubble(@RequestParam(value = "startTime", required = false) String startTime,
+                                                       @RequestParam(value = "endTime", required = false) String endTime,
+                                                       @RequestParam(value = "fireType", required = false) String fireType,
+                                                       @RequestParam(value = "unitId", required = false) String unitId) {
+        return ApiResult.success(demFireStatisticsService.getAvgAndSum(startTime, endTime, fireType, unitId));
+    }
+}
+

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemOnDutyController.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 值班表 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+@Controller
+@RequestMapping("/demOnDuty")
+public class DemOnDutyController {
+
+}
+

+ 139 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemPoliceInfoController.java

@@ -1,9 +1,22 @@
 package com.usky.fire.controller.web;
 
 
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.DemPoliceInfo;
+import com.usky.fire.service.DemMicroStationService;
+import com.usky.fire.service.DemPoliceInfoService;
+import com.usky.fire.service.DemVehicleFightService;
+import com.usky.fire.service.DemWaterSourceService;
+import com.usky.fire.service.vo.AlertStatisticsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
-import org.springframework.stereotype.Controller;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,9 +26,133 @@ import org.springframework.stereotype.Controller;
  * @author JCB
  * @since 2022-10-24
  */
-@Controller
+@RestController
 @RequestMapping("/demPoliceInfo")
 public class DemPoliceInfoController {
 
+    @Autowired
+    private DemMicroStationService demMicroStationService;
+
+    @Autowired
+    private DemPoliceInfoService demPoliceInfoService;
+
+    @Autowired
+    private DemWaterSourceService demWaterSourceService;
+
+    @Autowired
+    private DemVehicleFightService demVehicleFightService;
+
+    /**
+     * 综合警情-撒点
+     *
+     * @param streetTown    街镇
+     * @param scattererType 撒点类型
+     * @return
+     */
+    @GetMapping("synthesizePoliceSituationScatterer")
+    public ApiResult<List<Object>> synthesizePoliceSituationScatterer(@RequestParam(value = "streetTown", required = false) String streetTown,
+                                                                      @RequestParam(value = "scattererType", required = false) String scattererType) {
+        return ApiResult.success(demMicroStationService.synthesizePoliceSituationScatterer(streetTown, scattererType));
+    }
+
+    /**
+     * 综合警情-查询每年12个月警情
+     *
+     * @return
+     */
+    @GetMapping("/alertStatisticsByMonth")
+    public ApiResult<Map<String, List<AlertStatisticsVO>>> getAlertStatisticsByMonth(@RequestParam String startTime,
+                                                                                     @RequestParam String endTime,
+                                                                                     @RequestParam(value = "streetTown", required = false) String streetTown) {
+        return ApiResult.success(demPoliceInfoService.getAlertStatisticsByMonth(startTime, endTime, streetTown));
+    }
+
+    /**
+     * 查询不同警情(社会救助,警情,火灾)的占比
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/alertStatistics")
+    public ApiResult<List<AlertStatisticsVO>> getAlertStatistics(@RequestParam(value = "startTime") String startTime,
+                                                                 @RequestParam(value = "endTime") String endTime,
+                                                                 @RequestParam(value = "streetTown", required = false) String streetTown) {
+        return ApiResult.success(demPoliceInfoService.getAlertStatistics(startTime, endTime, streetTown));
+    }
+
+    /**
+     * 警情详细信息
+     *
+     * @param current   页数
+     * @param size      条数
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/page")
+    public ApiResult<CommonPage<DemPoliceInfo>> page(@RequestParam(value = "startTime", required = false) String startTime,
+                                                     @RequestParam(value = "endTime", required = false) String endTime,
+                                                     @RequestParam(value = "streetTown", required = false) String streetTown,
+                                                     @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                     @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
+        return ApiResult.success(demPoliceInfoService.page(current, size, startTime, endTime, streetTown));
+    }
+
+
+    /**
+     * 综合警情-警情时段分布
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/alertStatisticsByHouse")
+    public ApiResult<Map<String, List<AlertStatisticsVO>>> getAlertStatisticsByHouse(@RequestParam(value = "startTime") String startTime,
+                                                                                     @RequestParam(value = "endTime") String endTime,
+                                                                                     @RequestParam(value = "streetTown", required = false) String streetTown) {
+        return ApiResult.success(demPoliceInfoService.getAlertStatisticsByHouse(startTime, endTime, streetTown));
+    }
+
+
+    /**
+     * 综合警情-警情撒点
+     *
+     * @param streetTown 街镇
+     * @return
+     */
+    @GetMapping("/warningInstanceScatterer")
+    public ApiResult<List<Map<String, Object>>> warningInstanceScatterer(@RequestParam(value = "streetTown", required = false) String streetTown,
+                                                                         @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) {
+        return ApiResult.success(demPoliceInfoService.warningInstanceScatterer(streetTown, id));
+    }
+
+    /**
+     * 综合警情-周边资源
+     *
+     * @param longitude 实时警情经度
+     * @param latitude  实时警情纬度
+     * @param distance  距离
+     * @return
+     */
+    @GetMapping("/waterSourceList")
+    public ApiResult<List<Map<String, Object>>> waterSourceList(@RequestParam(value = "longitude") double longitude,
+                                                                @RequestParam(value = "latitude") double latitude,
+                                                                @RequestParam(value = "distance", required = false, defaultValue = "150") Integer distance) {
+        return ApiResult.success(demWaterSourceService.surroundingResources(longitude, latitude, distance));
+    }
+
+    /**
+     * 综合警情-警力实况
+     *
+     * @param policeId 案件信息ID
+     * @return
+     */
+    @GetMapping("/vehicleFightList")
+    public ApiResult<List<Map<String, Object>>> vehicleFightList(@RequestParam(value = "policeId") String policeId) {
+        return ApiResult.success(demVehicleFightService.vehicleFightList(policeId));
+    }
+
+
 }
 

+ 48 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/DemWaterSourceController.java

@@ -7,9 +7,12 @@ import com.usky.common.log.annotation.Log;
 import com.usky.common.log.enums.BusinessType;
 import com.usky.fire.domain.DemWaterSource;
 import com.usky.fire.service.DemWaterSourceService;
+import com.usky.fire.service.po.FireWaterPO;
+import com.usky.fire.service.vo.FireWaterStatisticsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -67,5 +70,50 @@ public class DemWaterSourceController {
         demWaterSourceService.delWaterSource(id);
         return ApiResult.success();
     }
+
+
+    /**
+     * 消防水源情况-警情撒点
+     *
+     * @param scattererType 撒点类型
+     * @param streetTown    街镇
+     * @return
+     */
+    @GetMapping("waterSourceScatterer")
+    public ApiResult<List<Object>> waterSourceScatterer(@RequestParam(value = "scattererType") String scattererType,
+                                                        @RequestParam(value = "streetTown", required = false) String streetTown) {
+        return ApiResult.success(demWaterSourceService.waterSourceScatterer(scattererType, streetTown));
+    }
+
+
+    /**
+     * 消防水源情况-消防水源数量
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/fireWaterStatistics")
+    public ApiResult<FireWaterStatisticsVO> getFireWaterStatistics(@RequestParam(value = "startTime", required = false) String startTime,
+                                                                   @RequestParam(value = "endTime", required = false) String endTime) {
+        return ApiResult.success(demWaterSourceService.getFireWaterStatistics(startTime, endTime));
+    }
+
+    /**
+     * 消防水源情况-水源情况
+     *
+     * @param current   当前页
+     * @param size      每页条数
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/page")
+    public ApiResult<CommonPage<FireWaterPO>> page(@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                   @RequestParam(value = "size", required = false, defaultValue = "10") Integer size,
+                                                   @RequestParam(value = "startTime", required = false) String startTime,
+                                                   @RequestParam(value = "endTime", required = false) String endTime) {
+        return ApiResult.success(demWaterSourceService.page(current, size, startTime, endTime));
+    }
 }
 

+ 79 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/UnitBeOnDutyController.java

@@ -0,0 +1,79 @@
+package com.usky.fire.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.DemMicroStation;
+import com.usky.fire.domain.DemVehicle;
+import com.usky.fire.service.DemMicroStationService;
+import com.usky.fire.service.DemOnDutyService;
+import com.usky.fire.service.DemVehicleService;
+import com.usky.fire.service.po.UnitBeOnDutyPO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 值班表 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+@RestController
+@RequestMapping("/unitBeOnDuty")
+public class UnitBeOnDutyController {
+
+    @Autowired
+    private DemOnDutyService demOnDutyService;
+
+    @Autowired
+    private DemMicroStationService demMicroStationService;
+
+    @Autowired
+    private DemVehicleService demVehicleService;
+
+    /**
+     * 消防救援站点-支队值班情况
+     *
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     * @return
+     */
+    @GetMapping("/list")
+    public ApiResult<List<List<UnitBeOnDutyPO>>> list(@RequestParam(value = "startTime", required = false) String startTime,
+                                                      @RequestParam(value = "endTime", required = false) String endTime) {
+        return ApiResult.success(demOnDutyService.list(startTime, endTime));
+    }
+
+    /**
+     * 消防救援站点-各站点执勤实力
+     *
+     * @param current 当前页
+     * @param size    每页条数
+     * @return
+     */
+    @GetMapping("/page")
+    public ApiResult<CommonPage<DemMicroStation>> page(@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
+                                                       @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
+        return ApiResult.success(demMicroStationService.page(current, size));
+    }
+
+    /**
+     * 消防救援站点-各站点执勤实力
+     *
+     * @param zdCode 所属消防机构
+     * @return
+     */
+    @GetMapping("vehiclelist")
+    public ApiResult<List<DemVehicle>> vehiclelist(@RequestParam String zdCode) {
+        return ApiResult.success(demVehicleService.list(zdCode));
+    }
+
+}
+

+ 80 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireInspect.java

@@ -0,0 +1,80 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消防检查
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DemFireInspect implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 所属单位ID
+     */
+    private String companyId;
+
+    /**
+     * 检查人员ID
+     */
+    private Integer personId;
+
+    /**
+     * 计划生成时间
+     */
+    private LocalDateTime planTime;
+
+    /**
+     * 检查结果
+     */
+    private String inspectResult;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 检查员名称
+     */
+    @TableField(exist = false)
+    private String personName;
+
+    /**
+     * 检查员职位
+     */
+    @TableField(exist = false)
+    private String personPosition;
+
+    /**
+     * 联系方式
+     */
+    @TableField(exist = false)
+    private String linkPhone;
+
+
+}

+ 66 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireInspectPerson.java

@@ -0,0 +1,66 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消防检查人员
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DemFireInspectPerson implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 检查员名称
+     */
+    private String personName;
+
+    /**
+     * 检查员职位
+     */
+    private String personPosition;
+
+    /**
+     * 联系方式
+     */
+    private String linkPhone;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    private String updatePerson;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+
+}

+ 6 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemFireStatistics.java

@@ -289,6 +289,12 @@ public class DemFireStatistics implements Serializable {
      */
     private LocalDateTime updateTime;
 
+    private String longitude;
+    private String latitude;
+    private String district;
+    private String street;
+
+
     /**
      * 起火物(一级)
      */

+ 166 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemOnDuty.java

@@ -0,0 +1,166 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 值班表
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DemOnDuty implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * ID;
+     */
+    private String dutyId;
+
+    /**
+     * 值班日期;
+     */
+    private LocalDateTime dutyTime;
+
+    /**
+     * 所属单位ID;
+     */
+    private String companyId;
+
+    /**
+     * 值班人员ID;
+     */
+    private String personId;
+
+    /**
+     * 值班人员姓名;
+     */
+    private String personName;
+
+    /**
+     * 值班类型ID;
+     */
+    private String dutyTypeId;
+
+    /**
+     * 时间戳;
+     */
+    private String timeStamp;
+
+    /**
+     * 机构名称;
+     */
+    private String organizateName;
+
+    /**
+     * 机构简称;
+     */
+    private String organizateAbbreviate;
+
+    /**
+     * 机构地址;
+     */
+    private String organizateAddress;
+
+    /**
+     * 机构联系电话;
+     */
+    private String linkPhone;
+
+    /**
+     * 机构排序;
+     */
+    private String organizateRank;
+
+    /**
+     * 值班岗位名称;
+     */
+    private String positionName;
+
+    /**
+     * 值班岗位排序;
+     */
+    private String positionRank;
+
+    /**
+     * XM姓名;
+     */
+    private String fullName;
+
+    /**
+     * RYID;
+     */
+    private String ryId;
+
+    /**
+     * RYXH;
+     */
+    private String ryXh;
+
+    /**
+     * YHZH;
+     */
+    private String yhzh;
+
+    /**
+     * ZHID;
+     */
+    private String zhId;
+
+    /**
+     * SJSZJG;
+     */
+    private String sjszjg;
+
+    /**
+     * JLZT;
+     */
+    private String jlzt;
+
+    /**
+     * YDDH;
+     */
+    private String yddh;
+
+    /**
+     * JGJC;
+     */
+    private String jgjc;
+
+    /**
+     * JGTREE;
+     */
+    private String jgtree;
+
+    /**
+     * 身份证号;
+     */
+    private String idNumber;
+
+    /**
+     * 值班人员排序;
+     */
+    private String personRank;
+
+    /**
+     * unionKey;
+     */
+    private String unionKey;
+
+
+}

+ 13 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/DemWaterSourceMaintain.java

@@ -3,11 +3,12 @@ package com.usky.fire.domain;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import java.io.Serializable;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
 /**
  * <p>
  * 天然水源信息表
@@ -69,5 +70,15 @@ public class DemWaterSourceMaintain implements Serializable {
      */
     private String deleteFlag;
 
+    /**
+     * 经度
+     */
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    private String latitude;
+
 
 }

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireInspectMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.DemFireInspect;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消防检查 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+public interface DemFireInspectMapper extends CrudMapper<DemFireInspect> {
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireInspectPersonMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 消防检查人员 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+public interface DemFireInspectPersonMapper extends CrudMapper<DemFireInspectPerson> {
+
+}

+ 10 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemFireStatisticsMapper.java

@@ -2,6 +2,13 @@ package com.usky.fire.mapper;
 
 import com.usky.fire.domain.DemFireStatistics;
 import com.usky.common.mybatis.core.CrudMapper;
+import com.usky.fire.service.po.FireStatisticsPO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -11,6 +18,9 @@ import com.usky.common.mybatis.core.CrudMapper;
  * @author JCB
  * @since 2022-09-13
  */
+@Repository
 public interface DemFireStatisticsMapper extends CrudMapper<DemFireStatistics> {
 
+    int updateList(List<FireStatisticsPO> list);
+
 }

+ 2 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemMicroStationMapper.java

@@ -2,6 +2,7 @@ package com.usky.fire.mapper;
 
 import com.usky.fire.domain.DemMicroStation;
 import com.usky.common.mybatis.core.CrudMapper;
+import org.springframework.stereotype.Repository;
 
 /**
  * <p>
@@ -11,6 +12,7 @@ import com.usky.common.mybatis.core.CrudMapper;
  * @author JCB
  * @since 2022-10-24
  */
+@Repository
 public interface DemMicroStationMapper extends CrudMapper<DemMicroStation> {
 
 }

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/DemOnDutyMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.DemOnDuty;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 值班表 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+public interface DemOnDutyMapper extends CrudMapper<DemOnDuty> {
+
+}

+ 30 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireInspectPersonService.java

@@ -0,0 +1,30 @@
+package com.usky.fire.service;
+
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.common.mybatis.core.CrudService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 消防检查人员 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+public interface DemFireInspectPersonService extends CrudService<DemFireInspectPerson> {
+
+    CommonPage<DemFireInspectPerson> fireInspectPersonList(String personName, String personPosition, Integer id, Integer pageNum, Integer pageSize);
+
+    List<DemFireInspectPerson> fireInspectPersonList(String personName, String personPosition, List<Integer> idList);
+
+    int fireInspectPersonCount(String personName, String personPosition, Integer id);
+
+    void addFireInspectPerson(DemFireInspectPerson demFireInspectPerson);
+
+    void updateFireInspectPerson(DemFireInspectPerson demFireInspectPerson);
+
+    void delFireInspectPerson(Integer id);
+}

+ 23 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireInspectService.java

@@ -0,0 +1,23 @@
+package com.usky.fire.service;
+
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.DemFireInspect;
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.DemFireInspectPerson;
+
+/**
+ * <p>
+ * 消防检查 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+public interface DemFireInspectService extends CrudService<DemFireInspect> {
+
+    CommonPage<DemFireInspect> fireInspectList(String companyId, Integer pageNum, Integer pageSize);
+
+    DemFireInspectPerson addFireInspect(DemFireInspect demFireInspect);
+
+    void updateFireInspect(DemFireInspect demFireInspect);
+}

+ 6 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireStatisticsAttachService.java

@@ -22,4 +22,10 @@ public interface DemFireStatisticsAttachService extends CrudService<DemFireStati
      * @return
      */
     List<DemFireStatisticsAttach> fireAccidentStatistic(List<String> fireNumberList);
+
+    List<String> fireCauseType();
+
+    Integer fireStatisticsAttachCount(String fireCauseType1);
+
+    List<String> getFireType();
 }

+ 13 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemFireStatisticsService.java

@@ -4,9 +4,14 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.DemFileLabel;
 import com.usky.fire.domain.DemFireStatistics;
+import com.usky.fire.service.po.FireStatisticsPO;
 import com.usky.fire.service.vo.DemFireStatisticsVo;
+import com.usky.fire.service.vo.FireBubbleVO;
+import com.usky.fire.service.vo.FireLevelRatioVO;
 import com.usky.fire.service.vo.ParameterVo;
 
+import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -89,4 +94,12 @@ public interface DemFireStatisticsService extends CrudService<DemFireStatistics>
     CommonPage<Map<String, Object>> firePlaceList(String fireNumber, Integer id, Integer pageNum, Integer pageSize);
 
     void updateFirePlace(DemFireStatistics demFireStatistics);
+
+    List<Object> getFireCountByData(String startTime, String endTime, String address, String fireType);
+
+    List<FireLevelRatioVO> getGroupByLevel(String startTime, String endTime, String address);
+
+    CommonPage<FireStatisticsPO> page(Integer current, Integer size, String startTime, String endTime, String address);
+
+    List<FireBubbleVO> getAvgAndSum(String startTime, String endTime, String fireType, String unitId);
 }

+ 6 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemMicroStationService.java

@@ -51,4 +51,10 @@ public interface DemMicroStationService extends CrudService<DemMicroStation> {
      * @return
      */
     List<Map<String, Object>> microStationDroplistList(String branchName);
+
+    List<Object> microStationScatterer(String streetTown);
+
+    List<Object> synthesizePoliceSituationScatterer(String streetTown, String scattererType);
+
+    CommonPage<DemMicroStation> page(Integer current, Integer size);
 }

+ 20 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemOnDutyService.java

@@ -0,0 +1,20 @@
+package com.usky.fire.service;
+
+import com.usky.fire.domain.DemOnDuty;
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.service.po.UnitBeOnDutyPO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 值班表 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+public interface DemOnDutyService extends CrudService<DemOnDuty> {
+
+    List<List<UnitBeOnDutyPO>> list(String startTime, String endTime);
+}

+ 15 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemPoliceInfoService.java

@@ -1,7 +1,12 @@
 package com.usky.fire.service;
 
+import com.usky.common.core.bean.CommonPage;
 import com.usky.fire.domain.DemPoliceInfo;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.service.vo.AlertStatisticsVO;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +18,14 @@ import com.usky.common.mybatis.core.CrudService;
  */
 public interface DemPoliceInfoService extends CrudService<DemPoliceInfo> {
 
+    Map<String, List<AlertStatisticsVO>> getAlertStatisticsByMonth(String startTime, String endTime, String streetTown);
+
+    List<AlertStatisticsVO> getAlertStatistics(String startTime, String endTime, String streetTown);
+
+    CommonPage<DemPoliceInfo> page(Integer current, Integer size, String startTime, String endTime, String streetTown);
+
+    Map<String, List<AlertStatisticsVO>> getAlertStatisticsByHouse(String startTime, String endTime, String streetTown);
+
+    List<Map<String, Object>> warningInstanceScatterer(String streetTown, Integer id);
+
 }

+ 4 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemVehicleFightService.java

@@ -3,6 +3,9 @@ package com.usky.fire.service;
 import com.usky.fire.domain.DemVehicleFight;
 import com.usky.common.mybatis.core.CrudService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 车辆作战信息 服务类
@@ -13,4 +16,5 @@ import com.usky.common.mybatis.core.CrudService;
  */
 public interface DemVehicleFightService extends CrudService<DemVehicleFight> {
 
+    List<Map<String, Object>> vehicleFightList(String policeId);
 }

+ 6 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemVehicleService.java

@@ -4,6 +4,8 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.DemVehicle;
 
+import java.util.List;
+
 /**
  * <p>
  * 车辆信息 服务类
@@ -39,4 +41,8 @@ public interface DemVehicleService extends CrudService<DemVehicle> {
      * @param id 主键ID
      */
     void delVehicle(Integer id);
+
+    List<DemVehicle> vehicleList(List<String> vehicleIdList);
+
+    List<DemVehicle> list(String zdCode);
 }

+ 4 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemWaterSourceMaintainService.java

@@ -4,6 +4,8 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.DemWaterSourceMaintain;
 
+import java.util.List;
+
 /**
  * <p>
  * 天然水源信息表 服务类
@@ -45,4 +47,6 @@ public interface DemWaterSourceMaintainService extends CrudService<DemWaterSourc
      * @param id 主键ID
      */
     void delWaterSourceMaintain(Integer id);
+
+    List<Object> waterSourceMaintainScatterer(String streetTown);
 }

+ 20 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/DemWaterSourceService.java

@@ -2,8 +2,12 @@ package com.usky.fire.service;
 
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.DemMicroStation;
 import com.usky.fire.domain.DemWaterSource;
+import com.usky.fire.service.po.FireWaterPO;
+import com.usky.fire.service.vo.FireWaterStatisticsVO;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -40,4 +44,20 @@ public interface DemWaterSourceService extends CrudService<DemWaterSource> {
      * @param id 主键ID
      */
     void delWaterSource(Integer id);
+
+    List<Object> waterSourceList(String streetTown);
+
+    List<DemWaterSource> waterSourceList();
+
+    List<Map<String, Object>> surroundingResources(double longitude, double latitude, Integer distance);
+
+    List<Object> waterSourceScatterer(String scattererType, String streetTown);
+
+    List<DemMicroStation> microStationScatterer();
+
+    int waterSourceCount(String waterType, String waterNature, String waterForm, String startTime, String endTime, String availableStatus);
+
+    FireWaterStatisticsVO getFireWaterStatistics(String startTime, String endTime);
+
+    CommonPage<FireWaterPO> page(Integer current, Integer size, String startTime, String endTime);
 }

+ 12 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyServiceImpl.java

@@ -250,12 +250,14 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
 
     @Override
     public List<Map<String, Object>> reportComplaint() {
+        IPage<DemEnforceReportComplaint> page = new Page<>(1, 500);
         List<Map<String, Object>> list1 = new ArrayList<>();
         LambdaQueryWrapper<DemEnforceReportComplaint> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(DemEnforceReportComplaint::getReportAddress, DemEnforceReportComplaint::getLatitude,
                 DemEnforceReportComplaint::getLongitude, DemEnforceReportComplaint::getId)
                 .eq(DemEnforceReportComplaint::getEnable, 0);
-        List<DemEnforceReportComplaint> list = demEnforceReportComplaintService.list(queryWrapper);
+        page = demEnforceReportComplaintService.page(page, queryWrapper);
+        List<DemEnforceReportComplaint> list = page.getRecords();
         if (CollectionUtils.isNotEmpty(list)) {
             for (int i = 0; i < list.size(); i++) {
                 Map<String, Object> map = new HashMap<>();
@@ -291,12 +293,14 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
 
     @Override
     public List<String> inspectDeclare() {
+        IPage<DemAtlInspectDeclare> page = new Page<>(1, 500);
         List<String> companyCodeList = new ArrayList<>();
         LambdaQueryWrapper<DemAtlInspectDeclare> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(DemAtlInspectDeclare::getDeclareCompanyCode)
                 .eq(DemAtlInspectDeclare::getDeleteFlag, 0)
                 .groupBy(DemAtlInspectDeclare::getDeclareCompanyCode);
-        List<DemAtlInspectDeclare> list = demAtlInspectDeclareService.list(queryWrapper);
+        page = demAtlInspectDeclareService.page(page, queryWrapper);
+        List<DemAtlInspectDeclare> list = page.getRecords();
         if (CollectionUtils.isNotEmpty(list)) {
             for (int i = 0; i < list.size(); i++) {
                 companyCodeList.add(list.get(i).getDeclareCompanyCode());
@@ -307,12 +311,14 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
 
     @Override
     public List<String> lawStatistics() {
+        IPage<DemLawStatistics> page = new Page<>(1, 500);
         List<String> companyCodeList = new ArrayList<>();
         LambdaQueryWrapper<DemLawStatistics> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(DemLawStatistics::getCompanyCode)
                 .eq(DemLawStatistics::getDeleteFlag, 0)
                 .groupBy(DemLawStatistics::getCompanyCode);
-        List<DemLawStatistics> list = demLawStatisticsService.list(queryWrapper);
+        page = demLawStatisticsService.page(page, queryWrapper);
+        List<DemLawStatistics> list = page.getRecords();
         if (CollectionUtils.isNotEmpty(list)) {
             for (int i = 0; i < list.size(); i++) {
                 companyCodeList.add(list.get(i).getCompanyCode());
@@ -434,13 +440,15 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
         streetTownList.add("浦锦街道");
         streetTownList.add("浦江镇");
         List<Object> list = new ArrayList<>();
+        IPage<BaseCompany> page = new Page<>(1, 500);
         LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName,
                 BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getStreetTown)
                 .eq(BaseCompany::getEnable, 0)
                 .eq(StringUtils.isNotBlank(streetTown), BaseCompany::getStreetTown, streetTown)
                 .eq(StringUtils.isNotBlank(companyType), BaseCompany::getCompanyType, companyType);
-        List<BaseCompany> list1 = this.list(queryWrapper);
+        page = this.page(page, queryWrapper);
+        List<BaseCompany> list1 = page.getRecords();
         if (CollectionUtils.isNotEmpty(list1)) {
             List<String> companyIdList = new ArrayList<>();
             for (int i = 0; i < list1.size(); i++) {

+ 92 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireInspectPersonServiceImpl.java

@@ -0,0 +1,92 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.fire.mapper.DemFireInspectPersonMapper;
+import com.usky.fire.service.DemFireInspectPersonService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ * 消防检查人员 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@Service
+public class DemFireInspectPersonServiceImpl extends AbstractCrudService<DemFireInspectPersonMapper, DemFireInspectPerson> implements DemFireInspectPersonService {
+
+    @Override
+    public CommonPage<DemFireInspectPerson> fireInspectPersonList(String personName, String personPosition, Integer id, Integer pageNum, Integer pageSize) {
+        IPage<DemFireInspectPerson> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DemFireInspectPerson> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.like(StringUtils.isNotBlank(personName), DemFireInspectPerson::getPersonName, personName)
+                .like(StringUtils.isNotBlank(personPosition), DemFireInspectPerson::getPersonPosition, personPosition)
+                .eq(null != id && id != 0, DemFireInspectPerson::getId, id)
+                .orderByDesc(DemFireInspectPerson::getId);
+        page = this.page(page, queryWrapper);
+        return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageNum);
+    }
+
+    @Override
+    public List<DemFireInspectPerson> fireInspectPersonList(String personName, String personPosition, List<Integer> idList) {
+        LambdaQueryWrapper<DemFireInspectPerson> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.like(StringUtils.isNotBlank(personName), DemFireInspectPerson::getPersonName, personName)
+                .like(StringUtils.isNotBlank(personPosition), DemFireInspectPerson::getPersonPosition, personPosition)
+                .in(CollectionUtils.isNotEmpty(idList), DemFireInspectPerson::getId, idList)
+                .orderByDesc(DemFireInspectPerson::getId);
+        List<DemFireInspectPerson> list = this.list(queryWrapper);
+        return list;
+    }
+
+    @Override
+    public int fireInspectPersonCount(String personName, String personPosition, Integer id) {
+        LambdaQueryWrapper<DemFireInspectPerson> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.like(StringUtils.isNotBlank(personName), DemFireInspectPerson::getPersonName, personName)
+                .like(StringUtils.isNotBlank(personPosition), DemFireInspectPerson::getPersonPosition, personPosition)
+                .ne(null != id && id != 0, DemFireInspectPerson::getId, id)
+                .orderByDesc(DemFireInspectPerson::getId);
+        int count = this.count(queryWrapper);
+        return count;
+    }
+
+    @Override
+    public void addFireInspectPerson(DemFireInspectPerson demFireInspectPerson) {
+        int count = this.fireInspectPersonCount(demFireInspectPerson.getPersonName(), demFireInspectPerson.getPersonPosition(), 0);
+        if (count > 0) {
+            throw new BusinessException("检查员重复,不可添加");
+        }
+        demFireInspectPerson.setCreator(SecurityUtils.getUsername());
+        demFireInspectPerson.setCreateTime(LocalDateTime.now());
+        this.save(demFireInspectPerson);
+    }
+
+    @Override
+    public void updateFireInspectPerson(DemFireInspectPerson demFireInspectPerson) {
+        int count = this.fireInspectPersonCount(demFireInspectPerson.getPersonName(), demFireInspectPerson.getPersonPosition(), demFireInspectPerson.getId());
+        if (count > 0) {
+            throw new BusinessException("检查员重复,不可修改");
+        }
+        demFireInspectPerson.setUpdatePerson(SecurityUtils.getUsername());
+        demFireInspectPerson.setUpdateTime(LocalDateTime.now());
+        this.updateById(demFireInspectPerson);
+    }
+
+    @Override
+    public void delFireInspectPerson(Integer id) {
+        this.removeById(id);
+    }
+}

+ 87 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireInspectServiceImpl.java

@@ -0,0 +1,87 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.fire.domain.DemFireInspect;
+import com.usky.fire.domain.DemFireInspectPerson;
+import com.usky.fire.mapper.DemFireInspectMapper;
+import com.usky.fire.service.DemFireInspectPersonService;
+import com.usky.fire.service.DemFireInspectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * <p>
+ * 消防检查 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-24
+ */
+@Service
+public class DemFireInspectServiceImpl extends AbstractCrudService<DemFireInspectMapper, DemFireInspect> implements DemFireInspectService {
+
+    @Autowired
+    private DemFireInspectPersonService demFireInspectPersonService;
+
+    @Override
+    public CommonPage<DemFireInspect> fireInspectList(String companyId, Integer pageNum, Integer pageSize) {
+        IPage<DemFireInspect> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DemFireInspect> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DemFireInspect::getCompanyId, companyId)
+                .orderByDesc(DemFireInspect::getId);
+        page = this.page(page, queryWrapper);
+        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+            List<Integer> personIdList = new ArrayList<>();
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                personIdList.add(page.getRecords().get(i).getPersonId());
+            }
+            List<DemFireInspectPerson> demFireInspectPeople = demFireInspectPersonService.fireInspectPersonList(null, null, personIdList);
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                for (int j = 0; j < demFireInspectPeople.size(); j++) {
+                    if (page.getRecords().get(i).getPersonId() == demFireInspectPeople.get(j).getId()) {
+                        page.getRecords().get(i).setPersonName(demFireInspectPeople.get(j).getPersonName());
+                        page.getRecords().get(i).setPersonPosition(demFireInspectPeople.get(j).getPersonPosition());
+                        page.getRecords().get(i).setLinkPhone(demFireInspectPeople.get(j).getLinkPhone());
+                    }
+                }
+            }
+        }
+        return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageNum);
+    }
+
+    @Transactional
+    @Override
+    public DemFireInspectPerson addFireInspect(DemFireInspect demFireInspect) {
+        List<DemFireInspectPerson> list = demFireInspectPersonService.fireInspectPersonList(null, null, null);
+        int value = 0;
+        if (list.size() != 1) {
+            Random random = new Random();
+            value = random.nextInt(list.size());
+        }
+        demFireInspect.setPersonId(list.get(value).getId());
+        demFireInspect.setPlanTime(LocalDateTime.now());
+        demFireInspect.setCreator(SecurityUtils.getUsername());
+        demFireInspect.setCreateTime(LocalDateTime.now());
+        this.save(demFireInspect);
+        return list.get(value);
+    }
+
+    @Override
+    public void updateFireInspect(DemFireInspect demFireInspect) {
+        this.updateById(demFireInspect);
+    }
+
+}

+ 46 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireStatisticsAttachServiceImpl.java

@@ -1,14 +1,20 @@
 package com.usky.fire.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.fire.domain.DemFireStatisticsAttach;
 import com.usky.fire.mapper.DemFireStatisticsAttachMapper;
 import com.usky.fire.service.DemFireStatisticsAttachService;
+import com.usky.fire.service.vo.FireLevelRatioVO;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -30,4 +36,44 @@ public class DemFireStatisticsAttachServiceImpl extends AbstractCrudService<DemF
         List<DemFireStatisticsAttach> list = this.list(queryWrapper);
         return list;
     }
+
+    @Override
+    public List<String> fireCauseType(){
+        LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemFireStatisticsAttach::getFireCauseType1)
+                .groupBy(DemFireStatisticsAttach::getFireCauseType1);
+        List<DemFireStatisticsAttach> list1 = this.list(queryWrapper);
+        List<String> list = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list1)){
+            for (int i = 0; i < list1.size(); i++) {
+                list.add(list1.get(i).getFireCauseType1());
+            }
+        }
+        return list;
+    }
+
+    @Override
+    public Integer fireStatisticsAttachCount(String fireCauseType1){
+        LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(StringUtils.isNotBlank(fireCauseType1),DemFireStatisticsAttach::getFireCauseType1, fireCauseType1);
+        int count = this.count(queryWrapper);
+        return count;
+    }
+
+    @Override
+    public List<String> getFireType() {
+        List<FireLevelRatioVO> list = new ArrayList<>();
+        List<String> fireTypes = this.fireCauseType();
+        if (CollectionUtils.isNotEmpty(fireTypes)) {
+            for (String cause : fireTypes) {
+                FireLevelRatioVO fireLevelRatioVo = new FireLevelRatioVO();
+                fireLevelRatioVo.setFireType(cause);
+                Integer count = this.fireStatisticsAttachCount(cause);
+                fireLevelRatioVo.setRadio(count.doubleValue());
+                list.add(fireLevelRatioVo);
+            }
+        }
+        return list.stream().sorted(Comparator.comparing(FireLevelRatioVO::getRadio).reversed())
+                .map(FireLevelRatioVO::getFireType).collect(Collectors.toList());
+    }
 }

+ 271 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemFireStatisticsServiceImpl.java

@@ -1,13 +1,18 @@
 package com.usky.fire.service.impl;
 
 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.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.ruoyi.common.core.utils.bean.BeanUtils;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.Arith;
+import com.usky.common.core.util.DateUtils;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.DemFileLabel;
@@ -19,18 +24,19 @@ import com.usky.fire.service.DemFileLabelService;
 import com.usky.fire.service.DemFireLabelAttributeService;
 import com.usky.fire.service.DemFireStatisticsAttachService;
 import com.usky.fire.service.DemFireStatisticsService;
+import com.usky.fire.service.po.FireStatisticsPO;
 import com.usky.fire.service.util.OnlineMethod;
-import com.usky.fire.service.vo.DemFireStatisticsVo;
-import com.usky.fire.service.vo.ParameterVo;
+import com.usky.fire.service.vo.*;
+import io.lettuce.core.dynamic.support.ReflectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.time.ZoneId;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -486,4 +492,263 @@ public class DemFireStatisticsServiceImpl extends AbstractCrudService<DemFireSta
         demFireStatisticsAttach.setUpdateTime(LocalDateTime.now());
         demFireStatisticsAttachService.updateById(demFireStatisticsAttach);
     }
+
+    @Override
+    public List<Object> getFireCountByData(String startTime, String endTime, String address, String fireType) {
+        Date startTime1 = null;
+        Date endTime1 = null;
+        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
+            startTime1 = OnlineMethod.transferString2Date(startTime);
+            endTime1 = OnlineMethod.transferString2Date(endTime);
+        }
+
+        List<Object> list = new ArrayList<>();
+        Date date = new Date();
+        Date beginDayOfYear = DateUtils.getBeginDayOfYear(date);
+        //获取传入时间的最大时间和最小时间
+        int distanceOfTwoDate = Integer.parseInt(DateUtils.getYear(endTime1)) - Integer.parseInt(DateUtils.getYear(startTime1)) + 1;
+        //获取数据库全部项目的最小时间和最大时间
+        QueryWrapper<DemFireStatistics> query = Wrappers.query();
+        query.select("max(fire_time) as fireTime");
+        DemFireStatistics one = this.getOne(query);
+        QueryWrapper<DemFireStatistics> query1 = Wrappers.query();
+        query1.select("min(fire_time) as fireTime");
+        DemFireStatistics one1 = this.getOne(query1);
+        Date maxDate = null;
+        Date minDate = null;
+        if (one.getFireTime() != null) {
+            maxDate = Date.from(one.getFireTime().atZone(ZoneId.systemDefault()).toInstant());
+        }
+        if (one1.getFireTime() != null) {
+            minDate = Date.from(one1.getFireTime().atZone(ZoneId.systemDefault()).toInstant());
+        }
+        int distanceOfTwoDateYear = Integer.parseInt(DateUtils.getYear(maxDate)) - Integer.parseInt(DateUtils.getYear(minDate)) + 1;
+        list.add(perfect(beginDayOfYear, date, address, fireType, 1));
+        list.add(perfect(startTime1, endTime1, address, fireType, distanceOfTwoDate));
+        list.add(perfect(null, null, address, fireType, distanceOfTwoDateYear));
+        return list;
+    }
+
+    public List<Object> perfect(Date startTime, Date endTime, String address, String fireType, Integer subTime) {
+        List<String> fireNumberList = new ArrayList<>();
+        if (StringUtils.isNotBlank(fireType)) {
+            LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.select(DemFireStatisticsAttach::getFireNumber)
+                    .eq(DemFireStatisticsAttach::getFireCauseType1, fireType);
+            List<DemFireStatisticsAttach> list1 = demFireStatisticsAttachService.list(queryWrapper);
+            if (CollectionUtils.isNotEmpty(list1)) {
+                for (int i = 0; i < list1.size(); i++) {
+                    fireNumberList.add(list1.get(i).getFireNumber());
+                }
+            }
+        }
+        QueryWrapper<DemFireStatistics> query = Wrappers.query();
+        query.select("MONTH (fire_time) monthTime", "COUNT(1) AS aCount")
+                .like(StringUtils.isNotBlank(address), "fire_address", address)
+                .in(CollectionUtils.isNotEmpty(fireNumberList), "fire_number", fireNumberList)
+                .between(startTime != null && endTime != null, "fire_time", startTime, endTime)
+                .groupBy("monthTime");
+        List<Map<String, Object>> list = this.listMaps(query);
+        List<Object> avgList = new ArrayList<>();
+        for (int i = 1; i <= 12; i++) {
+            int finalI = i;
+            list.stream()
+                    .filter(map -> Integer.parseInt(map.get("monthTime").toString()) == finalI)
+                    .findFirst()
+                    .map(map -> {
+                        avgList.add(Arith.div(Double.parseDouble(map.get("aCount").toString()), subTime, 2));
+                        return Optional.empty();
+                    })
+                    .orElseGet(() -> {
+                        avgList.add(0.00);
+                        return Optional.empty();
+                    });
+        }
+        return avgList;
+    }
+
+    @Override
+    public List<FireLevelRatioVO> getGroupByLevel(String startTime, String endTime, String address) {
+        List<FireLevelRatioVO> list = new ArrayList<>();
+        int fireCount = 0;
+        List<String> fireCauses = demFireStatisticsAttachService.getFireType();
+        for (String cause : fireCauses) {
+            if (StringUtils.isBlank(cause)) {
+                continue;
+            }
+            FireLevelRatioVO fireLevelRatioVo = new FireLevelRatioVO();
+            fireLevelRatioVo.setFireType(cause);
+            List<String> fireNumberList = new ArrayList<>();
+            if (StringUtils.isNotBlank(cause)) {
+                LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper = Wrappers.lambdaQuery();
+                queryWrapper.select(DemFireStatisticsAttach::getFireNumber)
+                        .eq(DemFireStatisticsAttach::getFireCauseType1, cause);
+                List<DemFireStatisticsAttach> list1 = demFireStatisticsAttachService.list(queryWrapper);
+                if (CollectionUtils.isNotEmpty(list1)) {
+                    for (int i = 0; i < list1.size(); i++) {
+                        fireNumberList.add(list1.get(i).getFireNumber());
+                    }
+                }
+            }
+            LambdaQueryWrapper<DemFireStatistics> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.like(StringUtils.isNotBlank(address), DemFireStatistics::getFireAddress, address)
+                    .between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemFireStatistics::getFireTime, startTime, endTime);
+            Integer count = this.count(queryWrapper);
+            fireLevelRatioVo.setRadio(count.doubleValue());
+            list.add(fireLevelRatioVo);
+            fireCount += count;
+        }
+        //排序
+        List<FireLevelRatioVO> orderByList = list.stream().sorted(Comparator.comparing(FireLevelRatioVO::getRadio).reversed()).limit(10).collect(Collectors.toList());
+
+        //差集求和
+        double sum = list.stream().filter(item -> !orderByList.contains(item)).mapToDouble(FireLevelRatioVO::getRadio).sum();
+        orderByList.stream().filter(item -> "其他".equals(item.getFireType())).findAny()
+                .map(fireLevelRatio -> {
+                            fireLevelRatio.setRadio(fireLevelRatio.getRadio() + sum);
+                            return fireLevelRatio;
+                        }
+                ).orElseGet(() -> {
+            FireLevelRatioVO fireLevelRatioVo = new FireLevelRatioVO();
+            fireLevelRatioVo.setFireType("其他");
+            fireLevelRatioVo.setRadio(sum);
+            orderByList.add(fireLevelRatioVo);
+            return fireLevelRatioVo;
+        });
+        int finalFireCount = fireCount;
+        if (0 != finalFireCount) {
+            orderByList.forEach(fireLevelRatio -> fireLevelRatio.setRadio(Arith.div(fireLevelRatio.getRadio(), finalFireCount)));
+        }
+        return orderByList;
+    }
+
+    @Override
+    public CommonPage<FireStatisticsPO> page(Integer current, Integer size, String startTime, String endTime, String address) {
+        Page<DemFireStatistics> page = new Page<>(current, size);
+        LambdaQueryWrapper<DemFireStatistics> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemFireStatistics::getFireTime, startTime, endTime)
+                .like(StringUtils.isNotBlank(address), DemFireStatistics::getFireAddress, address)
+                .orderByDesc(DemFireStatistics::getDeathToll);
+        page = this.page(page, queryWrapper);
+        List<Map<String, String>> listmap = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+            List<String> fireNumberList = new ArrayList<>();
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                fireNumberList.add(page.getRecords().get(i).getFireNumber());
+            }
+            LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper1 = Wrappers.lambdaQuery();
+            queryWrapper1.in(DemFireStatisticsAttach::getFireNumber, fireNumberList);
+            List<DemFireStatisticsAttach> list = demFireStatisticsAttachService.list(queryWrapper1);
+            AtomicReference<Map<String, String>> stringStringMap = new AtomicReference<>();
+            listmap = page.getRecords().stream().map(m -> {
+                list.stream().filter(m2 -> Objects.equals(m.getFireNumber(), m2.getFireNumber())).forEach(m2 -> {
+                    stringStringMap.set(convertObjectToMap(m));
+                    Map<String, String> stringStringMap1 = convertObjectToMap(m2);
+                    stringStringMap.get().putAll(stringStringMap1);
+                });
+                return stringStringMap.get();
+            }).collect(Collectors.toList());
+        }
+
+        List<FireStatisticsPO> list = listmap
+                .stream()
+                .map(this::enhanceFireStatisticsPo).collect(Collectors.toList());
+        //筛选出精度和维度是空的数据
+        List<FireStatisticsPO> isNullData = list.stream()
+                .filter(fireStatisticsPo -> 0.00 == fireStatisticsPo.getLatitude())
+                .filter(fireStatisticsPo -> StringUtils.isNotBlank(fireStatisticsPo.getAddress()))
+                .collect(Collectors.toList());
+        List<List<FireStatisticsPO>> subSets = Lists.partition(isNullData, 10);
+        for (List<FireStatisticsPO> listLimit : subSets) {
+            String addressList = listLimit.stream().map(FireStatisticsPO::getAddress).collect(Collectors.joining("|"));
+            List<LocateInfo> lonLat = OnlineMethod.getLonLat(addressList);
+            if (CollectionUtils.isNotEmpty(lonLat)) {
+                for (FireStatisticsPO fireStatisticsPo : listLimit) {
+                    fireStatisticsPo.setLatitude(lonLat.get(listLimit.indexOf(fireStatisticsPo)).getLatitude());
+                    fireStatisticsPo.setLongitude(lonLat.get(listLimit.indexOf(fireStatisticsPo)).getLongitude());
+                    fireStatisticsPo.setDistrict(lonLat.get(listLimit.indexOf(fireStatisticsPo)).getDistrict());
+                    fireStatisticsPo.setStreet(lonLat.get(listLimit.indexOf(fireStatisticsPo)).getStreet());
+
+                }
+                baseMapper.updateList(listLimit);
+            }
+        }
+        return new CommonPage<>(list, page.getTotal(), page.getSize(), page.getCurrent());
+    }
+
+    @Override
+    public List<FireBubbleVO> getAvgAndSum(String startTime, String endTime, String fireType, String unitId) {
+        List<FireBubbleVO> fireBubbleVOS = new ArrayList<>();
+        List<String> fireNumberList = new ArrayList<>();
+        if (StringUtils.isNotBlank(fireType)) {
+            LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.select(DemFireStatisticsAttach::getFireNumber)
+                    .eq(DemFireStatisticsAttach::getFireCauseType1, fireType);
+            List<DemFireStatisticsAttach> list = demFireStatisticsAttachService.list(queryWrapper);
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (int i = 0; i < list.size(); i++) {
+                    fireNumberList.add(list.get(i).getFireNumber());
+                }
+            }
+        }
+        QueryWrapper<DemFireStatistics> query = Wrappers.query();
+        query.select("administrative_division as region", "IFNULL(sum(death_toll),0) as deathPerson", "IFNULL(avg(burned_area),0.00) as fireArea", "count(1) as fireCount")
+                .eq(StringUtils.isNotBlank(unitId), "company_code", unitId)
+                .between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), "fire_time", startTime, endTime)
+                .in(CollectionUtils.isNotEmpty(fireNumberList), "fire_number", fireNumberList)
+                .groupBy("administrative_division");
+        List<Map<String, Object>> list = this.listMaps(query);
+//        list = list.stream().filter(s -> s.get("region").toString().contains("派出所")).collect(Collectors.toList());
+        list.forEach(s -> {
+            FireBubbleVO fireBubbleVo = new FireBubbleVO();
+            if (s.get("region").toString().contains("派出所")){
+                fireBubbleVo.setRegion(s.get("region").toString().replace("派出所",""));
+            }else {
+                fireBubbleVo.setRegion(s.get("region").toString());
+            }
+
+            fireBubbleVo.setFireCount(Integer.valueOf(s.get("fireCount").toString()));
+            fireBubbleVo.setDeathToll(Double.valueOf(s.get("deathPerson").toString()));
+            fireBubbleVo.setFireArea(Double.valueOf(s.get("fireArea").toString()));
+            fireBubbleVOS.add(fireBubbleVo);
+        });
+        return fireBubbleVOS;
+    }
+
+
+    public FireStatisticsPO enhanceFireStatisticsPo(Map<String, String> map) {
+        FireStatisticsPO fireStatisticsPo = new FireStatisticsPO();
+        fireStatisticsPo.setId(Optional.ofNullable(map.get("fireNumber")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setAddress(Optional.ofNullable(map.get("fireAddress")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setBurnedArea(Optional.ofNullable(map.get("burnedArea")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setPropertyLoss(Optional.ofNullable(map.get("directPropertyLoss")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setDeathToll(Optional.ofNullable(map.get("deathToll")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setNonFatal(Optional.ofNullable(map.get("victimNumber")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setDisasterHome(Optional.ofNullable(map.get("affectedHouse")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setFireCause(Optional.ofNullable(map.get("fireCauseType1")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setFireLevel(Optional.ofNullable(map.get("fireGrade")).filter(s -> !"null".equals(s)).orElse(""));
+        fireStatisticsPo.setLongitude(Double.valueOf(Optional.ofNullable(map.get("longitude")).filter(StringUtils::isNotBlank).orElse("0.00")));
+        fireStatisticsPo.setLatitude(Double.valueOf(Optional.ofNullable(map.get("latitude")).filter(StringUtils::isNotBlank).orElse("0.00")));
+        fireStatisticsPo.setDistrict(map.get("district"));
+        fireStatisticsPo.setStreet(map.get("street"));
+        fireStatisticsPo.setPlaceOne(map.get("initialFuelType1"));
+        fireStatisticsPo.setPlaceTwo(map.get("initialFuelType2"));
+        fireStatisticsPo.setFireGoodsOne(map.get("fireSiteType1"));
+        fireStatisticsPo.setFireGoodsTwo(map.get("fireSiteType2"));
+        fireStatisticsPo.setNature(map.get("useCharacterName"));
+        return fireStatisticsPo;
+    }
+
+
+    private static Map<String, String> convertObjectToMap(Object obj) {
+        return Arrays.stream(BeanUtils.getPropertyDescriptors(obj.getClass()))
+                .filter(pd -> !"class".equals(pd.getName()))
+                .collect(HashMap::new,
+                        (map, pd) -> {
+                            if (ReflectionUtils.invokeMethod(pd.getReadMethod(), obj) != null) {
+                                map.put(pd.getName(), String.valueOf(ReflectionUtils.invokeMethod(pd.getReadMethod(), obj)));
+                            }
+                        },
+                        HashMap::putAll);
+    }
 }

+ 70 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemMicroStationServiceImpl.java

@@ -7,10 +7,14 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.fire.domain.DemMicroStation;
 import com.usky.fire.mapper.DemMicroStationMapper;
+import com.usky.fire.service.BaseCompanyService;
 import com.usky.fire.service.DemMicroStationService;
+import com.usky.fire.service.DemWaterSourceService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -27,8 +31,13 @@ import java.util.*;
 @Service
 public class DemMicroStationServiceImpl extends AbstractCrudService<DemMicroStationMapper, DemMicroStation> implements DemMicroStationService {
 
+    @Autowired
+    private BaseCompanyService baseCompanyService;
+    @Autowired
+    private DemWaterSourceService demWaterSourceService;
+
     @Override
-    public CommonPage<Map<String, Object>> microStationList(String squadron, String stationName,String stationType,Integer id, Integer pageNum, Integer pageSize) {
+    public CommonPage<Map<String, Object>> microStationList(String squadron, String stationName, String stationType, Integer id, Integer pageNum, Integer pageSize) {
         List<Map<String, Object>> list = new ArrayList<>();
         IPage<DemMicroStation> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<DemMicroStation> queryWrapper = Wrappers.lambdaQuery();
@@ -38,7 +47,7 @@ public class DemMicroStationServiceImpl extends AbstractCrudService<DemMicroStat
                 DemMicroStation::getChargePhone, DemMicroStation::getStationType, DemMicroStation::getLongitude,
                 DemMicroStation::getDimension, DemMicroStation::getCreateTime, DemMicroStation::getUpdateTime)
                 .eq(DemMicroStation::getDeleteFlag, 0)
-                .eq(StringUtils.isNotBlank(stationType),DemMicroStation::getStationType,stationType)
+                .eq(StringUtils.isNotBlank(stationType), DemMicroStation::getStationType, stationType)
                 .like(StringUtils.isNotBlank(squadron), DemMicroStation::getSquadron, squadron)
                 .like(StringUtils.isNotBlank(stationName), DemMicroStation::getStationName, stationName)
                 .orderByDesc(DemMicroStation::getId);
@@ -101,4 +110,63 @@ public class DemMicroStationServiceImpl extends AbstractCrudService<DemMicroStat
         return list;
     }
 
+
+    @Override
+    public List<Object> microStationScatterer(String streetTown) {
+        IPage<DemMicroStation> page = new Page<>(1, 500);
+        LambdaQueryWrapper<DemMicroStation> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemMicroStation::getId, DemMicroStation::getStationName, DemMicroStation::getLongitude,
+                DemMicroStation::getDimension)
+                .eq(DemMicroStation::getDeleteFlag, "0")
+                .eq(StringUtils.isNotBlank(streetTown), DemMicroStation::getRemark, streetTown)
+                .orderByDesc(DemMicroStation::getId);
+        page = this.page(page, queryWrapper);
+        List<DemMicroStation> list1 = page.getRecords();
+        List<Object> list = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            for (int i = 0; i < list1.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", list1.get(i).getId());
+                map.put("stationName", list1.get(i).getStationName());
+                map.put("longitude", list1.get(i).getLongitude());
+                map.put("latitude", list1.get(i).getDimension());
+                list.add(map);
+            }
+        }
+        return list;
+    }
+
+    @Override
+    public List<Object> synthesizePoliceSituationScatterer(String streetTown, String scattererType) {
+        List<Object> list = new ArrayList<>();
+        switch (scattererType) {
+            case "消防站":
+                list = this.microStationScatterer(streetTown);
+                break;
+            case "监控":
+                break;
+            case "重点单位":
+                list = baseCompanyService.companyScatterer(streetTown, "1");
+                break;
+            case "消防车":
+                break;
+            case "消火栓/天然水源":
+                list = demWaterSourceService.waterSourceList(streetTown);
+                break;
+            default:
+                throw new BusinessException("该类型点位未定义");
+        }
+        return list;
+    }
+
+    @Override
+    public CommonPage<DemMicroStation> page(Integer current, Integer size) {
+        IPage<DemMicroStation> page = new Page<>(current, size);
+        LambdaQueryWrapper<DemMicroStation> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DemMicroStation::getDeleteFlag,0)
+                .orderByDesc(DemMicroStation::getId);
+        page = this.page(page, queryWrapper);
+        return new CommonPage<>(page.getRecords(), page.getTotal(), size, current);
+    }
+
 }

+ 57 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemOnDutyServiceImpl.java

@@ -0,0 +1,57 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.domain.DemOnDuty;
+import com.usky.fire.mapper.DemOnDutyMapper;
+import com.usky.fire.service.DemOnDutyService;
+import com.usky.fire.service.po.UnitBeOnDutyPO;
+import org.springframework.stereotype.Service;
+
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 值班表 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-11-28
+ */
+@Service
+public class DemOnDutyServiceImpl extends AbstractCrudService<DemOnDutyMapper, DemOnDuty> implements DemOnDutyService {
+
+    @Override
+    public List<List<UnitBeOnDutyPO>> list(String startTime, String endTime) {
+        List<List<UnitBeOnDutyPO>> lists = new ArrayList<>();
+        List<UnitBeOnDutyPO> list = new ArrayList<>();
+        LambdaQueryWrapper<DemOnDuty> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemOnDuty::getDutyTime, startTime, endTime);
+        List<DemOnDuty> unitBeOnDutyLists = this.list(queryWrapper);
+        unitBeOnDutyLists.forEach(stringStringMap -> list.add(enhanceUnitBeOnDutyPo(stringStringMap)));
+        TreeMap<String, List<UnitBeOnDutyPO>> collect = list.stream().collect(Collectors.groupingBy(UnitBeOnDutyPO::getTime, TreeMap::new, Collectors.toList()));
+        for (String s : collect.keySet()) {
+            lists.add(collect.get(s));
+        }
+        return lists;
+    }
+
+    public UnitBeOnDutyPO enhanceUnitBeOnDutyPo(DemOnDuty unitBeOnDutyMap) {
+        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        UnitBeOnDutyPO unitBeOnDutyPo = new UnitBeOnDutyPO();
+        unitBeOnDutyPo.setName(unitBeOnDutyMap.getPersonName());
+        unitBeOnDutyPo.setPostName(unitBeOnDutyMap.getPositionName());
+        unitBeOnDutyPo.setOrganizationName(unitBeOnDutyMap.getOrganizateName());
+        unitBeOnDutyPo.setOrganizationShort(unitBeOnDutyMap.getOrganizateAbbreviate());
+        unitBeOnDutyPo.setOrganizationAddress(unitBeOnDutyMap.getOrganizateAddress());
+        unitBeOnDutyPo.setTime(unitBeOnDutyMap.getDutyTime().format(fmt));
+        return unitBeOnDutyPo;
+    }
+
+}

+ 261 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemPoliceInfoServiceImpl.java

@@ -1,11 +1,35 @@
 package com.usky.fire.service.impl;
 
+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.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.Arith;
+import com.usky.common.core.util.DateUtils;
+import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.fire.domain.DemPoliceInfo;
 import com.usky.fire.mapper.DemPoliceInfoMapper;
+import com.usky.fire.service.DemFireStatisticsAttachService;
 import com.usky.fire.service.DemPoliceInfoService;
-import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.service.vo.AlertStatisticsVO;
+import com.usky.fire.service.vo.FireLevelRatioVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  * 警情信息 服务实现类
@@ -17,4 +41,240 @@ import org.springframework.stereotype.Service;
 @Service
 public class DemPoliceInfoServiceImpl extends AbstractCrudService<DemPoliceInfoMapper, DemPoliceInfo> implements DemPoliceInfoService {
 
+    public static final String[] ALERT_TYPE = {"火灾", "社会救助", "抢险救援", "排爆安检"};
+
+    @Autowired
+    private DemFireStatisticsAttachService demFireStatisticsAttachService;
+
+    @Override
+    public Map<String, List<AlertStatisticsVO>> getAlertStatisticsByMonth(String startTime, String endTime, String streetTown) {
+        QueryWrapper<DemPoliceInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("month(filing_time) monthTime", "COUNT(id) as aCount", "case_type as aType")
+                .between("filing_time", startTime, endTime)
+                .eq(StringUtils.isNotBlank(streetTown), "street_town", streetTown)
+                .groupBy("monthTime", "aType");
+        Map<String, List<AlertStatisticsVO>> typeMap = enhanceList(this.listMaps(queryWrapper));
+        Date maxDate = getMaxDate();
+        Date minDate = getMinDate();
+        int distanceOfTwoDateYear = Integer.parseInt(DateUtils.getYear(maxDate)) - Integer.parseInt(DateUtils.getYear(minDate)) + 1;
+        perfect(typeMap, 13, distanceOfTwoDateYear, 1);
+        return typeMap;
+    }
+
+    @Override
+    public List<AlertStatisticsVO> getAlertStatistics(String startTime, String endTime, String streetTown) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date startTime1 = null;
+        Date endTime1 = null;
+        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
+            try {
+                startTime1 = simpleDateFormat.parse(startTime);
+                endTime1 = simpleDateFormat.parse(endTime);
+            } catch (Exception e) {
+                throw new BusinessException("时间格式错误");
+            }
+        }
+        //获取同比
+        Date upStartTime = DateUtils.addYears(startTime1, -1);
+        Date upEndTime = DateUtils.addYears(endTime1, -1);
+        List<AlertStatisticsVO> list = new ArrayList<>();
+        list.add(getAsV(startTime1, endTime1, ALERT_TYPE[0], streetTown));
+        list.add(getAsV(startTime1, endTime1, ALERT_TYPE[1], streetTown));
+        list.add(getAsV(startTime1, endTime1, ALERT_TYPE[2], streetTown));
+        list.add(getAsV(startTime1, endTime1, ALERT_TYPE[3], streetTown));
+        list.forEach(alertStatisticsVO -> {
+            AlertStatisticsVO upAsv = getAsV(upStartTime, upEndTime, alertStatisticsVO.getType(), streetTown);
+            Integer number = alertStatisticsVO.getNumber();
+            Integer upNumber = upAsv.getNumber();
+            if (number.equals(upNumber)) {
+                alertStatisticsVO.setSameStatus(0);
+            } else if (number > upNumber) {
+                alertStatisticsVO.setSameStatus(1);
+            } else {
+                alertStatisticsVO.setSameStatus(2);
+            }
+            if (0 != upNumber) {
+                double radio = Arith.div(Arith.sub(number, upNumber), upNumber);
+                alertStatisticsVO.setRadio(Math.abs(radio));
+            } else {
+                if (number != 0) {
+                    alertStatisticsVO.setRadio(1.00);
+                } else {
+                    alertStatisticsVO.setRadio(0.00);
+                }
+            }
+        });
+        return list;
+    }
+
+    @Override
+    public CommonPage<DemPoliceInfo> page(Integer current, Integer size, String startTime, String endTime, String streetTown) {
+        IPage<DemPoliceInfo> page = new Page<>(current, size);
+        LambdaQueryWrapper<DemPoliceInfo> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemPoliceInfo::getCreateTime, startTime, endTime)
+                .eq(StringUtils.isNotBlank(streetTown), DemPoliceInfo::getStreetTown, streetTown)
+                .orderByDesc(DemPoliceInfo::getCreateTime);
+        page = this.page(page, queryWrapper);
+        return this.ToCommonPage(page);
+    }
+
+    @Override
+    public Map<String, List<AlertStatisticsVO>> getAlertStatisticsByHouse(String startTime, String endTime, String streetTown) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date startTime1 = null;
+        Date endTime1 = null;
+        try {
+            startTime1 = simpleDateFormat.parse(startTime);
+            endTime1 = simpleDateFormat.parse(endTime);
+        } catch (Exception e) {
+            throw new BusinessException("时间格式错误");
+        }
+        QueryWrapper<DemPoliceInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("HOUR(filing_time) monthTime", "COUNT(id) as aCount", "case_type as aType")
+                .between("filing_time", startTime1, endTime1)
+                .eq("street_town", streetTown)
+                .groupBy("monthTime", "case_type");
+        Map<String, List<AlertStatisticsVO>> typeMap = enhanceList(this.listMaps(queryWrapper));
+        Date maxDate = getMaxDate();
+        Date minDate = getMinDate();
+        AtomicInteger distanceOfTwoDate = new AtomicInteger(1);
+        Optional.ofNullable(maxDate)
+                .ifPresent(md -> distanceOfTwoDate.set(DateUtils.getDistanceOfTwoDateNew(minDate, maxDate)));
+        perfect(typeMap, 24, distanceOfTwoDate.get(), 0);
+        collectByThree(typeMap, distanceOfTwoDate.get());
+        return typeMap;
+    }
+
+    @Override
+    public List<Map<String, Object>> warningInstanceScatterer(String streetTown, Integer id) {
+        IPage<DemPoliceInfo> page = new Page<>(1, 500);
+        LambdaQueryWrapper<DemPoliceInfo> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemPoliceInfo::getAddress, DemPoliceInfo::getGisX, DemPoliceInfo::getGisY,
+                DemPoliceInfo::getId, DemPoliceInfo::getCaseType, DemPoliceInfo::getSquadron,
+                DemPoliceInfo::getFilingTime, DemPoliceInfo::getSupplement, DemPoliceInfo::getPoliceId)
+                .eq(StringUtils.isNotBlank(streetTown), DemPoliceInfo::getStreetTown, streetTown)
+                .eq(null != id && id != 0, DemPoliceInfo::getId, id)
+                .isNotNull(DemPoliceInfo::getQuenchTime)
+                .orderByDesc(DemPoliceInfo::getId);
+        page = this.page(page, queryWrapper);
+        List<Map<String, Object>> list = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(page.getRecords())) {
+            for (int i = 0; i < page.getRecords().size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", page.getRecords().get(i).getId());
+                map.put("policeId", page.getRecords().get(i).getPoliceId());
+                map.put("address", page.getRecords().get(i).getAddress());
+                map.put("longitude", page.getRecords().get(i).getGisX());
+                map.put("latitude", page.getRecords().get(i).getGisY());
+                map.put("caseType", page.getRecords().get(i).getCaseType());
+                map.put("squadron", page.getRecords().get(i).getSquadron());
+                map.put("filingTime", page.getRecords().get(i).getFilingTime());
+                map.put("AlarmTime", page.getRecords().get(i).getFilingTime());
+                map.put("supplement", page.getRecords().get(i).getSupplement());
+                list.add(map);
+            }
+        }
+        return list;
+    }
+
+    public void collectByThree(Map<String, List<AlertStatisticsVO>> map, Integer distanceOfTwoDate) {
+        for (String type : map.keySet()) {
+            List<AlertStatisticsVO> list = map.get(type);
+            List<List<AlertStatisticsVO>> partition = Lists.partition(list, 3);
+            List<AlertStatisticsVO> thList = new ArrayList<>();
+            for (List<AlertStatisticsVO> threeList : partition) {
+                double sum = threeList.stream().mapToDouble(AlertStatisticsVO::getNumber).sum();
+                AlertStatisticsVO alertStatisticsVO = new AlertStatisticsVO();
+                alertStatisticsVO.setType(type);
+                alertStatisticsVO.setMonth(String.valueOf(partition.indexOf(threeList)));
+                alertStatisticsVO.setAvg(Arith.div(sum, distanceOfTwoDate));
+                thList.add(alertStatisticsVO);
+            }
+            map.put(type, thList);
+        }
+    }
+
+    public AlertStatisticsVO getAsV(Date startTime, Date endTime, String type, String streetTown) {
+        AlertStatisticsVO alertStatisticsVo = new AlertStatisticsVO();
+        LambdaQueryWrapper<DemPoliceInfo> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(StringUtils.isNotBlank(type), DemPoliceInfo::getCaseType, type)
+                .eq(StringUtils.isNotBlank(streetTown), DemPoliceInfo::getStreetTown, streetTown);
+        if (null != startTime && null != endTime) {
+            queryWrapper.between(DemPoliceInfo::getArrivalTime, startTime, endTime);
+        }
+        alertStatisticsVo.setType(type);
+        alertStatisticsVo.setNumber(this.count(queryWrapper));
+        return alertStatisticsVo;
+    }
+
+
+    public Map<String, List<AlertStatisticsVO>> enhanceList(List<Map<String, Object>> mapList) {
+        List<AlertStatisticsVO> list = new ArrayList<>();
+        for (Map<String, Object> map : mapList) {
+            AlertStatisticsVO alertStatisticsVo = new AlertStatisticsVO();
+            alertStatisticsVo.setType(map.get("aType").toString());
+            alertStatisticsVo.setMonth(map.get("monthTime").toString());
+            alertStatisticsVo.setNumber(Integer.parseInt(map.get("aCount").toString()));
+            list.add(alertStatisticsVo);
+        }
+        return list.stream().collect(Collectors.groupingBy(AlertStatisticsVO::getType));
+    }
+
+    public Date getMaxDate() {
+        IPage<DemPoliceInfo> page = new Page<>(1, 1);
+        LambdaQueryWrapper<DemPoliceInfo> maxQuery = Wrappers.lambdaQuery();
+        maxQuery.isNotNull(DemPoliceInfo::getCreateTime)
+                .orderByDesc(DemPoliceInfo::getCreateTime);
+        IPage<DemPoliceInfo> maxPage = this.page(page, maxQuery);
+        LocalDateTime localDateTime = maxPage.getRecords().get(0).getCreateTime();
+        Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
+        Date date = Date.from(instant);
+        return date;
+    }
+
+    public Date getMinDate() {
+        IPage<DemPoliceInfo> page = new Page<>(1, 1);
+        LambdaQueryWrapper<DemPoliceInfo> minQuery = Wrappers.lambdaQuery();
+        minQuery.isNotNull(DemPoliceInfo::getCreateTime)
+                .orderByAsc(DemPoliceInfo::getCreateTime);
+        IPage<DemPoliceInfo> minPage = this.page(page, minQuery);
+        LocalDateTime localDateTime = minPage.getRecords().get(0).getCreateTime();
+        Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
+        Date date = Date.from(instant);
+        return date;
+    }
+
+    public void perfect(Map<String, List<AlertStatisticsVO>> typeMap, Integer times, Integer subTime, Integer defaultTime) {
+        for (String type : ALERT_TYPE) {
+            if (!typeMap.containsKey(type)) {
+                typeMap.put(type, new ArrayList<>());
+            }
+            perfectDate(typeMap.get(type), times, subTime, defaultTime);
+        }
+    }
+
+
+    public void perfectDate(List<AlertStatisticsVO> list, Integer times, Integer subTime, Integer defaultTime) {
+        for (int i = defaultTime; i < times; i++) {
+            int finalI = i;
+            list.stream()
+                    .filter(asv -> Integer.parseInt(asv.getMonth()) == finalI)
+                    .findFirst()
+                    .map(asv -> {
+                        asv.setAvg(Arith.div(asv.getNumber(), subTime));
+                        return asv;
+                    })
+                    .orElseGet(() -> {
+                        AlertStatisticsVO asv = new AlertStatisticsVO();
+                        asv.setMonth(Integer.toString(finalI));
+                        asv.setNumber(0);
+                        asv.setAvg(0.00);
+                        list.add(asv);
+                        return asv;
+                    });
+        }
+        list.sort(Comparator.comparingInt(x -> Integer.parseInt(x.getMonth())));
+    }
+
+
 }

+ 51 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemVehicleFightServiceImpl.java

@@ -1,11 +1,22 @@
 package com.usky.fire.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.domain.DemVehicle;
 import com.usky.fire.domain.DemVehicleFight;
 import com.usky.fire.mapper.DemVehicleFightMapper;
 import com.usky.fire.service.DemVehicleFightService;
-import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.service.DemVehicleService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 车辆作战信息 服务实现类
@@ -16,5 +27,44 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class DemVehicleFightServiceImpl extends AbstractCrudService<DemVehicleFightMapper, DemVehicleFight> implements DemVehicleFightService {
+    @Autowired
+    private DemVehicleService demVehicleService;
+
+    @Override
+    public List<Map<String, Object>> vehicleFightList(String policeId) {
+        List<Map<String, Object>> list = new ArrayList<>();
+        LambdaQueryWrapper<DemVehicleFight> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemVehicleFight::getId, DemVehicleFight::getVehicleId, DemVehicleFight::getCommander,
+                DemVehicleFight::getReporter, DemVehicleFight::getSoldier, DemVehicleFight::getDriver,
+                DemVehicleFight::getOrgaAbbreviat,DemVehicleFight::getDthh)
+                .eq(DemVehicleFight::getCaseId, policeId);
+        List<DemVehicleFight> list1 = this.list(queryWrapper);
+        if (CollectionUtils.isNotEmpty(list1)) {
+            List<String> vehicleIdList = new ArrayList<>();
+            for (int i = 0; i < list1.size(); i++) {
+                vehicleIdList.add(list1.get(i).getVehicleId());
+            }
+            List<DemVehicle> demVehicles = demVehicleService.vehicleList(vehicleIdList);
+            for (int i = 0; i < list1.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("commander", list1.get(i).getCommander());
+                map.put("reporter", list1.get(i).getReporter());
+                map.put("soldier", list1.get(i).getSoldier());
+                map.put("driver", list1.get(i).getDriver());
+                map.put("orgaAbbreviat", list1.get(i).getOrgaAbbreviat());
+                map.put("dthh", list1.get(i).getDthh());
+                map.put("licensePlate", null);
+                if (CollectionUtils.isNotEmpty(demVehicles)) {
+                    for (int j = 0; j < demVehicles.size(); j++) {
+                        if (list1.get(i).getVehicleId().equals(demVehicles.get(j).getVehicleId())) {
+                            map.put("licensePlate", demVehicles.get(j).getLicensePlate());
+                        }
+                    }
+                }
+                list.add(map);
+            }
+        }
+        return list;
+    }
 
 }

+ 29 - 14
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemVehicleServiceImpl.java

@@ -6,11 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.usky.common.core.bean.CommonPage;
-import com.usky.fire.domain.DemLawSituation;
+import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.fire.domain.DemVehicle;
 import com.usky.fire.mapper.DemVehicleMapper;
 import com.usky.fire.service.DemVehicleService;
-import com.usky.common.mybatis.core.AbstractCrudService;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -30,23 +29,23 @@ import java.util.Map;
 public class DemVehicleServiceImpl extends AbstractCrudService<DemVehicleMapper, DemVehicle> implements DemVehicleService {
 
     @Override
-    public CommonPage<Object> vehicleList(String vehicleCode, String vehicleAbbreviat, Integer id, Integer pageNum, Integer pageSize){
+    public CommonPage<Object> vehicleList(String vehicleCode, String vehicleAbbreviat, Integer id, Integer pageNum, Integer pageSize) {
         List<Object> list = new ArrayList<>();
         IPage<DemVehicle> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<DemVehicle> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select(DemVehicle::getId,DemVehicle::getVehicleCode,DemVehicle::getVehicleAbbreviat,
-                DemVehicle::getRadioChannel,DemVehicle::getRadioCallSign,DemVehicle::getFireOrga,
-                DemVehicle::getVehicleClassCode,DemVehicle::getLicensePlate,DemVehicle::getAssetCode,
-                DemVehicle::getEquipTime, DemVehicle::getFireFightStatus,DemVehicle::getRecordStatus,
-                DemVehicle::getPoliceListCode,DemVehicle::getCommanderName,DemVehicle::getReporter,
-                DemVehicle::getDriver,DemVehicle::getSoldier,DemVehicle::getTypeCode,
+        queryWrapper.select(DemVehicle::getId, DemVehicle::getVehicleCode, DemVehicle::getVehicleAbbreviat,
+                DemVehicle::getRadioChannel, DemVehicle::getRadioCallSign, DemVehicle::getFireOrga,
+                DemVehicle::getVehicleClassCode, DemVehicle::getLicensePlate, DemVehicle::getAssetCode,
+                DemVehicle::getEquipTime, DemVehicle::getFireFightStatus, DemVehicle::getRecordStatus,
+                DemVehicle::getPoliceListCode, DemVehicle::getCommanderName, DemVehicle::getReporter,
+                DemVehicle::getDriver, DemVehicle::getSoldier, DemVehicle::getTypeCode,
                 DemVehicle::getVehicleStatus)
                 .eq(DemVehicle::getDeleteFlag, 0)
-                .like(StringUtils.isNotBlank(vehicleAbbreviat),DemVehicle::getVehicleAbbreviat,vehicleAbbreviat)
-                .like(StringUtils.isNotBlank(vehicleCode),DemVehicle::getVehicleCode,vehicleCode)
-                .eq(id!=null&&id!=0,DemVehicle::getId,id)
+                .like(StringUtils.isNotBlank(vehicleAbbreviat), DemVehicle::getVehicleAbbreviat, vehicleAbbreviat)
+                .like(StringUtils.isNotBlank(vehicleCode), DemVehicle::getVehicleCode, vehicleCode)
+                .eq(id != null && id != 0, DemVehicle::getId, id)
                 .orderByDesc(DemVehicle::getId);
-        page=this.page(page, queryWrapper);
+        page = this.page(page, queryWrapper);
         for (int i = 0; i < page.getRecords().size(); i++) {
             Map<String, Object> map = new HashMap<>();
             map.put("id", page.getRecords().get(i).getId());
@@ -74,7 +73,7 @@ public class DemVehicleServiceImpl extends AbstractCrudService<DemVehicleMapper,
     }
 
     @Override
-    public void updateVehicle(DemVehicle demVehicle){
+    public void updateVehicle(DemVehicle demVehicle) {
         this.updateById(demVehicle);
     }
 
@@ -86,4 +85,20 @@ public class DemVehicleServiceImpl extends AbstractCrudService<DemVehicleMapper,
         this.updateById(demVehicle);
     }
 
+    @Override
+    public List<DemVehicle> vehicleList(List<String> vehicleIdList) {
+        LambdaQueryWrapper<DemVehicle> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemVehicle::getRadioCallSign, DemVehicle::getVehicleId, DemVehicle::getLicensePlate)
+                .in(DemVehicle::getVehicleId, vehicleIdList);
+        List<DemVehicle> list = this.list(queryWrapper);
+        return list;
+    }
+
+    @Override
+    public List<DemVehicle> list(String zdCode) {
+        LambdaQueryWrapper<DemVehicle> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DemVehicle::getFireOrga, zdCode);
+        return this.list(queryWrapper);
+    }
+
 }

+ 48 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemWaterSourceMaintainServiceImpl.java

@@ -2,6 +2,7 @@ package com.usky.fire.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,10 +12,15 @@ import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.DemWaterSourceMaintain;
 import com.usky.fire.mapper.DemWaterSourceMaintainMapper;
 import com.usky.fire.service.DemWaterSourceMaintainService;
+import com.usky.fire.service.util.OnlineMethod;
+import com.usky.fire.service.vo.LocateInfo;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -62,4 +68,46 @@ public class DemWaterSourceMaintainServiceImpl extends AbstractCrudService<DemWa
         demWaterSourceMaintain.setDeleteFlag("1");
         this.updateById(demWaterSourceMaintain);
     }
+
+    @Override
+    public List<Object> waterSourceMaintainScatterer(String streetTown) {
+        List<Object> list2 = new ArrayList<>();
+        IPage<DemWaterSourceMaintain> page = new Page<>(1, 500);
+        LambdaQueryWrapper<DemWaterSourceMaintain> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DemWaterSourceMaintain::getDeleteFlag, "0")
+                .isNotNull(DemWaterSourceMaintain::getDescribe)
+                .orderByDesc(DemWaterSourceMaintain::getId);
+        List<DemWaterSourceMaintain> list = this.list(queryWrapper);
+        if (CollectionUtils.isNotEmpty(list)) {
+            String longitude = null;
+            String latitude = null;
+            for (int i = 0; i < list.size(); i++) {
+                if (StringUtils.isBlank(list.get(i).getLongitude()) && StringUtils.isBlank(list.get(i).getLatitude())) {
+                    List<LocateInfo> lonLat = OnlineMethod.getLonLat(list.get(i).getDescribe());
+                    if (CollectionUtils.isNotEmpty(lonLat)) {
+                        longitude = "" + lonLat.get(0).getLongitude();
+                        latitude = "" + lonLat.get(0).getLatitude();
+                    }
+                    DemWaterSourceMaintain demWaterSourceMaintain = new DemWaterSourceMaintain();
+                    demWaterSourceMaintain.setId(list.get(i).getId());
+                    demWaterSourceMaintain.setLatitude(latitude);
+                    demWaterSourceMaintain.setLongitude(longitude);
+                    demWaterSourceMaintain.setUpdatePerson("程序修改");
+                    demWaterSourceMaintain.setCreateTime(LocalDateTime.now());
+                    this.updateById(demWaterSourceMaintain);
+                    list.get(i).setLatitude(latitude);
+                    list.get(i).setLongitude(longitude);
+                }
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", list.get(i).getId());
+                map.put("detachment", list.get(i).getDetachment());
+                map.put("squadron", list.get(i).getSquadron());
+                map.put("describe", list.get(i).getDescribe());
+                map.put("longitude", list.get(i).getLongitude());
+                map.put("latitude", list.get(i).getLatitude());
+                list2.add(map);
+            }
+        }
+        return list2;
+    }
 }

+ 229 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/DemWaterSourceServiceImpl.java

@@ -7,16 +7,22 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.Arith;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.fire.domain.DemMicroStation;
 import com.usky.fire.domain.DemWaterSource;
+import com.usky.fire.mapper.DemMicroStationMapper;
 import com.usky.fire.mapper.DemWaterSourceMapper;
+import com.usky.fire.service.DemWaterSourceMaintainService;
 import com.usky.fire.service.DemWaterSourceService;
+import com.usky.fire.service.po.FireWaterPO;
+import com.usky.fire.service.util.OnlineMethod;
+import com.usky.fire.service.vo.FireWaterStatisticsVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -29,12 +35,22 @@ import java.util.Map;
 @Service
 public class DemWaterSourceServiceImpl extends AbstractCrudService<DemWaterSourceMapper, DemWaterSource> implements DemWaterSourceService {
 
+    @Autowired
+    private DemWaterSourceMaintainService demWaterSourceMaintainService;
+
+    @Autowired
+    private DemMicroStationMapper demMicroStationMapper;
+
     @Override
     public CommonPage<Map<String, Object>> waterSourceList(String waterName, Integer id, Integer pageNum, Integer pageSize) {
         List<Map<String, Object>> list = new ArrayList<>();
         IPage<DemWaterSource> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<DemWaterSource> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select()
+        queryWrapper.select(DemWaterSource::getId, DemWaterSource::getWaterName, DemWaterSource::getWaterAddress,
+                DemWaterSource::getWaterType, DemWaterSource::getOrganizateName, DemWaterSource::getWaterForm,
+                DemWaterSource::getAvailableStatusName, DemWaterSource::getAvailableStatus, DemWaterSource::getWaterNature,
+                DemWaterSource::getBuildTime, DemWaterSource::getPipeCompany, DemWaterSource::getContactMode,
+                DemWaterSource::getFireAbbreviat, DemWaterSource::getPipePressure, DemWaterSource::getHydrantInterface)
                 .eq(DemWaterSource::getDeleteFlag, 0)
                 .like(StringUtils.isNotBlank(waterName), DemWaterSource::getWaterName, waterName)
                 .orderByDesc(DemWaterSource::getId);
@@ -64,7 +80,7 @@ public class DemWaterSourceServiceImpl extends AbstractCrudService<DemWaterSourc
     }
 
     @Override
-    public void updateWaterSource(DemWaterSource demWaterSource){
+    public void updateWaterSource(DemWaterSource demWaterSource) {
         this.updateById(demWaterSource);
     }
 
@@ -76,4 +92,211 @@ public class DemWaterSourceServiceImpl extends AbstractCrudService<DemWaterSourc
         this.updateById(demWaterSource);
     }
 
+    @Override
+    public List<Object> waterSourceList(String streetTown) {
+        IPage<DemWaterSource> page = new Page<>(1, 500);
+        LambdaQueryWrapper<DemWaterSource> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemWaterSource::getId, DemWaterSource::getWaterName, DemWaterSource::getWaterAddress,
+                DemWaterSource::getGisX, DemWaterSource::getGisY)
+                .eq(DemWaterSource::getDeleteFlag, 0)
+                .orderByDesc(DemWaterSource::getId);
+        page = this.page(page, queryWrapper);
+        List<DemWaterSource> list1 = page.getRecords();
+        List<Object> list = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            for (int i = 0; i < list1.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", list1.get(i).getId());
+                map.put("waterName", list1.get(i).getWaterName());
+                map.put("waterAddress", list1.get(i).getWaterAddress());
+                map.put("longitude", list1.get(i).getGisX());
+                map.put("latitude", list1.get(i).getGisY());
+                list.add(map);
+            }
+        }
+        return list;
+    }
+
+    @Override
+    public List<DemWaterSource> waterSourceList() {
+        LambdaQueryWrapper<DemWaterSource> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemWaterSource::getId, DemWaterSource::getWaterType, DemWaterSource::getWaterName,
+                DemWaterSource::getWaterAddress, DemWaterSource::getWaterCompany, DemWaterSource::getContactMode,
+                DemWaterSource::getGisX, DemWaterSource::getGisY)
+                .eq(DemWaterSource::getDeleteFlag, 0)
+                .orderByDesc(DemWaterSource::getId);
+        List<DemWaterSource> list = this.list(queryWrapper);
+        return list;
+    }
+
+    @Override
+    public List<Map<String, Object>> surroundingResources(double longitude, double latitude, Integer distance) {
+        List<Map<String, Object>> list = new ArrayList<>();
+        List<DemWaterSource> list1 = this.waterSourceList();
+        List<DemMicroStation> list2 = this.microStationScatterer();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            for (int i = 0; i < list1.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                int distance1 = 0;
+                if (StringUtils.isNotBlank(list1.get(i).getGisX()) && StringUtils.isNotBlank(list1.get(i).getGisY())) {
+                    double gisX = Double.valueOf(list1.get(i).getGisX());
+                    double gisY = Double.valueOf(list1.get(i).getGisY());
+                    double v = OnlineMethod.GetDistance(longitude, latitude, gisX, gisY);
+                    distance1 = new Double(v).intValue();
+                    map.put("distance", v);
+                } else {
+                    map.put("distance", null);
+                }
+                map.put("id", list1.get(i).getId());
+                map.put("waterType", list1.get(i).getWaterType());
+                map.put("waterName", list1.get(i).getWaterName());
+                map.put("waterAddress", list1.get(i).getWaterAddress());
+                map.put("waterCompany", list1.get(i).getWaterCompany());
+                map.put("contactMode", list1.get(i).getContactMode());
+                map.put("longitude", list1.get(i).getGisX());
+                map.put("latitude", list1.get(i).getGisY());
+                map.put("chargeName", null);
+                if (distance1 <= distance && distance1 != 0) {
+                    list.add(map);
+                }
+            }
+        }
+
+        if (CollectionUtils.isNotEmpty(list2)) {
+            for (int i = 0; i < list2.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                int distance1 = 0;
+                if (StringUtils.isNotBlank(list2.get(i).getLongitude().toString()) && StringUtils.isNotBlank(list2.get(i).getDimension().toString())) {
+                    double gisX = Double.valueOf(list2.get(i).getLongitude().toString());
+                    double gisY = Double.valueOf(list2.get(i).getDimension().toString());
+                    double v = OnlineMethod.GetDistance(longitude, latitude, gisX, gisY);
+                    distance1 = new Double(v).intValue();
+                    map.put("distance", v);
+                } else {
+                    map.put("distance", null);
+                }
+                map.put("id", list2.get(i).getId());
+                map.put("waterType", "消防站");
+                map.put("waterName", list2.get(i).getStationName());
+                map.put("waterAddress", list2.get(i).getAddress());
+                map.put("waterCompany", null);
+                map.put("chargeName", list2.get(i).getChargeName());
+                map.put("contactMode", list2.get(i).getChargePhone());
+                map.put("longitude", list2.get(i).getLongitude());
+                map.put("latitude", list2.get(i).getDimension());
+                if (distance1 <= distance && distance1 != 0) {
+                    list.add(map);
+                }
+            }
+        }
+        return list;
+    }
+
+
+    @Override
+    public List<Object> waterSourceScatterer(String scattererType, String streetTown) {
+        List<Object> list = new ArrayList<>();
+        switch (scattererType) {
+            case "消火栓":
+                list = this.waterSourceList(streetTown);
+                break;
+            case "天然水源":
+                list = demWaterSourceMaintainService.waterSourceMaintainScatterer(streetTown);
+                break;
+            default:
+                throw new BusinessException("该类型点位未定义");
+        }
+        return list;
+    }
+
+    @Override
+    public List<DemMicroStation> microStationScatterer() {
+        LambdaQueryWrapper<DemMicroStation> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DemMicroStation::getId, DemMicroStation::getStationName, DemMicroStation::getLongitude,
+                DemMicroStation::getDimension, DemMicroStation::getAddress, DemMicroStation::getChargeName,
+                DemMicroStation::getChargePhone)
+                .eq(DemMicroStation::getDeleteFlag, "0")
+                .orderByDesc(DemMicroStation::getId);
+        List<DemMicroStation> list = demMicroStationMapper.selectList(queryWrapper);
+        return list;
+    }
+
+    @Override
+    public int waterSourceCount(String waterType, String waterNature, String waterForm, String startTime, String endTime, String availableStatus) {
+        LambdaQueryWrapper<DemWaterSource> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DemWaterSource::getDeleteFlag, 0)
+                .eq(StringUtils.isNotBlank(waterType), DemWaterSource::getWaterType, waterType)
+                .eq(StringUtils.isNotBlank(waterNature), DemWaterSource::getWaterNature, waterNature)
+                .eq(StringUtils.isNotBlank(waterForm), DemWaterSource::getWaterForm, waterForm)
+                .eq(StringUtils.isNotBlank(availableStatus), DemWaterSource::getAvailableStatus, availableStatus)
+                .between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemWaterSource::getBdpAudit, startTime, endTime);
+        int count = this.count(queryWrapper);
+        return count;
+    }
+
+    @Override
+    public FireWaterStatisticsVO getFireWaterStatistics(String startTime, String endTime) {
+        FireWaterStatisticsVO fireWaterStatisticsVO = new FireWaterStatisticsVO();
+        fireWaterStatisticsVO.setMunicipalFireCode(
+                this.waterSourceCount("消火栓", "市政", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setCommunityFireCode(
+                this.waterSourceCount("消火栓", "居民", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setUnitFireCode(
+                this.waterSourceCount("消火栓", "单位", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setNaturalWater(
+                this.waterSourceCount("天然水源", null, null, startTime, endTime, null));
+        fireWaterStatisticsVO.setMunicipalWater(
+                this.waterSourceCount(null, "市政", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setResidentWater(
+                this.waterSourceCount(null, "居民", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setUnitWater(
+                this.waterSourceCount(null, "单位", null, startTime, endTime, null));
+        fireWaterStatisticsVO.setMunicipalGetWater(
+                this.waterSourceCount(null, null, "市政", startTime, endTime, null));
+        fireWaterStatisticsVO.setLandGetWater(
+                this.waterSourceCount(null, null, "地上", startTime, endTime, null));
+        Integer total = this.waterSourceCount(null, null, null, startTime, endTime, null);
+        fireWaterStatisticsVO.setMunicipalGetWaterRadio(Arith.div(fireWaterStatisticsVO.getMunicipalGetWater(), total));
+        fireWaterStatisticsVO.setLandGetWaterRadio(Arith.div(fireWaterStatisticsVO.getLandGetWater(), total));
+        Integer waterIntact = this.waterSourceCount(null, null, null, startTime, endTime, "1");
+        fireWaterStatisticsVO.setWaterIntact(Arith.div(waterIntact, total));
+        return fireWaterStatisticsVO;
+    }
+
+    @Override
+    public CommonPage<FireWaterPO> page(Integer current, Integer size, String startTime, String endTime) {
+        List<FireWaterPO> list = new ArrayList<>();
+        Page<DemWaterSource> page = new Page<>(current, size);
+        LambdaQueryWrapper<DemWaterSource> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.between(StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime), DemWaterSource::getBdpAudit, startTime, endTime);
+        page = this.page(page, queryWrapper);
+        page.getRecords().forEach(stringObjectMap -> list.add(enhanceFireWaterPo(stringObjectMap)));
+        return new CommonPage<>(list, page.getTotal(), page.getSize(), page.getCurrent());
+    }
+
+    /**
+     * map转换为unitpo
+     *
+     * @param fireWaterMap
+     * @return
+     */
+    public FireWaterPO enhanceFireWaterPo(DemWaterSource fireWaterMap) {
+        FireWaterPO fireWaterPo = new FireWaterPO();
+        fireWaterPo.setAddress(fireWaterMap.getWaterAddress());
+        fireWaterPo.setPhone(Optional.ofNullable(fireWaterMap.getContactMode()).orElse(""));
+        fireWaterPo.setType(fireWaterMap.getWaterType());
+        fireWaterPo.setJurisdictionalAgency(fireWaterMap.getOrganizateName());
+        fireWaterPo.setDetachmentName(fireWaterMap.getBranchName());
+        fireWaterPo.setGetWaterType(fireWaterMap.getWaterForm());
+        fireWaterPo.setWaterAdministrative(Optional.ofNullable(fireWaterMap.getWaterNature()).orElse(""));
+        fireWaterPo.setStatus(fireWaterMap.getAvailableStatus() + "");
+        fireWaterPo.setWaterUnit(fireWaterMap.getWaterCompany());
+        fireWaterPo.setWaterGage(fireWaterMap.getPipePressure());
+        fireWaterPo.setGisX(fireWaterMap.getGisX());
+        fireWaterPo.setGisY(fireWaterMap.getGisY());
+        fireWaterPo.setGisBaiDuX(fireWaterMap.getGisXBaidu());
+        fireWaterPo.setGisBaiDuY(fireWaterMap.getGisYBaidu());
+        return fireWaterPo;
+    }
+
 }

+ 20 - 20
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/mqtt/fire/FireStrategy.java

@@ -35,26 +35,26 @@ public class FireStrategy implements MqttStrategy {
 
     @Override
     public String disposeMessage(MqttBaseVO mqttBaseVO) {
-        LambdaQueryWrapper<SpOwnerCompany> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select(SpOwnerCompany::getOwnerId);
-        List<SpOwnerCompany> list = spOwnerCompanyService.list(queryWrapper);
-        String topic = mqttBaseVO.getTopic();
-        topic = topic.split("/")[3];
-        String finalTopic = topic;
-        list.stream().filter(s -> s.getOwnerId().equals(finalTopic))
-                .findAny().ifPresent(s -> {
-            FireAlarmVO fireAlarmVo = JsonUtils.fromJson(mqttBaseVO.getData().toString(), FireAlarmVO.class);
-            TbAlarm tbAlarm = this.enhanceData(fireAlarmVo);
-            if ("ALARM".equals(fireAlarmVo.getType())) {
-                tbAlarmService.save(tbAlarm);
-
-            } else if ("STATE".equals(fireAlarmVo.getType())) {
-//            LambdaUpdateWrapper<DeviceStatus> updateWrapper = Wrappers.lambdaUpdate();
-//            updateWrapper.set(DeviceStatus::getDevicestatus,fireAlarmVo.getDevState())
-//                    .eq(DeviceStatus::getDeviceid,fireAlarmVo.getDevId());
-//            deviceStatusService.update(updateWrapper);
-            }
-        });
+//        LambdaQueryWrapper<SpOwnerCompany> queryWrapper = Wrappers.lambdaQuery();
+//        queryWrapper.select(SpOwnerCompany::getOwnerId);
+//        List<SpOwnerCompany> list = spOwnerCompanyService.list(queryWrapper);
+//        String topic = mqttBaseVO.getTopic();
+//        topic = topic.split("/")[3];
+//        String finalTopic = topic;
+//        list.stream().filter(s -> s.getOwnerId().equals(finalTopic))
+//                .findAny().ifPresent(s -> {
+//            FireAlarmVO fireAlarmVo = JsonUtils.fromJson(mqttBaseVO.getData().toString(), FireAlarmVO.class);
+//            TbAlarm tbAlarm = this.enhanceData(fireAlarmVo);
+//            if ("ALARM".equals(fireAlarmVo.getType())) {
+//                tbAlarmService.save(tbAlarm);
+//
+//            } else if ("STATE".equals(fireAlarmVo.getType())) {
+////            LambdaUpdateWrapper<DeviceStatus> updateWrapper = Wrappers.lambdaUpdate();
+////            updateWrapper.set(DeviceStatus::getDevicestatus,fireAlarmVo.getDevState())
+////                    .eq(DeviceStatus::getDeviceid,fireAlarmVo.getDevId());
+////            deviceStatusService.update(updateWrapper);
+//            }
+//        });
 
         return null;
     }

+ 85 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/FireStatisticsPO.java

@@ -0,0 +1,85 @@
+package com.usky.fire.service.po;
+
+import com.usky.fire.service.vo.LocateInfo;
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/28 9:49
+ * 火灾统计
+ */
+@Data
+public class FireStatisticsPO extends LocateInfo {
+
+    /**
+     * id
+     */
+    private String id;
+
+
+    /**
+     * 火灾地址
+     */
+    private String address;
+
+    /**
+     * 过火面积
+     */
+    private String burnedArea;
+
+    /**
+     * 财产损失
+     */
+    private String propertyLoss;
+
+
+    /**
+     * 死亡人数
+     */
+    private String deathToll;
+
+    /**
+     * 受伤人数
+     */
+    private String nonFatal;
+
+    /**
+     * 受灾户数
+     */
+    private String disasterHome;
+
+    /**
+     * 受灾原因
+     */
+    private String fireCause;
+
+    /**
+     * 火灾登记
+     */
+    private String fireLevel;
+
+    /**
+     * 场所一级
+     */
+    private String placeOne;
+    /**
+     * 场所二级
+     */
+    private String placeTwo;
+
+    /**
+     * 起火物一级
+     */
+    private String fireGoodsOne;
+
+    /**
+     * 起火物二级
+     */
+    private String fireGoodsTwo;
+
+    /**
+     * 性质
+     */
+    private String nature;
+
+}

+ 79 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/FireWaterPO.java

@@ -0,0 +1,79 @@
+package com.usky.fire.service.po;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/27 16:17
+ * 水源信息
+ */
+@Data
+public class FireWaterPO {
+
+    /**
+     * 地址
+     */
+    public String address;
+
+    /**
+     * 责任人
+     */
+    private String dutyPerson;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+
+    /**
+     * 水源类型
+     */
+    private String type;
+
+    /**
+     * 管辖机构
+     */
+    private String jurisdictionalAgency;
+
+    /**
+     * 支队名称
+     */
+    private String detachmentName;
+
+    /**
+     * 取水形式
+     */
+    private String getWaterType;
+
+
+    /**
+     * 水源行政
+     */
+    private String waterAdministrative;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 供水单位
+     */
+    private String waterUnit;
+
+
+    /**
+     * 水压
+     */
+    private String waterGage;
+
+    private String gisX;
+
+    private String gisY;
+
+    private String gisBaiDuX;
+
+    private String gisBaiDuY;
+
+}

+ 46 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/po/UnitBeOnDutyPO.java

@@ -0,0 +1,46 @@
+package com.usky.fire.service.po;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author yq
+ * @date 2021/5/27 15:19
+ * 值班表
+ */
+@Data
+public class UnitBeOnDutyPO {
+
+    /**
+     * 名称
+     */
+    private String name;
+
+
+    /**
+     * 岗位名称
+     */
+    private String postName;
+
+
+    /**
+     * 机构名称
+     */
+    private String organizationName;
+
+    /**
+     * 机构简称
+     */
+    private String organizationShort;
+    /**
+     * 机构地址
+      */
+    private String organizationAddress;
+
+    /**
+     * 值班日期
+     */
+    private String time;
+
+}

+ 69 - 12
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/util/OnlineMethod.java

@@ -5,7 +5,6 @@ package com.usky.fire.service.util;
 import com.alibaba.nacos.common.utils.StringUtils;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.usky.common.core.exception.BusinessException;
 import com.usky.common.core.util.HttpUtils;
 import com.usky.fire.service.vo.LocateInfo;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
@@ -32,20 +31,78 @@ import java.util.stream.Collectors;
 @Slf4j
 public class OnlineMethod {
 
-    public static String getAlarmType(String value,Integer deviceType) {
+    public static Date transferString2Date(String s) {
+        Date date = new Date();
+        try {
+            date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s);
+        } catch (ParseException e) {
+            //LOGGER.error("时间转换错误, string = {}", s, e);
+        }
+        return date;
+    }
+
+    /**
+     * 默认地球半径
+     */
+    private static double EARTH_RADIUS = 6371000;//赤道半径(单位m)
+
+    /**
+     * 转化为弧度(rad)
+     * */
+    private static double rad(double d)
+    {
+        return d * Math.PI / 180.0;
+    }
+    /**
+     * @param lon1 第一点的精度
+     * @param lat1 第一点的纬度
+     * @param lon2 第二点的精度
+     * @param lat2 第二点的纬度
+     * @return 返回的距离,单位m
+     * */
+    public static double GetDistance(double lon1,double lat1,double lon2, double lat2) {
+        double radLat1 = rad(lat1);
+        double radLat2 = rad(lat2);
+        double a = radLat1 - radLat2;
+        double b = rad(lon1) - rad(lon2);
+        double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
+        s = s * EARTH_RADIUS;
+        s = Math.round(s * 10000) / 10000;
+        return s;
+    }
+
+    /**
+     * 计算中心经纬度与目标经纬度的距离(米)
+     *
+     * @param centerLon 中心精度
+     * @param centerLat 中心纬度
+     * @param targetLon 需要计算的精度
+     * @param targetLat 需要计算的纬度
+     * @return 米
+     */
+    public static double distance(double centerLon, double centerLat, double targetLon, double targetLat) {
+        double jl_jd = 102834.74258026089786013677476285;// 每经度单位米;
+        double jl_wd = 111712.69150641055729984301412873;// 每纬度单位米;
+        double b = Math.abs((centerLat - targetLat) * jl_jd);
+        double a = Math.abs((centerLon - targetLon) * jl_wd);
+        return Math.sqrt((a * a + b * b));
+    }
+
+
+    public static String getAlarmType(String value, Integer deviceType) {
         String alarmType = null;
         switch (value) {
             case "火警":
                 alarmType = "2";
                 break;
             case "故障":
-                if (deviceType==1){
+                if (deviceType == 1) {
                     alarmType = "4";
-                }else if (deviceType==2){
+                } else if (deviceType == 2) {
                     alarmType = "WP3";
-                }else if (deviceType==5){
+                } else if (deviceType == 5) {
                     alarmType = "LL3";
-                }else if (deviceType==7){
+                } else if (deviceType == 7) {
                     alarmType = "y05";
                 }
                 break;
@@ -80,23 +137,23 @@ public class OnlineMethod {
                 alarmType = "EF8";
                 break;
             case "离线":
-                if (deviceType==2){
+                if (deviceType == 2) {
                     alarmType = "WP4";
-                }else if (deviceType==7){
+                } else if (deviceType == 7) {
                     alarmType = "EF9";
                 }
                 break;
             case "正常":
-                if (deviceType==2){
+                if (deviceType == 2) {
                     alarmType = "WP0";
-                }else if (deviceType==5){
+                } else if (deviceType == 5) {
                     alarmType = "LL0";
                 }
                 break;
             case "低压":
-                if (deviceType==2){
+                if (deviceType == 2) {
                     alarmType = "WP1";
-                }else if (deviceType==3){
+                } else if (deviceType == 3) {
                     alarmType = "y04";
                 }
                 break;

+ 42 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/AlertStatisticsVO.java

@@ -0,0 +1,42 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/28 14:55
+ * 警情统计
+ */
+@Data
+public class AlertStatisticsVO {
+
+    /**
+     * 类型(社会援助,火灾,抢险救援)
+     */
+    private String type;
+
+    /**
+     * 数量
+     */
+    private Integer number;
+
+    /**
+     * 月份
+     */
+    private String month;
+
+    /**
+     * 占比
+     */
+    private Double radio;
+
+    /**
+     * 同比上升還是下降
+     */
+    private Integer sameStatus;
+
+    /**
+     * 平均值
+     */
+    private Double avg;
+}

+ 32 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireBubbleVO.java

@@ -0,0 +1,32 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/6/24 13:22
+ * 火灾气泡图
+ */
+@Data
+public class FireBubbleVO {
+
+    /**
+     * 街道
+     */
+    private String region;
+
+    /**
+     * 死亡人数
+     */
+    private Double deathToll;
+
+    /**
+     * 火灾面积
+     */
+    private Double fireArea;
+
+    /**
+     * 火灾数
+     */
+    private Integer fireCount;
+}

+ 23 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireLevelRatioVO.java

@@ -0,0 +1,23 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/28 14:03
+ * 火灾原因占比
+ */
+@Data
+public class FireLevelRatioVO {
+
+    /**
+     * 火灾类别
+     */
+    private String fireType;
+
+
+    /**
+     * 比例
+     */
+    private Double radio;
+}

+ 76 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/FireWaterStatisticsVO.java

@@ -0,0 +1,76 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author yq
+ * @date 2021/5/27 16:31
+ * 水源统计信息
+ */
+@Data
+public class FireWaterStatisticsVO {
+
+
+    /**
+     * 市政消火栓
+     */
+    private Integer municipalFireCode;
+
+
+    /**
+     * 社区(居民)消火栓
+     */
+    private Integer communityFireCode;
+
+    /**
+     * 单位消火栓
+     */
+    private Integer unitFireCode;
+
+    /**
+     * 天然水源
+     */
+    private Integer naturalWater;
+
+    /**
+     * 市政水源
+     */
+    private Integer municipalWater;
+
+    /**
+     * 居民水源
+     */
+    private Integer residentWater;
+
+    /**
+     * 单位水源
+     */
+    private Integer unitWater;
+
+    /**
+     * 市政取水
+     */
+    private Integer municipalGetWater;
+
+
+    /**
+     * 地下取水
+     */
+    private Integer landGetWater;
+
+    /**
+     * 市政取水占比
+     */
+    private Double municipalGetWaterRadio;
+
+    /**
+     * 地下取水占比
+     */
+    private Double landGetWaterRadio;
+
+    /**
+     * 水源完好率
+     */
+    private Double waterIntact;
+
+}

+ 16 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireInspectMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.DemFireInspectMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.DemFireInspect">
+        <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
+        <result column="person_id" property="personId" />
+        <result column="plan_time" property="planTime" />
+        <result column="inspect_result" property="inspectResult" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+    </resultMap>
+
+</mapper>

+ 17 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireInspectPersonMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.DemFireInspectPersonMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.DemFireInspectPerson">
+        <id column="id" property="id" />
+        <result column="person_name" property="personName" />
+        <result column="person_position" property="personPosition" />
+        <result column="link_phone" property="linkPhone" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+        <result column="update_person" property="updatePerson" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+</mapper>

+ 12 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemFireStatisticsMapper.xml

@@ -57,6 +57,18 @@
         <result column="create_time" property="createTime" />
         <result column="update_person" property="updatePerson" />
         <result column="update_time" property="updateTime" />
+        <result column="longitude" property="longitude" />
+        <result column="latitude" property="latitude" />
+        <result column="district" property="district" />
+        <result column="street" property="street" />
     </resultMap>
 
+    <update id="updateList" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" separator=";">
+            UPDATE dem_fire_statistics
+            SET longitude = #{item.longitude},latitude = #{item.latitude},district = #{item.district},street = #{item.street}
+            WHERE fire_number = #{item.id}
+        </foreach>
+    </update>
+
 </mapper>

+ 37 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemOnDutyMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.DemOnDutyMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.DemOnDuty">
+        <id column="id" property="id" />
+        <result column="duty_id" property="dutyId" />
+        <result column="duty_time" property="dutyTime" />
+        <result column="company_id" property="companyId" />
+        <result column="person_id" property="personId" />
+        <result column="person_name" property="personName" />
+        <result column="duty_type_id" property="dutyTypeId" />
+        <result column="time_stamp" property="timeStamp" />
+        <result column="organizate_name" property="organizateName" />
+        <result column="organizate_abbreviate" property="organizateAbbreviate" />
+        <result column="organizate_address" property="organizateAddress" />
+        <result column="link_phone" property="linkPhone" />
+        <result column="organizate_rank" property="organizateRank" />
+        <result column="position_name" property="positionName" />
+        <result column="position_rank" property="positionRank" />
+        <result column="full_name" property="fullName" />
+        <result column="ry_id" property="ryId" />
+        <result column="ry_xh" property="ryXh" />
+        <result column="yhzh" property="yhzh" />
+        <result column="zh_id" property="zhId" />
+        <result column="sjszjg" property="sjszjg" />
+        <result column="jlzt" property="jlzt" />
+        <result column="yddh" property="yddh" />
+        <result column="jgjc" property="jgjc" />
+        <result column="jgtree" property="jgtree" />
+        <result column="id_number" property="idNumber" />
+        <result column="person_rank" property="personRank" />
+        <result column="union_key" property="unionKey" />
+    </resultMap>
+
+</mapper>

+ 2 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/DemWaterSourceMaintainMapper.xml

@@ -13,6 +13,8 @@
         <result column="update_time" property="updateTime" />
         <result column="update_person" property="updatePerson" />
         <result column="delete_flag" property="deleteFlag" />
+        <result column="longitude" property="longitude" />
+        <result column="latitude" property="latitude" />
     </resultMap>
 
 </mapper>