6 files modified
19 files added
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>blade-service-api</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>blade-dp-api</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | </project> |
| | |
| | | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.dto.DeptDTO; |
| | | import org.springblade.system.entity.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @GetMapping(REGION) |
| | | R<Region> getRegion(@RequestParam("code") String code); |
| | | |
| | | /** |
| | | * 获取各个单位下的用户 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserGroupByDept") |
| | | R<List<DeptDTO>> getUserGroupByDept(); |
| | | |
| | | } |
| | |
| | | package org.springblade.system.feign; |
| | | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.dto.DeptDTO; |
| | | import org.springblade.system.entity.*; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<DeptDTO>> getUserGroupByDept() { |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <module>blade-scope-api</module> |
| | | <module>blade-system-api</module> |
| | | <module>blade-user-api</module> |
| | | <module>blade-dp-api</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>blade-service</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>blade-dp</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-fire</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-system-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-dp-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| New file |
| | |
| | | package org.springblade.modules; |
| | | |
| | | import org.springblade.core.cloud.client.BladeCloudApplication; |
| | | import org.springblade.core.launch.BladeApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | @BladeCloudApplication |
| | | public class DpApplication { |
| | | public static void main(String[] args) { |
| | | BladeApplication.run(AppConstant.APPLICATION_NAME_PREFIX.concat("dp"), DpApplication.class, args); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.dp.service.IComprehensiveStatisticsService; |
| | | import org.springblade.modules.fire.service.IFireService; |
| | | import org.springblade.modules.fire.vo.FireVO; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 大屏综合统计 控制器 |
| | | * |
| | | * @author GuoShiLong |
| | | * @since 2023-03-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("dp/comprehensiveStatistics") |
| | | @Api(value = "综合统计", tags = "综合统计接口") |
| | | public class ComprehensiveStatisticsController extends BladeController { |
| | | private IComprehensiveStatisticsService comprehensiveStatisticsService; |
| | | private IFireService fireService; |
| | | |
| | | /** |
| | | * 数据概览 |
| | | */ |
| | | @GetMapping("/dataOverview") |
| | | @ApiOperation(value = "数据概览", notes = "数据概览") |
| | | public R getDataOverview() { |
| | | List<HashMap<String,String>> dataStatistics = comprehensiveStatisticsService.getDataOverview(); |
| | | return R.data(dataStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 入驻单位统计 |
| | | */ |
| | | @GetMapping("/deptStatistics") |
| | | @ApiOperation(value = "入驻单位统计", notes = "入驻单位统计") |
| | | public R getDeptStatistics() { |
| | | List<HashMap<String,String>> deptStatistics = comprehensiveStatisticsService.getDeptStatistics(); |
| | | return R.data(deptStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 实时火警事件 |
| | | * @param time 时间 |
| | | * @return |
| | | */ |
| | | @GetMapping("/realtimeFireAlarmIncident") |
| | | @ApiOperation(value = "实时火警事件", notes = "实时火警事件") |
| | | public R getRealtimeFireAlarmIncident(@RequestParam(name="time", defaultValue="48")String time) { |
| | | List<FireVO> fireList = fireService.getRealtime(time); |
| | | return R.data(fireList); |
| | | } |
| | | |
| | | /** |
| | | * 火警事件来源 |
| | | */ |
| | | @GetMapping("/fireCallSource") |
| | | @ApiOperation(value = "火警事件来源", notes = "火警事件来源") |
| | | public R getFireCallSource() { |
| | | List fireCallSource = comprehensiveStatisticsService.getFireCallSource(); |
| | | return R.data(fireCallSource); |
| | | } |
| | | |
| | | /** |
| | | * 易发区统计 |
| | | * @param regionCode 区域编码 36 3601 360124,三种任意一种 |
| | | * @param limit 限制前几 |
| | | * @return |
| | | */ |
| | | @GetMapping("/proneAreasStatistics") |
| | | @ApiOperation(value = "易发区统计", notes = "易发区统计") |
| | | public R getProneAreasStatistics(String regionCode, @RequestParam(name="limit", defaultValue="15")Integer limit) { |
| | | List proneAreasStatistics = comprehensiveStatisticsService.getProneAreasStatistics(regionCode,limit); |
| | | return R.data(proneAreasStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 火警上报趋势 |
| | | */ |
| | | @GetMapping("/fireReportingTrend") |
| | | @ApiOperation(value = "火警上报趋势", notes = "火警上报趋势") |
| | | public R getFireReportingTrend() { |
| | | List<HashMap<String,String>> FireReportingTrend = comprehensiveStatisticsService.getFireReportingTrend(); |
| | | return R.data(FireReportingTrend); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.fire.service.IFireService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 大屏防火预警 控制器 |
| | | * |
| | | * @author GuoShiLong |
| | | * @since 2023-03-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("dp/fireWarning") |
| | | @Api(value = "防火预警", tags = "防火预警接口") |
| | | public class FireWarningController extends BladeController { |
| | | // private IFireWarningService fireWarningService; |
| | | private IFireService fireService; |
| | | |
| | | /** |
| | | * 预警台账 |
| | | */ |
| | | @GetMapping("/earlyWarningLedger") |
| | | @ApiOperation(value = "预警台账", notes = "预警台账") |
| | | public R getEarlyWarningLedger() { |
| | | |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.dp.service.IMilitaryLocalCoordinationService; |
| | | import org.springblade.modules.fire.service.IFireService; |
| | | import org.springblade.modules.fire.vo.FireVO; |
| | | import org.springblade.modules.fireSupplement.entity.FireSupplementEntity; |
| | | import org.springblade.modules.fireSupplement.service.IFireSupplementService; |
| | | import org.springblade.system.dto.DeptDTO; |
| | | import org.springblade.system.feign.ISysClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 大屏军地协同 控制器 |
| | | * |
| | | * @author GuoShiLong |
| | | * @since 2023-03-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("dp/militaryLocalCoordination") |
| | | @Api(value = "军地协同", tags = "军地协同接口") |
| | | public class MilitaryLocalCoordinationController extends BladeController { |
| | | private final IFireService fireService; |
| | | private final IFireSupplementService fireSupplementService; |
| | | private final IMilitaryLocalCoordinationService militaryLocalCoordinationService; |
| | | |
| | | private final ISysClient sysClient; |
| | | |
| | | /** |
| | | * 火警事件 |
| | | */ |
| | | @GetMapping("/fireAlarmIncident") |
| | | @ApiOperation(value = "火警事件", notes = "火警事件") |
| | | public R<IPage<FireVO>> getEarlyWarningLedger(FireVO fire, Query query) { |
| | | IPage<FireVO> pages = fireService.selectFirePage(Condition.getPage(query), fire); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 灾后评估 |
| | | */ |
| | | @GetMapping("/disasterAssessment") |
| | | @ApiOperation(value = "详情", notes = "传入fireSupplement") |
| | | public R<FireSupplementEntity> detail(FireSupplementEntity fireSupplement) { |
| | | FireSupplementEntity detail = fireSupplementService.getOne(Condition.getQueryWrapper(fireSupplement)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 视频会商,传部门和部门下的人(远程调用) |
| | | */ |
| | | @GetMapping("/getUserGroupByDept") |
| | | @ApiOperation(value = "视频会商", notes = "视频会商") |
| | | public R getUserGroupByDept() { |
| | | return sysClient.getUserGroupByDept(); |
| | | } |
| | | |
| | | /** |
| | | * 周边查询 |
| | | * @param lon 经度 |
| | | * @param lat 纬度 |
| | | * @param distance 查询范围 |
| | | * @return |
| | | */ |
| | | @GetMapping("/surroundingQuery") |
| | | @ApiOperation(value = "周边查询", notes = "周边查询") |
| | | public R getSurroundingQueryList(String lon,String lat,String distance) { |
| | | HashMap<String, List<HashMap<String, String>>> surroundingQueryList = militaryLocalCoordinationService.getSurroundingQueryList(lon,lat,distance); |
| | | return R.data(surroundingQueryList); |
| | | } |
| | | |
| | | /** |
| | | * 导出火灾报告 |
| | | */ |
| | | @GetMapping("export-fire-report") |
| | | @ApiOperation(value = "导出火灾报告", notes = "传入火灾id") |
| | | public void exportUser(String fireId,HttpServletResponse response) { |
| | | militaryLocalCoordinationService.getFireAllDetail(fireId,response); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | public interface ComprehensiveStatisticsMapper { |
| | | |
| | | List<HashMap<String, String>> getDataOverview(); |
| | | |
| | | List<HashMap<String, String>> getDeptStatistics(); |
| | | |
| | | List<HashMap<String,String>> getFireCallSource(); |
| | | |
| | | List<HashMap<String, String>> getFireReportingTrend(); |
| | | |
| | | List<HashMap<String, String>> getProneAreasStatistics(@Param("regionCode") String regionCode,@Param("limit") Integer limit); |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.dp.mapper.ComprehensiveStatisticsMapper"> |
| | | |
| | | |
| | | <select id="getDataOverview" resultType="java.util.HashMap"> |
| | | SELECT a.deptNumber,b.policeCarNumber,c.deviceNumber,d.outNumber |
| | | FROM( |
| | | ( SELECT COUNT(*) AS deptNumber FROM blade_dept dept WHERE dept.is_deleted = 0 ) a, |
| | | ( SELECT COUNT(*) AS policeCarNumber FROM sys_vehicle vehicle WHERE vehicle.is_deleted = 0 ) b, |
| | | ( SELECT COUNT(*) AS deviceNumber FROM sys_device device WHERE device.is_deleted = 0 ) c, |
| | | ( SELECT COUNT(*) AS outNumber FROM sys_fire fire WHERE fire.is_deleted = 0 AND fire.status !=1 ) d |
| | | ); |
| | | </select> |
| | | |
| | | <select id="getDeptStatistics" resultType="java.util.HashMap"> |
| | | SELECT DISTINCT a.city cityCode,a.cityNumber,region.city_name cityName |
| | | FROM |
| | | ( |
| | | SELECT dept.city,COUNT(*) AS cityNumber |
| | | FROM blade_dept dept WHERE dept.is_deleted = 0 |
| | | GROUP BY dept.city |
| | | ) a LEFT JOIN blade_region region ON region.city_code = a.city |
| | | </select> |
| | | <select id="getFireCallSource" resultType="java.util.HashMap"> |
| | | SELECT |
| | | CONVERT(COUNT(*),CHAR) AS number, |
| | | fire.find_way findWay, |
| | | biz.dict_value findWayName |
| | | FROM |
| | | sys_fire fire |
| | | LEFT JOIN blade_dict_biz biz ON biz.dict_key = fire.find_way AND biz.`code` = 'fire_find_way' |
| | | WHERE |
| | | fire.is_deleted = 0 |
| | | GROUP BY |
| | | fire.find_way |
| | | </select> |
| | | <select id="getFireReportingTrend" resultType="java.util.HashMap"> |
| | | SELECT |
| | | m.id month,IFNULL(b.number,0) number |
| | | FROM |
| | | ( |
| | | SELECT 1 AS id UNION |
| | | SELECT 2 UNION |
| | | SELECT 3 UNION |
| | | SELECT 4 UNION |
| | | SELECT 5 UNION |
| | | SELECT 6 UNION |
| | | SELECT 7 UNION |
| | | SELECT 8 UNION |
| | | SELECT 9 UNION |
| | | SELECT 10 UNION |
| | | SELECT 11 UNION |
| | | SELECT 12 |
| | | ) m |
| | | LEFT JOIN |
| | | ( |
| | | SELECT MONTH(fire.alarm_time) month,COUNT(*) number |
| | | FROM sys_fire fire |
| | | WHERE fire.is_deleted = 0 |
| | | GROUP BY MONTH ( fire.alarm_time ) |
| | | ) b ON b.`month` = m.id |
| | | ORDER BY month |
| | | </select> |
| | | |
| | | <select id="getProneAreasStatistics" resultType="java.util.HashMap"> |
| | | SELECT |
| | | address,COUNT(*) times |
| | | FROM |
| | | `sys_fire` |
| | | WHERE |
| | | is_deleted = 0 |
| | | AND find_way = 1 |
| | | AND FIND_IN_SET(#{regionCode},REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(location,'[',-1),']',1),'"','')) |
| | | GROUP BY |
| | | address |
| | | ORDER BY times DESC |
| | | LIMIT #{limit} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.dp.mapper; |
| | | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Repository |
| | | public interface FireWarningMapper { |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.dp.mapper.FireWarningMapper"> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.dp.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.fireSupplement.vo.FireSupplementVO; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface MilitaryLocalCoordinationMapper { |
| | | |
| | | List<HashMap<String, String>> gerSurroundingDeptList(@Param("lon") String lon, @Param("lat") String lat, @Param("distance") String distance); |
| | | |
| | | List<HashMap<String, String>> gerSurroundingDeviceList(@Param("lon") String lon, @Param("lat") String lat, @Param("distance") String distance); |
| | | |
| | | List<HashMap<String, String>> gerSurroundingVehicleList(@Param("lon") String lon, @Param("lat") String lat, @Param("distance") String distance); |
| | | |
| | | FireSupplementVO getFireAllDetail(@Param("fireId") String fireId); |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.dp.mapper.MilitaryLocalCoordinationMapper"> |
| | | |
| | | <select id="gerSurroundingDeptList" resultType="java.util.HashMap"> |
| | | SELECT id,dept_name,lon,lat, |
| | | round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) distance |
| | | FROM `blade_dept` |
| | | WHERE is_deleted = 0 |
| | | AND round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) <= #{distance} |
| | | </select> |
| | | |
| | | <select id="gerSurroundingDeviceList" resultType="java.util.HashMap"> |
| | | SELECT id,name,lon,lat, |
| | | round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) distance |
| | | FROM sys_device |
| | | WHERE is_deleted = 0 |
| | | AND round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) <= #{distance} |
| | | </select> |
| | | |
| | | <select id="gerSurroundingVehicleList" resultType="java.util.HashMap"> |
| | | SELECT id,license_plate,lon,lat, |
| | | round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) distance |
| | | FROM sys_vehicle |
| | | WHERE is_deleted = 0 |
| | | AND round(6378.138 * 2 * asin(sqrt(pow( sin(( lat * pi() / 180 - #{lat} * pi() / 180 ) / 2 ), 2 ) + cos( lat * pi() / 180 ) * cos( #{lat} * pi() / 180 ) * pow( sin(( lon * pi() / 180 - #{lon} * pi() / 180 ) / 2 ), 2 ))) * 1000) <= #{distance} |
| | | </select> |
| | | |
| | | <resultMap id="fireAllDetail" type="org.springblade.modules.fireSupplement.vo.FireSupplementVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="fire_id" property="fireId"/> |
| | | <result column="lon" property="lon"/> |
| | | <result column="lat" property="lat"/> |
| | | <result column="alarm_time" property="alarmTime"/> |
| | | <result column="province_name" property="province"/> |
| | | <result column="city_name" property="city"/> |
| | | <result column="district_name" property="district"/> |
| | | <result column="sumInjuryPerson" property="sumInjuryPerson"/> |
| | | <result column="fire_reason" property="fireReason"/> |
| | | <result column="tree_species" property="treeSpecies"/> |
| | | <result column="extinguishing_time" property="extinguishingTime"/> |
| | | <result column="perpetrator" property="perpetrator"/> |
| | | <result column="sum_person" property="sumPerson"/> |
| | | <result column="punish_person" property="punishPerson"/> |
| | | <result column="situation" property="situation"/> |
| | | <result column="minor_injury_person" property="minorInjuryPerson"/> |
| | | <result column="serious_injury_person" property="seriousInjuryPerson"/> |
| | | <result column="death_person" property="deathPerson"/> |
| | | <result column="economic_loss" property="economicLoss" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result column="damage_area" property="damageArea" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | <result column="police_resources" property="policeResources" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> |
| | | </resultMap> |
| | | |
| | | <select id="getFireAllDetail" resultMap="fireAllDetail"> |
| | | SELECT |
| | | sup.id, |
| | | sup.fire_id, |
| | | fire.location, |
| | | fire.lon, |
| | | fire.lat, |
| | | fire.alarm_time, |
| | | |
| | | region.province_name, |
| | | region.city_name, |
| | | region.district_name, |
| | | |
| | | sup.extinguishing_time, |
| | | sup.tree_species, |
| | | sup.fire_reason, |
| | | sup.perpetrator, |
| | | sup.damage_area, |
| | | sup.economic_loss, |
| | | (sup.minor_injury_person+sup.serious_injury_person+sup.death_person) as sumInjuryPerson, |
| | | sup.minor_injury_person, |
| | | sup.serious_injury_person, |
| | | sup.death_person, |
| | | sup.police_resources, |
| | | sup.situation, |
| | | sup.sum_person, |
| | | sup.punish_person |
| | | FROM |
| | | sys_fire fire |
| | | LEFT JOIN sys_fire_supplement sup ON sup.fire_id = fire.id |
| | | LEFT JOIN |
| | | ( |
| | | SELECT |
| | | id, |
| | | SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(location,'[',-1),']',1),'"',''),',',1),',',-1) provinceCode, |
| | | SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(location,'[',-1),']',1),'"',''),',',2),',',-1) cityCode, |
| | | SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(location,'[',-1),']',1),'"',''),',',3),',',-1) districtCode |
| | | FROM sys_fire WHERE is_deleted = 0 AND id = #{fireId} |
| | | ) r ON fire.id = r.id |
| | | LEFT JOIN blade_region region ON region.code = r.districtCode |
| | | WHERE |
| | | fire.id = #{fireId} |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.dp.service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | public interface IComprehensiveStatisticsService { |
| | | /** |
| | | * 获取数据概览 |
| | | * @return |
| | | */ |
| | | List<HashMap<String, String>> getDataOverview(); |
| | | |
| | | /** |
| | | * 获取入驻单位统计 |
| | | * @return |
| | | */ |
| | | List<HashMap<String, String>> getDeptStatistics(); |
| | | |
| | | /** |
| | | * 获取火警事件来源 |
| | | * @return |
| | | */ |
| | | List getFireCallSource(); |
| | | |
| | | /** |
| | | * 获取火警上报趋势 |
| | | * @return |
| | | */ |
| | | List<HashMap<String, String>> getFireReportingTrend(); |
| | | |
| | | /** |
| | | * 获取易发区统计数据 |
| | | * @param regionCode 区域编号 |
| | | * @return |
| | | */ |
| | | List<HashMap<String, String>> getProneAreasStatistics(String regionCode,Integer limit); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.service; |
| | | |
| | | public interface IFireWarningService { |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | public interface IMilitaryLocalCoordinationService { |
| | | /** |
| | | * 获取周边数据 |
| | | * @param lon |
| | | * @param lat |
| | | * @param distance |
| | | * @return |
| | | */ |
| | | HashMap<String, List<HashMap<String, String>>> getSurroundingQueryList(String lon,String lat,String distance); |
| | | |
| | | void getFireAllDetail(String fireId, HttpServletResponse response); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.service.impl; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.modules.dp.mapper.ComprehensiveStatisticsMapper; |
| | | import org.springblade.modules.dp.service.IComprehensiveStatisticsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ComprehensiveStatisticsServiceImpl implements IComprehensiveStatisticsService { |
| | | |
| | | private ComprehensiveStatisticsMapper comprehensiveStatisticsMapper; |
| | | |
| | | @Override |
| | | public List<HashMap<String, String>> getDataOverview() { |
| | | return comprehensiveStatisticsMapper.getDataOverview(); |
| | | } |
| | | |
| | | @Override |
| | | public List<HashMap<String, String>> getDeptStatistics() { |
| | | return comprehensiveStatisticsMapper.getDeptStatistics(); |
| | | } |
| | | |
| | | @Override |
| | | public List getFireCallSource() { |
| | | List list = new ArrayList(); |
| | | Map<String, Integer> m1 = new HashMap<>(16); |
| | | List<HashMap<String,String>> fireCallSource = comprehensiveStatisticsMapper.getFireCallSource(); |
| | | int number = fireCallSource.stream().mapToInt(e -> Integer.parseInt(e.get("number"))).sum(); |
| | | m1.put("sum",number); |
| | | list.add(fireCallSource); |
| | | list.add(m1); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<HashMap<String, String>> getFireReportingTrend() { |
| | | return comprehensiveStatisticsMapper.getFireReportingTrend(); |
| | | } |
| | | |
| | | @Override |
| | | public List getProneAreasStatistics(String regionCode,Integer limit) { |
| | | return comprehensiveStatisticsMapper.getProneAreasStatistics(regionCode,limit); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.service.impl; |
| | | |
| | | import org.springblade.modules.dp.mapper.FireWarningMapper; |
| | | import org.springblade.modules.dp.service.IFireWarningService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class FireWarningServiceImpl implements IFireWarningService { |
| | | @Autowired |
| | | private FireWarningMapper fireWarningMapper; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.dp.service.impl; |
| | | |
| | | import org.springblade.modules.dp.mapper.MilitaryLocalCoordinationMapper; |
| | | import org.springblade.modules.dp.service.IMilitaryLocalCoordinationService; |
| | | import org.springblade.modules.fireSupplement.vo.FireSupplementVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class MilitaryLocalCoordinationServiceImpl implements IMilitaryLocalCoordinationService { |
| | | @Autowired |
| | | private MilitaryLocalCoordinationMapper militaryLocalCoordinationMapper; |
| | | |
| | | @Override |
| | | public HashMap<String, List<HashMap<String, String>>> getSurroundingQueryList(String lon, String lat, String distance) { |
| | | HashMap<String,List<HashMap<String,String>>> query = new HashMap<>(); |
| | | |
| | | List<HashMap<String,String>> deptList = militaryLocalCoordinationMapper.gerSurroundingDeptList(lon,lat,distance); |
| | | query.put("dept",deptList); |
| | | |
| | | List<HashMap<String,String>> deviceList = militaryLocalCoordinationMapper.gerSurroundingDeviceList(lon,lat,distance); |
| | | query.put("device",deviceList); |
| | | |
| | | List<HashMap<String,String>> vehicleList = militaryLocalCoordinationMapper.gerSurroundingVehicleList(lon,lat,distance); |
| | | query.put("vehicle",vehicleList); |
| | | |
| | | return query; |
| | | } |
| | | |
| | | @Override |
| | | public void getFireAllDetail(String fireId, HttpServletResponse response){ |
| | | FireSupplementVO fireAllDetail = militaryLocalCoordinationMapper.getFireAllDetail(fireId); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public void excelExport(String fileName,HttpServletResponse response,List data) throws IOException { |
| | | } |
| | | } |
| New file |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8222 |
| | | |
| | | #数据源配置 |
| | | spring: |
| | | datasource: |
| | | url: ${blade.datasource.dev.url} |
| | | username: ${blade.datasource.dev.username} |
| | | password: ${blade.datasource.dev.password} |
| | | |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.system.dto.DeptDTO; |
| | | import org.springblade.system.entity.*; |
| | | import org.springblade.system.service.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | return R.data(regionService.getById(code)); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping("/getUserGroupByDept") |
| | | public R<List<DeptDTO>> getUserGroupByDept() { |
| | | return R.data(deptService.getUserGroupByDept()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <module>blade-system</module> |
| | | <module>blade-user</module> |
| | | <module>blade-fire</module> |
| | | <module>blade-dp</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | |
| | | <module>blade-plugin-api</module> |
| | | <module>blade-service</module> |
| | | <module>blade-service-api</module> |
| | | <module>blade-dp</module> |
| | | </modules> |
| | | |
| | | <dependencyManagement> |