This commit is contained in:
esacpe
2024-07-17 21:00:42 +08:00
commit b80c560e87
1931 changed files with 163526 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package com.mosty.yjzl;
import com.mosty.common.base.timeconsume.EnableTimeConsume;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 预警指令 微服务
* @author zengbo
* @date 2022/7/11 14:29 PM[
* @since 1.0.0
*/
@EnableTimeConsume
@EnableFeignClients(basePackages = "com.mosty.base.feign.service")
@MapperScan("com.mosty.yjzl.mapper")
@EnableDiscoveryClient
@SpringBootApplication
@EnableScheduling
public class MostyYjzlApplication {
public static void main(String[] args) {
SpringApplication.run(MostyYjzlApplication.class, args);
}
}

View File

@ -0,0 +1,12 @@
package com.mosty.yjzl.cluster;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
public class Cluster {
}

View File

@ -0,0 +1,38 @@
package com.mosty.yjzl.cluster;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class DistanceRunnable implements Runnable {
private WGS84Point point;
private Set<WGS84Point> points;
private List<NeighborDTO> neighborList;
private long scope;
public DistanceRunnable(WGS84Point point, Set<WGS84Point> points, List<NeighborDTO> neighborList, long scope) {
super();
this.point = point;
this.points = points;
this.neighborList = neighborList;
this.scope = scope;
}
@Override
public void run() {
Map<WGS84Point, Long> map = new HashMap<>();
for (WGS84Point point2 : points) {
if (point.equals(point2)) {
continue;
}
long distance = PositionUtil.getDistance(point.getLatitude(), point.getLongitude(), point2.getLatitude(), point2.getLongitude());
if (distance < scope) {
map.put(point2, distance);
}
}
neighborList.add(new NeighborDTO(point, map));
}
}

View File

@ -0,0 +1,37 @@
package com.mosty.yjzl.cluster;
import java.util.Map;
public class NeighborDTO implements Comparable<NeighborDTO> {
private WGS84Point point;
private Map<WGS84Point, Long> neighbors;
public NeighborDTO(WGS84Point point, Map<WGS84Point, Long> neighbors) {
super();
this.point = point;
this.neighbors = neighbors;
}
public WGS84Point getPoint() {
return point;
}
public void setPoint(WGS84Point point) {
this.point = point;
}
public Map<WGS84Point, Long> getNeighbors() {
return neighbors;
}
public void setNeighbors(Map<WGS84Point, Long> neighbors) {
this.neighbors = neighbors;
}
@Override
public int compareTo(NeighborDTO o) {
return o.getNeighbors().size() - neighbors.size();
}
}

View File

@ -0,0 +1,24 @@
package com.mosty.yjzl.cluster;
public class NeighborDistanceDTO {
private long distance;
private WGS84Point neighbor;
public long getDistance() {
return distance;
}
public void setDistance(long distance) {
this.distance = distance;
}
public WGS84Point getNeighbor() {
return neighbor;
}
public void setNeighbor(WGS84Point neighbor) {
this.neighbor = neighbor;
}
}

View File

@ -0,0 +1,197 @@
package com.mosty.yjzl.cluster;
import java.util.Arrays;
/**
* 坐标系转换工具类 </br>
* WGS84坐标系 地球坐标系,国际通用坐标系 </br>
* GCJ02坐标系 火星坐标系WGS84坐标系加密后的坐标系Google国内地图、高德、QQ地图 使用 </br>
* BD09坐标系 百度坐标系GCJ02坐标系加密后的坐标系
*/
public class PositionUtil {
private static double pi = 3.1415926535897932384626;
private static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
private static double a = 6378245.0;
private static double ee = 0.00669342162296594323;
private static double transformLat(double x, double y) {
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
return ret;
}
private static double transformLon(double x, double y) {
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 * pi)) * 2.0 / 3.0;
return ret;
}
private static double[] transform(double latitude, double longitude) {
if (outOfChina(latitude, longitude)) {
return new double[] { latitude, longitude };
}
double dLat = transformLat(longitude - 105.0, latitude - 35.0);
double dLon = transformLon(longitude - 105.0, latitude - 35.0);
double radLat = latitude / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = latitude + dLat;
double mgLon = longitude + dLon;
return new double[] { mgLat, mgLon };
}
private static boolean outOfChina(double latitude, double longitude) {
if (longitude < 72.004 || longitude > 137.8347) {
return true;
}
if (latitude < 0.8293 || latitude > 55.8271) {
return true;
}
return false;
}
/**
* WGS-84 转 火星坐标系
*
* @param latitude
* @param longitude
* @return
*/
public static double[] wgs84ToGcj02(double latitude, double longitude) {
if (outOfChina(latitude, longitude)) {
return new double[] { latitude, longitude };
}
double dLat = transformLat(longitude - 105.0, latitude - 35.0);
double dLon = transformLon(longitude - 105.0, latitude - 35.0);
double radLat = latitude / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = latitude + dLat;
double mgLon = longitude + dLon;
return new double[] { mgLat, mgLon };
}
public static void main(String[] args) {
double[] wgs84ToGcj02 = wgs84ToGcj02(30.55956521, 104.27152736);
System.out.println(Arrays.toString(wgs84ToGcj02));
}
/**
* 火星坐标系 (GCJ-02) 转 WGS-84
*
* @param latitude
* @param longitude
* @return
*/
public static double[] gcj02ToWgs84(double latitude, double longitude) {
double[] wgs = transform(latitude, longitude);
double longitudetitude = longitude * 2 - wgs[1];
double latitudeitude = latitude * 2 - wgs[0];
return new double[] { latitudeitude, longitudetitude };
}
/**
* 火星坐标系 (GCJ-02) 转百度坐标系 (BD-09)
*
* @param latitude
* @param longitude
* @return
*/
public static double[] gcj02ToBd09(double latitude, double longitude) {
double x = longitude, y = latitude;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta) + 0.0065;
double tempLat = z * Math.sin(theta) + 0.006;
double[] wgs = { tempLat, tempLon };
return wgs;
}
/**
* 百度坐标系 (BD-09) 转 火星坐标系 (GCJ-02)
*
* @param latitude
* @param longitude
* @return
*/
public static double[] bd09ToGcj02(double latitude, double longitude) {
double x = longitude - 0.0065, y = latitude - 0.006;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta);
double tempLat = z * Math.sin(theta);
double[] wgs = { tempLat, tempLon };
return wgs;
}
/**
* WGS-84 转 百度坐标系 (BD-09)
*
* @param latitude
* @param longitude
* @return
*/
public static double[] wgs84ToBd09(double latitude, double longitude) {
double[] gcj02 = wgs84ToGcj02(latitude, longitude);
double[] bd09 = gcj02ToBd09(gcj02[0], gcj02[1]);
return bd09;
}
/**
* 百度坐标系 (BD-09) 转 WGS-84
*
* @param latitude
* @param longitude
* @return
*/
public static double[] bd09ToWgs84(double latitude, double longitude) {
double[] gcj02 = bd09ToGcj02(latitude, longitude);
double[] wgs84 = gcj02ToWgs84(gcj02[0], gcj02[1]);
// 保留小数点后六位
wgs84[0] = retain6(wgs84[0]);
wgs84[1] = retain6(wgs84[1]);
return wgs84;
}
/**
* 保留小数点后六位
*
* @param num
* @return
*/
private static double retain6(double num) {
String result = String.format("%.6f", num);
return Double.valueOf(result);
}
/**
* 计算两个坐标之间的距离
*
* @param latitude1
* @param longitude1
* @param latitude2
* @param longitude2
* @return
*/
public static long getDistance(double latitude1, double longitude1, double latitude2, double longitude2) {
double rad = pi / 180.0;
double radlatitude1 = latitude1 * rad;
double radlatitude2 = latitude2 * rad;
double s = 2
* Math.asin(Math.sqrt(Math.pow(Math.sin((radlatitude1 - radlatitude2) / 2), 2) + Math.cos(radlatitude1)
* Math.cos(radlatitude2) * Math.pow(Math.sin(((longitude1 - longitude2) * rad) / 2), 2)));
return Math.round(s * a * 100) / 100;
}
}

View File

@ -0,0 +1,75 @@
/*
* Copyright 2010, Silvio Heuberger @ IFS www.ifs.hsr.ch
*
* This code is release under the Apache License 2.0.
* You should have received a copy of the license
* in the LICENSE file. If you have not, see
* http://www.apache.org/licenses/LICENSE-2.0
*/
package com.mosty.yjzl.cluster;
import java.io.Serializable;
/**
* {@link WGS84Point} encapsulates coordinates on the earths surface.<br>
* Coordinate projections might end up using this class...
*/
public class WGS84Point implements Serializable {
private static final long serialVersionUID = 7457963026513014856L;
private final double longitude;
private final double latitude;
private String ssbmdm;
public String getSsbmdm() {
return ssbmdm;
}
public void setSsbmdm(String ssbmdm) {
this.ssbmdm = ssbmdm;
}
public WGS84Point(double latitude, double longitude, String ssbmdm) {
this.latitude = latitude;
this.longitude = longitude;
this.ssbmdm = ssbmdm;
if (Math.abs(latitude) > 90 || Math.abs(longitude) > 180) {
throw new IllegalArgumentException("The supplied coordinates " + this + " are out of range.");
}
}
public WGS84Point(WGS84Point other) {
this(other.latitude, other.longitude, other.ssbmdm);
}
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
@Override
public String toString() {
return String.format("(" + latitude + "," + longitude + ")");
}
@Override
public boolean equals(Object obj) {
if (obj instanceof WGS84Point) {
WGS84Point other = (WGS84Point) obj;
return latitude == other.latitude && longitude == other.longitude;
}
return false;
}
@Override
public int hashCode() {
int result = 42;
long latBits = Double.doubleToLongBits(latitude);
long lonBits = Double.doubleToLongBits(longitude);
result = 31 * result + (int) (latBits ^ (latBits >>> 32));
result = 31 * result + (int) (lonBits ^ (lonBits >>> 32));
return result;
}
}

View File

@ -0,0 +1,23 @@
package com.mosty.yjzl.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Configuration
public class FeignConfig implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attr != null) {
HttpServletRequest request = attr.getRequest();
// 添加token
requestTemplate.header("Authorization", request.getHeader("Authorization"));
}
}
}

View File

@ -0,0 +1,25 @@
package com.mosty.yjzl.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
* 全局配置
* @author kevin
* @date 2022/5/25 1:56 上午
* @since 1.0.0
*/
@Data
@Configuration
@ConfigurationProperties("exclude.path-patterns")
public class GlobalYmlConfig {
/**
* swagger 静态文件的放行列表
*/
private List<String> swagger;
}

View File

@ -0,0 +1,120 @@
package com.mosty.yjzl.config;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.mosty.common.token.SysUserInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* 单体服务拦截器
* @author kevin
* @date 2022/3/21 11:17 PM
* @since 1.0.0
*/
@Configuration
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer, InitializingBean {
private static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
private static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
@Value("${server.servlet.context-path:/}")
private String contextPath;
@Autowired
private GlobalYmlConfig globalYmlConfig;
@Override
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
ObjectMapper objectMapper = converter.getObjectMapper();
// 生成JSON时,将所有Long转换成String
SimpleModule simpleModule = new SimpleModule();
//日期格式化
simpleModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
simpleModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
simpleModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
simpleModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
simpleModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
objectMapper.registerModule(simpleModule);
// 时间格式化
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true);
objectMapper.configure(JsonGenerator.Feature.IGNORE_UNKNOWN, true);
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
// 设置格式化内容
converter.setObjectMapper(objectMapper);
converters.add(0, converter);
}
@Override
public void afterPropertiesSet() throws Exception {
log.info("当前服务的 contextPath={}", contextPath);
log.info("当前服务的 swaggerExcludePathPatterns={}", JSON.toJSONString(globalYmlConfig.getSwagger()));
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userInfoInterceptor()).addPathPatterns("/**")
.excludePathPatterns(globalYmlConfig.getSwagger());
log.info("初始化WebMvcConfig 监控拦截器SysUserInterceptor");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
if (!registry.hasMappingForPattern("/template/**")) {
registry.addResourceHandler("/template/**").addResourceLocations("classpath:/template/");
}
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("docs.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
WebMvcConfigurer.super.addResourceHandlers(registry);
}
@Bean
public SysUserInterceptor userInfoInterceptor() {
log.info("初始化WebMvcConfig 拦截器SysUserInterceptor");
return new SysUserInterceptor();
}
}

View File

@ -0,0 +1,82 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.yjzl.TbFzycDto;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbFzycService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "犯罪预测接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbFzyc")
public class TbFzycController {
private TbFzycService tbFzycService;
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "犯罪预测新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbFzyc vo) {
return ResponseResult.success(tbFzycService.insert(vo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "犯罪预测更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbFzyc vo) {
return ResponseResult.success(tbFzycService.fzUpdateById(vo));
}
@ApiOperation("删除数据")
@JwtSysUser
@DeleteMapping("/{id}")
@Log(title = "犯罪预测删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> update(@PathVariable("id") String id) {
return ResponseResult.success(tbFzycService.deleteById(id));
}
@ApiOperation("App查询犯罪预测列表")
@JwtSysUser
@PostMapping("/queryListApp")
@Log(title = "查询犯罪预测列表", businessType = BusinessType.OTHER)
public ResponseResult<List<TbFzyc>> queryListApp(@RequestBody TbFzycDto tbFzycDto) {
return ResponseResult.success(tbFzycService.queryListApp(tbFzycDto));
}
@ApiOperation("查询犯罪预测列表")
@JwtSysUser
@PostMapping("/queryList")
@Log(title = "查询犯罪预测列表", businessType = BusinessType.OTHER)
public ResponseResult<List<TbFzyc>> queryList(@RequestBody TbFzycDto tbFzycDto) {
return ResponseResult.success(tbFzycService.queryList(tbFzycDto));
}
@ApiOperation("分页查询犯罪预测列表")
@JwtSysUser
@PostMapping("/queryListPage")
@Log(title = "分页查询犯罪预测列表", businessType = BusinessType.OTHER)
public ResponseResult<IPage<TbFzyc>> queryListPage(@RequestBody TbFzycDto tbFzycDto) {
return ResponseResult.success(tbFzycService.queryListPage(tbFzycDto));
}
@GetMapping("/getFzyjCount")
@ApiOperation("查询犯罪预测数量")
public ResponseResult<Integer> getFzyjCount(String ssbmdm, String time, String sfxl) {
return ResponseResult.success(tbFzycService.getFzyjCount(ssbmdm, time, sfxl));
}
}

View File

@ -0,0 +1,49 @@
package com.mosty.yjzl.controller;
import com.mosty.base.model.vo.yjzl.TbFzycPzVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbFzycPzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Api(tags = "犯罪预测配置接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbFzycPz")
public class TbFzycPzController {
private TbFzycPzService tbFzycService;
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "犯罪预测配置新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbFzycPzVo vo) {
return ResponseResult.success(tbFzycService.insert(vo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "犯罪预测配置更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbFzycPzVo vo) {
return ResponseResult.success(tbFzycService.updateById(vo));
}
@ApiOperation("删除数据")
@JwtSysUser
@DeleteMapping("/{id}")
@Log(title = "犯罪预测配置删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> update(@PathVariable("id") String id) {
return ResponseResult.success(tbFzycService.deleteById(id));
}
}

View File

@ -0,0 +1,80 @@
package com.mosty.yjzl.controller;
import com.mosty.base.model.dto.yjzl.TbFzycXljlDto;
import com.mosty.base.model.entity.wzzx.TbWzSbsswz;
import com.mosty.base.model.entity.yjzl.TbFzycXljl;
import com.mosty.base.model.vo.wzzx.TbWzSblswzVo;
import com.mosty.base.model.vo.yjzl.TbFzJlVo;
import com.mosty.base.model.vo.yjzl.TbFzycPzVo;
import com.mosty.base.model.vo.yjzl.TbFzycXljlVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbFzycPzService;
import com.mosty.yjzl.service.TbFzycXljlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "犯罪预测巡逻记录接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbFzycXljl")
public class TbFzycXljlController {
private TbFzycXljlService tbFzycXljlService;
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "犯罪预测巡逻记录新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbFzycXljlVo vo) {
return ResponseResult.success(tbFzycXljlService.insert(vo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "犯罪预测巡逻记录更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbFzycXljlVo vo) {
return ResponseResult.success(tbFzycXljlService.updateById(vo));
}
@ApiOperation("删除数据")
@JwtSysUser
@DeleteMapping("/{id}")
@Log(title = "犯罪预测巡逻记录删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> update(@PathVariable("id") String id) {
return ResponseResult.success(tbFzycXljlService.deleteById(id));
}
@ApiOperation("根据ID查询")
@JwtSysUser
@GetMapping("/{id}")
@Log(title = "根据ID查询", businessType = BusinessType.OTHER)
public ResponseResult<TbFzycXljl> queryById(@PathVariable("id") String id) {
return ResponseResult.success(tbFzycXljlService.queryById(id));
}
@ApiOperation("查询犯罪预警预测指令巡逻记录列表")
@JwtSysUser
@GetMapping("/qfzxl")
@Log(title = "查询犯罪预警预测指令巡逻记录列表", businessType = BusinessType.OTHER)
public ResponseResult<List<TbFzycXljlDto>> qfzxl(String id) {
return ResponseResult.success(tbFzycXljlService.qfzxl(id));
}
@ApiOperation("新增数据")
@PostMapping("/addBySbwz")
@Log(title = "通过设备位置新增犯罪预测巡逻记录", businessType = BusinessType.INSERT)
public ResponseResult<Void> addBySbwz(@RequestBody TbFzJlVo vo) {
tbFzycXljlService.addBySbwz(vo);
return ResponseResult.success();
}
}

View File

@ -0,0 +1,50 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.entity.yjzl.TbYjDyyjxx;
import com.mosty.base.model.query.yjzl.TbYjDyyjxxQuery;
import com.mosty.yjzl.service.TbYjDyyjxxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "订阅预警信息接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjDyyjxx")
public class TbYjDyyjxxController {
private TbYjDyyjxxService tbYjDyyjxxService;
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping
public ResponseResult<IPage<TbYjDyyjxx>> paginQuery(TbYjDyyjxxQuery dto){
return ResponseResult.success(tbYjDyyjxxService.queryByPage(dto));
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "订阅预警信息新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjDyyjxx dyyjxx){
return ResponseResult.success(tbYjDyyjxxService.insert(dyyjxx));
}
@ApiOperation("通过主键删除数据")
@DeleteMapping("/bacth")
@Log(title = "订阅预警信息删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> deleteByIds(@RequestParam List<String> list){
return ResponseResult.success(tbYjDyyjxxService.deleteById(list));
}
}

View File

@ -0,0 +1,73 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.query.yjzl.TbYjmxQuery;
import com.mosty.base.model.vo.yjzl.TbYjmxAllVo;
import com.mosty.base.model.vo.yjzl.TbYjmxVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbYjmxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Api(tags = "预警模型接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjmx")
public class TbYjmxController {
private TbYjmxService tbYjmxService;
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警模型新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjmxVo vo){
return ResponseResult.success(tbYjmxService.insert(vo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警模型更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjmxVo clVo){
return ResponseResult.success(tbYjmxService.updateById(clVo));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping
@Log(title = "分页查询", businessType = BusinessType.OTHER)
public ResponseResult<IPage<TbYjmxVo>> getPage(TbYjmxQuery dto){
return ResponseResult.success(tbYjmxService.getPage(dto));
}
@ApiOperation("删除数据")
@JwtSysUser
@DeleteMapping("/{id}")
@Log(title = "预警模型删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> update(@PathVariable("id") String id){
return ResponseResult.success(tbYjmxService.deleteById(id));
}
@ApiOperation("启动、停止模型")
@JwtSysUser
@GetMapping("/{id}")
@Log(title = "启动、停止模型", businessType = BusinessType.DELETE)
public ResponseResult<Integer> start(@PathVariable("id") String id){
return ResponseResult.success(tbYjmxService.startMx(id));
}
@ApiOperation("查询模型参数详情信息")
@JwtSysUser
@PostMapping("/getMxCs/{mxid}")
public ResponseResult<TbYjmxAllVo> getMxCs(@PathVariable("mxid") String mxid){
return ResponseResult.success(this.tbYjmxService.getMxCs(mxid));
}
}

View File

@ -0,0 +1,60 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.query.yjzl.TbYjmxCsbQuery;
import com.mosty.base.model.vo.yjzl.TbYjmxCsbVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbYjmxCsbService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Api(tags = "预警模型参数表接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjmxCsb")
public class TbYjmxCsbController {
private TbYjmxCsbService tbYjmxCsbService;
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警模型参数表新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjmxCsbVo vo){
return ResponseResult.success(tbYjmxCsbService.insert(vo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警模型参数表更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjmxCsbVo clVo){
return ResponseResult.success(tbYjmxCsbService.updateById(clVo));
}
@ApiOperation("删除数据")
@JwtSysUser
@DeleteMapping("/{id}")
@Log(title = "预警模型参数表删除", businessType = BusinessType.DELETE)
public ResponseResult<Integer> delete(@PathVariable("id") String id){
return ResponseResult.success(tbYjmxCsbService.deleteById(id));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping
@Log(title = "分页查询", businessType = BusinessType.OTHER)
public ResponseResult<IPage<TbYjmxCsbVo>> getPage(TbYjmxCsbQuery dto){
return ResponseResult.success(tbYjmxCsbService.getPage(dto));
}
}

View File

@ -0,0 +1,92 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.query.yjzl.TbYjxxClQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxClVo;
import com.mosty.yjzl.service.TbYjxxClService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 预警信息-人员表 前端控制器
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Api(tags = "预警信息人员接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjxxCl")
public class TbYjxxClController {
private TbYjxxClService tbYjxxClService;
@ApiOperation("通过ID查询单条数据")
@JwtSysUser
@GetMapping("{id}")
@Log(title = "预警信息车辆数据", businessType = BusinessType.OTHER)
@ApiImplicitParam(name = "id", value = "配置ID", paramType = "path", required = true, dataType="String")
public ResponseResult<TbYjxxClVo> queryById(@PathVariable String id){
return ResponseResult.success(tbYjxxClService.queryById(id));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping("/paginQuery")
public ResponseResult<IPage<TbYjxxClVo>> paginQuery(TbYjxxClQuery tbYjxxClQuery){
try {
return ResponseResult.success(tbYjxxClService.queryByPage(tbYjxxClQuery));
}catch (Exception e){
return ResponseResult.fail(500, e.getMessage());
}
}
@ApiOperation("不分页查询")
@JwtSysUser
@GetMapping("/queryListNoPager")
public ResponseResult<List<TbYjxxClVo>> queryListNoPager(TbYjxxClQuery tbYjxxClQuery){
try {
return ResponseResult.success(tbYjxxClService.queryList(tbYjxxClQuery));
}catch (Exception e){
return ResponseResult.fail(500, e.getMessage());
}
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警车辆信息新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjxxClVo ryVo){
return ResponseResult.success(tbYjxxClService.insert(ryVo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警信息人员更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjxxClVo clVo){
return ResponseResult.success(tbYjxxClService.update(clVo));
}
@ApiOperation("通过主键删除数据")
@DeleteMapping("/bacth")
@Log(title = "预警车辆信息删除", businessType = BusinessType.UPDATE)
@ApiImplicitParam(name = "list", value = "标签主键", paramType = "path", required = true, dataType="String")
public ResponseResult<Integer> deleteByIds(@RequestParam List<String> list){
return ResponseResult.success(tbYjxxClService.deleteById(list));
}
}

View File

@ -0,0 +1,175 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.yjzl.GetLastYjDto;
import com.mosty.base.model.dto.yjzl.TbYjxxDTO;
import com.mosty.base.model.dto.yjzl.YjConvertZlDto;
import com.mosty.base.model.entity.rh.RhMyhtWarn;
import com.mosty.base.model.query.afjcsj.VwSyrkJzgjGxListQuery;
import com.mosty.base.model.query.yjzl.*;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.entity.yjzl.TbYjxx;
import com.mosty.yjzl.service.TbYjxxService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.yaml.snakeyaml.util.UriEncoder;
import java.util.List;
import java.util.Map;
/**
* 预警信息表(TbYjxx)表控制层
*
* @author zhangHaiJun
* @since 2022-07-11 20:06:06
*/
@Api(tags = "预警信息相关接口")
@RestController
@RequestMapping("tbYjxx")
@AllArgsConstructor
public class TbYjxxController {
private final TbYjxxService tbYjxxService;
@ApiOperation("查询预警列表-分页")
@PostMapping(value = "/getPageList")
@JwtSysUser
public ResponseResult<IPage<TbYjxx>> getPageList(@RequestBody TbYjxxQuery dto) {
return ResponseResult.success(tbYjxxService.getPageList(dto));
}
@ApiOperation("查询预警列表-不分页")
@GetMapping("/getList")
@JwtSysUser
public ResponseResult<List<TbYjxx>> getList(TbYjxxNoPageQuery dto) {
return ResponseResult.success(tbYjxxService.getList(dto));
}
@ApiOperation("查询预警列表-根据预警内容查询")
@GetMapping("/selectYjByNr")
@JwtSysUser
public ResponseResult<List<TbYjxxDTO>> selectYjByNr(@RequestParam("yjNr") String yjNr) {
return ResponseResult.success(tbYjxxService.selectYjByNr(yjNr));
}
@ApiOperation("查询预警列表-热力图使用")
@GetMapping("/getListHotMapEs")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getListHotMapEs(TbYjxxNoPageQuery dto) {
return ResponseResult.success(tbYjxxService.getListHotMapEs(dto));
}
@ApiOperation("查询预警列表-热力图使用")
@GetMapping("/getListHotMap")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getListHotMap(TbYjxxNoPageQuery dto) {
return ResponseResult.success(tbYjxxService.getListHotMap(dto));
}
@ApiOperation("查询预警详情")
@GetMapping("/getInfo/{id}")
@JwtSysUser
public ResponseResult<TbYjxx> getInfo(@PathVariable("id") String id) {
return ResponseResult.success(tbYjxxService.getInfo(id));
}
@ApiOperation("大屏-巡组气泡框-预警轨迹")
@GetMapping("/selectTrack")
@JwtSysUser
@Log(title = "大屏-巡组气泡框-预警轨迹", businessType = BusinessType.OTHER)
public ResponseResult<IPage<TbYjxx>> selectTrack(TbYjxxYjgjQuery tbYjxx) {
return ResponseResult.success(tbYjxxService.selectTrack(tbYjxx));
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping("/insert")
@Log(title = "预警新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjxx yjxx) {
return ResponseResult.success(tbYjxxService.insert(yjxx));
}
@ApiOperation("查询预警列表-不分页")
@GetMapping("/queryYjxx")
@JwtSysUser
public ResponseResult<TbYjxx> queryYjxx(TbYjxx dto) {
return ResponseResult.success(tbYjxxService.queryYjxx(dto));
}
@ApiOperation("通过证件号码和车牌号查询人员的预警信息")
@GetMapping("/getYjgj")
@JwtSysUser
public ResponseResult<IPage<TbYjxx>> getYjgj(VwSyrkJzgjGxListQuery dto) {
return ResponseResult.success(tbYjxxService.getYjgj(dto));
}
@ApiOperation("APP端预警信息统计-预警级别")
@GetMapping("/getYjxxTj")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getYjxxTj(TbYjxxYjjbStatisticsQuery dto) {
return ResponseResult.success(tbYjxxService.getYjxxTj(dto));
}
@ApiOperation("APP端预警信息统计-预警类型")
@GetMapping("/getYjxxTjYjlx")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getYjxxTjYjlx(String kssj, String jssj) {
return ResponseResult.success(tbYjxxService.getYjxxTjYjlx(kssj, jssj));
}
@ApiOperation("APP端单人、单车预警统计")
@GetMapping("/getStatistics")
@JwtSysUser
public ResponseResult<Map<String, Object>> getStatistics(TbYjxxStatisticsQuery dto) {
return ResponseResult.success(tbYjxxService.getStatistics(dto));
}
@ApiOperation("APP各时段预警")
@GetMapping("/gsdyj")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "1.今天 2.7天 3.30天 4.90天", required = true, dataType = "String"),
})
public ResponseResult<Object> gsdyj(String type) {
return ResponseResult.success(tbYjxxService.gsdyj(type));
}
@ApiOperation("APP预警转为指令")
@PostMapping(value = "/yjConvertZl")
public ResponseResult<Void> yjConvertZl(@RequestBody YjConvertZlDto dto) {
this.tbYjxxService.yjConvertZl(dto);
return ResponseResult.success();
}
@ApiOperation("获取最新一条预警")
@PostMapping(value = "/getLastYj")
public ResponseResult<TbYjxx> getLastYj(@RequestBody GetLastYjDto dto) {
return ResponseResult.success(this.tbYjxxService.getLastYj(dto));
}
@ApiOperation("修改预警信息是否发送指令")
@PostMapping(value = "/updateYjxxSffszl/{id}")
public ResponseResult<TbYjxx> updateYjxxSffszl(@PathVariable("id") String id) {
this.tbYjxxService.updateYjxxSffszl(id);
return ResponseResult.success();
}
@ApiOperation("查询预警信息列表(只查询又经纬度信息的)")
@PostMapping(value = "/getYjxx30Day")
public ResponseResult<List<TbYjxx>> getYjxx30Day(@RequestBody TbYjxxQuery dto) {
return ResponseResult.success(this.tbYjxxService.getYjxx30Day(dto));
}
}

View File

@ -0,0 +1,68 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.query.yjzl.TbYjxxDypzQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxDypzVo;
import com.mosty.yjzl.service.TbYjxxDypzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "预警信息配置接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjxxDypz")
public class TbYjxxDypzController {
private TbYjxxDypzService tbYjxxDypzService;
@ApiOperation("通过ID查询单条数据")
@JwtSysUser
@GetMapping("{id}")
@Log(title = "预警配置数据", businessType = BusinessType.OTHER)
@ApiImplicitParam(name = "id", value = "配置ID", paramType = "path", required = true, dataType="String")
public ResponseResult<TbYjxxDypzVo> queryById(@PathVariable String id){
return ResponseResult.success(tbYjxxDypzService.queryById(id));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping
public ResponseResult<IPage<TbYjxxDypzVo>> paginQuery(TbYjxxDypzQuery dto){
return ResponseResult.success(tbYjxxDypzService.queryList(dto));
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警配置新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjxxDypzVo dypz){
return ResponseResult.success(tbYjxxDypzService.insert(dypz));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警配置更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjxxDypzVo dypz){
return ResponseResult.success(tbYjxxDypzService.updateById(dypz));
}
@ApiOperation("通过主键删除数据")
@DeleteMapping("/bacth")
@Log(title = "预警配置删除", businessType = BusinessType.UPDATE)
@ApiImplicitParam(name = "list", value = "标签主键", paramType = "path", required = true, dataType="String")
public ResponseResult<Integer> deleteByIds(@RequestParam List<String> list){
return ResponseResult.success(tbYjxxDypzService.deleteById(list));
}
}

View File

@ -0,0 +1,46 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.BasePage;
import com.mosty.base.model.entity.lzother.TAlarmYjgj;
import com.mosty.base.model.entity.yjzl.TbYjxxMxyj;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.yjzl.service.TbYjxxLzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 预警信息表(TbYjxx)泸州拓尔思
*
* @author dw
* @since 2022-11-20
*/
@Api(tags = "预警信息相关接口(泸州拓尔思)")
@RestController
@RequestMapping("tbYjxxLz")
@AllArgsConstructor
public class TbYjxxLzController {
private final TbYjxxLzService tbYjxxLzService;
@ApiOperation("添加泸州拓尔思预警信息")
@PostMapping(value = "/addYjxx")
public ResponseResult<Void> addYjxx(@RequestBody TAlarmYjgj item) {
this.tbYjxxLzService.addYjxx(item);
return ResponseResult.success();
}
@ApiOperation("LZ模型预警查询")
@GetMapping
public ResponseResult<IPage<TbYjxxMxyj>> querYjmx(BasePage basePage, String ssbmdm) {
return ResponseResult.success(this.tbYjxxLzService.querYjmx(basePage,ssbmdm));
}
}

View File

@ -0,0 +1,84 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.query.yjzl.TbYjxxRyQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxRyVo;
import com.mosty.yjzl.service.TbYjxxRyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 预警信息-人员表 前端控制器
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Api(tags = "预警信息人员接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjxxRy")
public class TbYjxxRyController {
private TbYjxxRyService tbYjxxRyService;
@ApiOperation("通过ID查询单条数据")
@JwtSysUser
@GetMapping("{id}")
@Log(title = "预警信息人员数据", businessType = BusinessType.OTHER)
@ApiImplicitParam(name = "id", value = "配置ID", paramType = "path", required = true, dataType="String")
public ResponseResult<TbYjxxRyVo> queryById(@PathVariable String id){
return ResponseResult.success(tbYjxxRyService.queryById(id));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping("/paginQuery")
public ResponseResult<IPage<TbYjxxRyVo>> paginQuery(TbYjxxRyQuery tbYjxxRyQuery){
return ResponseResult.success(tbYjxxRyService.queryByPage(tbYjxxRyQuery));
}
@ApiOperation("不分页查询")
@JwtSysUser
@GetMapping("/queryListNoPager")
public ResponseResult<List<TbYjxxRyVo>> queryListNoPager(TbYjxxRyQuery tbYjxxRyQuery){
return ResponseResult.success(tbYjxxRyService.queryList(tbYjxxRyQuery));
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警信息人员新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjxxRyVo ryVo){
return ResponseResult.success(tbYjxxRyService.insert(ryVo));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警信息人员更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjxxRyVo ryVo){
return ResponseResult.success(tbYjxxRyService.update(ryVo));
}
@ApiOperation("通过主键删除数据")
@DeleteMapping("/bacth")
@Log(title = "预警信息人员删除", businessType = BusinessType.UPDATE)
@ApiImplicitParam(name = "list", value = "标签主键", paramType = "path", required = true, dataType="String")
public ResponseResult<Integer> deleteByIds(@RequestParam List<String> list){
return ResponseResult.success(tbYjxxRyService.deleteById(list));
}
}

View File

@ -0,0 +1,83 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.base.model.query.yjzl.TbYjxxSjQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxSjVo;
import com.mosty.yjzl.service.TbYjxxSjService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 预警信息-事件表 前端控制器
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Api(tags = "预警信息事件表接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbYjxxSj")
public class TbYjxxSjController {
private TbYjxxSjService tbYjxxSjService;
@ApiOperation("通过ID查询单条数据")
@JwtSysUser
@GetMapping("{id}")
@Log(title = "预警事件数据", businessType = BusinessType.OTHER)
@ApiImplicitParam(name = "id", value = "配置ID", paramType = "path", required = true, dataType="String")
public ResponseResult<TbYjxxSjVo> queryById(@PathVariable String id){
return ResponseResult.success(tbYjxxSjService.queryById(id));
}
@ApiOperation("分页查询")
@JwtSysUser
@GetMapping
public ResponseResult<IPage<TbYjxxSjVo>> paginQuery(TbYjxxSjQuery tbYjxxSjQuery){
try {
return ResponseResult.success(tbYjxxSjService.queryByPage(tbYjxxSjQuery));
}catch (Exception e){
return ResponseResult.fail(500, e.getMessage());
}
}
@ApiOperation("新增数据")
@JwtSysUser
@PostMapping
@Log(title = "预警事件新增", businessType = BusinessType.INSERT)
public ResponseResult<Integer> add(@RequestBody TbYjxxSjVo yjsj){
return ResponseResult.success(tbYjxxSjService.insert(yjsj));
}
@ApiOperation("更新数据")
@JwtSysUser
@PutMapping
@Log(title = "预警事件更新", businessType = BusinessType.UPDATE)
public ResponseResult<Integer> edit(@RequestBody TbYjxxSjVo yjsj){
return ResponseResult.success(tbYjxxSjService.update(yjsj));
}
@ApiOperation("通过主键删除数据")
@DeleteMapping("/bacth")
@Log(title = "预警事件删除", businessType = BusinessType.UPDATE)
@ApiImplicitParam(name = "list", value = "标签主键", paramType = "path", required = true, dataType="String")
public ResponseResult<Integer> deleteByIds(@RequestParam List<String> list){
return ResponseResult.success(tbYjxxSjService.deleteById(list));
}
}

View File

@ -0,0 +1,246 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
import com.mosty.base.model.dto.yjzl.*;
import com.mosty.base.model.entity.trs.VwAlermYjgl;
import com.mosty.base.model.entity.trs.VwAlermYjzl;
import com.mosty.base.model.entity.yjzl.TbZlYjRy;
import com.mosty.base.model.entity.yjzl.TbZlxx;
import com.mosty.base.model.query.afjcsj.VwSyrkJzgjGxListQuery;
import com.mosty.base.model.query.yjzl.TbZlxxQuery;
import com.mosty.base.model.vo.trs.VwAlermYjzlVo;
import com.mosty.base.model.vo.yjzl.*;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbZlxxService;
import com.mosty.yjzl.service.TbZlxxZxjlService;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Api(tags = "指令信息相关接口")
@RestController
@AllArgsConstructor
@CrossOrigin
@RequestMapping("/tbZl")
public class TbZlxxController {
private final TbZlxxService tbZlxxService;
private final TbZlxxZxjlService tbZlxxZxjlService;
@ApiOperation("根据时间查询指令执行情况")
@GetMapping("/selectInstructCount")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(value = "查询开始时间(默认查询当天)", name = "startTime", dataType = "String"),
@ApiImplicitParam(value = "查询结束时间(默认查询当天)", name = "endTime", dataType = "String")
})
public ResponseResult<Map<String, Object>> selectInstructCount(String startTime, String endTime) {
return ResponseResult.success(this.tbZlxxService.selectInstructCount(startTime, endTime));
}
@ApiOperation("大屏-查询指令列表-分页")
@PostMapping(value = "/selectInstructList")
@JwtSysUser
public ResponseResult<IPage<TbZlxxVo>> selectInstructList(@RequestBody TbZlxxQuery dto) {
return ResponseResult.success(this.tbZlxxService.selectInstructList(dto));
}
@ApiOperation("添加指令信息")
@PostMapping(value = "/addZl")
@Log(title = "添加指令信息", businessType = BusinessType.INSERT)
@JwtSysUser
public ResponseResult<Void> addZl(@RequestBody TbZlxxInsertDto dto) {
this.tbZlxxService.addZl(dto);
return ResponseResult.success();
}
@ApiOperation("修改指令信息")
@PostMapping(value = "/updateZl")
@Log(title = "修改指令信息", businessType = BusinessType.UPDATE)
@JwtSysUser
public ResponseResult<Void> updateZl(@RequestBody TbZlxxInsertDto dto) {
this.tbZlxxService.updateZl(dto);
return ResponseResult.success();
}
@ApiOperation("查询事件的参与警力")
@GetMapping(value = "/getCyjlList")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getCyjlList(CyjlSearchDto dto) {
return ResponseResult.success(this.tbZlxxZxjlService.getCyjlList(dto));
}
@ApiOperation("查询事件的现场装备")
@GetMapping(value = "/getXczbList")
@JwtSysUser
public ResponseResult<List<TbQwXfbbVo>> getXczbList(String sjid) {
return ResponseResult.success(this.tbZlxxZxjlService.getXczbList(sjid));
}
@ApiOperation("APP获取我的指令数量")
@GetMapping(value = "/getMyZlCount")
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getMyZlCount() {
return ResponseResult.success(this.tbZlxxZxjlService.getMyZlCount());
}
@ApiOperation("APP获取我的指令列表")
@GetMapping(value = "/getMyZlList")
@JwtSysUser
public ResponseResult<IPage<TbZlxxZxrVo>> getMyZlList(MyZlSearchDto dto) {
return ResponseResult.success(this.tbZlxxZxjlService.getMyZlList(dto));
}
@ApiOperation("查询指令处置流程以及最新记录")
@GetMapping(value = "/getZxjlList")
@JwtSysUser
public ResponseResult<List<TbZlxxZxjlVo>> getNewZxjl(NewZxjlSearchDto dto) {
return ResponseResult.success(this.tbZlxxZxjlService.getNewZxjl(dto));
}
@ApiOperation("指令到期状态修改")
@PostMapping(value = "/changeZlGqzt")
@JwtSysUser
public ResponseResult<Void> changeZlGqzt() {
this.tbZlxxService.changeZlGqzt();
return ResponseResult.success();
}
@ApiOperation("指令处置流程")
@PostMapping(value = "/zlHandle")
@Log(title = "指令处置流程", businessType = BusinessType.UPDATE)
@JwtSysUser
public ResponseResult<Void> zlHandle(@RequestBody TbZlxxZtChangeDto dto) {
this.tbZlxxService.zlHandle(dto);
return ResponseResult.success();
}
@ApiOperation("指令处置流程(人员管控)")
@PostMapping(value = "/zlHandleRygk")
@Log(title = "指令处置流程(人员管控)", businessType = BusinessType.UPDATE)
@JwtSysUser
public ResponseResult<Void> zlHandleRygk(@RequestBody TbZlxxZtChangeRygkDto dto) {
this.tbZlxxService.zlHandleRygk(dto);
return ResponseResult.success();
}
@ApiOperation("查询指令详细信息")
@GetMapping(value = "{id}")
@JwtSysUser
public ResponseResult<TbZlxxInfoVo> getInfo(@PathVariable("id") String id) {
return ResponseResult.success(this.tbZlxxService.getInfo(id));
}
@ApiOperation("添加指令执行记录")
@PostMapping(value = "/addZxjl")
@Log(title = "添加指令执行记录", businessType = BusinessType.INSERT)
@JwtSysUser
public ResponseResult<Void> addZxjl(@RequestBody TbZlxxZxjlInsertDto dto) {
this.tbZlxxService.addZxjl(dto);
return ResponseResult.success();
}
@ApiOperation("添加指令盘查人车的记录")
@PostMapping(value = "/addPcrycl")
@Log(title = "添加指令盘查人车的记录", businessType = BusinessType.INSERT)
@JwtSysUser
public ResponseResult<Void> addPcrycl(@RequestBody TbZlxxPcryclInsertDto dto) {
this.tbZlxxService.addPcrycl(dto);
return ResponseResult.success();
}
@ApiOperation("获取托尔斯预警指令信息添加")
@PostMapping(value = "/addTrsZl")
public ResponseResult<Void> addTrsZl(@RequestBody VwAlermYjzlVo vo) {
this.tbZlxxService.addTrsZl(vo);
return ResponseResult.success();
}
@ApiOperation("获取托尔斯预警信息添加")
@PostMapping(value = "/addTrsYj")
public ResponseResult<Void> addTrsYj(@RequestBody VwAlermYjgl vo) {
this.tbZlxxService.addTrsYj(vo);
return ResponseResult.success();
}
@ApiOperation("获取最后一条TRS推送的指令信息")
@PostMapping(value = "/getLastZlxx")
public ResponseResult<TbZlxx> getLastZlxx() {
return ResponseResult.success(this.tbZlxxService.getLastZlxx());
}
@ApiOperation("查询实有人口指令信息")
@GetMapping(value = "/getSyrkZlxx")
public ResponseResult<IPage<TbZlYjRyVo>> getSyrkZlxx(VwSyrkJzgjGxListQuery dto) {
return ResponseResult.success(this.tbZlxxService.getSyrkZlxx(dto));
}
@ApiOperation("APP指令统计--指令类型")
@GetMapping(value = "/getTjOfZllx")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
})
@JwtSysUser
public ResponseResult<List<Map<String, Object>>> getTjOfZllx(String type) {
return ResponseResult.success(this.tbZlxxService.getTjOfZllx(type));
}
@ApiOperation("根据完成情况统计指令数量")
@JwtSysUser
@GetMapping(value = "/getStatisticsByStatus")
public ResponseResult<Map<String, Object>> getStatisticsByStatus() {
return ResponseResult.success(this.tbZlxxService.getStatisticsByStatus());
}
@ApiOperation("查询我发送的指令")
@JwtSysUser
@GetMapping(value = "/getMySendZlList")
public ResponseResult<IPage<TbZlxxVo>> getMySendZlList(MyZlSearchDto dto) {
return ResponseResult.success(this.tbZlxxService.getMySendZlList(dto));
}
@ApiOperation("查询我发送的指令")
@JwtSysUser
@GetMapping(value = "/getZlCount")
public ResponseResult<Integer> getZlCount(String ssbmdm, String time, String zlzxzt) {
return ResponseResult.success(this.tbZlxxService.getZlCount(ssbmdm, time, zlzxzt));
}
@ApiOperation("大屏预警统计")
@JwtSysUser
@PostMapping(value = "/yjzlTj")
public ResponseResult<Map<String,Integer>> yjzlTj() {
return ResponseResult.success(this.tbZlxxService.yjzlTj());
}
@ApiOperation("警情转指令")
@JwtSysUser
@GetMapping(value = "/andJqZl")
public ResponseResult<Void> andJqZl(String ssbmid,String jqid, String bbids, String zlxflx) {
this.tbZlxxService.andJqZl(ssbmid,jqid, bbids,zlxflx);
return ResponseResult.success();
}
@ApiOperation("预警转指令")
@JwtSysUser
@GetMapping(value = "/andYjZl")
public ResponseResult<Void> andYjZl(String yjid, String bbids) {
this.tbZlxxService.andYjZl(yjid, bbids);
return ResponseResult.success();
}
}

View File

@ -0,0 +1,69 @@
package com.mosty.yjzl.controller;
import com.mosty.base.model.vo.yjzl.TbYjzlZqtjVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjphVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjxxVo;
import com.mosty.base.model.vo.yjzl.TbYzzlDjtjVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbYjzltjService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@Api(tags = "指令中心统计接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbZlxxtj")
public class TbZlxxtjController {
private TbYjzltjService tbYjzltjService;
@ApiOperation("指令中心--首页指令状态统计信息")
@GetMapping(value = "/ZlZtTjxx")
@JwtSysUser
public ResponseResult<List<TbYjzltjxxVo>> ZlZtTjxx() {
return ResponseResult.success(tbYjzltjService.rwzttjxx());
}
@ApiOperation("指令中心--首页指令排行统计信息")
@GetMapping(value = "/zlPhTjxx")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
})
public ResponseResult<List<TbYjzltjphVo>> zlPhTjxx(String type) {
return ResponseResult.success(tbYjzltjService.rwphtjxx(type));
}
@ApiOperation("指令中心--首页指令周期统计信息")
@GetMapping(value = "/zlZqtjxx")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
})
public ResponseResult<Map<String, Object>> zlZqtjxx(String type) {
return ResponseResult.success(tbYjzltjService.zlZqtjxx(type));
}
@ApiOperation("指令中心--首页指令等级统计信息")
@GetMapping(value = "/zlDjtjxx")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
})
public ResponseResult<List<TbYzzlDjtjVo>> zlDjtjxx(String type) {
return ResponseResult.success(tbYjzltjService.zlDjtjxx(type));
}
}

View File

@ -0,0 +1,53 @@
package com.mosty.yjzl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.entity.yjzl.TbZxzb;
import com.mosty.base.model.query.yjzl.TbZxzbQuery;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.TbZxzbService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "中心坐标相关接口")
@RestController
@AllArgsConstructor
@CrossOrigin
@RequestMapping("/tbZxzb")
public class TbZxzbController {
private final TbZxzbService tbZxzbService;
@ApiOperation("查询中心坐标列表-分页")
@GetMapping(value = "/getPageList")
@JwtSysUser
public ResponseResult<IPage<TbZxzb>> getPageList(@RequestBody TbZxzbQuery zxzbQuery) {
return ResponseResult.success(tbZxzbService.queryListPage(zxzbQuery));
}
@ApiOperation("查询中心坐标列表-不分页")
@GetMapping("/getList")
@JwtSysUser
public ResponseResult<List<TbZxzb>> getList(TbZxzbQuery zxzbQuery) {
return ResponseResult.success(tbZxzbService.queryList(zxzbQuery));
}
@ApiOperation("计算犯罪区域")
@GetMapping("/computeCenter")
@JwtSysUser
@ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "String", required = false),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "String", required = false)
})
public ResponseResult computeCenter(String startTime, String endTime) {
tbZxzbService.computeCenter(startTime, endTime);
return ResponseResult.success();
}
}

View File

@ -0,0 +1,237 @@
package com.mosty.yjzl.controller;
import com.mosty.base.model.dto.yjzl.*;
import com.mosty.base.model.query.yjzl.TbYjqkQuery;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.YjzlStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Api(tags = "预警信息相关统计接口原magic旧接口--预警信息")
@AllArgsConstructor
@RestController
@RequestMapping("/yjxx")
public class YjzlStatisticsController {
private YjzlStatisticsService yjzlStatisticsService;
@ApiOperation("车辆预警列表TOP")
@JwtSysUser
@GetMapping("/yjcl/clyjlb")
public ResponseResult<List<Map<String, Object>>> clyjlb(TbYjxxStatisticsDto vo) {
return ResponseResult.success(yjzlStatisticsService.clyjlb(vo));
}
@ApiOperation("根据车牌号查询")
@JwtSysUser
@GetMapping("/yjcl/queryBycCphm")
public ResponseResult<List<Map<String, Object>>> queryBycCphm(TbYjxxPageStatisticsDto vo) {
return ResponseResult.success(yjzlStatisticsService.queryBycCphm(vo));
}
@ApiOperation("根据车牌号查询预警列表-日")
@JwtSysUser
@GetMapping("/yjcl/queryBycCphmlb")
public ResponseResult<List<Map<String, Object>>> queryBycCphmlb(TbYjxxPageStatisticsDto vo) {
return ResponseResult.success(yjzlStatisticsService.queryBycCphmlb(vo));
}
@ApiOperation("根据车牌号查询预警列表-月")
@JwtSysUser
@GetMapping("/yjcl/yqueryBycCphmlb")
public ResponseResult<List<Map<String, Object>>> yqueryBycCphmlb(TbYjxxYStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yqueryBycCphmlb(dto));
}
@ApiOperation("根据车牌号查询预警列表-月")
@JwtSysUser
@GetMapping("/yjcl/zqueryBycCphmlb")
public ResponseResult<List<Map<String, Object>>> zqueryBycCphmlb(TbYjxxPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zqueryBycCphmlb(dto));
}
@ApiOperation("日预警车辆TOP20")
@JwtSysUser
@GetMapping("/yjcl/yjcltj")
public ResponseResult<List<Map<String, Object>>> yjcltj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjcltj(dto));
}
@ApiOperation("预警标签统计")
@JwtSysUser
@GetMapping("/yjcl/yjbqtj")
public ResponseResult<List<Map<String, Object>>> yjbqtj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjbqtj(dto));
}
@ApiOperation("预警级别统计")
@JwtSysUser
@GetMapping("/yjcl/yjjbtj")
public ResponseResult<List<Map<String, Object>>> yjjbtj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjjbtj(dto));
}
@ApiOperation("月预警车辆TOP20")
@JwtSysUser
@GetMapping("/yjcl/yyjcltj")
public ResponseResult<List<Map<String, Object>>> yyjcltj(TbYjxxYStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yyjcltj(dto));
}
@ApiOperation("周预警车辆TOP20")
@JwtSysUser
@GetMapping("/yjcl/zyjcltj")
public ResponseResult<List<Map<String, Object>>> zyjcltj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zyjcltj(dto));
}
@ApiOperation("根据身份证查询")
@JwtSysUser
@GetMapping("/yjry/queryBySfzh")
public ResponseResult<List<Map<String, Object>>> queryBySfzh(TbYjxxRyStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.queryBySfzh(dto));
}
@ApiOperation("根据身份证查询列表-日")
@JwtSysUser
@GetMapping("/yjry/queryBySfzhlb")
public ResponseResult<List<Map<String, Object>>> queryBySfzhlb(TbYjxxRyPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.queryBySfzhlb(dto));
}
@ApiOperation("根据身份证查询列表-日(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/queryBySfzhlbsc")
public ResponseResult<List<Map<String, Object>>> queryBySfzhlbsc(TbYjxxRyPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.queryBySfzhlbsc(dto));
}
@ApiOperation("根据身份证查询列表-月")
@JwtSysUser
@GetMapping("/yjry/yqueryBySfzhlb")
public ResponseResult<List<Map<String, Object>>> yqueryBySfzhlb(TbYjxxRyNyStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yqueryBySfzhlb(dto));
}
@ApiOperation("根据身份证查询列表-月(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/yqueryBySfzhlbsc")
public ResponseResult<List<Map<String, Object>>> yqueryBySfzhlbsc(TbYjxxRyNyStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yqueryBySfzhlbsc(dto));
}
@ApiOperation("根据身份证查询列表-周")
@JwtSysUser
@GetMapping("/yjry/zqueryBySfzhlb")
public ResponseResult<List<Map<String, Object>>> zqueryBySfzhlb(TbYjxxRyPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zqueryBySfzhlb(dto));
}
@ApiOperation("根据身份证查询列表-周(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/zqueryBySfzhlbsc")
public ResponseResult<List<Map<String, Object>>> zqueryBySfzhlbsc(TbYjxxRyPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zqueryBySfzhlbsc(dto));
}
@ApiOperation("人员预警列表TOP")
@JwtSysUser
@GetMapping("/yjry/ryyjlb")
public ResponseResult<List<Map<String, Object>>> ryyjlb(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.ryyjlb(dto));
}
@ApiOperation("预警级别统计-人员")
@JwtSysUser
@GetMapping("/yjry/yjjbtj")
public ResponseResult<List<Map<String, Object>>> yjjbtjRy(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjjbtjRy(dto));
}
@ApiOperation("预警人员级别统计-人员")
@JwtSysUser
@GetMapping("/yjry/jbtj")
public ResponseResult<List<Map<String, Object>>> jbtj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.jbtj(dto));
}
@ApiOperation("预警人员TOP20")
@JwtSysUser
@GetMapping("/yjry/yjrytj")
public ResponseResult<List<Map<String, Object>>> yjrytj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjrytj(dto));
}
@ApiOperation("预警人员TOP20(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/yjrytjsc")
public ResponseResult<List<Map<String, Object>>> yjrytjsc(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yjrytjsc(dto));
}
@ApiOperation("月预警人员TOP20")
@JwtSysUser
@GetMapping("/yjry/yyjrytj")
public ResponseResult<List<Map<String, Object>>> yyjrytj(TbYjxxYyjStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yyjrytj(dto));
}
@ApiOperation("月预警人员TOP20(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/yyjrytjsc")
public ResponseResult<List<Map<String, Object>>> yyjrytjsc(TbYjxxYyjStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.yyjrytjsc(dto));
}
@ApiOperation("周预警人员TOP20")
@JwtSysUser
@GetMapping("/yjry/zyjrytj")
public ResponseResult<List<Map<String, Object>>> zyjrytj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zyjrytj(dto));
}
@ApiOperation("周预警人员TOP20(三车前科人员)")
@JwtSysUser
@GetMapping("/yjry/zyjrytjsc")
public ResponseResult<List<Map<String, Object>>> zyjrytjsc(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zyjrytjsc(dto));
}
@ApiOperation("周边预警列表(不分页)")
@JwtSysUser
@GetMapping("/zbyj/zbyjbfylb")
public ResponseResult<List<Map<String, Object>>> zbyjbfylb(TbYjxxRyPageStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zbyjbfylb(dto));
}
@ApiOperation("周边预警列表(不分页)")
@JwtSysUser
@GetMapping("/zbyj/zbyjtj")
public ResponseResult<List<Map<String, Object>>> zbyjtj(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.zbyjtj(dto));
}
// 泸州态势统计-各区县预警情况
@ApiOperation("泸州态势统计-各区县预警情况")
@PostMapping("/getGqxyjqk")
@JwtSysUser
public ResponseResult<Map<String,Object>> getXfscAndLcTj(TbYjqkQuery dto) {
return ResponseResult.success(yjzlStatisticsService.getGqxyjqk(dto));
}
// 泸州态势统计-警情与预警指令执行对比分析
@ApiOperation("泸州态势统计-警情与预警指令执行对比分析")
@PostMapping("/getJqscAndZlTj")
@JwtSysUser
public ResponseResult<Map<String,Object>> getJqscAndZlTj(TbYjqkQuery dto) {
return ResponseResult.success(yjzlStatisticsService.getJqscAndZlTj(dto));
}
}

View File

@ -0,0 +1,60 @@
package com.mosty.yjzl.controller;
import com.mosty.base.model.dto.yjzl.*;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.YjzlStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@Api(tags = "预警信息相关统计接口原magic旧接口--预警中心")
@AllArgsConstructor
@RestController
@RequestMapping("/yjzx")
public class YjzxStatisticsController {
private YjzlStatisticsService yjzlStatisticsService;
@ApiOperation("感知源预警排名")
@JwtSysUser
@GetMapping("/gzyyjpm")
public ResponseResult<List<Map<String, Object>>> gzyyjpm(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.gzyyjpm(dto));
}
@ApiOperation("派出所预警排名")
@JwtSysUser
@GetMapping("/pcsyjpm")
public ResponseResult<List<Map<String, Object>>> pcsyjpm(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.pcsyjpm(dto));
}
@ApiOperation("人员预警排名")
@JwtSysUser
@GetMapping("/ryyjpm")
public ResponseResult<List<Map<String, Object>>> ryyjpm(TbYjxxStatisticsDto dto) {
return ResponseResult.success(yjzlStatisticsService.ryyjpm(dto));
}
@ApiOperation("右侧预警统计")
@JwtSysUser
@GetMapping("/ycyjtj")
public ResponseResult<List<Map<String, Object>>> ycyjtj(TbYjxxStatisticsQueryDto dto) {
return ResponseResult.success(yjzlStatisticsService.ycyjtj(dto));
}
@ApiOperation("预警中心--预警统计")
@JwtSysUser
@GetMapping("/yjtj")
public ResponseResult<List<Map<String, Object>>> ycyjtj() {
return ResponseResult.success(yjzlStatisticsService.yjtj());
}
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbFzycJsdx;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 犯罪预测 Mapper 接口
* </p>
*/
@Mapper
public interface TbFzycJsdxMapper extends BaseMapper<TbFzycJsdx> {
}

View File

@ -0,0 +1,25 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.dto.yjzl.TbFzycDto;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 犯罪预测 Mapper 接口
* </p>
*/
@Mapper
public interface TbFzycMapper extends BaseMapper<TbFzyc> {
List<TbFzyc> selectListBm(TbFzycDto dto);
int getFzyjCount(TbFzycDto dto);
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbFzycPz;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 犯罪预测配置 Mapper 接口
* </p>
*/
@Mapper
public interface TbFzycPzMapper extends BaseMapper<TbFzycPz> {
}

View File

@ -0,0 +1,23 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbFzycJsdx;
import com.mosty.base.model.entity.yjzl.TbFzycXfxz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* 犯罪预测 Mapper 接口
* </p>
*/
@Mapper
public interface TbFzycXfxzMapper extends BaseMapper<TbFzycXfxz> {
int updateSfqs(String zlid);
String selectQs(@Param("bbid")String bbid,@Param("fzycid")String fzycid);
}

View File

@ -0,0 +1,41 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
import com.mosty.base.model.entity.yjzl.TbFzycXljl;
import com.mosty.base.model.vo.yjzl.TbFzycXljlVo;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 犯罪预测巡逻记录 Mapper 接口
* </p>
*/
@Mapper
public interface TbFzycXljlMapper extends BaseMapper<TbFzycXljl> {
@ApiOperation("新增犯罪区域记录")
int insertEntity(TbFzycXljl xfbb);
@ApiOperation("修改犯罪区域记录")
int updateEntity(TbFzycXljl xfbb);
@ApiOperation("修改犯罪区域记录")
TbFzycXljl selectByFzBb(TbFzycXljlVo xljlVo);
@ApiOperation("查询犯罪预警预测指令巡逻记录列表")
List<TbFzycXljl> qfzxl(String fzyjyczlId);
@ApiOperation("盘查人员数")
int pcrys(String bbid);
@ApiOperation("盘查车辆数")
int pccls(String bbid);
}

View File

@ -0,0 +1,20 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjDyyjxx;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TbYjDyyjxxMapper extends BaseMapper<TbYjDyyjxx> {
/**
* 根据ID删除
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
}

View File

@ -0,0 +1,13 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjmxCsb;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TbYjmxCsbMapper extends BaseMapper<TbYjmxCsb> {
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjmx;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 预警模型 Mapper 接口
* </p>
*/
@Mapper
public interface TbYjmxMapper extends BaseMapper<TbYjmx> {
}

View File

@ -0,0 +1,42 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxClBq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-车辆-标签表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@Mapper
public interface TbYjxxClBqMapper extends BaseMapper<TbYjxxClBq> {
/**
* 根据ID删除
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
/**
* 根据预警ID删除
* @param yjid
*/
int deleteByYjId(@Param("yjid") String yjid);
/**
* 根据预警ID查询
* @param list
* @return
*/
List<TbYjxxClBq> queryByYjid(@Param("list") List<String> list);
}

View File

@ -0,0 +1,27 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxCl;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-车辆表 Mapper 接口
* </p>
*
* @author dw
* @since 2022-10-21
*/
@Mapper
public interface TbYjxxClMapper extends BaseMapper<TbYjxxCl> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("添加预警车辆信息")
void insertEntity(TbYjxxCl clxx);
}

View File

@ -0,0 +1,22 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypzClbq;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TbYjxxDypzClbqMapper extends BaseMapper<TbYjxxDypzClbq> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据订阅ID查询")
List<TbYjxxDypzClbq> queryByDyid(@Param("list") List<String> list);
@ApiOperation("根据订阅ID删除")
void deleteByDyid(@Param("dyid") String dyid);
}

View File

@ -0,0 +1,24 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypzGzy;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TbYjxxDypzGzyMapper extends BaseMapper<TbYjxxDypzGzy> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据订阅ID查询")
List<TbYjxxDypzGzy> queryByDyid(@Param("list") List<String> list);
@ApiOperation("根据订阅ID删除")
void deleteByDyid(@Param("dyid") String dyid);
}

View File

@ -0,0 +1,27 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-订阅配置表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@Mapper
public interface TbYjxxDypzMapper extends BaseMapper<TbYjxxDypz> {
/**
* 根据ID删除
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
}

View File

@ -0,0 +1,31 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypzRybq;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-订阅-人员标签表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@Mapper
public interface TbYjxxDypzRybqMapper extends BaseMapper<TbYjxxDypzRybq> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据订阅ID查询")
List<TbYjxxDypzRybq> queryByDyid(@Param("list") List<String> list);
@ApiOperation("根据订阅ID删除")
void deleteByDyid(@Param("dyid") String dyid);
}

View File

@ -0,0 +1,31 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypzSjbq;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-订阅-事件标签表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@Mapper
public interface TbYjxxDypzSjbqMapper extends BaseMapper<TbYjxxDypzSjbq> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据订阅ID查询")
List<TbYjxxDypzSjbq> queryByDyid(@Param("list") List<String> list);
@ApiOperation("根据订阅ID删除")
void deleteByDyid(@Param("dyid") String dyid);
}

View File

@ -0,0 +1,31 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxDypzYjjb;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-订阅-预警级别表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@Mapper
public interface TbYjxxDypzYjjbMapper extends BaseMapper<TbYjxxDypzYjjb> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据订阅ID查询")
List<TbYjxxDypzYjjb> queryByDyid(@Param("list") List<String> list);
@ApiOperation("根据订阅ID删除")
void deleteByDyid(@Param("dyid") String dyid);
}

View File

@ -0,0 +1,71 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.sjzx.TbJq;
import com.mosty.base.model.entity.yjzl.TbYjxx;
import com.mosty.base.model.query.yjzl.TbYjxxYjjbStatisticsQuery;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 预警信息表(TbYjxx)表数据库访问层
*
* @author zhangHaiJun
* @since 2022-07-11 20:06:06
*/
@Mapper
public interface TbYjxxMapper extends BaseMapper<TbYjxx> {
@ApiOperation("获取预警信息总数")
int getCount(Map<String, Object> map);
@ApiOperation("分页获取预警信息")
List<TbYjxx> getListPage(Map<String, Object> map);
@ApiOperation("查询预警信息不分页")
List<TbYjxx> getList(Map<String, Object> map);
@ApiOperation("查询预警详情")
TbYjxx getInfoById(String id);
@ApiOperation("根据来源Id查询预警信息")
TbYjxx queryTbYjxx(String warningId);
@ApiOperation("根据身份证号和车牌号查询预警数量")
Integer countBySfzhOrCph(@Param("sfzh") String sfzh, @Param("cphm") String cphm);
@ApiOperation("根据身份证号和车牌号查询预警数量")
int countCurrentBySfzhOrCph(@Param("sfzh") String sfzh, @Param("cphm") String cphm);
@ApiOperation("新增预警数据")
void insertEntity(TbYjxx yjxx);
@ApiOperation("APP预警信息统计")
List<Map<String, Object>> getYjxxTj(Map<String, Object> map);
@ApiOperation("APP预警信息统计-预警类型")
List<Map<String, Object>> getYjxxTjYjlx(@Param("kssj") String kssj,
@Param("jssj") String jssj,
@Param("ssbmdm") String ssbmdm);
@ApiOperation("统计今日各时段预警")
List<Map<String, Object>> todayGsdyj(@Param("useSql") String useSql);
@ApiOperation("修改预警信息")
void updateEntity(TbYjxx tempYjxx);
@ApiOperation("查询警情信息此处由于数据量太大没有走feign")
List<TbJq> queryJq(@Param("kssj") String kssj,
@Param("jssj") String jssj);
}

View File

@ -0,0 +1,27 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxMxyj;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
@Mapper
public interface TbYjxxMxyjMapper extends BaseMapper<TbYjxxMxyj> {
@ApiOperation("新增模型预警")
void insertEntity(TbYjxxMxyj mxyj);
@ApiOperation("修改模型预警")
void updateEntity(TbYjxxMxyj mxyj);
@ApiOperation("查询模型2的模型预警单条")
TbYjxxMxyj selectbyMxId(@Param("kssj") String kssj,
@Param("jssj") String jssj,
@Param("radius") int radius,
@Param("jd") BigDecimal jd,
@Param("wd") BigDecimal wd,
@Param("mxid") String mxid);
}

View File

@ -0,0 +1,40 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxRyBq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-人员-标签表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxRyBqMapper extends BaseMapper<TbYjxxRyBq> {
/**
* 根据ID删除
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
/**
* 根据预警人员ID查询
* @param list
* @return
*/
List<TbYjxxRyBq> queryByYjryId(@Param("list") List<String> list);
/**
* 根据业务ID删除
* @param ywid
*/
void deleteByYwid(@Param("ywid") String ywid);
}

View File

@ -0,0 +1,28 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxRy;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* 预警信息-人员表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxRyMapper extends BaseMapper<TbYjxxRy> {
@ApiOperation("根据ID删除")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("新增人员信息")
void insertEntity(TbYjxxRy ryxx);
}

View File

@ -0,0 +1,40 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxRySjaj;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-人员-涉及案件表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxRySjajMapper extends BaseMapper<TbYjxxRySjaj> {
/**
* 根据ID删除
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
/**
* 根据预警人员-涉及案件表
* @param list
* @return
*/
List<TbYjxxRySjaj> queryByYjryId(@Param("list") List<String> list);
/**
* 根据业务ID删除
* @param ywid
*/
void deleteByYwid(@Param("ywid") String ywid);
}

View File

@ -0,0 +1,40 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxSjGlrycl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警-事件-关联人员车辆表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxSjGlryclMapper extends BaseMapper<TbYjxxSjGlrycl> {
/**
* 删除事件-关联人员车辆表
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
/**
* 根据预警ID删除
* @param yjid
*/
int deleteByYjId(@Param("yjid") String yjid);
/**
* 根据预警ID查询
* @param list
* @return
*/
List<TbYjxxSjGlrycl> queryByYjid(@Param("list") List<String> list);
}

View File

@ -0,0 +1,30 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxSj;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-事件表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxSjMapper extends BaseMapper<TbYjxxSj> {
@ApiOperation("删除盘查人员车辆")
int deleteByIds(@Param("list") List<String> list);
@ApiOperation("根据预警ID删除")
int deleteByYjId(@Param("yjid") String yjid);
@ApiOperation("添加事件预警信息")
void insertEntity(TbYjxxSj sj);
}

View File

@ -0,0 +1,27 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbYjxxYjczjl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 预警信息-操作记录表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbYjxxYjczjlMapper extends BaseMapper<TbYjxxYjczjl> {
/**
* 删除盘查人员车辆
* @param list
*/
int deleteByIds(@Param("list") List<String> list);
}

View File

@ -0,0 +1,32 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlxx;
import com.mosty.base.model.vo.yjzl.TbYjzlZqtjVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjphVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjxxVo;
import com.mosty.base.model.vo.yjzl.TbYzzlDjtjVo;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Mapper
public interface TbYjzltjMapper extends BaseMapper<TbZlxx> {
@ApiOperation("指令中心--首页指令状态统计信息")
List<TbYjzltjxxVo> rwzttjxx(Map<String, Object> map);
@ApiOperation("指令中心--首页指令排行统计信息")
List<TbYjzltjphVo> rwphtjxx(@Param("kssj") String kssj,
@Param("jssj") String jssj);
@ApiOperation("指令中心--首页指令周期统计信息")
List<Map<String, Object>> zlZqtjxx(Map<String, Object> map);
@ApiOperation("指令中心--首页指令等级统计信息")
List<TbYzzlDjtjVo> zlDjtjxx(Map<String, Object> map);
}

View File

@ -0,0 +1,10 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlJq;
import org.mapstruct.Mapper;
@Mapper
public interface TbZlJqMapper extends BaseMapper<TbZlJq> {
}

View File

@ -0,0 +1,13 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlRg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TbZlRgMapper extends BaseMapper<TbZlRg> {
@ApiOperation("添加人工指令")
void insertEntity(TbZlRg rgzl);
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlXlBxd;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 指令-巡逻指令-必巡点表 Mapper 接口
* </p>
*
* @author 鞠梦曦
* @since 2022-10-14
*/
@Mapper
public interface TbZlXlBxdMapper extends BaseMapper<TbZlXlBxd> {
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlXlBxdXljl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 指令-巡逻指令-必巡点巡逻记录表 Mapper 接口
* </p>
*
* @author 鞠梦曦
* @since 2022-10-14
*/
@Mapper
public interface TbZlXlBxdXljlMapper extends BaseMapper<TbZlXlBxdXljl> {
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlXl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 指令-巡逻指令表 Mapper 接口
* </p>
*
* @author 鞠梦曦
* @since 2022-10-14
*/
@Mapper
public interface TbZlXlMapper extends BaseMapper<TbZlXl> {
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlYjClCnry;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 指令-车辆乘坐人员预警指令表 Mapper 接口
* </p>
*
* @author 鞠梦曦
* @since 2022-10-14
*/
@Mapper
public interface TbZlYjClCnryMapper extends BaseMapper<TbZlYjClCnry> {
}

View File

@ -0,0 +1,13 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlYjCl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TbZlYjClMapper extends BaseMapper<TbZlYjCl> {
@ApiOperation("添加指令信息")
void insertEntity(TbZlYjCl zlCl);
}

View File

@ -0,0 +1,14 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlYjRy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TbZlYjRyMapper extends BaseMapper<TbZlYjRy> {
@ApiOperation("添加人员预警指令信息")
void insertEntity(TbZlYjRy zlRy);
}

View File

@ -0,0 +1,13 @@
package com.mosty.yjzl.mapper;
import com.mosty.base.model.entity.yjzl.TbZlYjSj;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TbZlYjSjMapper extends BaseMapper<TbZlYjSj> {
@ApiOperation("添加指令预警事件实体")
void insertEntity(TbZlYjSj zlSj);
}

View File

@ -0,0 +1,64 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlxx;
import com.mosty.base.model.entity.yjzl.TbZlxxZxr;
import com.mosty.base.model.vo.yjzl.TbZlxxZxrVo;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Created by 张海军 on 2022/7/11 17:20
*
* @ClassName TbZlMapper
*/
@Mapper
public interface TbZlxxMapper extends BaseMapper<TbZlxx> {
@ApiOperation("根据时间查询指令执行情况")
Map<String, Object> selectInstructCount(@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("ssbmdm") String ssbmdm);
@ApiOperation("查询指令列表")
List<TbZlxx> getListPage(Map<String, Object> map);
@ApiOperation("查询指令数量")
int getCount(Map<String, Object> map);
@ApiOperation("添加指令数据")
void insertEntity(TbZlxx zl);
@ApiOperation("修改指令数据")
void updateEntity(TbZlxx zl);
@ApiOperation("根据条件查询我的指令信息")
List<Map<String, Object>> getMyZlCount(Map<String, Object> map);
@ApiOperation("根据条件查询我的指令信息列表")
List<TbZlxxZxrVo> getMyZlList(Map<String, Object> mp);
@ApiOperation("根据条件获取指令数量")
int getMyZlCountBy(Map<String, Object> mp);
@ApiOperation("查询当前指令的执行人")
TbZlxxZxr selectZxr(@Param("zlId") String zlId,
@Param("ssbmid") String ssbmid,
@Param("sfz") String sfz);
@ApiOperation("APP指令统计--指令类型")
List<Map<String, Object>> getTjOfZllx(@Param("kssj") String kssj,
@Param("jssj") String jssj,
@Param("ssbmdm") String ssbmdm);
@ApiOperation("根据完成情况统计指令数量")
int getStatisticsByStatus(@Param("sfz") String sfz,
@Param("ssbmid") String ssbmid,
@Param("type") String type);
@ApiOperation("根据身份证号查询指令统计--新稚")
List<Map<String, Object>> getStatistics(Map<String, Object> mp);
}

View File

@ -0,0 +1,18 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlxxPcrycl;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbZlxxPcryclMapper extends BaseMapper<TbZlxxPcrycl> {
}

View File

@ -0,0 +1,30 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlxxZxjl;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 指令-执行过程表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@Mapper
public interface TbZlxxZxjlMapper extends BaseMapper<TbZlxxZxjl> {
@ApiOperation("删除执行过程")
int deleteZxjl(@Param("list") List<String> list);
@ApiOperation("根据指令ID删除")
void deleteByZlid(@Param("zlid") String zlid);
@ApiOperation("添加实体")
void insertEntity(TbZlxxZxjl zxjl);
}

View File

@ -0,0 +1,22 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZlxxZxr;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* 指令-执行人或部门或巡组表 Mapper 接口
* </p>
*
* @author zengbo
* @since 2022-09-05
*/
@Mapper
public interface TbZlxxZxrMapper extends BaseMapper<TbZlxxZxr> {
@ApiOperation("删除指令执行人信息")
void deleteByZlid(@Param("zlid") String zlid);
}

View File

@ -0,0 +1,16 @@
package com.mosty.yjzl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.base.model.entity.yjzl.TbZxzb;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 中心坐标
*/
@Mapper
public interface TbZxzbMapper extends BaseMapper<TbZxzb> {
void deleteAll(@Param("zblx") String zblx);
}

View File

@ -0,0 +1,145 @@
package com.mosty.yjzl.mapper;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.checkerframework.checker.signature.qual.FieldDescriptorForPrimitiveOrArrayInUnnamedPackage;
import java.util.List;
import java.util.Map;
@Mapper
public interface YjzlStatisticsMapper {
@ApiOperation("车辆预警列表TOP")
List<Map<String, Object>> clyjlb(Map<String, Object> map);
@ApiOperation("根据车牌号查询")
List<Map<String, Object>> queryBycCphm(Map<String, Object> map);
@ApiOperation("根据车牌号查询预警列表-日")
List<Map<String, Object>> queryBycCphmlb(Map<String, Object> map);
@ApiOperation("根据车牌号查询预警列表-月")
List<Map<String, Object>> yqueryBycCphmlb(Map<String, Object> map);
@ApiOperation("根据车牌号查询预警列表-周")
List<Map<String, Object>> zqueryBycCphmlb(Map<String, Object> map);
@ApiOperation("日预警车辆TOP20")
List<Map<String, Object>> yjcltj(Map<String, Object> map);
@ApiOperation("预警标签统计")
List<Map<String, Object>> yjbqtj(Map<String, Object> map);
@ApiOperation("预警级别统计")
List<Map<String, Object>> yjjbtj(Map<String, Object> map);
@ApiOperation("月预警车辆TOP20")
List<Map<String, Object>> yyjcltj(Map<String, Object> map);
@ApiOperation("周预警车辆TOP20")
List<Map<String, Object>> zyjcltj(Map<String, Object> map);
@ApiOperation("根据身份证查询")
List<Map<String, Object>> queryBySfzh(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-日")
List<Map<String, Object>> queryBySfzhlb(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-日(三车前科人员)")
List<Map<String, Object>> queryBySfzhlbsc(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-月")
List<Map<String, Object>> yqueryBySfzhlb(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-月(三车前科人员)")
List<Map<String, Object>> yqueryBySfzhlbsc(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-周")
List<Map<String, Object>> zqueryBySfzhlb(Map<String, Object> map);
@ApiOperation("根据身份证查询列表-周(三车前科人员)")
List<Map<String, Object>> zqueryBySfzhlbsc(Map<String, Object> map);
@ApiOperation("人员预警列表TOP")
List<Map<String, Object>> ryyjlb(Map<String, Object> map);
@ApiOperation("预警级别统计--人员")
List<Map<String, Object>> yjjbtjRy(Map<String, Object> map);
@ApiOperation("预警人员级别统计")
List<Map<String, Object>> jbtj(Map<String, Object> map);
@ApiOperation("预警人员TOP20")
List<Map<String, Object>> yjrytj(Map<String, Object> map);
@ApiOperation("预警人员TOP20(三车前科人员)")
List<Map<String, Object>> yjrytjsc(Map<String, Object> map);
@ApiOperation("月预警人员TOP20")
List<Map<String, Object>> yyjrytj(Map<String, Object> map);
@ApiOperation("月预警人员TOP20(三车前科人员)")
List<Map<String, Object>> yyjrytjsc(Map<String, Object> map);
@ApiOperation("周预警人员TOP20")
List<Map<String, Object>> zyjrytj(Map<String, Object> map);
@ApiOperation("周预警人员TOP20(三车前科人员)")
List<Map<String, Object>> zyjrytjsc(Map<String, Object> map);
@ApiOperation("周边预警列表(不分页)")
List<Map<String, Object>> zbyjbfylb(Map<String, Object> map);
@ApiOperation("周边预警统计")
List<Map<String, Object>> zbyjtj(Map<String, Object> map);
@ApiOperation("感知源预警排名")
List<Map<String, Object>> gzyyjpm(Map<String, Object> map);
@ApiOperation("派出所预警排名")
List<Map<String, Object>> pcsyjpm(Map<String, Object> map);
@ApiOperation("人员预警排名")
List<Map<String, Object>> ryyjpm(Map<String, Object> map);
@ApiOperation("右侧预警统计")
List<Map<String, Object>> ycyjtj(Map<String, Object> map);
@ApiOperation("预警中心--预警统计")
List<Map<String, Object>> yjtj(@Param("ssbmdm") String ssbmdm);
@ApiOperation("预警数")
List<Map<String, Object>> getYjsl(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("指令数")
List<Map<String, Object>> getZls();
@ApiOperation("执行数量")
List<Map<String, Object>> getZxs(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("警情统计")
List<Map<String, Object>> getJqTj(@Param("kssj") String kssj);
@ApiOperation("预警数1")
List<Map<String, Object>> getYjsl1(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("指令数1")
List<Map<String, Object>> getZls1(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("执行数量")
List<Map<String, Object>> getZxs1(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("警情(按时间)")
List<Map<String, Object>> getJqTjByTime(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("预警(按时间)")
List<Map<String, Object>> getYjslByTime(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("指令数(按时间)")
List<Map<String, Object>> getZlsByTime(@Param("kssj") String kssj, @Param("jssj") String jssj);
@ApiOperation("执行数(按时间)")
List<Map<String, Object>> getZxsByTime(@Param("kssj") String kssj, @Param("jssj") String jssj);
}

View File

@ -0,0 +1,117 @@
package com.mosty.yjzl.mybatisplus;
import cn.hutool.http.HttpStatus;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.common.base.util.IpUtil;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import org.apache.ibatis.reflection.MetaObject;
import java.sql.Timestamp;
import java.util.Objects;
/**
* MybatisPlus注入处理器
*
* @author Lhh
* @date 2021/4/25
*/
public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
try {
UserInfo userInfo = UserInfoManager.getUser();
//根据属性名字设置要填充的值
if (metaObject.hasGetter("xtCjip")) {
if (metaObject.getValue("xtCjip") == null) {
this.strictInsertFill(metaObject, "xtCjip", String.class, IpUtil.getIpAddress());
}
}
//根据属性名字设置要填充的值
if (metaObject.hasGetter("xtSjzt")) {
if (metaObject.getValue("xtSjzt") == null) {
this.strictInsertFill(metaObject, "xtSjzt", String.class, "1");
}
}
if (metaObject.hasGetter("xtScbz")) {
if (metaObject.getValue("xtScbz") == null) {
this.strictInsertFill(metaObject, "xtScbz", String.class, "0");
}
}
if (metaObject.hasGetter("xtCjsj")) {
if (metaObject.getValue("xtCjsj") == null) {
this.strictInsertFill(metaObject, "xtCjsj", Timestamp.class, new Timestamp(System.currentTimeMillis()));
}
}
if (Objects.nonNull(userInfo)) {
if (metaObject.hasGetter("xtCjrId")) {
if (metaObject.getValue("xtCjrId") == null) {
this.strictInsertFill(metaObject, "xtCjrId", String.class, String.valueOf(userInfo.userId));
}
}
if (metaObject.hasGetter("xtCjr")) {
if (metaObject.getValue("xtCjr") == null) {
this.strictInsertFill(metaObject, "xtCjr", String.class, String.valueOf(userInfo.userName));
}
}
if (metaObject.hasGetter("xtCjbmdm")) {
if (metaObject.getValue("xtCjbmdm") == null) {
this.strictInsertFill(metaObject, "xtCjbmdm", String.class, String.valueOf(userInfo.getDeptId()));
}
}
if (metaObject.hasGetter("xtCjbmmc")) {
if (metaObject.getValue("xtCjbmmc") == null) {
this.strictInsertFill(metaObject, "xtCjbmmc", String.class, userInfo.getDeptName());
}
}
}
} catch (Exception e) {
throw new BusinessException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
}
}
@Override
public void updateFill(MetaObject metaObject) {
try {
UserInfo userInfo = UserInfoManager.getUser();
if (metaObject.hasGetter("xtZhgxip")) {
if (metaObject.getValue("xtZhgxip") == null) {
this.strictUpdateFill(metaObject, "xtZhgxip", String.class, IpUtil.getIpAddress());
}
}
if (metaObject.hasGetter("xtZhgxsj")) {
if (metaObject.getValue("xtZhgxsj") == null) {
this.strictUpdateFill(metaObject, "xtZhgxsj", Timestamp.class, new Timestamp(System.currentTimeMillis()));
}
}
if (Objects.nonNull(userInfo)) {
if (metaObject.hasGetter("xtZhgxrid")) {
if (metaObject.getValue("xtZhgxrid") == null) {
this.strictUpdateFill(metaObject, "xtZhgxrid", String.class, String.valueOf(userInfo.userId));
}
}
if (metaObject.hasGetter("xtZhgxr")) {
if (metaObject.getValue("xtZhgxr") == null) {
this.strictUpdateFill(metaObject, "xtZhgxr", String.class, userInfo.userName);
}
}
if (metaObject.hasGetter("xtZhgxbmdm")) {
if (metaObject.getValue("xtZhgxbmdm") == null) {
this.strictUpdateFill(metaObject, "xtZhgxbmdm", String.class, String.valueOf(userInfo.getDeptId()));
}
}
if (metaObject.hasGetter("xtZhgxbm")) {
if (metaObject.getValue("xtZhgxbm") == null) {
this.strictUpdateFill(metaObject, "xtZhgxbm", String.class, userInfo.getDeptName());
}
}
}
} catch (Exception e) {
throw new BusinessException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_UNAUTHORIZED);
}
}
}

View File

@ -0,0 +1,29 @@
package com.mosty.yjzl.mybatisplus;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* mybatis-plus配置类
*
* @author Lhh
*/
@EnableTransactionManagement(proxyTargetClass = true)
@Configuration
@MapperScan("com.mosty.yjzl.esmapper")
public class MybatisPlusConfig {
/**
* 元对象字段填充控制器
* https://baomidou.com/guide/auto-fill-metainfo.html
*/
@Bean
public MetaObjectHandler metaObjectHandler() {
return new CreateAndUpdateMetaObjectHandler();
}
}

View File

@ -0,0 +1,198 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mosty.base.model.dto.base.GetSsbmDto;
import com.mosty.base.model.dto.base.SysDeptDTO;
import com.mosty.base.feign.service.MostyBaseFeignService;
import com.mosty.base.model.query.base.SysDeptQuery;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.common.config.entity.vo.SysDictVO;
import com.mosty.common.core.business.entity.SysDept;
import com.mosty.common.core.business.entity.SysUser;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.util.List;
/**
* 调用部门信息远程适配层
*
* @author kevin
* @date 2022/7/6 10:37 上午
* @since 1.0.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbBaseAdaptRemoteService {
private final MostyBaseFeignService mostyBaseFeignService;
// 根据部门编码查询部门信息
public SysDeptDTO getDeptByOrgCode(String orgCode) {
if (StringUtils.isBlank(orgCode)) {
throw new BusinessException("远程调用部门编码查询部门信息异常");
}
ResponseResult<SysDeptDTO> responseResult = mostyBaseFeignService.getDeptByOrgCode(orgCode);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("远程调用部门编码查询部门信息异常");
}
return responseResult.getData();
}
// 获取部门详细信息
public DeptInfoVo getOrgByDeptId(String deptid) {
if (StringUtils.isBlank(deptid)) {
throw new BusinessException("调用部门编码查询部门信息异常");
}
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByDeptId(deptid);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("调用部门编码查询部门信息异常");
}
return responseResult.getData();
}
// 获取部门详细信息
public DeptInfoVo getOrgByOrgcode(String orgcode) {
if (StringUtils.isBlank(orgcode)) {
throw new BusinessException("调用部门编码查询部门信息异常");
}
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByOrgcode(orgcode);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("调用部门编码查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("调用部门编码查询部门信息异常");
}
return responseResult.getData();
}
// 根据用户ID获取用户部门信息
public DeptInfoVo getDeptInfoByUserId(String userId) {
if (StringUtils.isBlank(userId)) {
throw new BusinessException("获取用户部门信息异常");
}
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getDeptInfoByUserId(userId);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取用户部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取用户部门信息异常");
}
return responseResult.getData();
}
// 查询部门下的总人数(包含子部门)
public Integer getUserCount(String deptId) {
if (StringUtils.isBlank(deptId)) {
throw new BusinessException("查询部门下的总人数异常");
}
ResponseResult<Integer> responseResult = mostyBaseFeignService.getUserCount(deptId);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询部门下的总人数异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询部门下的总人数异常");
}
return responseResult.getData();
}
// 通过key获取配置信息
public String getValue(String pzj) {
if (StringUtils.isBlank(pzj)) {
return null;
}
ResponseResult<String> responseResult = mostyBaseFeignService.getValue(pzj);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询系统配置异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询系统配置异常");
}
return responseResult.getData();
}
// 通过字典名称获取词条列表
public SysDictVO getSysDictByCode(String dictCode) {
if (StringUtils.isBlank(dictCode)) {
return null;
}
ResponseResult<SysDictVO> responseResult = mostyBaseFeignService.getSysDictByCode(dictCode);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取字典信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取字典信息异常");
}
return responseResult.getData();
}
// 通过身份证号获取用户信息
public SysUser getUserInfoBySfzh(String sfzh) {
if (StringUtils.isBlank(sfzh)) {
return null;
}
ResponseResult<SysUser> responseResult = mostyBaseFeignService.getUserInfoBySfzh(sfzh);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取用户信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取用户信息异常");
}
return responseResult.getData();
}
// 获取部门信息
public List<SysDept> getOrg(SysDeptQuery deptQuery) {
ResponseResult<List<SysDept>> responseResult = mostyBaseFeignService.getOrg(deptQuery);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取用户信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取用户信息异常");
}
return responseResult.getData();
}
// 获取地址中文信息
public JSONObject getAddress(String jd, String wd) {
ResponseResult<JSONObject> responseResult = mostyBaseFeignService.getAddress(jd, wd);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取地址中文信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取地址中文信息异常");
}
return responseResult.getData();
}
// 查询部门下的所有的子部门信息列表
public List<String> getChildDept(String ssbmid) {
ResponseResult<List<String>> responseResult = mostyBaseFeignService.getChildDept(ssbmid);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询部门下的所有的子部门信息列表 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询部门下的所有的子部门信息列表 异常");
}
return responseResult.getData();
}
// 获取权限查询条件
public String getSsbm(String ssbmdm, String isChild) {
GetSsbmDto dto = new GetSsbmDto(ssbmdm, isChild);
ResponseResult<String> responseResult = mostyBaseFeignService.getSsbm(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取权限查询条件异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取权限查询条件异常");
}
return responseResult.getData();
}
// 根据用户ID获取用户部门信息
public DeptInfoVo getDeptInfoBySfzh(String sfzh) {
if (StringUtils.isBlank(sfzh)) {
throw new BusinessException("获取用户部门信息异常");
}
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getDeptInfoBySfzh(sfzh);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取用户部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
// throw new BusinessException("获取用户部门信息异常");
return null;
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,47 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.model.dto.jcgl.TbJcglXfllVo;
import com.mosty.base.feign.service.MostyJcglFeignService;
import com.mosty.base.model.dto.jcgl.TbJcglXfqyDto;
import com.mosty.base.model.query.jcgl.TbJcglXfllQueryAllDto;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 基础管理远程调用
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbJcglAdaptRemoteService {
private final MostyJcglFeignService mostyJcglFeignService;
// 获取部门下的巡防力量信息
public List<TbJcglXfllVo> getXfll(TbJcglXfllQueryAllDto dto) {
ResponseResult<List<TbJcglXfllVo>> responseResult = mostyJcglFeignService.getXfll(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取部门下的巡防力量信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取部门下的巡防力量信息失败");
}
return responseResult.getData();
}
// 查询所有巡防区数据
public List<TbJcglXfqyDto> getListXfqyAll() {
ResponseResult<List<TbJcglXfqyDto>> responseResult = mostyJcglFeignService.getListXfqyAll();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询所有巡防区数据失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询所有巡防区数据失败");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,68 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.model.dto.qwzx.TbQwJlDto;
import com.mosty.base.model.dto.qwzx.TbQwXfbbQueryByJlDto;
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
import com.mosty.base.feign.service.MostyQwzxFeignService;
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 勤务中心远程调用
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbQwzxAdaptRemoteService {
private final MostyQwzxFeignService mostyQwzxFeignService;
// 获取报备详情
public TbQwXfbbVo getBbInfo(String id) {
ResponseResult<TbQwXfbbVo> responseResult = mostyQwzxFeignService.getBbInfo(id);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取报备详情失败 responseResult = {}", JSON.toJSONString(responseResult));
return null;
}
return responseResult.getData();
}
// 根据报备ID查询巡组下的人员列表
public List<TbQwJlDto> getJlxxByBbid(String id) {
ResponseResult<List<TbQwJlDto>> responseResult = mostyQwzxFeignService.getJlxxByBbid(id);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取报备警力失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取报备警力列表异常!");
}
return responseResult.getData();
}
// 查询范围内的最近的巡组信息
public TbQwXfbb getBbxxByJi(TbQwXfbbQueryByJlDto dto) {
ResponseResult<TbQwXfbb> responseResult = mostyQwzxFeignService.getBbxxByJi(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询范围内的最近的巡组信息 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询范围内的最近的巡组信息异常!");
}
return responseResult.getData();
}
// 根据巡区获取报备id
public List<TbQwXfbb> getBbidByXq(String xqid) {
ResponseResult<List<TbQwXfbb>> responseResult = mostyQwzxFeignService.getBbidByXq(xqid);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询范围内的最近的巡组信息 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询范围内的最近的巡组信息异常!");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,67 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyRwzxFeignService;
import com.mosty.base.model.dto.rwzx.TbRwTaskDto;
import com.mosty.base.model.entity.rwzx.TbRwTask;
import com.mosty.base.model.entity.yjzl.TbZlxx;
import com.mosty.base.model.query.rwzx.TbRwTaskByYwidQuery;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author dw
* @since 2022/10/05
* 外部调用任务中心接口
**/
@Service
@Slf4j
public class TbRwzxAdaptRemoteService {
@Resource
private MostyRwzxFeignService mostyRwzxFeignService;
/**
* 发送任务给各个用户
*
* @return
*/
public Integer addRw(TbRwTaskDto dto) {
ResponseResult<Integer> responseResult = mostyRwzxFeignService.addRw(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("任务下发失败 responseResult = {}", JSON.toJSONString(responseResult));
return 0;
}
return responseResult.getData();
}
/**
* 发送任务给各个用户
*
* @return
*/
public TbRwTask getRwByYwid(TbRwTaskByYwidQuery dto) {
ResponseResult<TbRwTask> responseResult = mostyRwzxFeignService.getRwByYwid(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("任务下发失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("任务查询报错!!");
}
return responseResult.getData();
}
/**
* 修改旧的指令任务状态为未读
* @return
*/
public void changeTaskStateByZlid(TbZlxx zlxx) {
ResponseResult<Void> responseResult = mostyRwzxFeignService.changeTaskStateByZlid(zlxx);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("修改任务状态失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("修改任务状态失败!!");
}
}
}

View File

@ -0,0 +1,93 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostySjzxFeignService;
import com.mosty.base.model.entity.lzother.VLz110Txj;
import com.mosty.base.model.entity.sjzx.TbJq;
import com.mosty.base.model.entity.sjzx.TbJqCjdb;
import com.mosty.base.model.vo.sjzx.TbJqVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author dw
* @since 2022/10/31
* 外部调用事件中心接口
**/
@Service
@Slf4j
public class TbSjzxAdaptRemoteService {
@Resource
private MostySjzxFeignService mostySjzxFeignService;
// 同步仁寿警情信息
public void addRsJq(TbJq dto) {
ResponseResult<Void> responseResult = this.mostySjzxFeignService.addRsJq(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("同步仁寿警情信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("同步仁寿警情信息异常");
}
}
// 获取警情的最新的一条信息
public TbJqVo getLastJq() {
ResponseResult<TbJqVo> responseResult = this.mostySjzxFeignService.getLastJq();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取警情的最新的一条信息异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取警情的最新的一条信息异常");
}
return responseResult.getData();
}
// 获取最新一条处警单的数据
public TbJqCjdb getLastJqCjdb() {
ResponseResult<TbJqCjdb> responseResult = this.mostySjzxFeignService.getLastJqCjdb();
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取最新一条处警单的数据 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取最新一条处警单的数据异常");
}
return responseResult.getData();
}
// 添加仁寿处警单数据
public void addRsCjdb(TbJqCjdb cjdb) {
ResponseResult<TbJqCjdb> responseResult = this.mostySjzxFeignService.addRsCjdb(cjdb);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("添加仁寿处警单数据 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("添加仁寿处警单数据异常");
}
}
// 添加泸州110警情数据
public void addLzJq(VLz110Txj lz110) {
ResponseResult<Void> responseResult = this.mostySjzxFeignService.addLzJq(lz110);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("添加泸州110警情数据 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("添加泸州110警情数据异常");
}
}
// 查询警情详情
public TbJqVo getJqInfo(String id) {
ResponseResult<TbJqVo> responseResult = this.mostySjzxFeignService.queryById(id);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("查询警情详情 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("查询警情详情 异常");
}
return responseResult.getData();
}
// 修改警情处置状态
public void updateJqCzzt(String id, String czzt) {
ResponseResult<TbJq> responseResult = this.mostySjzxFeignService.updateJqCzzt(id, czzt);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("修改警情处置状态 异常 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("修改警情处置状态 异常");
}
}
}

View File

@ -0,0 +1,34 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyWebSocketFeignService;
import com.mosty.base.model.dto.websocket.WebSocketObject;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author dw
* @since 2022/7/23
* websocket外部调用基础管理接口
**/
@Service
@Slf4j
public class TbWebSocketAdaptRemoteService {
@Resource
private MostyWebSocketFeignService mostyWebSocketFeignService;
// 发送websocket信息
public void sendMessage(WebSocketObject obj) {
ResponseResult<Void> responseResult = this.mostyWebSocketFeignService.sendMessage(obj);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("发送websocket信息异常 Result = {}", JSON.toJSONString(responseResult));
throw new BusinessException("发送websocket信息异常");
}
}
}

View File

@ -0,0 +1,91 @@
package com.mosty.yjzl.remote;
import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyJcglFeignService;
import com.mosty.base.feign.service.MostyYszxFeignService;
import com.mosty.base.model.dto.jcgl.TbJcglXfllVo;
import com.mosty.base.model.dto.yszx.TbYsDlDTO;
import com.mosty.base.model.dto.yszx.TbYsSxtDto;
import com.mosty.base.model.entity.yszx.TbYsDl;
import com.mosty.base.model.query.yszx.TbYsSxtPageOneQuery;
import com.mosty.base.model.vo.yszx.TbYsDlDto;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 要素中心远程调用
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbYszxAdaptRemoteService {
private final MostyYszxFeignService mostyYszxFeignService;
// 获取感知源详细信息
public TbYsSxtDto getSxtInfoVo(String id) {
ResponseResult<TbYsSxtDto> responseResult = mostyYszxFeignService.getSxtInfoVo(id);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取感知源详细信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取感知源详细信息失败");
}
return responseResult.getData();
}
// 根据设备编号查询摄像头详情
public TbYsSxtDto getInfoBySbbh(String sbbh) {
ResponseResult<TbYsSxtDto> responseResult = mostyYszxFeignService.getInfoBySbbh(sbbh);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取感知源详细信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取感知源详细信息失败");
}
return responseResult.getData();
}
// 查询摄像头信息
public TbYsSxtDto selectGzy(TbYsSxtPageOneQuery dto) {
ResponseResult<TbYsSxtDto> responseResult = mostyYszxFeignService.selectGzy(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("获取感知源信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("获取感知源信息失败");
}
return responseResult.getData();
}
// 添加摄像头信息
public Integer addSxt(TbYsSxtDto dto) {
ResponseResult<Integer> responseResult = mostyYszxFeignService.addSxt(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("添加摄像头信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("添加摄像头信息失败");
}
return responseResult.getData();
}
// 添加地理要素信息
public Integer addDlYs(TbYsDlDto dto) {
ResponseResult<Integer> responseResult = mostyYszxFeignService.addDlYs(dto);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("添加地理要素信息失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("添加地理要素信息失败");
}
return responseResult.getData();
}
// 根据名称查询地理要素
public TbYsDl selectDlys(String ysmc) {
ResponseResult<TbYsDl> responseResult = mostyYszxFeignService.selectDlys(ysmc);
if (responseResult == null || !responseResult.isSuccess()) {
log.error("根据名称查询地理要素失败 responseResult = {}", JSON.toJSONString(responseResult));
throw new BusinessException("根据名称查询地理要素失败");
}
return responseResult.getData();
}
}

View File

@ -0,0 +1,93 @@
package com.mosty.yjzl.service.Impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.entity.yjzl.TbFzycPz;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.yjzl.TbFzycPzVo;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.yjzl.mapper.TbFzycPzMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbFzycPzService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@AllArgsConstructor
public class TbFzycPzServiceImpl extends ServiceImpl<TbFzycPzMapper, TbFzycPz>
implements TbFzycPzService {
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public int insert(TbFzycPzVo fzycPzVo) {
TbFzycPz pz = this.baseMapper.selectOne(new QueryWrapper<TbFzycPz>().eq("ssbmdm", fzycPzVo.getSsbmdm()));
if (null != pz) {
throw new BusinessException(fzycPzVo.getSsbm() + "部门已存在犯罪预测配置中!");
}
TbFzycPz fzycPz = new TbFzycPz();
BeanUtil.copyProperties(fzycPzVo, fzycPz);
fzycPz.setId(UUIDGenerator.getUUID());
if (StringUtils.isNotBlank(fzycPzVo.getSsbmdm())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(fzycPzVo.getSsbmdm());
if (dept != null) {
fzycPz.setSsbm(dept.getDeptname());
fzycPz.setSsbmdm(dept.getDeptcode());
fzycPz.setSsbmid(dept.getDeptid());
fzycPz.setSsxgaj(dept.getFxjname());
fzycPz.setSsxgajid(String.valueOf(dept.getFxjid()));
fzycPz.setSsxgajdm(dept.getFxjcode());
fzycPz.setSssgaj(dept.getDszname());
fzycPz.setSssgajid(String.valueOf(dept.getDszid()));
fzycPz.setSssgajdm(dept.getDszcode());
}
}
return this.baseMapper.insert(fzycPz);
}
@Override
public int updateById(TbFzycPzVo fzycPzVo) {
TbFzycPz vo = this.baseMapper.selectById(fzycPzVo.getId());
TbFzycPz fzycPz = new TbFzycPz();
BeanUtil.copyProperties(fzycPzVo, fzycPz);
if (StringUtils.isNotEmpty(fzycPzVo.getSsbmdm()) && !fzycPzVo.getSsbmdm().equals(vo.getSsbmdm())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(fzycPzVo.getSsbmdm());
if (dept != null) {
fzycPz.setSsbm(dept.getDeptname());
fzycPz.setSsbmdm(dept.getDeptcode());
fzycPz.setSsbmid(dept.getDeptid());
fzycPz.setSsxgaj(dept.getFxjname());
fzycPz.setSsxgajid(String.valueOf(dept.getFxjid()));
fzycPz.setSsxgajdm(dept.getFxjcode());
fzycPz.setSssgaj(dept.getDszname());
fzycPz.setSssgajid(String.valueOf(dept.getDszid()));
fzycPz.setSssgajdm(dept.getDszcode());
}
}
return this.baseMapper.updateById(fzycPz);
}
@Override
public TbFzycPz queryById(String id) {
return this.baseMapper.selectById(id);
}
@Override
public int deleteById(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List<TbFzycPz> queryAll() {
return this.baseMapper.selectList(new QueryWrapper<>());
}
}

View File

@ -0,0 +1,158 @@
package com.mosty.yjzl.service.Impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.dto.base.SysDeptDTO;
import com.mosty.base.model.dto.yjzl.TbFzycDto;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import com.mosty.base.model.entity.yjzl.TbFzycPz;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.yjzl.ForecastInterfaceVO;
import com.mosty.base.utils.Constant;
import com.mosty.base.utils.DateUtils;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.core.business.service.SysRoleService;
import com.mosty.common.core.util.http.HttpUtils;
import com.mosty.common.redis.service.RedisService;
import com.mosty.common.token.DeptInfo;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.yjzl.mapper.TbFzycMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbFzycPzService;
import com.mosty.yjzl.service.TbFzycService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@AllArgsConstructor
public class TbFzycServiceImpl extends ServiceImpl<TbFzycMapper, TbFzyc>
implements TbFzycService {
private final TbFzycPzService tbFzycPzService;
private final SysRoleService sysRoleService;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
private final RedisService redisService;
@Override
public int insert(TbFzyc fzyc) {
fzyc.setId(UUIDGenerator.getUUID());
fzyc.setSfxl("0");
return this.baseMapper.insert(fzyc);
}
@Override
public int fzUpdateById(TbFzyc fzyc) {
return this.baseMapper.updateById(fzyc);
}
@Override
public TbFzyc queryById(String id) {
return this.baseMapper.selectById(id);
}
@Override
public int deleteById(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List<TbFzyc> queryList(TbFzycDto tbFzycDto) {
tbFzycDto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(tbFzycDto.getSsbmdm(), null));
if (StringUtils.isBlank(tbFzycDto.getKssj())) {
tbFzycDto.setKssj(DateUtils.getSystemDateString());
}
// if (CollectionUtils.isEmpty(tbFzycDto.getBcList())) {
// tbFzycDto.setBc(redisService.getCacheObject(Constant.FZYC_BC));
// }
return this.baseMapper.selectListBm(tbFzycDto);
}
@Override
public List<TbFzyc> queryListApp(TbFzycDto tbFzycDto) {
tbFzycDto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(tbFzycDto.getSsbmdm(), null));
if (StringUtils.isBlank(tbFzycDto.getKssj())) {
tbFzycDto.setKssj(DateUtils.getSystemDateString());
}
//app只查看当前
if (StringUtils.isEmpty(tbFzycDto.getBc())) {
tbFzycDto.setBc(redisService.getCacheObject(Constant.FZYC_BC));
}
return this.baseMapper.selectListBm(tbFzycDto);
}
@Override
public IPage<TbFzyc> queryListPage(TbFzycDto tbFzycDto) {
QueryWrapper<TbFzyc> tb = new QueryWrapper<>();
if (StringUtils.isNotBlank(tbFzycDto.getSsbmdm())) {
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(tbFzycDto.getSsbmdm(), null);
tb.lambda().likeRight(StringUtils.isNotBlank(ssbm), TbFzyc::getSsbmdm, ssbm);
} else if (StringUtils.isNotBlank(tbFzycDto.getSsbmid())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(tbFzycDto.getSsbmid());
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(dept.getDeptcode(), null);
tb.lambda().likeRight(StringUtils.isNotBlank(ssbm), TbFzyc::getSsbmdm, ssbm);
} else {
UserInfo user = UserInfoManager.getUser();
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(user.getDeptCode());
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(dept.getDeptcode(), null);
tb.lambda().likeRight(StringUtils.isNotBlank(ssbm), TbFzyc::getSsbmdm, ssbm);
}
tb.lambda().eq(StringUtils.isNotBlank(tbFzycDto.getSfxl()), TbFzyc::getSfxl, tbFzycDto.getSfxl())
.eq(StringUtils.isNotBlank(tbFzycDto.getGridType()), TbFzyc::getGridType, tbFzycDto.getGridType())
.ge(StringUtils.isNotBlank(tbFzycDto.getKssj()), TbFzyc::getRealDate, tbFzycDto.getKssj())
.le(StringUtils.isNotBlank(tbFzycDto.getJssj()), TbFzyc::getRealDate, tbFzycDto.getJssj())
.gt(tbFzycDto.getProb() != null, TbFzyc::getProb, tbFzycDto.getProb())
.orderByDesc(TbFzyc::getRealDate);
return this.baseMapper.selectPage(new Page<>(tbFzycDto.getPageCurrent(), tbFzycDto.getPageSize()), tb);
}
@Override
public int updateBySfxl(String id) {
TbFzyc fzyc = this.baseMapper.selectById(id);
fzyc.setSfxl("1");
return this.baseMapper.updateById(fzyc);
}
@Override
public Integer getFzyjCount(String ssbmdm, String time, String sfxl) {
try {
// ssbmdm = this.tbBaseAdaptRemoteService.getSsbm(ssbmdm, null);
// time = time.replaceAll("-", "");
// return this.baseMapper.selectCount(
// new LambdaQueryWrapper<TbFzyc>()
// .likeRight(!StringUtils.isEmpty(ssbmdm), TbFzyc::getSsbmdm, ssbmdm)
// .eq(StringUtils.isNotBlank(sfxl), TbFzyc::getSfxl, sfxl)
// .eq(TbFzyc::getRealDate, time)
// );
TbFzycDto dto = new TbFzycDto();
dto.setSsbmdm(ssbmdm);
dto.setKssj(time);
dto.setJssj(time);
dto.setSfxl(sfxl);
return this.baseMapper.getFzyjCount(dto);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
}

View File

@ -0,0 +1,283 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.dto.yjzl.TbFzycDto;
import com.mosty.base.model.dto.yjzl.TbFzycXljlDto;
import com.mosty.base.model.entity.wzzx.TbWzSbsswz;
import com.mosty.base.model.entity.wzzx.TbWzXfwz;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import com.mosty.base.model.entity.yjzl.TbFzycXljl;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.wzzx.TbWzSblswzVo;
import com.mosty.base.model.vo.yjzl.TbFzJlVo;
import com.mosty.base.model.vo.yjzl.TbFzycXljlVo;
import com.mosty.base.utils.JtsUtils;
import com.mosty.base.utils.Kit;
import com.mosty.base.utils.PositionUtil;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.yjzl.mapper.TbFzycXfxzMapper;
import com.mosty.yjzl.mapper.TbFzycXljlMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbFzycService;
import com.mosty.yjzl.service.TbFzycXljlService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import sun.rmi.runtime.Log;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@AllArgsConstructor
public class TbFzycXljlServiceImpl extends ServiceImpl<TbFzycXljlMapper, TbFzycXljl>
implements TbFzycXljlService {
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
private final TbFzycService tbFzycService;
private final TbFzycXfxzMapper tbFzycXfxzMapper;
@Override
public int insert(TbFzycXljlVo xljlVo) {
TbFzycXljl tbFzycXljl = new TbFzycXljl();
BeanUtils.copyProperties(xljlVo, tbFzycXljl);
tbFzycXljl.setId(UUIDGenerator.getUUID());
if (StringUtils.isNotEmpty(xljlVo.getSsbmid())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(xljlVo.getSsbmdm());
if (dept != null) {
tbFzycXljl.setSsbm(dept.getDeptname());
tbFzycXljl.setSsbmdm(dept.getDeptcode());
tbFzycXljl.setSsxgaj(dept.getFxjname());
tbFzycXljl.setSsxgajid(String.valueOf(dept.getFxjid()));
tbFzycXljl.setSsxgajdm(dept.getFxjcode());
tbFzycXljl.setSssgaj(dept.getDszname());
tbFzycXljl.setSssgajid(String.valueOf(dept.getDszid()));
tbFzycXljl.setSssgajdm(dept.getDszcode());
}
}
return this.baseMapper.insertEntity(tbFzycXljl);
}
public int saveFzjl(TbFzycXljlVo xljlVo) {
//判断该巡组是否巡逻过该犯罪预警预测方格
TbFzycXljl fzycXlj = this.baseMapper.selectByFzBb(xljlVo);
if (null == fzycXlj) {//该巡组没有巡逻过该方格,直接保存
//修改犯罪预测状态 已巡逻
tbFzycService.updateBySfxl(xljlVo.getFzyjyczlId());
xljlVo.setXlkssj(new Date());
List<BigDecimal[]> list = new ArrayList<>();
BigDecimal[] decimals = new BigDecimal[2];
decimals[0] = xljlVo.getDqjd();
decimals[1] = xljlVo.getDqwd();
list.add(decimals);
list.add(decimals);
xljlVo.setZb(JtsUtils.createLine(list));
xljlVo.setXljssj(new Date());
this.insert(xljlVo);
} else {
List<BigDecimal[]> zbList = JtsUtils.decodeLineString(fzycXlj.getZb());
fzycXlj.setZbList(zbList);
fzycXlj.setXzmc(xljlVo.getXzmc());
//该巡组巡逻过该方格,进入下一个判断
// if (fzycXlj.getXljssj() == null) {
//
// //该方格只被该巡组巡逻过一次,直接更新,不用判断 (有问题 第一次点位 然后跑出去了 再回来 巡逻时长要乱)
// fzycXlj.setZxJl(xljlVo.getZxJl());
//
// int l =(int) (fzycXlj.getXljssj().getTime() - fzycXlj.getXlkssj().getTime())/1000;
// fzycXlj.setXfsc(l);
// int distance =(int) PositionUtil.getDistance(fzycXlj.getDqjd().doubleValue(), fzycXlj.getDqwd().doubleValue(),
// xljlVo.getDqjd().doubleValue(), xljlVo.getDqwd().doubleValue());
// fzycXlj.setXflc(distance + fzycXlj.getXflc());
//
// fzycXlj.setDqjd(xljlVo.getDqjd());
// fzycXlj.setDqwd(xljlVo.getDqwd());
//
// List<BigDecimal[]> list = fzycXlj.getZbList();
// if (CollectionUtils.isEmpty(list)) {
// list = new ArrayList<>();
// }
// BigDecimal[] decimals = new BigDecimal[2];
// decimals[0] = xljlVo.getDqjd();
// decimals[1] = xljlVo.getDqwd();
// list.add(decimals);
// if (list.size() == 1) {
// list.add(decimals);
// }
// if (list.size() >= 3) {
// BigDecimal[] decimal0 = list.get(0);
// BigDecimal[] decimal1 = list.get(1);
// if (decimal0 == decimal1) {
// list.remove(0);
// }
// }
// fzycXlj.setZb(JtsUtils.createLine(list));
//
// this.baseMapper.updateEntity(fzycXlj);
// } else {
if (new Date().getTime() - fzycXlj.getXljssj().getTime() > 300000) {
//该巡组上次进入方格的结束时间距离当前时间已经超过五分钟分钟,所以保存一条新的数据
xljlVo.setXlkssj(new Date());
List<BigDecimal[]> list = new ArrayList<>();
BigDecimal[] decimals = new BigDecimal[2];
decimals[0] = xljlVo.getDqjd();
decimals[1] = xljlVo.getDqwd();
list.add(decimals);
list.add(decimals);
xljlVo.setZb(JtsUtils.createLine(list));
xljlVo.setXljssj(new Date());
this.insert(xljlVo);
} else {
//该巡组上次进入方格的结束时间距离当前时间没有超过五分钟分钟,所以更新本条数据
fzycXlj.setZxJl(xljlVo.getZxJl());
fzycXlj.setXljssj(new Date());
int l = (int) (fzycXlj.getXljssj().getTime() - fzycXlj.getXlkssj().getTime()) / 1000;
fzycXlj.setXfsc(l);
int distance = (int) PositionUtil.getDistance(fzycXlj.getDqjd().doubleValue(), fzycXlj.getDqwd().doubleValue(),
xljlVo.getDqjd().doubleValue(), xljlVo.getDqwd().doubleValue());
fzycXlj.setXflc(distance + fzycXlj.getXflc());
fzycXlj.setDqjd(xljlVo.getDqjd());
fzycXlj.setDqwd(xljlVo.getDqwd());
List<BigDecimal[]> list = fzycXlj.getZbList();
if (CollectionUtils.isEmpty(list)) {
list = new ArrayList<>();
}
BigDecimal[] decimals = new BigDecimal[2];
decimals[0] = xljlVo.getDqjd();
decimals[1] = xljlVo.getDqwd();
list.add(decimals);
if (list.size() == 1) {
list.add(decimals);
}
if (list.size() >= 3) {
BigDecimal[] decimal0 = list.get(0);
BigDecimal[] decimal1 = list.get(1);
if (decimal0 == decimal1) {
list.remove(0);
}
}
fzycXlj.setZb(JtsUtils.createLine(list));
this.baseMapper.updateEntity(fzycXlj);
// }
}
}
return 1;
}
@Override
public int updateById(TbFzycXljlVo xljlVo) {
TbFzycXljl tbFzycXljl = new TbFzycXljl();
BeanUtils.copyProperties(xljlVo, tbFzycXljl);
if (StringUtils.isNotEmpty(xljlVo.getSsbmid())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(xljlVo.getSsbmid());
if (dept != null) {
tbFzycXljl.setSsbm(dept.getDeptname());
tbFzycXljl.setSsbmdm(dept.getDeptcode());
tbFzycXljl.setSsxgaj(dept.getFxjname());
tbFzycXljl.setSsxgajid(String.valueOf(dept.getFxjid()));
tbFzycXljl.setSsxgajdm(dept.getFxjcode());
tbFzycXljl.setSssgaj(dept.getDszname());
tbFzycXljl.setSssgajid(String.valueOf(dept.getDszid()));
tbFzycXljl.setSssgajdm(dept.getDszcode());
}
}
return this.baseMapper.updateEntity(tbFzycXljl);
}
@Override
public TbFzycXljl queryById(String id) {
return this.baseMapper.selectById(id);
}
@Override
public int deleteById(String id) {
return this.baseMapper.deleteById(id);
}
@Override
public List<TbFzycXljlDto> qfzxl(String fzyjyczlId) {
List<TbFzycXljl> qfzxl = this.baseMapper.qfzxl(fzyjyczlId);
if (!CollectionUtils.isEmpty(qfzxl)) {
List<TbFzycXljlDto> list = new ArrayList<>();
for (TbFzycXljl xljl : qfzxl) {
TbFzycXljlDto dto = new TbFzycXljlDto();
BeanUtils.copyProperties(xljl, dto);
List<BigDecimal[]> zbList = JtsUtils.decodeLineString(xljl.getZb());
dto.setZbList(zbList);
//查询有没指令
String qs = tbFzycXfxzMapper.selectQs(xljl.getXlbbId(), xljl.getFzyjyczlId());
if (StringUtils.isEmpty(qs)) {
dto.setSfqsmc("");
} else {
if (qs.equals("1")) {
dto.setSfqsmc("签收");
} else {
dto.setSfqsmc("未签收");
}
}
dto.setSfqs(qs);
//查询核查人员数
dto.setPcry(this.baseMapper.pcrys(xljl.getXlbbId()));
//查询核查车数
dto.setPccl(this.baseMapper.pccls(xljl.getXlbbId()));
list.add(dto);
}
return list;
}
return null;
}
@Override
public int addBySbwz(TbFzJlVo fzJlVo) {
if (fzJlVo != null && StringUtils.isNotBlank(fzJlVo.getSsbmdm())) {
TbFzycDto tbFzycDto = new TbFzycDto();
tbFzycDto.setSsbmdm(fzJlVo.getSsbmdm());
List<TbFzyc> tbFzycs = tbFzycService.queryList(tbFzycDto);
if (!CollectionUtils.isEmpty(tbFzycs)) {
for (TbFzyc fzyc : tbFzycs) {
//计算中心点位
BigDecimal X = fzyc.getZxX();
BigDecimal Y = fzyc.getZxY();
//计算两个位置距离
double distance = Kit.getDistance(X.doubleValue(), Y.doubleValue(),
fzJlVo.getJd().doubleValue(), fzJlVo.getWd().doubleValue());
//巡逻到犯罪预测区域,提示已巡逻 200米
String gridType = fzyc.getGridType();
Long aLong = ((Long.valueOf(gridType)) / 2) + 100;
if (distance <= aLong) {
//保存数据
TbFzycXljlVo vo = new TbFzycXljlVo();
vo.setXlbbId(fzJlVo.getBbid());
vo.setFzyjyczlId(fzyc.getId());
vo.setXlkssj(new Date());
vo.setZxJl(new BigDecimal(distance));
vo.setSsbm(fzJlVo.getSsbm());
vo.setSsbmdm(fzJlVo.getSsbmdm());
vo.setSsbmid(fzJlVo.getSsbmid());
vo.setSsxgaj(fzJlVo.getSsxgaj());
vo.setSsxgajdm(fzJlVo.getSsxgajdm());
vo.setSsxgajid(fzJlVo.getSsxgajid());
vo.setSssgaj(fzJlVo.getSssgaj());
vo.setSssgajdm(fzJlVo.getSssgajdm());
vo.setSssgajid(fzJlVo.getSssgaj());
vo.setDqjd(fzJlVo.getJd());
vo.setDqwd(fzJlVo.getWd());
vo.setXzmc(fzJlVo.getXzmc());
this.saveFzjl(vo);
}
}
}
}
return 0;
}
}

View File

@ -0,0 +1,69 @@
package com.mosty.yjzl.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.extension.plugins.pagination.Page;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.base.model.entity.yjzl.TbYjDyyjxx;
import com.mosty.base.model.query.yjzl.TbYjDyyjxxQuery;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.yjzl.mapper.TbYjDyyjxxMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjDyyjxxService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@AllArgsConstructor
@Service
public class TbYjDyyjxxServiceImpl implements TbYjDyyjxxService {
private TbYjDyyjxxMapper tbYjDyyjxxMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public IPage<TbYjDyyjxx> queryByPage(TbYjDyyjxxQuery dto) {
IPage<TbYjDyyjxx> page = new Page<>(dto.getPageCurrent(), dto.getPageSize());
QueryWrapper<TbYjDyyjxx> qw = new QueryWrapper<>();
// UserInfo user = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(qw, user);
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
qw.lambda().eq(StringUtils.isNotBlank(dto.getDyryId()), TbYjDyyjxx::getDyryId, dto.getDyryId())
.like(StringUtils.isNotBlank(dto.getDyryXm()), TbYjDyyjxx::getDyryXm, dto.getDyryXm())
.likeRight(StringUtils.isNotBlank(dto.getSsbmdm()), TbYjDyyjxx::getSsbmdm, dto.getSsbmdm())
.like(StringUtils.isNotBlank(dto.getDyrySfzh()), TbYjDyyjxx::getDyrySfzh, dto.getDyrySfzh())
.eq(StringUtils.isNotBlank(dto.getYjId()), TbYjDyyjxx::getYjId, dto.getYjId())
.eq(StringUtils.isNotBlank(dto.getDxjssjh()), TbYjDyyjxx::getDxjssjh, dto.getDxjssjh())
.ge(dto.getYjkssj() != null, TbYjDyyjxx::getYjsj, dto.getYjkssj())
.le(dto.getYjjssj() != null, TbYjDyyjxx::getYjsj, dto.getYjkssj());
return tbYjDyyjxxMapper.selectPage(page, qw);
}
@Override
public int insert(TbYjDyyjxx dyyjxx) {
dyyjxx.setId(UUIDGenerator.getUUID());
UserInfo user = UserInfoManager.get();
dyyjxx.setSsbm(user.getDeptName());
dyyjxx.setSsbmid(String.valueOf(user.getDeptId()));
dyyjxx.setSsbmdm(user.getDeptCode());
dyyjxx.setSsxgaj(user.getFxjDeptName());
dyyjxx.setSsxgajid(String.valueOf(user.getFxjDeptId()));
dyyjxx.setSsxgajdm(user.getFxjDeptCode());
dyyjxx.setSssgaj(user.getDszDeptName());
dyyjxx.setSssgajid(String.valueOf(user.getDszDeptId()));
dyyjxx.setSssgajdm(user.getDszDeptCode());
return tbYjDyyjxxMapper.insert(dyyjxx);
}
@Override
public int deleteById(List<String> list) {
return tbYjDyyjxxMapper.deleteByIds(list);
}
}

View File

@ -0,0 +1,80 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.entity.yjzl.TbYjmxCsb;
import com.mosty.base.model.query.yjzl.TbYjmxCsbQuery;
import com.mosty.base.model.vo.yjzl.TbYjmxCsbVo;
import com.mosty.yjzl.mapper.TbYjmxCsbMapper;
import com.mosty.yjzl.service.TbYjmxCsbService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@Service
public class TbYjmxCsbServiceImpl extends ServiceImpl<TbYjmxCsbMapper, TbYjmxCsb>
implements TbYjmxCsbService {
@Override
public int insert(TbYjmxCsbVo csb) {
TbYjmxCsb vo = new TbYjmxCsb();
BeanUtils.copyProperties(csb, vo);
vo.setXtSjly("1");
return this.baseMapper.insert(vo);
}
@Override
public TbYjmxCsbVo queryById(String id) {
TbYjmxCsb tbYjmxCsb = baseMapper.selectById(id);
TbYjmxCsbVo vo = new TbYjmxCsbVo();
BeanUtils.copyProperties(tbYjmxCsb, vo);
return vo;
}
@Override
public int deleteById(String id) {
return baseMapper.deleteById(id);
}
@Override
public IPage<TbYjmxCsbVo> getPage(TbYjmxCsbQuery dto) {
IPage<TbYjmxCsb> page = this.baseMapper.selectPage(
new Page<>(dto.getPageCurrent(),dto.getPageSize()),
new LambdaQueryWrapper<TbYjmxCsb>()
.eq(StringUtils.isNotBlank(dto.getMxid()),TbYjmxCsb::getMxid,dto.getMxid())
.like(StringUtils.isNotBlank(dto.getCsdm()),TbYjmxCsb::getCsdm,dto.getCsdm())
.eq(StringUtils.isNotBlank(dto.getCsmc()),TbYjmxCsb::getCsmc,dto.getCsmc())
.eq(StringUtils.isNotBlank(dto.getCsz()),TbYjmxCsb::getCsz,dto.getCsz())
.eq(StringUtils.isNotBlank(dto.getCslx()),TbYjmxCsb::getCslx,dto.getCslx())
);
IPage<TbYjmxCsbVo> pageVo = new Page<>(dto.getPageCurrent(),dto.getPageSize());
List<TbYjmxCsbVo> voList = new ArrayList<>();
if(!CollectionUtils.isEmpty(page.getRecords())){
page.getRecords().forEach(item->{
TbYjmxCsbVo vo = new TbYjmxCsbVo();
BeanUtils.copyProperties(item,vo);
voList.add(vo);
});
}
pageVo.setRecords(voList);
pageVo.setTotal(page.getTotal());
return pageVo;
}
@Override
public int updateById(TbYjmxCsbVo clVo) {
TbYjmxCsb csb = new TbYjmxCsb();
BeanUtils.copyProperties(clVo,csb);
csb.setXtSjly("1");
return this.baseMapper.updateById(csb);
}
}

View File

@ -0,0 +1,149 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.entity.yjzl.TbYjmx;
import com.mosty.base.model.entity.yjzl.TbYjmxCsb;
import com.mosty.base.model.entity.yjzl.TbYjxx;
import com.mosty.base.model.query.yjzl.TbYjmxQuery;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.yjzl.TbYjmxAllVo;
import com.mosty.base.model.vo.yjzl.TbYjmxCsbVo;
import com.mosty.base.model.vo.yjzl.TbYjmxVo;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.yjzl.mapper.TbYjmxCsbMapper;
import com.mosty.yjzl.mapper.TbYjmxMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjmxService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@Service
@AllArgsConstructor
public class TbYjmxServiceImpl extends ServiceImpl<TbYjmxMapper, TbYjmx>
implements TbYjmxService {
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
private final TbYjmxCsbMapper tbYjmxCsbMapper;
@Override
public int insert(TbYjmxVo vo) {
TbYjmx mx = this.baseMapper.selectById(vo.getId());
if (mx != null) {
throw new BusinessException("模型ID已存在");
}
TbYjmx yjmx1 = new TbYjmx();
BeanUtils.copyProperties(vo, yjmx1);
yjmx1.setMxzt("01");
yjmx1.setXtSjly("1");
if (StringUtils.isNotBlank(vo.getSsbmid())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(vo.getSsbmid());
if (dept != null) {
yjmx1.setSsbm(dept.getDeptname());
yjmx1.setSsbmdm(dept.getDeptcode());
}
}
return baseMapper.insert(yjmx1);
}
@Override
public int updateById(TbYjmxVo vo) {
TbYjmx yjmx1 = new TbYjmx();
BeanUtils.copyProperties(vo, yjmx1);
yjmx1.setXtSjly("1");
if (StringUtils.isNotBlank(vo.getSsbmid())) {
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(vo.getSsbmid());
if (dept != null) {
yjmx1.setSsbm(dept.getDeptname());
yjmx1.setSsbmdm(dept.getDeptcode());
}
}
return baseMapper.updateById(yjmx1);
}
@Override
public TbYjmxVo queryById(String id) {
TbYjmx yjmx = baseMapper.selectById(id);
TbYjmxVo vo = new TbYjmxVo();
BeanUtils.copyProperties(yjmx, vo);
return vo;
}
@Override
public int deleteById(String id) {
return baseMapper.deleteById(id);
}
@Override
public IPage<TbYjmxVo> getPage(TbYjmxQuery dto) {
IPage<TbYjmx> page = this.baseMapper.selectPage(
new Page<>(dto.getPageCurrent(), dto.getPageSize()),
new LambdaQueryWrapper<TbYjmx>()
.like(StringUtils.isNotBlank(dto.getMxmc()), TbYjmx::getMxmc, dto.getMxmc())
.eq(StringUtils.isNotBlank(dto.getMxlx()), TbYjmx::getMxlx, dto.getMxlx())
.like(StringUtils.isNotBlank(dto.getSsbm()), TbYjmx::getSsbm, dto.getSsbm())
.eq(StringUtils.isNotBlank(dto.getSsbmdm()), TbYjmx::getSsbmdm, dto.getSsbmdm())
.eq(StringUtils.isNotBlank(dto.getSsbmid()), TbYjmx::getSsbmid, dto.getSsbmid())
.eq(StringUtils.isNotBlank(dto.getMxzt()), TbYjmx::getMxzt, dto.getMxzt())
);
IPage<TbYjmxVo> pageVo = new Page<>(dto.getPageCurrent(), dto.getPageSize());
List<TbYjmxVo> voList = new ArrayList<>();
if (!CollectionUtils.isEmpty(page.getRecords())) {
page.getRecords().forEach(item -> {
TbYjmxVo vo = new TbYjmxVo();
BeanUtils.copyProperties(item, vo);
voList.add(vo);
});
}
pageVo.setRecords(voList);
pageVo.setTotal(page.getTotal());
return pageVo;
}
@Override
public int startMx(String id) {
TbYjmx yjmx = baseMapper.selectById(id);
TbYjmxVo vo = new TbYjmxVo();
BeanUtils.copyProperties(yjmx, vo);
if (yjmx.getMxzt().equals("01")) {
yjmx.setMxzt("02");
} else if (yjmx.getMxzt().equals("02")) {
yjmx.setMxzt("01");
}
return this.baseMapper.updateById(yjmx);
}
@Override
public TbYjmxAllVo getMxCs(String mxid) {
TbYjmx mx = this.baseMapper.selectById(mxid);
if (mx == null) return null;
TbYjmxAllVo vo = new TbYjmxAllVo();
BeanUtils.copyProperties(mx, vo);
List<TbYjmxCsb> csList = this.tbYjmxCsbMapper.selectList(
new LambdaQueryWrapper<TbYjmxCsb>()
.eq(TbYjmxCsb::getMxid, mxid)
.eq(TbYjmxCsb::getXtSjzt, "1")
);
List<TbYjmxCsbVo> voList = new ArrayList<>();
csList.forEach(item -> {
TbYjmxCsbVo csVo = new TbYjmxCsbVo();
BeanUtils.copyProperties(item, csVo);
voList.add(csVo);
});
vo.setCsList(voList);
return vo;
}
}

View File

@ -0,0 +1,199 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mosty.base.model.entity.yjzl.TbYjxxCl;
import com.mosty.base.model.entity.yjzl.TbYjxxClBq;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.base.model.query.yjzl.TbYjxxClQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxClVo;
import com.mosty.yjzl.mapper.TbYjxxClBqMapper;
import com.mosty.yjzl.mapper.TbYjxxClMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjxxClService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 预警信息-车辆表 服务实现类
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
@AllArgsConstructor
@Service
public class TbYjxxClServiceImpl implements TbYjxxClService {
private final TbYjxxClMapper tbYjxxClMapper;
private final TbYjxxClBqMapper tbYjxxClBqMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public IPage<TbYjxxClVo> queryByPage(TbYjxxClQuery yjcl) {
IPage<TbYjxxClVo> voIPage = new Page<>(yjcl.getPageCurrent(), yjcl.getPageSize());
IPage<TbYjxxCl> pageQuery = new Page<>(yjcl.getPageCurrent(), yjcl.getPageSize());
QueryWrapper<TbYjxxCl> queryWrapper = getQueryWrapper(yjcl);
IPage<TbYjxxCl> page = tbYjxxClMapper.selectPage(pageQuery, queryWrapper);
voIPage.setTotal(page.getTotal());
List<TbYjxxCl> records = page.getRecords();
List<TbYjxxClVo> vos = dataPerfact(records);
voIPage.setRecords(vos);
return voIPage;
}
@Override
public List<TbYjxxClVo> queryList(TbYjxxClQuery tbYjxxClQuery) {
QueryWrapper<TbYjxxCl> queryWrapper = getQueryWrapper(tbYjxxClQuery);
List<TbYjxxCl> records = tbYjxxClMapper.selectList(queryWrapper);
List<TbYjxxClVo> vos = dataPerfact(records);
return vos;
}
@Override
public int insert(TbYjxxClVo clVo) {
TbYjxxCl cl = new TbYjxxCl();
BeanUtils.copyProperties(clVo, cl);
cl.setId(UUIDGenerator.getUUID());
perfectDept(cl);
saveRelevanceData(cl, clVo);
return tbYjxxClMapper.insert(cl);
}
@Override
public int update(TbYjxxClVo clVo) {
TbYjxxCl cl = new TbYjxxCl();
BeanUtils.copyProperties(clVo, cl);
cl.setXtZhgxsj(new Timestamp(System.currentTimeMillis()));
tbYjxxClBqMapper.deleteByYjId(cl.getId());
saveRelevanceData(cl, clVo);
return tbYjxxClMapper.updateById(cl);
}
@Override
public int deleteById(List<String> list) {
return tbYjxxClMapper.deleteByIds(list);
}
@Override
public TbYjxxClVo queryById(String id) {
TbYjxxCl cl = tbYjxxClMapper.selectById(id);
TbYjxxClVo vo = new TbYjxxClVo();
BeanUtils.copyProperties(cl, vo);
List<TbYjxxClBq> bqList = tbYjxxClBqMapper.queryByYjid(Arrays.asList(id));
vo.setClbqList(bqList);
return vo;
}
/**
* 获取查询条件
*
* @param yjcl
* @return
*/
public QueryWrapper<TbYjxxCl> getQueryWrapper(TbYjxxClQuery yjcl) {
QueryWrapper<TbYjxxCl> queryWrapper = new QueryWrapper<>();
// UserInfo userInfo = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(queryWrapper, userInfo);
yjcl.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(yjcl.getSsbmdm(), null));
queryWrapper.lambda().eq(TbYjxxCl::getXtScbz, "0")
.eq(StringUtils.isNotBlank(yjcl.getYjId()), TbYjxxCl::getYjId, yjcl.getYjId())
.eq(StringUtils.isNotBlank(yjcl.getSjId()), TbYjxxCl::getSjId, yjcl.getSjId())
.eq(StringUtils.isNotBlank(yjcl.getYjClbq()), TbYjxxCl::getYjClbq, yjcl.getYjClbq())
.eq(StringUtils.isNotBlank(yjcl.getYjJb()), TbYjxxCl::getYjJb, yjcl.getYjJb())
.like(StringUtils.isNotBlank(yjcl.getYjClcph()), TbYjxxCl::getYjClcph, yjcl.getYjClcph())
.likeRight(StringUtils.isNotBlank(yjcl.getSsbmdm()), TbYjxxCl::getSsbmdm, yjcl.getSsbmdm());
if (yjcl.getYjsksj() != null && yjcl.getYjsksj() == null) {
queryWrapper.lambda().ge(TbYjxxCl::getYjSj, yjcl.getYjsksj());
}
if (yjcl.getYjsksj() == null && yjcl.getYjsksj() != null) {
queryWrapper.lambda().le(TbYjxxCl::getYjSj, yjcl.getYjsksj());
}
if (yjcl.getYjsksj() != null && yjcl.getYjsksj() != null) {
queryWrapper.lambda().between(TbYjxxCl::getYjSj, yjcl.getYjsksj(), yjcl.getYjsksj());
}
return queryWrapper;
}
/**
* 预警人员数据完善
*
* @param records
* @return
*/
public List<TbYjxxClVo> dataPerfact(List<TbYjxxCl> records) {
List<TbYjxxClVo> vos = new ArrayList<>();
if (!CollectionUtils.isEmpty(records)) {
List<String> ids = records.stream().map(TbYjxxCl::getId).collect(Collectors.toList());
List<TbYjxxClBq> bqList = tbYjxxClBqMapper.queryByYjid(ids);
for (TbYjxxCl record : records) {
TbYjxxClVo vo = new TbYjxxClVo();
BeanUtils.copyProperties(record, vo);
List<TbYjxxClBq> clBqList =
bqList.stream().filter(item -> item.getYjclId().equals(record.getId())).collect(Collectors.toList());
vo.setClbqList(clBqList);
vos.add(vo);
}
}
return vos;
}
/**
* 保存关联数据
*
* @param cl
* @param vo
*/
public void saveRelevanceData(TbYjxxCl cl, TbYjxxClVo vo) {
if (vo != null) {
List<TbYjxxClBq> clList = vo.getClbqList();
if (!CollectionUtils.isEmpty(clList)) {
for (TbYjxxClBq bq : clList) {
bq.setId(UUIDGenerator.getUUID());
bq.setYjclId(cl.getId());
bq.setXtSjzt("1");
bq.setXtSjly("1");
bq.setXtScbz("0");
tbYjxxClBqMapper.insert(bq);
}
}
}
}
/**
* 部门赋值
*
* @param zfpb
*/
public void perfectDept(TbYjxxCl zfpb) {
zfpb.setXtSjly("1");
zfpb.setXtSjzt("1");
zfpb.setXtScbz("0");
UserInfo user = UserInfoManager.get();
zfpb.setSsbm(user.getDeptName());
zfpb.setSsbmid(String.valueOf(user.getDeptId()));
zfpb.setSsbmdm(user.getDeptCode());
zfpb.setSsxgaj(user.getFxjDeptName());
zfpb.setSsxgajid(String.valueOf(user.getFxjDeptId()));
zfpb.setSsxgajdm(user.getFxjDeptCode());
zfpb.setSssgaj(user.getDszDeptName());
zfpb.setSssgajid(String.valueOf(user.getDszDeptId()));
zfpb.setSssgajdm(user.getDszDeptCode());
}
}

View File

@ -0,0 +1,222 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.base.model.entity.yjzl.*;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.base.model.query.yjzl.TbYjxxDypzQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxDypzVo;
import com.mosty.yjzl.mapper.*;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjxxDypzService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 预警信息订阅配置
* </p>
*
* @author zengbo
* @since 2022-07-22
*/
@AllArgsConstructor
@Service
public class TbYjxxDypzServiceImpl implements TbYjxxDypzService {
private TbYjxxDypzMapper tbYjxxDypzMapper;
private TbYjxxDypzClbqMapper tbYjxxDypzClbqMapper;
private TbYjxxDypzGzyMapper tbYjxxDypzGzyMapper;
private TbYjxxDypzRybqMapper tbYjxxDypzRybqMapper;
private TbYjxxDypzSjbqMapper tbYjxxDypzSjbqMapper;
private TbYjxxDypzYjjbMapper tbYjxxDypzYjjbMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public IPage<TbYjxxDypzVo> queryList(TbYjxxDypzQuery dypz) {
IPage<TbYjxxDypz> xfpbIPage = queryDypz(dypz);
IPage<TbYjxxDypzVo> voIPage = new Page<>(dypz.getPageCurrent(), dypz.getPageSize());
List<TbYjxxDypz> records = xfpbIPage.getRecords();
List<TbYjxxDypzVo> vos = new ArrayList<>();
if (!CollectionUtils.isEmpty(records)) {
List<String> ids = records.stream().map(TbYjxxDypz::getId).collect(Collectors.toList());
List<TbYjxxDypzClbq> clbqList = tbYjxxDypzClbqMapper.queryByDyid(ids);
List<TbYjxxDypzGzy> gzyList = tbYjxxDypzGzyMapper.queryByDyid(ids);
List<TbYjxxDypzRybq> rybqList = tbYjxxDypzRybqMapper.queryByDyid(ids);
List<TbYjxxDypzSjbq> sjbqList = tbYjxxDypzSjbqMapper.queryByDyid(ids);
List<TbYjxxDypzYjjb> yjjbList = tbYjxxDypzYjjbMapper.queryByDyid(ids);
for (TbYjxxDypz record : records) {
TbYjxxDypzVo vo = new TbYjxxDypzVo();
BeanUtils.copyProperties(record, vo);
List<TbYjxxDypzClbq> clbq = clbqList.stream().filter(item -> item.getDyId().equals(record.getId())).collect(Collectors.toList());
List<TbYjxxDypzGzy> gzy = gzyList.stream().filter(item -> item.getDyId().equals(record.getId())).collect(Collectors.toList());
List<TbYjxxDypzRybq> rybq = rybqList.stream().filter(item -> item.getDyId().equals(record.getId())).collect(Collectors.toList());
List<TbYjxxDypzSjbq> sjbq = sjbqList.stream().filter(item -> item.getDyId().equals(record.getId())).collect(Collectors.toList());
List<TbYjxxDypzYjjb> yjjb = yjjbList.stream().filter(item -> item.getDyId().equals(record.getId())).collect(Collectors.toList());
vo.setClbqList(clbq);
vo.setGzyList(gzy);
vo.setRybqList(rybq);
vo.setSjbqList(sjbq);
vo.setYjjbList(yjjb);
vos.add(vo);
}
}
voIPage.setRecords(vos);
voIPage.setTotal(xfpbIPage.getTotal());
return voIPage;
}
@Override
public int insert(TbYjxxDypzVo dypzVo) {
TbYjxxDypz dypz = new TbYjxxDypz();
BeanUtils.copyProperties(dypzVo, dypz);
dypz.setId(UUIDGenerator.getUUID());
UserInfo user = UserInfoManager.get();
dypz.setSsbm(user.getDeptName());
dypz.setSsbmid(String.valueOf(user.getDeptId()));
dypz.setSsbmdm(user.getDeptCode());
dypz.setSsxgaj(user.getFxjDeptName());
dypz.setSsxgajid(String.valueOf(user.getFxjDeptId()));
dypz.setSsxgajdm(user.getFxjDeptCode());
dypz.setSssgaj(user.getDszDeptName());
dypz.setSssgajid(String.valueOf(user.getDszDeptId()));
dypz.setSssgajdm(user.getDszDeptCode());
saveRelevanceData(dypzVo, dypz.getId());
return tbYjxxDypzMapper.insert(dypz);
}
@Override
public int updateById(TbYjxxDypzVo dypzVo) {
TbYjxxDypz dypz = new TbYjxxDypz();
BeanUtils.copyProperties(dypzVo, dypz);
dypz.setXtZhgxsj(new Timestamp(System.currentTimeMillis()));
deleteRelevanceData(dypz.getId());
saveRelevanceData(dypzVo, dypz.getId());
return tbYjxxDypzMapper.updateById(dypz);
}
@Override
public TbYjxxDypzVo queryById(String id) {
TbYjxxDypz dypz = tbYjxxDypzMapper.selectById(id);
TbYjxxDypzVo vo = new TbYjxxDypzVo();
BeanUtils.copyProperties(dypz, vo);
List<TbYjxxDypzClbq> clbqList = tbYjxxDypzClbqMapper.queryByDyid(Collections.singletonList(id));
List<TbYjxxDypzGzy> gzyList = tbYjxxDypzGzyMapper.queryByDyid(Collections.singletonList(id));
List<TbYjxxDypzRybq> rybqList = tbYjxxDypzRybqMapper.queryByDyid(Collections.singletonList(id));
List<TbYjxxDypzSjbq> sjbqList = tbYjxxDypzSjbqMapper.queryByDyid(Collections.singletonList(id));
List<TbYjxxDypzYjjb> yjjbList = tbYjxxDypzYjjbMapper.queryByDyid(Collections.singletonList(id));
vo.setClbqList(clbqList);
vo.setGzyList(gzyList);
vo.setRybqList(rybqList);
vo.setSjbqList(sjbqList);
vo.setYjjbList(yjjbList);
return vo;
}
@Override
public int deleteById(List<String> list) {
if (list.size() > 0) {
for (String id : list) {
deleteRelevanceData(id);
}
}
return tbYjxxDypzMapper.deleteByIds(list);
}
public IPage<TbYjxxDypz> queryDypz(TbYjxxDypzQuery dypz) {
IPage<TbYjxxDypz> page = new Page<>(dypz.getPageCurrent(), dypz.getPageSize());
QueryWrapper<TbYjxxDypz> qw = new QueryWrapper<>();
// UserInfo userInfo = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(qw, userInfo);
dypz.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dypz.getSsbmdm(), null));
qw.lambda().eq(StringUtils.isNotBlank(dypz.getDyryId()), TbYjxxDypz::getDyryId, dypz.getDyryId())
.like(StringUtils.isNotBlank(dypz.getDyryXm()), TbYjxxDypz::getDyryXm, dypz.getDyryXm())
.eq(StringUtils.isNotBlank(dypz.getDyYjjb()), TbYjxxDypz::getDyYjjb, dypz.getDyYjjb())
.eq(StringUtils.isNotBlank(dypz.getDyYjrybq()), TbYjxxDypz::getDyYjrybq, dypz.getDyYjrybq())
.like(StringUtils.isNotBlank(dypz.getDyYjclbq()), TbYjxxDypz::getDyYjclbq, dypz.getDyYjclbq())
.like(StringUtils.isNotBlank(dypz.getSsbmdm()), TbYjxxDypz::getSsbmdm, dypz.getSsbmdm())
.likeRight(StringUtils.isNotBlank(dypz.getSsbmdm()), TbYjxxDypz::getSsbmdm, dypz.getSsbmdm())
.like(StringUtils.isNotBlank(dypz.getSsbmid()), TbYjxxDypz::getSsbmid, dypz.getSsbmid());
return tbYjxxDypzMapper.selectPage(page, qw);
}
// 保存关联数据
public void saveRelevanceData(TbYjxxDypzVo vo, String ywid) {
if (vo != null) {
List<TbYjxxDypzClbq> clbqList = vo.getClbqList();
List<TbYjxxDypzGzy> gzyList = vo.getGzyList();
List<TbYjxxDypzRybq> rybqList = vo.getRybqList();
List<TbYjxxDypzSjbq> sjbqList = vo.getSjbqList();
List<TbYjxxDypzYjjb> yjjbList = vo.getYjjbList();
if (!CollectionUtils.isEmpty(clbqList)) {
for (TbYjxxDypzClbq clbq : clbqList) {
clbq.setId(UUIDGenerator.getUUID());
clbq.setDyId(ywid);
clbq.setXtSjly("1");
tbYjxxDypzClbqMapper.insert(clbq);
}
}
if (!CollectionUtils.isEmpty(gzyList)) {
for (TbYjxxDypzGzy gzy : gzyList) {
gzy.setId(UUIDGenerator.getUUID());
gzy.setDyId(ywid);
gzy.setXtSjly("1");
tbYjxxDypzGzyMapper.insert(gzy);
}
}
if (!CollectionUtils.isEmpty(rybqList)) {
for (TbYjxxDypzRybq rybq : rybqList) {
rybq.setId(UUIDGenerator.getUUID());
rybq.setDyId(ywid);
rybq.setXtSjly("1");
tbYjxxDypzRybqMapper.insert(rybq);
}
}
if (!CollectionUtils.isEmpty(sjbqList)) {
for (TbYjxxDypzSjbq sjbq : sjbqList) {
sjbq.setId(UUIDGenerator.getUUID());
sjbq.setDyId(ywid);
sjbq.setXtSjly("1");
tbYjxxDypzSjbqMapper.insert(sjbq);
}
}
if (!CollectionUtils.isEmpty(yjjbList)) {
for (TbYjxxDypzYjjb yjjb : yjjbList) {
yjjb.setId(UUIDGenerator.getUUID());
yjjb.setDyId(ywid);
yjjb.setXtSjly("1");
tbYjxxDypzYjjbMapper.insert(yjjb);
}
}
}
}
// 删除关联数据
public void deleteRelevanceData(String id) {
tbYjxxDypzClbqMapper.deleteByDyid(id);
tbYjxxDypzGzyMapper.deleteByDyid(id);
tbYjxxDypzRybqMapper.deleteByDyid(id);
tbYjxxDypzSjbqMapper.deleteByDyid(id);
tbYjxxDypzYjjbMapper.deleteByDyid(id);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,225 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mosty.base.model.entity.yjzl.TbYjxxRy;
import com.mosty.base.model.entity.yjzl.TbYjxxRyBq;
import com.mosty.base.model.entity.yjzl.TbYjxxRySjaj;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.base.model.query.yjzl.TbYjxxRyQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxRyVo;
import com.mosty.yjzl.mapper.TbYjxxRyBqMapper;
import com.mosty.yjzl.mapper.TbYjxxRyMapper;
import com.mosty.yjzl.mapper.TbYjxxRySjajMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjxxRyService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 预警信息-人员表 服务实现类
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@AllArgsConstructor
@Service
public class TbYjxxRyServiceImpl implements TbYjxxRyService {
private final TbYjxxRyMapper tbYjxxRyMapper;
private final TbYjxxRyBqMapper tbYjxxRyBqMapper;
private final TbYjxxRySjajMapper tbYjxxRySjajMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public IPage<TbYjxxRyVo> queryByPage(TbYjxxRyQuery yjry) {
IPage<TbYjxxRyVo> voIPage = new Page<>(yjry.getPageCurrent(), yjry.getPageSize());
IPage<TbYjxxRy> pageQuery = new Page<>(yjry.getPageCurrent(), yjry.getPageSize());
QueryWrapper<TbYjxxRy> queryWrapper = getQueryWrapper(yjry);
IPage<TbYjxxRy> page = tbYjxxRyMapper.selectPage(pageQuery, queryWrapper);
voIPage.setTotal(page.getTotal());
List<TbYjxxRy> records = page.getRecords();
List<TbYjxxRyVo> vos = dataPerfact(records);
voIPage.setRecords(vos);
return voIPage;
}
@Override
public List<TbYjxxRyVo> queryList(TbYjxxRyQuery tbYjxxRyQuery) {
QueryWrapper<TbYjxxRy> queryWrapper = getQueryWrapper(tbYjxxRyQuery);
List<TbYjxxRy> records = tbYjxxRyMapper.selectList(queryWrapper);
return dataPerfact(records);
}
@Override
public int insert(TbYjxxRyVo ryVo) {
TbYjxxRy ry = new TbYjxxRy();
BeanUtils.copyProperties(ryVo, ry);
ry.setId(UUIDGenerator.getUUID());
perfectDept(ry);
saveRelevanceData(ry, ryVo, ry.getId());
return tbYjxxRyMapper.insert(ry);
}
@Override
public int update(TbYjxxRyVo ryVo) {
TbYjxxRy ry = new TbYjxxRy();
BeanUtils.copyProperties(ryVo, ry);
ry.setXtZhgxsj(new Timestamp(System.currentTimeMillis()));
deleteRelevanceData(ry.getId());
saveRelevanceData(ry, ryVo, ry.getId());
return tbYjxxRyMapper.updateById(ry);
}
@Override
public int deleteById(List<String> list) {
if (list.size() > 0) {
for (String id : list) {
deleteRelevanceData(id);
}
}
return tbYjxxRyMapper.deleteByIds(list);
}
@Override
public TbYjxxRyVo queryById(String id) {
TbYjxxRyVo ryVo = new TbYjxxRyVo();
TbYjxxRy ry = tbYjxxRyMapper.selectById(id);
BeanUtils.copyProperties(ry, ryVo);
List<TbYjxxRyBq> bqList = tbYjxxRyBqMapper.queryByYjryId(Arrays.asList(id));
List<TbYjxxRySjaj> sjajList = tbYjxxRySjajMapper.queryByYjryId(Arrays.asList((id)));
ryVo.setRybqList(bqList);
ryVo.setSjajList(sjajList);
return ryVo;
}
/**
* 获取查询条件
*
* @param yjry
* @return
*/
public QueryWrapper<TbYjxxRy> getQueryWrapper(TbYjxxRyQuery yjry) {
QueryWrapper<TbYjxxRy> queryWrapper = new QueryWrapper<>();
// UserInfo userInfo = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(queryWrapper, userInfo);
yjry.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(yjry.getSsbmdm(), null));
queryWrapper.lambda()
.eq(TbYjxxRy::getXtScbz, "0")
.eq(StringUtils.isNotBlank(yjry.getYjId()), TbYjxxRy::getYjId, yjry.getYjId())
.like(StringUtils.isNotBlank(yjry.getYjClid()), TbYjxxRy::getYjClid, yjry.getYjClid())
.likeRight(StringUtils.isNotBlank(yjry.getSsbmdm()), TbYjxxRy::getSsbmdm, yjry.getSsbmdm())
.eq(StringUtils.isNotBlank(yjry.getSjId()), TbYjxxRy::getSjId, yjry.getSjId())
.eq(StringUtils.isNotBlank(yjry.getYjSjly()), TbYjxxRy::getYjSjly, yjry.getYjSjly())
.like(StringUtils.isNotBlank(yjry.getYjGzyid()), TbYjxxRy::getYjGzyid, yjry.getYjGzyid())
.like(StringUtils.isNotBlank(yjry.getYjJb()), TbYjxxRy::getYjJb, yjry.getYjJb());
return queryWrapper;
}
/**
* 预警人员数据完善
*
* @param records
* @return
*/
public List<TbYjxxRyVo> dataPerfact(List<TbYjxxRy> records) {
List<TbYjxxRyVo> vos = new ArrayList<>();
if (!CollectionUtils.isEmpty(records)) {
List<String> ids = records.stream().map(TbYjxxRy::getId).collect(Collectors.toList());
List<TbYjxxRyBq> bqList = tbYjxxRyBqMapper.queryByYjryId(ids);
List<TbYjxxRySjaj> sjajList = tbYjxxRySjajMapper.queryByYjryId(ids);
for (TbYjxxRy record : records) {
TbYjxxRyVo vo = new TbYjxxRyVo();
BeanUtils.copyProperties(record, vo);
List<TbYjxxRyBq> bq =
bqList.stream().filter(item -> item.getYjryId().equals(record.getId())).collect(Collectors.toList());
List<TbYjxxRySjaj> sjaj =
sjajList.stream().filter(item -> item.getYjryId().equals(record.getId())).collect(Collectors.toList());
vo.setRybqList(bq);
vo.setSjajList(sjaj);
vos.add(vo);
}
}
return vos;
}
/**
* 保存关联数据
*
* @param vo
* @param ywid
*/
public void saveRelevanceData(TbYjxxRy ry, TbYjxxRyVo vo, String ywid) {
if (vo != null) {
List<TbYjxxRyBq> bqList = vo.getRybqList();
List<TbYjxxRySjaj> sjajList = vo.getSjajList();
if (!CollectionUtils.isEmpty(bqList)) {
for (TbYjxxRyBq bq : bqList) {
bq.setId(UUIDGenerator.getUUID());
bq.setYjryId(ywid);
bq.setXtSjzt("1");
bq.setXtSjly("1");
bq.setXtScbz("0");
tbYjxxRyBqMapper.insert(bq);
}
}
if (!CollectionUtils.isEmpty(sjajList)) {
for (TbYjxxRySjaj sjaj : sjajList) {
sjaj.setId(UUIDGenerator.getUUID());
sjaj.setYjryId(ywid);
sjaj.setXtSjzt("1");
sjaj.setXtSjly("1");
sjaj.setXtScbz("0");
tbYjxxRySjajMapper.insert(sjaj);
}
}
}
}
/**
* 删除关联数据
*
* @param id
*/
public void deleteRelevanceData(String id) {
tbYjxxRyBqMapper.deleteByYwid(id);
tbYjxxRySjajMapper.deleteByYwid(id);
}
/**
* 部门赋值
*
* @param zfpb
*/
public void perfectDept(TbYjxxRy zfpb) {
zfpb.setXtSjly("1");
zfpb.setXtSjzt("1");
zfpb.setXtScbz("0");
UserInfo user = UserInfoManager.get();
zfpb.setSsbm(user.getDeptName());
zfpb.setSsbmid(String.valueOf(user.getDeptId()));
zfpb.setSsbmdm(user.getDeptCode());
zfpb.setSsxgaj(user.getFxjDeptName());
zfpb.setSsxgajid(String.valueOf(user.getFxjDeptId()));
zfpb.setSsxgajdm(user.getFxjDeptCode());
zfpb.setSssgaj(user.getDszDeptName());
zfpb.setSssgajid(String.valueOf(user.getDszDeptId()));
zfpb.setSssgajdm(user.getDszDeptCode());
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,214 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.entity.yjzl.TbYjxx;
import com.mosty.base.model.entity.yjzl.TbYjxxSj;
import com.mosty.base.model.entity.yjzl.TbYjxxSjGlrycl;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.base.model.query.yjzl.TbYjxxSjQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxSjVo;
import com.mosty.yjzl.mapper.TbYjxxMapper;
import com.mosty.yjzl.mapper.TbYjxxSjGlryclMapper;
import com.mosty.yjzl.mapper.TbYjxxSjMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.TbYjxxSjService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 预警信息-事件表 服务实现类
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@AllArgsConstructor
@Service
public class TbYjxxSjServiceImpl extends ServiceImpl<TbYjxxSjMapper, TbYjxxSj>
implements TbYjxxSjService {
private final TbYjxxSjGlryclMapper tbYjxxSjGlryclMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public IPage<TbYjxxSjVo> queryByPage(TbYjxxSjQuery yjxxSj) {
IPage<TbYjxxSjVo> voIPage = new Page<>(yjxxSj.getPageCurrent(), yjxxSj.getPageSize());
IPage<TbYjxxSj> pageQuery = new Page<>(yjxxSj.getPageCurrent(), yjxxSj.getPageSize());
QueryWrapper<TbYjxxSj> queryWrapper = getQueryWrapper(yjxxSj);
IPage<TbYjxxSj> page = this.baseMapper.selectPage(pageQuery, queryWrapper);
voIPage.setTotal(page.getTotal());
List<TbYjxxSj> records = page.getRecords();
List<TbYjxxSjVo> vos = dataPerfact(records);
voIPage.setRecords(vos);
return voIPage;
}
@Override
public List<TbYjxxSjVo> queryList(TbYjxxSjQuery tbYjxxSjQuery) {
QueryWrapper<TbYjxxSj> queryWrapper = getQueryWrapper(tbYjxxSjQuery);
List<TbYjxxSj> records = this.baseMapper.selectList(queryWrapper);
List<TbYjxxSjVo> vos = dataPerfact(records);
return vos;
}
@Override
public int insert(TbYjxxSjVo sjVo) {
TbYjxxSj sj = new TbYjxxSj();
BeanUtils.copyProperties(sjVo, sj);
sj.setId(UUIDGenerator.getUUID());
perfectDept(sj);
saveRelevanceData(sj, sjVo);
return this.baseMapper.insert(sj);
}
@Override
public int update(TbYjxxSjVo sjVo) {
TbYjxxSj sj = new TbYjxxSj();
BeanUtils.copyProperties(sjVo, sj);
sj.setXtZhgxsj(new Timestamp(System.currentTimeMillis()));
tbYjxxSjGlryclMapper.deleteByYjId(sj.getId());
saveRelevanceData(sj, sjVo);
return this.baseMapper.updateById(sj);
}
@Override
public int deleteById(List<String> list) {
return this.baseMapper.deleteByIds(list);
}
@Override
public TbYjxxSjVo queryById(String id) {
TbYjxxSjVo vo = new TbYjxxSjVo();
TbYjxxSj sj = this.baseMapper.selectById(id);
BeanUtils.copyProperties(sj, vo);
List<TbYjxxSjGlrycl> glryclList = tbYjxxSjGlryclMapper.queryByYjid(Arrays.asList(id));
vo.setGlryclList(glryclList);
return vo;
}
@Override
public void addEntity(TbYjxx yjxx, String sjFl, String sjFlmc) {
TbYjxxSj sj = new TbYjxxSj();
BeanUtils.copyProperties(yjxx, sj);
sj.setId(UUIDGenerator.getUUID());
sj.setYjId(yjxx.getId());
sj.setSjFl(sjFl);
sj.setXtSjly("1");
sj.setSjFlmc(sjFlmc);
this.baseMapper.insertEntity(sj);
}
/**
* 获取查询条件
*
* @param yjsj
* @return
*/
public QueryWrapper<TbYjxxSj> getQueryWrapper(TbYjxxSjQuery yjsj) {
QueryWrapper<TbYjxxSj> queryWrapper = new QueryWrapper<>();
// UserInfo userInfo = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(queryWrapper, userInfo);
String ssbm = this.tbBaseAdaptRemoteService.getSsbm(null, null);
queryWrapper.lambda().eq(TbYjxxSj::getXtScbz, "0")
.eq(StringUtils.isNotBlank(yjsj.getYjId()), TbYjxxSj::getYjId, yjsj.getYjId())
.like(StringUtils.isNotBlank(yjsj.getYjGzyid()), TbYjxxSj::getYjGzyid, yjsj.getYjGzyid())
.likeRight(StringUtils.isNotBlank(ssbm), TbYjxxSj::getSsbmdm, ssbm)
.eq(StringUtils.isNotBlank(yjsj.getSjFl()), TbYjxxSj::getSjFl, yjsj.getSjFl())
.eq(StringUtils.isNotBlank(yjsj.getYjJb()), TbYjxxSj::getYjJb, yjsj.getYjJb());
// if (yjsj.getYjsksj() != null && yjsj.getYjsksj() == null) {
// queryWrapper.lambda().ge(TbYjxxSj::getYjSj, yjsj.getYjsksj());
// }
// if (yjsj.getYjsksj() == null && yjsj.getYjsksj() != null) {
// queryWrapper.lambda().le(TbYjxxSj::getYjSj, yjsj.getYjsksj());
// }
if (yjsj.getYjsksj() != null && yjsj.getYjsksj() != null) {
queryWrapper.lambda().between(TbYjxxSj::getYjSj, yjsj.getYjsksj(), yjsj.getYjsksj());
}
return queryWrapper;
}
/**
* 预警人员数据完善
*
* @param records
* @return
*/
public List<TbYjxxSjVo> dataPerfact(List<TbYjxxSj> records) {
List<TbYjxxSjVo> vos = new ArrayList<>();
if (!CollectionUtils.isEmpty(records)) {
List<String> ids = records.stream().map(TbYjxxSj::getId).collect(Collectors.toList());
List<TbYjxxSjGlrycl> bqList = tbYjxxSjGlryclMapper.queryByYjid(ids);
for (TbYjxxSj record : records) {
TbYjxxSjVo vo = new TbYjxxSjVo();
BeanUtils.copyProperties(record, vo);
List<TbYjxxSjGlrycl> yjczjl =
bqList.stream().filter(item -> item.getYjId().equals(record.getId())).collect(Collectors.toList());
vo.setGlryclList(yjczjl);
vos.add(vo);
}
}
return vos;
}
/**
* 部门赋值
*
* @param zfpb
*/
public void perfectDept(TbYjxxSj zfpb) {
zfpb.setXtSjly("1");
zfpb.setXtSjzt("1");
zfpb.setXtScbz("0");
UserInfo user = UserInfoManager.get();
zfpb.setSsbm(user.getDeptName());
zfpb.setSsbmid(String.valueOf(user.getDeptId()));
zfpb.setSsbmdm(user.getDeptCode());
zfpb.setSsxgaj(user.getFxjDeptName());
zfpb.setSsxgajid(String.valueOf(user.getFxjDeptId()));
zfpb.setSsxgajdm(user.getFxjDeptCode());
zfpb.setSssgaj(user.getDszDeptName());
zfpb.setSssgajid(String.valueOf(user.getDszDeptId()));
zfpb.setSssgajdm(user.getDszDeptCode());
}
/**
* 保存关联数据
*
* @param ry
* @param vo
*/
public void saveRelevanceData(TbYjxxSj ry, TbYjxxSjVo vo) {
if (vo != null) {
List<TbYjxxSjGlrycl> sjList = vo.getGlryclList();
if (!CollectionUtils.isEmpty(sjList)) {
for (TbYjxxSjGlrycl sj : sjList) {
sj.setId(UUIDGenerator.getUUID());
sj.setYjId(ry.getYjId());
sj.setYjryclId(ry.getId());
sj.setXtSjzt("1");
sj.setXtSjly("1");
sj.setXtScbz("0");
tbYjxxSjGlryclMapper.insert(sj);
}
}
}
}
}

View File

@ -0,0 +1,168 @@
package com.mosty.yjzl.service.Impl;
import com.mosty.base.model.vo.yjzl.TbYjzlZqtjVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjphVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjxxVo;
import com.mosty.base.model.vo.yjzl.TbYzzlDjtjVo;
import com.mosty.base.utils.DateUtils;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.yjzl.mapper.TbYjzltjMapper;
import com.mosty.yjzl.mapper.TbZlxxMapper;
import com.mosty.yjzl.service.TbYjxxSjService;
import com.mosty.yjzl.service.TbYjzltjService;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class TbYjzltjServiceImpl implements TbYjzltjService {
private TbYjzltjMapper tbYjzltjMapper;
@Override
public List<TbYjzltjxxVo> rwzttjxx() {
UserInfo user = UserInfoManager.get();
Map<String, Object> map = new HashMap<>();
map.put("sfz", user.getIdEntityCard());
map.put("ssbmid", String.valueOf(user.getDeptId()));
return tbYjzltjMapper.rwzttjxx(map);
}
@Override
public List<TbYjzltjphVo> rwphtjxx(String type) {
String kssj = "", jssj = "";
if ("1".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("2".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -7), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("3".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -30), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("4".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -90), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
}
return tbYjzltjMapper.rwphtjxx(kssj, jssj);
}
@Override
public Map<String, Object> zlZqtjxx(String type) {
Map<String, Object> map = new HashMap<>();
List<String> timeList = new ArrayList<>();
List<Map<String, Object>> resList;
if ("1".equals(type)) {
String t = DateUtils.getQueryDateString(new Date(), "01") + " ";
String m = ":00:00";
String s = ":59:59";
timeList.add(t + "23" + s);
timeList.add(t + "20" + m);
timeList.add(t + "16" + m);
timeList.add(t + "12" + m);
timeList.add(t + "08" + m);
timeList.add(t + "04" + m);
timeList.add(t + "00" + m);
} else if ("2".equals(type)) {
for (int i = 0; i < 7; i++) {
timeList.add(DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "D", -i), "01"));
}
} else if ("3".equals(type)) {
for (int i = 0; i < 7; i++) {
timeList.add(DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "D", -i * 6), "01"));
}
} else if ("4".equals(type)) {
for (int i = 0; i < 7; i++) {
timeList.add(DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "D", -i * 9), "01"));
}
}
Integer[] data1 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data2 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data3 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data4 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data5 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data6 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data7 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Integer[] data8 = new Integer[]{0, 0, 0, 0, 0, 0, 0};
Collections.reverse(timeList);
for (int i = 0; i < timeList.size() - 1; i++) {
Map<String, Object> mp = new HashMap();
if ("1".equals(type)) {
mp.put("kssj", timeList.get(i));
mp.put("jssj", timeList.get(i + 1));
} else {
mp.put("start", timeList.get(i));
mp.put("end", timeList.get(i + 1));
}
resList = this.tbYjzltjMapper.zlZqtjxx(mp);
for (int j = 0; j < resList.size(); j++) {
Map<String, Object> item = resList.get(j);
String zllx = item.get("zllx").toString();
if ("01".equals(zllx)) {
data1[j] = Integer.parseInt(item.get("count") + "");
} else if ("02".equals(zllx)) {
data2[j] = Integer.parseInt(item.get("count") + "");
} else if ("03".equals(zllx)) {
data3[j] = Integer.parseInt(item.get("count") + "");
} else if ("04".equals(zllx)) {
data4[j] = Integer.parseInt(item.get("count") + "");
} else if ("05".equals(zllx)) {
data5[j] = Integer.parseInt(item.get("count") + "");
} else if ("06".equals(zllx)) {
data6[j] = Integer.parseInt(item.get("count") + "");
} else if ("07".equals(zllx)) {
data7[j] = Integer.parseInt(item.get("count") + "");
} else if ("08".equals(zllx)) {
data8[j] = Integer.parseInt(item.get("count") + "");
}
}
}
timeList = timeList.stream().map(item -> {
if ("1".equals(type)) {
return DateUtils.getQueryDateString(DateUtils.strToDate(item, "02"), "16");
} else {
return DateUtils.getQueryDateString(DateUtils.strToDate(item, "01"), "18");
}
}).collect(Collectors.toList());
map.put("time", timeList);
map.put("data1", data1);
map.put("data2", data2);
map.put("data3", data3);
map.put("data4", data4);
map.put("data5", data5);
map.put("data6", data6);
map.put("data7", data7);
map.put("data8", data8);
return map;
}
@Override
public List<TbYzzlDjtjVo> zlDjtjxx(String type) {
String kssj = "", jssj = "";
if ("1".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("2".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -7), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("3".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -30), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
} else if ("4".equals(type)) {
kssj = com.mosty.base.utils.DateUtils.getQueryDateString(com.mosty.base.utils.DateUtils.getNextDate(new Date(), "D", -90), "01");
jssj = com.mosty.base.utils.DateUtils.getQueryDateString(new Date(), "01");
}
Map<String, Object> map = new HashMap();
map.put("kssj", kssj);
map.put("jssj", jssj);
return tbYjzltjMapper.zlDjtjxx(map);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,360 @@
package com.mosty.yjzl.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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.dto.jcgl.TbJcglXfllVo;
import com.mosty.base.model.dto.qwzx.TbQwXfbbVo;
import com.mosty.base.model.dto.yjzl.CyjlSearchDto;
import com.mosty.base.model.dto.yjzl.MyZlSearchDto;
import com.mosty.base.model.dto.yjzl.NewZxjlSearchDto;
import com.mosty.base.model.dto.yjzl.third.ThirdMyZlSearchDto;
import com.mosty.base.model.dto.yjzl.third.ThirdZlInfoSearchDto;
import com.mosty.base.model.query.jcgl.TbJcglXfllQueryAllDto;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.model.vo.yjzl.TbZlxxInfoVo;
import com.mosty.base.model.vo.yjzl.TbZlxxVo;
import com.mosty.base.model.vo.yjzl.TbZlxxZxjlVo;
import com.mosty.base.model.vo.yjzl.TbZlxxZxrVo;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.common.core.business.entity.SysUser;
import com.mosty.common.core.business.entity.vo.SysUserVO;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.base.model.entity.yjzl.TbZlxx;
import com.mosty.base.model.entity.yjzl.TbZlxxZxjl;
import com.mosty.base.model.entity.yjzl.TbZlxxZxr;
import com.mosty.base.model.query.yjzl.TbZlxxZxjlQuery;
import com.mosty.yjzl.mapper.TbZlxxMapper;
import com.mosty.yjzl.mapper.TbZlxxZxjlMapper;
import com.mosty.yjzl.mapper.TbZlxxZxrMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.remote.TbJcglAdaptRemoteService;
import com.mosty.yjzl.remote.TbQwzxAdaptRemoteService;
import com.mosty.yjzl.service.TbZlxxZxjlService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
* 指令-执行过程表 服务实现类
* </p>
*
* @author zengbo
* @since 2022-07-19
*/
@AllArgsConstructor
@Service
public class TbZlxxZxjlServiceImpl extends ServiceImpl<TbZlxxZxjlMapper, TbZlxxZxjl> implements TbZlxxZxjlService {
private final TbZlxxZxrMapper tbZlxxZxrMapper;
private final TbZlxxMapper tbZlxxMapper;
private final TbZlxxZxjlMapper tbZlxxZxjlMapper;
private final TbJcglAdaptRemoteService tbJcglAdaptRemoteService;
private final TbQwzxAdaptRemoteService tbQwzxAdaptRemoteService;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public List<TbZlxxZxjl> queryList(TbZlxxZxjlQuery zxjl) {
QueryWrapper<TbZlxxZxjl> queryWrapper = new QueryWrapper<>();
// UserInfo userInfo = UserInfoManager.get();
// PermissionsUtil.queryWrapperUtil(queryWrapper, userInfo);
zxjl.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(zxjl.getSsbmdm(), null));
queryWrapper.lambda().eq(TbZlxxZxjl::getXtScbz, "0")
.eq(StringUtils.isNotBlank(zxjl.getZlId()), TbZlxxZxjl::getZlId, zxjl.getZlId())
.likeRight(StringUtils.isNotBlank(zxjl.getSsbmdm()), TbZlxxZxjl::getSsbmdm, zxjl.getSsbmdm())
.like(StringUtils.isNotBlank(zxjl.getZlzxzt()), TbZlxxZxjl::getZlzxzt, zxjl.getZlzxzt());
return this.baseMapper.selectList(queryWrapper);
}
@Override
public int insert(TbZlxxZxjl zxjl) {
zxjl.setId(UUIDGenerator.getUUID());
zxjl.setXtSjly("2");
UserInfo user = UserInfoManager.get();
zxjl.setSsbm(user.getDeptName());
zxjl.setSsbmid(String.valueOf(user.getDeptId()));
zxjl.setSsbmdm(user.getDeptCode());
zxjl.setSsxgaj(user.getFxjDeptName());
zxjl.setSsxgajid(String.valueOf(user.getFxjDeptId()));
zxjl.setSsxgajdm(user.getFxjDeptCode());
zxjl.setSssgaj(user.getDszDeptName());
zxjl.setSssgajid(String.valueOf(user.getDszDeptId()));
zxjl.setSssgajdm(user.getDszDeptCode());
return this.baseMapper.insert(zxjl);
}
@Override
public int update(TbZlxxZxjl zxjl) {
zxjl.setXtZhgxsj(new Timestamp(System.currentTimeMillis()));
return this.baseMapper.updateById(zxjl);
}
@Override
public int deleteById(List<String> list) {
return this.baseMapper.deleteZxjl(list);
}
@Override
public List<Map<String, Object>> getCyjlList(CyjlSearchDto dto) {
List<TbZlxx> zlList = this.tbZlxxMapper.selectList(
new LambdaQueryWrapper<TbZlxx>()
.eq(TbZlxx::getYwId, dto.getSjid())
);
if (CollectionUtils.isEmpty(zlList)) return null;
List<String> zlidList = zlList.stream().map(TbZlxx::getId).collect(Collectors.toList());
List<TbZlxxZxr> zxrList = this.tbZlxxZxrMapper.selectList(new LambdaQueryWrapper<TbZlxxZxr>().in(TbZlxxZxr::getZlId, zlidList));
List<Map<String, Object>> list = new ArrayList<>();
zxrList.forEach(item -> {
if ("01".equals(item.getZxrLx())) {
List<Map<String, Object>> tempList = list.stream().filter(it -> it.get("sfz").equals(item.getZxrSfz())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(tempList)) {
Map<String, Object> map = new HashMap<>();
map.put("xm", item.getZxrXm());
map.put("sfz", item.getZxrSfz());
map.put("dh", item.getZxrDh());
map.put("ssbm", item.getSsbm());
map.put("fl", item.getZxrJllx());
list.add(map);
}
} else if ("02".equals(item.getZxrLx())) {
// 查询该部门下的所有的巡防力量
TbJcglXfllQueryAllDto queryAllDto = new TbJcglXfllQueryAllDto();
queryAllDto.setDeptid(item.getSsbmid());
List<TbJcglXfllVo> llList = this.tbJcglAdaptRemoteService.getXfll(queryAllDto);
llList.forEach(ll -> {
List<Map<String, Object>> tempList = list.stream().filter(it -> it.get("sfz").equals(ll.getSfzh())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(tempList)) {
Map<String, Object> map = new HashMap<>();
map.put("xm", ll.getXm());
map.put("sfz", ll.getSfzh());
map.put("dh", ll.getLxdh());
map.put("ssbm", ll.getSsbm());
map.put("fl", ll.getFl());
list.add(map);
}
});
} else if ("03".equals(item.getZxrLx())) {
// 查询巡组信息
TbQwXfbbVo bb = this.tbQwzxAdaptRemoteService.getBbInfo(item.getZxrXzid());
if (bb != null) {
List<Map<String, Object>> tempList = list.stream().filter(it -> it.get("sfz").equals(bb.getFzrSfzh())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(tempList)) {
Map<String, Object> map = new HashMap<>();
map.put("xm", bb.getFzrXm());
map.put("sfz", bb.getFzrSfzh());
map.put("dh", bb.getFzrLxdh());
map.put("ssbm", bb.getSsbm());
map.put("fl", "01");
list.add(map);
}
if (!CollectionUtils.isEmpty(bb.getJlList())) {
bb.getJlList().forEach(jl -> {
if (jl != null && jl.getSfzh() != null) {
List<Map<String, Object>> jlTempList = list.stream().filter(it -> it.get("sfz").equals(jl.getSfzh())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(jlTempList)) {
Map<String, Object> map = new HashMap<>();
map.put("xm", jl.getJlxm());
map.put("sfz", jl.getSfzh());
map.put("dh", jl.getLxdh());
map.put("ssbm", jl.getSsbm());
map.put("fl", jl.getJllx());
list.add(map);
}
}
});
}
}
}
});
return list;
}
@Override
public List<TbQwXfbbVo> getXczbList(String sjid) {
List<TbZlxx> zlList = this.tbZlxxMapper.selectList(new LambdaQueryWrapper<TbZlxx>().eq(TbZlxx::getYwId, sjid));
if (CollectionUtils.isEmpty(zlList)) {
return null;
}
List<String> zlidList = zlList.stream().map(TbZlxx::getId).collect(Collectors.toList());
List<TbZlxxZxr> zxrList = this.tbZlxxZxrMapper.selectList(new LambdaQueryWrapper<TbZlxxZxr>().in(TbZlxxZxr::getZlId, zlidList));
List<TbQwXfbbVo> list = new ArrayList<>();
for (TbZlxxZxr item : zxrList) {
if ("03".equals(item.getZxrLx())) {
TbQwXfbbVo bb = this.tbQwzxAdaptRemoteService.getBbInfo(item.getZxrXzid());
if (bb != null) {
List<TbQwXfbbVo> temp = list.stream().filter(it -> it.getId().equals(bb.getId())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(temp)) {
list.add(bb);
}
}
}
}
return list;
}
@Override
public List<Map<String, Object>> getMyZlCount() {
UserInfo user = UserInfoManager.get();
if (user == null) {
return null;
}
Map<String, Object> mp = new HashMap<>();
mp.put("sfz", user.getIdEntityCard());
mp.put("ssbmid", String.valueOf(user.getDeptId()));
return this.tbZlxxMapper.getMyZlCount(mp);
}
@Override
public IPage<TbZlxxZxrVo> getMyZlList(MyZlSearchDto dto) {
if (StringUtils.isNotBlank(dto.getKssj())) {
dto.setKssj(dto.getKssj() + " 00:00:00");
}
if (StringUtils.isNotBlank(dto.getJssj())) {
dto.setJssj(dto.getJssj() + " 23:59:59");
}
UserInfo user = UserInfoManager.get();
if (user == null) return null;
Map<String, Object> mp = new HashMap<>();
mp.put("sfz", user.getIdEntityCard());
mp.put("ssbmid", String.valueOf(user.getDeptId()));
List<String> ztList = new ArrayList<>();
List<String> lxList = new ArrayList<>();
if (StringUtils.isNotBlank(dto.getZlzxzt())) {
ztList = Arrays.asList(dto.getZlzxzt().split(","));
}
if (StringUtils.isNotBlank(dto.getZllx())) {
lxList = Arrays.asList(dto.getZllx().split(","));
}
mp.put("ztList", ztList);
mp.put("zlnr", dto.getZlnr());
mp.put("lxList", lxList);
mp.put("kssj", dto.getKssj());
mp.put("jssj", dto.getJssj());
mp.put("pageIndex", (dto.getPageCurrent() - 1) * dto.getPageSize());
mp.put("pageSize", dto.getPageSize());
int count = this.tbZlxxMapper.getMyZlCountBy(mp);
List<TbZlxxZxrVo> rList = this.tbZlxxMapper.getMyZlList(mp);
IPage<TbZlxxZxrVo> page = new Page<>(dto.getPageCurrent(), dto.getPageSize());
page.setTotal(count);
page.setRecords(rList);
return page;
}
@Override
public List<TbZlxxZxjlVo> getNewZxjl(NewZxjlSearchDto dto) {
List<TbZlxxZxjl> jlList = this.tbZlxxZxjlMapper.selectList(
new LambdaQueryWrapper<TbZlxxZxjl>()
.eq(TbZlxxZxjl::getZlId, dto.getZlid())
.gt(StringUtils.isNotBlank(dto.getTime()), TbZlxxZxjl::getZxsj, dto.getTime())
.orderByAsc(TbZlxxZxjl::getZxsj)
.orderByDesc(TbZlxxZxjl::getFjid)
);
List<TbZlxxZxjlVo> voList = new ArrayList<>();
jlList.forEach(item -> {
TbZlxxZxjlVo vo = new TbZlxxZxjlVo();
BeanUtils.copyProperties(item, vo);
voList.add(vo);
});
return voList;
}
@Override
public List<Map<String, Object>> getStatistics(String sfzh) {
SysUser user = this.tbBaseAdaptRemoteService.getUserInfoBySfzh(sfzh);
if (user == null) {
throw new BusinessException("用户不存在!");
}
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getDeptInfoByUserId(String.valueOf(user.getId()));
if (dept == null) {
throw new BusinessException("用户未分配任何部门!");
}
Map<String, Object> mp = new HashMap<>();
mp.put("sfz", user.getIdEntityCard());
mp.put("ssbmid", String.valueOf(dept.getDeptid()));
return this.tbZlxxMapper.getStatistics(mp);
}
@Override
public IPage<TbZlxxZxrVo> getPageList(ThirdMyZlSearchDto dto) {
if (StringUtils.isBlank(dto.getSfzh())) {
throw new BusinessException("身份证号不能为空");
}
SysUser user = this.tbBaseAdaptRemoteService.getUserInfoBySfzh(dto.getSfzh());
if (user == null) {
throw new BusinessException("用户不存在!");
}
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getDeptInfoByUserId(String.valueOf(user.getId()));
if (dept == null) {
throw new BusinessException("用户未分配任何部门!");
}
if (StringUtils.isNotBlank(dto.getKssj())) {
dto.setKssj(dto.getKssj() + " 00:00:00");
}
if (StringUtils.isNotBlank(dto.getJssj())) {
dto.setJssj(dto.getJssj() + " 23:59:59");
}
Map<String, Object> mp = new HashMap<>();
mp.put("sfz", user.getIdEntityCard());
mp.put("ssbmid", String.valueOf(dept.getDeptid()));
List<String> ztList = new ArrayList<>();
if (StringUtils.isNotBlank(dto.getZlzxzt())) {
ztList = Arrays.asList(dto.getZlzxzt().split(","));
}
List<String> lxList = new ArrayList<>();
if (StringUtils.isNotBlank(dto.getZllx())) {
lxList = Arrays.asList(dto.getZllx().split(","));
}
mp.put("ztList", ztList);
mp.put("zlnr", dto.getZlnr());
mp.put("lxList", lxList);
mp.put("kssj", dto.getKssj());
mp.put("jssj", dto.getJssj());
mp.put("pageIndex", (dto.getPageCurrent() - 1) * dto.getPageSize());
mp.put("pageSize", dto.getPageSize());
mp.put("time", dto.getTime());
int count = this.tbZlxxMapper.getMyZlCountBy(mp);
List<TbZlxxZxrVo> rList = this.tbZlxxMapper.getMyZlList(mp);
IPage<TbZlxxZxrVo> page = new Page<>(dto.getPageCurrent(), dto.getPageSize());
page.setTotal(count);
page.setRecords(rList);
return page;
}
@Override
public TbZlxxInfoVo getInfo(ThirdZlInfoSearchDto dto) {
if (StringUtils.isBlank(dto.getSfzh())) {
throw new BusinessException("身份证号不能为空");
}
SysUser user = this.tbBaseAdaptRemoteService.getUserInfoBySfzh(dto.getSfzh());
if (user == null) {
throw new BusinessException("用户不存在!");
}
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getDeptInfoByUserId(String.valueOf(user.getId()));
if (dept == null) {
throw new BusinessException("用户未分配任何部门!");
}
TbZlxx zlxx = this.tbZlxxMapper.selectById(dto.getZlid());
TbZlxxInfoVo vo = new TbZlxxInfoVo();
BeanUtils.copyProperties(zlxx, vo);
TbZlxxZxr zxr = this.tbZlxxMapper.selectZxr(dto.getZlid(), dept.getDeptid(), user.getIdEntityCard());
if (zxr != null) {
TbZlxxZxrVo zxrVo = new TbZlxxZxrVo();
BeanUtils.copyProperties(zxr, zxrVo);
vo.setZxrVo(zxrVo);
}
return vo;
}
}

View File

@ -0,0 +1,382 @@
package com.mosty.yjzl.service.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.dto.jcgl.TbJcglXfqyDto;
import com.mosty.base.model.dto.yjzl.TbZlxxInsertDto;
import com.mosty.base.model.dto.yjzl.TbZlxxZxrDtoInsertDto;
import com.mosty.base.model.entity.qwzx.TbQwXfbb;
import com.mosty.base.model.entity.sjzx.TbJq;
import com.mosty.base.model.entity.yjzl.*;
import com.mosty.base.model.query.yjzl.TbZxzbQuery;
import com.mosty.base.model.vo.base.DeptInfoVo;
import com.mosty.base.utils.Constant;
import com.mosty.base.utils.DateUtils;
import com.mosty.base.utils.Kit;
import com.mosty.base.utils.UUIDGenerator;
import com.mosty.common.redis.service.RedisService;
import com.mosty.yjzl.cluster.DistanceRunnable;
import com.mosty.yjzl.cluster.NeighborDTO;
import com.mosty.yjzl.cluster.WGS84Point;
import com.mosty.yjzl.mapper.*;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.remote.TbJcglAdaptRemoteService;
import com.mosty.yjzl.remote.TbQwzxAdaptRemoteService;
import com.mosty.yjzl.service.TbZlxxService;
import com.mosty.yjzl.service.TbZxzbService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.locationtech.jts.geom.Coordinate;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.stream.Collectors;
/**
* 中心坐标服务器
*/
@Service
@AllArgsConstructor
public class TbZxzbServiceImpl extends ServiceImpl<TbZxzbMapper, TbZxzb>
implements TbZxzbService {
private final TbYjxxMapper tbYjxxMapper;
private final TbFzycMapper tbFzycMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
private final TbJcglAdaptRemoteService tbJcglAdaptRemoteService;
private final TbFzycJsdxMapper tbFzycJsdxMapper;
private final TbQwzxAdaptRemoteService tbQwzxAdaptRemoteService;
private final TbZlxxService tbZlxxService;
private final TbFzycXfxzMapper tbFzycXfxzMapper;
private final RedisService redisService;
@Override
public IPage<TbZxzb> queryListPage(TbZxzbQuery zxzbQuery) {
IPage<TbZxzb> page = this.baseMapper.selectPage(
new Page<>(zxzbQuery.getPageNum(), zxzbQuery.getPageSize()),
new LambdaQueryWrapper<TbZxzb>()
.eq(TbZxzb::getZblx, zxzbQuery.getZblx())
.eq(StringUtils.isNotBlank(zxzbQuery.getZbrq()), TbZxzb::getZbrq, zxzbQuery.getZbrq())
.orderByDesc(TbZxzb::getZxdsl)
);
return page;
}
@Override
public List<TbZxzb> queryList(TbZxzbQuery zxzbQuery) {
List<TbZxzb> list = this.baseMapper.selectList(
new LambdaQueryWrapper<TbZxzb>()
.eq(TbZxzb::getZblx, zxzbQuery.getZblx())
.eq(StringUtils.isNotBlank(zxzbQuery.getZbrq()), TbZxzb::getZbrq, zxzbQuery.getZbrq())
.orderByDesc(TbZxzb::getZxdsl)
);
return list;
}
@Override
public void computeCenter(String startTime, String endTime) {
if (StringUtils.isEmpty(endTime)) {
endTime = DateUtils.getHDateString();
}
if (StringUtils.isEmpty(startTime)) {
String queryDateString = DateUtils.getQueryDateString(new Date(), "16");
if (queryDateString.equals("09")) {
startTime = DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "H", -8), "02");
} else {
startTime = DateUtils.getQueryDateString(DateUtils.getNextDate(new Date(), "H", -4), "02");
}
}
// int xldw = 1;//默认相邻点位10
// String xldws = tbBaseAdaptRemoteService.getValue("ZXZB_XLDWSL");
// if (StringUtils.isNotBlank(xldws)) {
// //有配置取配置相邻点位
// xldw = Integer.valueOf(xldws);
// }
//用于定位本地获取方块区域
String uuid = UUIDGenerator.getUUID();
List<TbJq> jqList = this.tbYjxxMapper.queryJq(startTime, endTime);
Set<WGS84Point> points = new HashSet<>();
if (!CollectionUtils.isEmpty(jqList)) {
for (TbJq jq : jqList) {
if (jq.getJd() != null && jq.getWd() != null) {
points.add(new WGS84Point(jq.getWd().doubleValue(), jq.getJd().doubleValue(), jq.getSsbmdm()));
}
}
}
if (points.size() > 0) {
this.baseMapper.deleteAll("01");
ScheduledExecutorService threadPool = Executors.newScheduledThreadPool(100);
List<NeighborDTO> neighborList = Collections.synchronizedList(new ArrayList<>(30000));
// int counter = 0;
for (WGS84Point point : points) {
// 计算每个点一定范围内所有点坐标
threadPool.execute(new DistanceRunnable(point, points, neighborList, 1000));
// System.out.println(++counter);
}
// 等待线程池执行完毕
while (neighborList.size() != points.size()) {
System.out.println(neighborList.size());
}
threadPool.shutdown();
// 排序
Collections.sort(neighborList);
// 筛选
Map<WGS84Point, Long> map = new HashMap<>();
Iterator<NeighborDTO> it = neighborList.iterator();
while (it.hasNext()) {
NeighborDTO neighborDTO = (NeighborDTO) it.next();
Map<WGS84Point, Long> neighbors = neighborDTO.getNeighbors();
if (map.containsKey(neighborDTO.getPoint())) {
it.remove();
}
map.putAll(neighbors);
}
if (!CollectionUtils.isEmpty(neighborList)) {
//查询所有巡防区
List<TbJcglXfqyDto> listXfqyAll = this.tbJcglAdaptRemoteService.getListXfqyAll();
Map<String, List<TbFzycJsdx>> xqMap = new HashMap<>();
//查询最后一条数据的的标示
TbFzyc fzyc1 = this.tbFzycMapper.selectOne(new LambdaQueryWrapper<TbFzyc>().orderByDesc(TbFzyc::getXtCjsj).last(" limit 1"));
if (ObjectUtils.isNotEmpty(fzyc1)) {
String dwId = fzyc1.getDwId();
if (StringUtils.isNotEmpty(dwId)) {
List<TbFzycJsdx> tbFzycJsdxes = this.tbFzycJsdxMapper.selectList(new LambdaQueryWrapper<TbFzycJsdx>().eq(TbFzycJsdx::getDwId, dwId).isNotNull(TbFzycJsdx::getXfqId));
if (ObjectUtils.isNotEmpty(tbFzycJsdxes)) {
xqMap = tbFzycJsdxes.stream().filter(s -> StringUtils.isNotEmpty(s.getXfqId())).collect(Collectors.groupingBy(TbFzycJsdx::getXfqId));
}
}
}
List<TbFzyc> fzycList = new ArrayList<>();
// 业务操作
for (NeighborDTO neighborDTO : neighborList) {
WGS84Point point = neighborDTO.getPoint();
Map<WGS84Point, Long> neighbors = neighborDTO.getNeighbors();
int size = neighbors.size() + 1;
//半径
Map<String, double[]> mapPoint = returnLLSquarePoint(point.getLongitude(), point.getLatitude(), 150);
double[] leftTopPoint = mapPoint.get("leftTopPoint");
double[] rightBottomPoint = mapPoint.get("rightBottomPoint");
BigDecimal x1 = BigDecimal.valueOf(leftTopPoint[1]);
BigDecimal y1 = BigDecimal.valueOf(leftTopPoint[0]);
BigDecimal x2 = BigDecimal.valueOf(rightBottomPoint[1]);
BigDecimal y2 = BigDecimal.valueOf(rightBottomPoint[0]);
TbFzyc fzyc = new TbFzyc();
fzyc.setId(UUIDGenerator.getUUID());
fzyc.setRealDate(endTime.substring(0, 10));
fzyc.setX1(x1);
fzyc.setY1(y1);
fzyc.setX2(x2);
fzyc.setY2(y2);
fzyc.setGridType("300");
fzyc.setProb(BigDecimal.valueOf(size));
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(point.getSsbmdm());
if (ObjectUtils.isNotEmpty(dept)) {
fzyc.setSsbm(dept.getDeptname());
fzyc.setSsbmid(dept.getDeptid());
fzyc.setSsbmdm(dept.getDeptcode());
fzyc.setSsxgajdm(dept.getFxjcode());
fzyc.setSsxgajid(dept.getFxjid());
fzyc.setSsxgaj(dept.getFxjname());
fzyc.setSssgaj(dept.getDszname());
fzyc.setSssgajdm(dept.getDszcode());
fzyc.setSssgajid(dept.getDszid());
} else {
fzyc.setSsbm("四川省德阳市公安局");
fzyc.setSsbmid("44015");
fzyc.setSsbmdm("510600000000");
fzyc.setSsxgajdm("510600000000");
fzyc.setSsxgajid("44015");
fzyc.setSsxgaj("四川省德阳市公安局");
fzyc.setSssgaj("四川省德阳市公安局");
fzyc.setSssgajdm("510600000000");
fzyc.setSssgajid("44015");
}
fzyc.setXtSjzt("1");
fzyc.setXtScbz("0");
fzyc.setXtCjsj(new Timestamp(System.currentTimeMillis()));
BigDecimal X = x1.add(x2.subtract(x1).divide(new BigDecimal(2)));
BigDecimal Y = y1.add(y2.subtract(y1).divide(new BigDecimal(2)));
fzyc.setZxX(X);
fzyc.setZxY(Y);
fzyc.setDwId(uuid);
fzyc.setBc(startTime.substring(11, 13) + "-" + endTime.substring(11, 13));
// //根据点位计算在那个巡区上
// Set<String> xfq = new HashSet<>();
if (!CollectionUtils.isEmpty(listXfqyAll)) {
int cs = 0;
for (TbJcglXfqyDto dto : listXfqyAll) {
//特警大队 机动一 二 三不生成方块
if (!dto.getSsbmdm().equals("510700440300") && !dto.getSsbmdm().equals("510700440400") && !dto.getSsbmdm().equals("510700440500") && !dto.getSsbmdm().equals("510700440600")) {
Coordinate[] coordinates = new Coordinate[dto.getPgis().size()];
for (int i = 0; i < dto.getPgis().size(); i++) {
BigDecimal[] jwd = dto.getPgis().get(i);
Coordinate coor = new Coordinate();
coor.x = jwd[0].doubleValue();
coor.y = jwd[1].doubleValue();
coordinates[i] = coor;
}
boolean s = Kit.isInGeometry(coordinates, X + "," + Y);
if (s) {
TbFzycJsdx tbFzycJsdx = new TbFzycJsdx();
BeanUtils.copyProperties(dto, tbFzycJsdx);
tbFzycJsdx.setId(UUIDGenerator.getUUID());
tbFzycJsdx.setFzycId(fzyc.getId());
tbFzycJsdx.setXfqId(dto.getId());
tbFzycJsdx.setXfqMc(dto.getXfqMc());
tbFzycJsdx.setDwId(uuid);
cs += tbFzycJsdxMapper.insert(tbFzycJsdx);
//本地区域已经有数据 删除上次区域数据
xqMap.remove(dto.getId());
//下发指令
List<TbQwXfbb> xfbbs = this.tbQwzxAdaptRemoteService.getBbidByXq(dto.getId());
for (TbQwXfbb bb : xfbbs) {
TbZlxxInsertDto zldto = new TbZlxxInsertDto();
zldto.setYwId(fzyc.getId());
zldto.setZllx("09");
zldto.setZlly("09");
zldto.setZlzxlx("1");
zldto.setZlbt("犯罪预测");
zldto.setZlnr("次区域内发生" + size + "起警情,请加强巡逻");
zldto.setZldj("40");
zldto.setZljsdx("03");
zldto.setJd(X);
zldto.setWd(Y);
zldto.setZlfsddxzqh(fzyc.getSsbmdm().substring(0, 6));
zldto.setZljsrs(1);
zldto.setSsbmid(bb.getSsbmid());
zldto.setSsbmdm(bb.getSsbmdm());
zldto.setSsbm(bb.getSsbm());
zldto.setSsbm(bb.getSsbm());
zldto.setZlxflx("4");
List<TbZlxxZxrDtoInsertDto> zxrDtoList = new ArrayList<>();
TbZlxxZxrDtoInsertDto zxr = new TbZlxxZxrDtoInsertDto();
zxr.setZxrLx("03").setZxrXzid(bb.getId()).setZxrXzmc(bb.getJzMc());
zxrDtoList.add(zxr);
zldto.setZxrDtoList(zxrDtoList);
String zlid = tbZlxxService.addZl(zldto);
TbFzycXfxz xfxz = new TbFzycXfxz();
BeanUtils.copyProperties(tbFzycJsdx, xfxz);
xfxz.setId(UUIDGenerator.getUUID());
xfxz.setBbId(bb.getId());
xfxz.setZlId(zlid);
xfxz.setSfqs("0");
String xzmc = bb.getJzMc();
if (StringUtils.isEmpty(xzmc)) {
xzmc = bb.getFzrXm() + "警组";
}
xfxz.setXzmc(xzmc);
this.tbFzycXfxzMapper.insert(xfxz);
}
}
}
}
if (cs > 0) {
fzycList.add(fzyc);
this.tbFzycMapper.insert(fzyc);
//查询警情部门是否添加
int jsc = this.tbFzycJsdxMapper.selectCount(new LambdaQueryWrapper<TbFzycJsdx>()
.eq(TbFzycJsdx::getFzycId, fzyc.getId())
.eq(TbFzycJsdx::getSsbmdm, point.getSsbmdm())
);
if (jsc < 1) {
//不管有没有都存到到对象里面
TbFzycJsdx tbFzycJsdx = new TbFzycJsdx();
BeanUtils.copyProperties(fzyc, tbFzycJsdx);
tbFzycJsdx.setId(UUIDGenerator.getUUID());
tbFzycJsdx.setFzycId(fzyc.getId());
tbFzycJsdx.setDwId(uuid);
tbFzycJsdxMapper.insert(tbFzycJsdx);
}
}
}
}
//上次存在的区域 本次没有定位
if (ObjectUtils.isNotEmpty(xqMap)) {
List<TbFzycJsdx> jsdxList = new ArrayList<>();
for (String k : xqMap.keySet()) {
jsdxList.addAll(xqMap.get(k));
}
Map<String, List<TbFzycJsdx>> fzMap = jsdxList.stream().collect(Collectors.groupingBy(TbFzycJsdx::getFzycId));
Set<String> setFz = jsdxList.stream().map(TbFzycJsdx::getFzycId).collect(Collectors.toSet());
List<TbFzyc> tbFzycs = this.tbFzycMapper.selectList(new LambdaQueryWrapper<TbFzyc>().in(TbFzyc::getId, setFz));
for (TbFzyc fzyc : tbFzycs) {
List<TbFzycJsdx> jsdxList1 = fzMap.get(fzyc.getId());
fzyc.setLsId(fzyc.getId());
fzyc.setId(UUIDGenerator.getUUID());
fzyc.setDwId(uuid);
fzyc.setSfxl("0");
fzyc.setRealDate(endTime.substring(0, 10));
fzyc.setBc(startTime.substring(11, 13) + "-" + endTime.substring(11, 13));
fzyc.setXtCjsj(new Timestamp(System.currentTimeMillis()));
fzycList.add(fzyc);
this.tbFzycMapper.insert(fzyc);
for (TbFzycJsdx jsdx : jsdxList1) {
jsdx.setId(UUIDGenerator.getUUID());
jsdx.setFzycId(fzyc.getId());
jsdx.setLsId(fzyc.getId());
jsdx.setDwId(uuid);
jsdx.setXtCjsj(new Timestamp(System.currentTimeMillis()));
tbFzycJsdxMapper.insert(jsdx);
}
}
}
redisService.setCacheObject(Constant.FZYC_LIST, fzycList);
redisService.setCacheObject(Constant.FZYC_BC, startTime.substring(11, 13) + "-" + endTime.substring(11, 13));
}
}
}
/**
* 根据经纬度,获取正方形四个点位
*
* @param longitude 经度
* @param latitude 纬度
* @param distance 范围(米) 半径
* @return
*/
public static Map<String, double[]> returnLLSquarePoint(double longitude, double latitude, double distance) {
Map<String, double[]> squareMap = new HashMap<String, double[]>();
// 计算经度弧度,从弧度转换为角度
double dLongitude = 2 * (Math.asin(Math.sin(distance / (2 * 6378137)) / Math.cos(Math.toRadians(latitude))));
dLongitude = Math.toDegrees(dLongitude);
// 计算纬度角度
double dLatitude = distance / 6378137;
dLatitude = Math.toDegrees(dLatitude);
// 正方形
//左上角
double[] leftTopPoint = {latitude + dLatitude, longitude - dLongitude};
//右上角
double[] rightTopPoint = {latitude + dLatitude, longitude + dLongitude};
//左下角
double[] leftBottomPoint = {latitude - dLatitude, longitude - dLongitude};
//右下角
double[] rightBottomPoint = {latitude - dLatitude, longitude + dLongitude};
squareMap.put("leftTopPoint", leftTopPoint);
squareMap.put("rightTopPoint", rightTopPoint);
squareMap.put("leftBottomPoint", leftBottomPoint);
squareMap.put("rightBottomPoint", rightBottomPoint);
return squareMap;
}
}

View File

@ -0,0 +1,578 @@
package com.mosty.yjzl.service.Impl;
import com.google.common.collect.ImmutableList;
import com.mosty.base.model.dto.yjzl.*;
import com.mosty.base.model.query.yjzl.TbYjqkQuery;
import com.mosty.base.utils.DateUtils;
import com.mosty.common.base.exception.BusinessException;
import com.mosty.common.token.UserInfo;
import com.mosty.common.token.UserInfoManager;
import com.mosty.common.util.PermissionsUtil;
import com.mosty.yjzl.mapper.YjzlStatisticsMapper;
import com.mosty.yjzl.remote.TbBaseAdaptRemoteService;
import com.mosty.yjzl.service.YjzlStatisticsService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor
public class YjzlStatisticsServiceImpl implements YjzlStatisticsService {
private final YjzlStatisticsMapper yjzlStatisticsMapper;
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
@Override
public List<Map<String, Object>> clyjlb(TbYjxxStatisticsDto vo) {
// UserInfo user = UserInfoManager.get();
vo.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(vo.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", vo);
// map.put("useSql", PermissionsUtil.createSql("", user));
return this.yjzlStatisticsMapper.clyjlb(map);
}
@Override
public List<Map<String, Object>> queryBycCphm(TbYjxxPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.queryBycCphm(map);
}
@Override
public List<Map<String, Object>> queryBycCphmlb(TbYjxxPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.queryBycCphmlb(map);
}
@Override
public List<Map<String, Object>> yqueryBycCphmlb(TbYjxxYStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yqueryBycCphmlb(map);
}
@Override
public List<Map<String, Object>> zqueryBycCphmlb(TbYjxxPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zqueryBycCphmlb(map);
}
@Override
public List<Map<String, Object>> yjcltj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjcltj(map);
}
@Override
public List<Map<String, Object>> yjbqtj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjbqtj(map);
}
@Override
public List<Map<String, Object>> yjjbtj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjjbtj(map);
}
@Override
public List<Map<String, Object>> yyjcltj(TbYjxxYStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yyjcltj(map);
}
@Override
public List<Map<String, Object>> zyjcltj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zyjcltj(map);
}
@Override
public List<Map<String, Object>> queryBySfzh(TbYjxxRyStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.queryBySfzh(map);
}
@Override
public List<Map<String, Object>> queryBySfzhlb(TbYjxxRyPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.queryBySfzhlb(map);
}
@Override
public List<Map<String, Object>> queryBySfzhlbsc(TbYjxxRyPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.queryBySfzhlbsc(map);
}
@Override
public List<Map<String, Object>> yqueryBySfzhlb(TbYjxxRyNyStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yqueryBySfzhlb(map);
}
@Override
public List<Map<String, Object>> yqueryBySfzhlbsc(TbYjxxRyNyStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yqueryBySfzhlbsc(map);
}
@Override
public List<Map<String, Object>> zqueryBySfzhlb(TbYjxxRyPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zqueryBySfzhlb(map);
}
@Override
public List<Map<String, Object>> zqueryBySfzhlbsc(TbYjxxRyPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("a", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zqueryBySfzhlbsc(map);
}
@Override
public List<Map<String, Object>> ryyjlb(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.ryyjlb(map);
}
@Override
public List<Map<String, Object>> yjjbtjRy(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjjbtjRy(map);
}
@Override
public List<Map<String, Object>> jbtj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.jbtj(map);
}
@Override
public List<Map<String, Object>> yjrytj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjrytj(map);
}
@Override
public List<Map<String, Object>> yjrytjsc(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjrytjsc(map);
}
@Override
public List<Map<String, Object>> yyjrytj(TbYjxxYyjStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yyjrytj(map);
}
@Override
public List<Map<String, Object>> yyjrytjsc(TbYjxxYyjStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yyjrytjsc(map);
}
@Override
public List<Map<String, Object>> zyjrytj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zyjrytj(map);
}
@Override
public List<Map<String, Object>> zyjrytjsc(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zyjrytjsc(map);
}
@Override
public List<Map<String, Object>> zbyjbfylb(TbYjxxRyPageStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zbyjbfylb(map);
}
@Override
public List<Map<String, Object>> zbyjtj(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.zbyjtj(map);
}
@Override
public List<Map<String, Object>> gzyyjpm(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.gzyyjpm(map);
}
@Override
public List<Map<String, Object>> pcsyjpm(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.pcsyjpm(map);
}
@Override
public List<Map<String, Object>> ryyjpm(TbYjxxStatisticsDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.ryyjpm(map);
}
@Override
public List<Map<String, Object>> ycyjtj(TbYjxxStatisticsQueryDto dto) {
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
Map<String, Object> map = new HashMap<>();
map.put("dto", dto);
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.ycyjtj(map);
}
@Override
public List<Map<String, Object>> yjtj() {
String ssbmdm = this.tbBaseAdaptRemoteService.getSsbm(null, null);
// Map<String, Object> map = new HashMap<>();
// map.put("useSql", PermissionsUtil.createSql("", UserInfoManager.get()));
return this.yjzlStatisticsMapper.yjtj(ssbmdm);
}
/**
* 泸州态势统计-各区县预警情况
*
* @param dto
* @return
*/
@Override
public Map<String, Object> getGqxyjqk(TbYjqkQuery dto) {
HashMap<Object, Object> ssxgajxx = new HashMap<>();
ssxgajxx.put("10111", "泸州机场分局");
ssxgajxx.put("10929", "江阳区分局");
ssxgajxx.put("11336", "龙马潭区分局");
ssxgajxx.put("11379", "纳溪区");
ssxgajxx.put("11382", "泸县");
ssxgajxx.put("11436", "合江县");
ssxgajxx.put("11503", "叙永县");
ssxgajxx.put("11531", "古蔺县");
if (StringUtils.isEmpty(dto.getKssj()) || StringUtils.isEmpty(dto.getJssj())) { // 为空的提示
throw new BusinessException("请选择您要查询时间!");
}
Map<String, Object> map = new HashMap<>();
// 预警数量
List<Map<String, Object>> yjsl = this.yjzlStatisticsMapper.getYjsl(dto.getKssj(), dto.getJssj());
// 指令数
List<Map<String, Object>> zls = this.yjzlStatisticsMapper.getZls();
// 执行数
List<Map<String, Object>> zxs = this.yjzlStatisticsMapper.getZxs(dto.getKssj(), dto.getJssj());
// re预警数量
List<Map<String, Object>> yjslResList = new ArrayList<>();
// re指令数
List<Map<String, Object>> zlsResList = new ArrayList<>();
// re执行数
List<Map<String, Object>> zxsResList = new ArrayList<>();
ssxgajxx.keySet().forEach(item -> { // 循环遍历 通过key获取value 过滤比较从数据库获取的值
Map<String, Object> resMap = new HashMap<>();
// 预警数量
List<Map<String, Object>> yjslList = yjsl.stream().filter(it -> String.valueOf(it.get("ssxgajid")).equals(item)).collect(Collectors.toList());
resMap.put("ssxgaj", ssxgajxx.get(item)); // value 为所属县公安局
resMap.put("ssxgajid", item); // key 为所属县公安局id
if (yjslList.size() == 1) { // 如果集合的长度为1 说明数据库中有获取count
resMap.put("count", yjslList.get(0).get("count"));
} else { // 否则设置count为0
resMap.put("count", 0);
}
yjslResList.add(resMap); // 将resMap添加进yjslResList中 最后put进map
// 指令数
resMap = new HashMap<>();
List<Map<String, Object>> zlsList = zls.stream().filter(it -> String.valueOf(it.get("ssxgajid")).equals(item)).collect(Collectors.toList());
resMap.put("ssxgaj", ssxgajxx.get(item));
resMap.put("ssxgajid", item);
if (zlsList.size() == 1) {
resMap.put("count", zlsList.get(0).get("count"));
} else {
resMap.put("count", 0);
}
zlsResList.add(resMap);
// 执行数
resMap = new HashMap<>();
List<Map<String, Object>> zxsList = zxs.stream().filter(it -> String.valueOf(it.get("ssxgajid")).equals(item)).collect(Collectors.toList());
resMap.put("ssxgaj", ssxgajxx.get(item));
resMap.put("ssxgajid", item);
if (zxsList.size() == 1) {
resMap.put("count", zxsList.get(0).get("count"));
} else {
resMap.put("count", 0);
}
zxsResList.add(resMap);
});
map.put("yjslResList", yjslResList);
map.put("zlsResList", zlsResList);
map.put("zxsResList", zxsResList);
return map;
}
@Override
public Map<String, Object> getJqscAndZlTj(TbYjqkQuery dto) {
if (com.mosty.common.base.util.StringUtils.isEmpty(dto.getKssj()) || com.mosty.common.base.util.StringUtils.isEmpty(dto.getJssj())) {
throw new BusinessException("请选择查询时间");
}
Map<String, Object> map = new HashMap<>();
if (dto.getKssj().equals(dto.getJssj())) {
// 查询警情数据
List<Map<String, Object>> jqList = this.yjzlStatisticsMapper.getJqTj(dto.getKssj());
// 预警数量
List<Map<String, Object>> yjsl = this.yjzlStatisticsMapper.getYjsl1(dto.getKssj(), dto.getJssj());
// 指令数
List<Map<String, Object>> zls = this.yjzlStatisticsMapper.getZls1(dto.getKssj(), dto.getJssj());
// 执行数
List<Map<String, Object>> zxs = this.yjzlStatisticsMapper.getZxs1(dto.getKssj(), dto.getJssj());
List<String> timeList = ImmutableList.of("00", "01", "02", "03", "04", "05", "06", "07", "08", "09",
"10", "11", "12", "13", "14", "15", "16", "17",
"18", "19", "20", "21", "22", "23");
timeList.forEach(item -> {
boolean jqFlag = false;
boolean yjFlag = false;
boolean zlsFlag = false;
boolean zxsFlag = false;
for (Map<String, Object> jq : jqList) {
String time = String.valueOf(jq.get("time")).length() == 1 ?
"0" + jq.get("time") : String.valueOf(jq.get("time"));
if (item.equals(time)) {
jqFlag = true;
}
}
for (Map<String, Object> jq : yjsl) {
String time = String.valueOf(jq.get("time")).length() == 1 ?
"0" + jq.get("time") : String.valueOf(jq.get("time"));
if (item.equals(time)) {
yjFlag = true;
}
}
for (Map<String, Object> jq : zls) {
String time = String.valueOf(jq.get("time")).length() == 1 ?
"0" + jq.get("time") : String.valueOf(jq.get("time"));
if (item.equals(time)) {
zlsFlag = true;
}
}
for (Map<String, Object> jq : zxs) {
String time = String.valueOf(jq.get("time")).length() == 1 ?
"0" + jq.get("time") : String.valueOf(jq.get("time"));
if (item.equals(time)) {
zxsFlag = true;
}
}
if (!jqFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", item);
mp.put("count", 0);
jqList.add(mp);
}
if (!yjFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", item);
mp.put("count", 0);
yjsl.add(mp);
}
if (!zlsFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", item);
mp.put("count", 0);
zls.add(mp);
}
if (!zxsFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", item);
mp.put("count", 0);
zxs.add(mp);
}
});
jqList.sort(Comparator.comparingInt(a -> Integer.parseInt(a.get("time").toString())));
yjsl.sort(Comparator.comparingInt(a -> Integer.parseInt(a.get("time").toString())));
zls.sort(Comparator.comparingInt(a -> Integer.parseInt(a.get("time").toString())));
zxs.sort(Comparator.comparingInt(a -> Integer.parseInt(a.get("time").toString())));
map.put("jqList", jqList.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("yjsl", yjsl.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("zls", zls.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("zxs", zxs.stream().map(item -> item.get("count")).collect(Collectors.toList()));
} else {
// 警情
List<Map<String, Object>> jqList = this.yjzlStatisticsMapper.getJqTjByTime(dto.getKssj(), dto.getJssj());
// 预警数量
List<Map<String, Object>> yjsl = this.yjzlStatisticsMapper.getYjslByTime(dto.getKssj(), dto.getJssj());
// 指令数
List<Map<String, Object>> zls = this.yjzlStatisticsMapper.getZlsByTime(dto.getKssj(), dto.getJssj());
// 执行数
List<Map<String, Object>> zxs = this.yjzlStatisticsMapper.getZxsByTime(dto.getKssj(), dto.getJssj());
Date kssj = DateUtils.strToDate(dto.getKssj(), "01");
Date jssj = DateUtils.strToDate(dto.getJssj(), "01");
while (kssj.getTime() <= jssj.getTime()) {
boolean jqFlag = false;
boolean yjFlag = false;
boolean zlFlag = false;
boolean zxFlag = false;
for (Map<String, Object> item : yjsl) {
if (String.valueOf(item.get("time")).equals(DateUtils.getQueryDateString(kssj, "01"))) {
yjFlag = true;
}
}
for (Map<String, Object> item : zls) {
if (String.valueOf(item.get("time")).equals(DateUtils.getQueryDateString(kssj, "01"))) {
zlFlag = true;
}
}
for (Map<String, Object> item : jqList) {
if (String.valueOf(item.get("time")).equals(DateUtils.getQueryDateString(kssj, "01"))) {
jqFlag = true;
}
}
for (Map<String, Object> item : zxs) {
if (String.valueOf(item.get("time")).equals(DateUtils.getQueryDateString(kssj, "01"))) {
zxFlag = true;
}
}
if (!jqFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", DateUtils.getQueryDateString(kssj, "01"));
mp.put("count", 0);
jqList.add(mp);
}
if (!yjFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", DateUtils.getQueryDateString(kssj, "01"));
mp.put("count", 0);
yjsl.add(mp);
}
if (!zlFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", DateUtils.getQueryDateString(kssj, "01"));
mp.put("count", 0);
zls.add(mp);
}
if (!zxFlag) {
Map<String, Object> mp = new HashMap<>();
mp.put("time", DateUtils.getQueryDateString(kssj, "01"));
mp.put("count", 0);
zxs.add(mp);
}
kssj = DateUtils.getNextDate(kssj, "D", 1);
}
jqList.sort((a, b) -> {
Date k = DateUtils.strToDate(a.get("time").toString(), "01");
Date j = DateUtils.strToDate(b.get("time").toString(), "01");
return (int) (k.getTime() - j.getTime());
});
yjsl.sort((a, b) -> {
Date k = DateUtils.strToDate(a.get("time").toString(), "01");
Date j = DateUtils.strToDate(b.get("time").toString(), "01");
return (int) (k.getTime() - j.getTime());
});
zls.sort((a, b) -> {
Date k = DateUtils.strToDate(a.get("time").toString(), "01");
Date j = DateUtils.strToDate(b.get("time").toString(), "01");
return (int) (k.getTime() - j.getTime());
});
zxs.sort((a, b) -> {
Date k = DateUtils.strToDate(a.get("time").toString(), "01");
Date j = DateUtils.strToDate(b.get("time").toString(), "01");
return (int) (k.getTime() - j.getTime());
});
map.put("jqList", jqList.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("yjsl", yjsl.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("zls", zls.stream().map(item -> item.get("count")).collect(Collectors.toList()));
map.put("zxs", zxs.stream().map(item -> item.get("count")).collect(Collectors.toList()));
}
return map;
}
}

View File

@ -0,0 +1,27 @@
package com.mosty.yjzl.service;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import com.mosty.base.model.entity.yjzl.TbFzycPz;
import com.mosty.base.model.vo.yjzl.TbFzycPzVo;
import io.swagger.annotations.ApiOperation;
import java.util.List;
public interface TbFzycPzService {
@ApiOperation("新增")
int insert(TbFzycPzVo fzycPzVo);
@ApiOperation("修改")
int updateById(TbFzycPzVo fzycPzVo);
@ApiOperation("根据ID查询")
TbFzycPz queryById(String id);
@ApiOperation("根据ID删除")
int deleteById(String id);
@ApiOperation("查询全部配置单位")
List<TbFzycPz> queryAll();
}

View File

@ -0,0 +1,39 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.yjzl.TbFzycDto;
import com.mosty.base.model.entity.yjzl.TbFzyc;
import io.swagger.annotations.ApiOperation;
import java.util.List;
public interface TbFzycService {
@ApiOperation("新增")
int insert(TbFzyc fzyc);
@ApiOperation("修改")
int fzUpdateById(TbFzyc fzyc);
@ApiOperation("根据ID查询")
TbFzyc queryById(String id);
@ApiOperation("根据ID删除")
int deleteById(String id);
@ApiOperation("查询犯罪预测列表")
List<TbFzyc> queryList(TbFzycDto tbFzycDto);
@ApiOperation("查询犯罪预测列表")
List<TbFzyc> queryListApp(TbFzycDto tbFzycDto);
@ApiOperation("查询犯罪预测列表")
IPage<TbFzyc> queryListPage(TbFzycDto tbFzycDto);
@ApiOperation("已巡逻修改")
int updateBySfxl(String id);
@ApiOperation("查询犯罪预测数量")
Integer getFzyjCount(String ssbmdm, String time, String sfxl);
}

View File

@ -0,0 +1,33 @@
package com.mosty.yjzl.service;
import com.mosty.base.model.dto.yjzl.TbFzycXljlDto;
import com.mosty.base.model.entity.wzzx.TbWzSbsswz;
import com.mosty.base.model.entity.yjzl.TbFzycXljl;
import com.mosty.base.model.vo.wzzx.TbWzSblswzVo;
import com.mosty.base.model.vo.yjzl.TbFzJlVo;
import com.mosty.base.model.vo.yjzl.TbFzycXljlVo;
import io.swagger.annotations.ApiOperation;
import java.util.List;
public interface TbFzycXljlService {
@ApiOperation("新增")
int insert(TbFzycXljlVo xljlVo);
@ApiOperation("修改")
int updateById(TbFzycXljlVo xljlVo);
@ApiOperation("根据ID查询")
TbFzycXljl queryById(String id);
@ApiOperation("根据ID删除")
int deleteById(String id);
@ApiOperation("查询犯罪预警预测指令巡逻记录列表")
List<TbFzycXljlDto> qfzxl(String id);
@ApiOperation("新增")
int addBySbwz(TbFzJlVo vo);
}

View File

@ -0,0 +1,22 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.entity.yjzl.TbYjDyyjxx;
import com.mosty.base.model.query.yjzl.TbYjDyyjxxQuery;
import io.swagger.annotations.ApiOperation;
import java.util.List;
public interface TbYjDyyjxxService {
@ApiOperation("查询订阅预警信息")
IPage<TbYjDyyjxx> queryByPage(TbYjDyyjxxQuery dyyjxx);
@ApiOperation("新增订阅预警信息")
int insert(TbYjDyyjxx dyyjxx);
@ApiOperation("根据ID删除")
int deleteById(List<String> list);
}

View File

@ -0,0 +1,39 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.query.yjzl.TbYjmxCsbQuery;
import com.mosty.base.model.vo.yjzl.TbYjmxCsbVo;
import io.swagger.annotations.ApiOperation;
public interface TbYjmxCsbService {
/**
* 新增
* @param csb
*/
int insert(TbYjmxCsbVo csb);
/**
* 查询
* @param id
* @return
*/
TbYjmxCsbVo queryById(String id);
/**
* 根据ID删除
* @param id
* @return
*/
int deleteById(String id);
@ApiOperation("分页查询")
IPage<TbYjmxCsbVo> getPage(TbYjmxCsbQuery dto);
@ApiOperation("编辑")
int updateById(TbYjmxCsbVo clVo);
}

View File

@ -0,0 +1,57 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.query.yjzl.TbYjmxQuery;
import com.mosty.base.model.vo.yjzl.TbYjmxAllVo;
import com.mosty.base.model.vo.yjzl.TbYjmxVo;
import io.swagger.annotations.ApiOperation;
public interface TbYjmxService {
/**
* 新增
* @param yjmx
*/
int insert(TbYjmxVo yjmx);
/**
* 编辑
* @param yjmx
*/
int updateById(TbYjmxVo yjmx);
/**
* 查询
* @param id
* @return
*/
TbYjmxVo queryById(String id);
/**
* 根据ID删除
* @param id
* @return
*/
int deleteById(String id);
@ApiOperation("分页查询")
IPage<TbYjmxVo> getPage(TbYjmxQuery dto);
/**
* 根据ID更改模型状态
* @param id
* @return
*/
int startMx(String id);
/**
* 查询模型参数详情信息
* @param mxid
* @return
*/
TbYjmxAllVo getMxCs(String mxid);
}

View File

@ -0,0 +1,59 @@
package com.mosty.yjzl.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.query.yjzl.TbYjxxClQuery;
import com.mosty.base.model.vo.yjzl.TbYjxxClVo;
import java.util.List;
/**
* <p>
* 预警信息-车辆表 服务类
* </p>
*
* @author zengbo
* @since 2022-07-21
*/
public interface TbYjxxClService {
/**
* 分页查询预警车辆
* @param tbYjxxClQuery
* @return
*/
IPage<TbYjxxClVo> queryByPage(TbYjxxClQuery tbYjxxClQuery);
/**
* 不分页查询预警车辆
* @param tbYjxxClQuery
* @return
*/
List<TbYjxxClVo> queryList(TbYjxxClQuery tbYjxxClQuery);
/**
* 新增预警车辆
* @param clVo
*/
int insert(TbYjxxClVo clVo);
/**
* 修改预警车辆
* @param clVo
*/
int update(TbYjxxClVo clVo);
/**
* 根据ID删除
* @param list
* @return
*/
int deleteById(List<String> list);
/**
* 根据ID查询
* @param id
* @return
*/
TbYjxxClVo queryById(String id);
}

Some files were not shown because too many files have changed in this diff Show More