初始提交
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
package com.mosty.yszx;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 要素中心 微服务
|
||||
* @author zengbo
|
||||
* @date 2022/7/11 19:43 PM[
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@EnableTimeConsume
|
||||
//@ComponentScan("com.mosty")
|
||||
@EnableFeignClients(basePackages = "com.mosty.base.feign.service")
|
||||
@MapperScan("com.mosty.yszx.mapper")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class MostyYszxApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(MostyYszxApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.mosty.yszx.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"));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.mosty.yszx.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;
|
||||
|
||||
}
|
120
mosty-yszx/src/main/java/com/mosty/yszx/config/WebMvcConfig.java
Normal file
120
mosty-yszx/src/main/java/com/mosty/yszx/config/WebMvcConfig.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.mosty.yszx.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();
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.mosty.yszx.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.dto.yszx.TbYsAjDelDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDto;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsAjVo;
|
||||
import com.mosty.yszx.service.TbYsAjService;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/18
|
||||
* 要素中心-案件接口
|
||||
**/
|
||||
@Api(tags = "要素中心-案件接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbYsAj")
|
||||
public class TbYsAjController {
|
||||
|
||||
private final TbYsAjService tbYsAjService;
|
||||
|
||||
@ApiOperation("案件新增")
|
||||
@JwtSysUser
|
||||
@Log(title = "案件新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping("addAj")
|
||||
public ResponseResult<Void> addAj(@RequestBody TbYsAjDto dto) {
|
||||
this.tbYsAjService.addAj(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("案件修改")
|
||||
@JwtSysUser
|
||||
@Log(title = "案件修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("updateAj")
|
||||
public ResponseResult<Void> updateAj(@RequestBody TbYsAjDto dto) {
|
||||
this.tbYsAjService.updateAj(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("案件查询-分页")
|
||||
@JwtSysUser
|
||||
@GetMapping("getPageList")
|
||||
public ResponseResult<IPage<TbYsAjVo>> getPageList(TbYsAjQuery dto) {
|
||||
return ResponseResult.success(this.tbYsAjService.getPageList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("案件查询-不分页")
|
||||
@JwtSysUser
|
||||
@GetMapping("getList")
|
||||
public ResponseResult<List<TbYsAjVo>> getList(TbYsAjNoPageQuery dto) {
|
||||
return ResponseResult.success(this.tbYsAjService.getList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("删除案件信息")
|
||||
@JwtSysUser
|
||||
@DeleteMapping("delAj")
|
||||
public ResponseResult<Void> delAj(TbYsAjDelDto dto) {
|
||||
this.tbYsAjService.delAj(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取案件信息的数据--热力图")
|
||||
@JwtSysUser
|
||||
@GetMapping("getAjHotMap")
|
||||
public ResponseResult<List<Map<String,Object>>> getAjHotMap(TbYsAjNoPageQuery dto) {
|
||||
return ResponseResult.success(this.tbYsAjService.getAjHotMap(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询案件案件详情")
|
||||
@JwtSysUser
|
||||
@GetMapping("getInfo")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true),
|
||||
@ApiImplicitParam(name = "ajfl", value = "--D_BB_AJLB(案件类别)案件分类:1-刑事案件,2-行政案件", required = true)
|
||||
})
|
||||
public ResponseResult<TbYsAjVo> getInfo(String id, String ajfl) {
|
||||
return ResponseResult.success(this.tbYsAjService.getInfo(id, ajfl));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.mosty.yszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlVo;
|
||||
import com.mosty.common.base.domain.BaseController;
|
||||
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.vo.yszx.TbYsDlDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsDl;
|
||||
import com.mosty.yszx.service.TbYsDlService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/18
|
||||
* 要素中心-地理要素
|
||||
**/
|
||||
@Api(tags = "要素中心-地理要素")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbYsDl")
|
||||
public class TbYsDlController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private TbYsDlService tbYsDlService;
|
||||
|
||||
@RequestMapping(value = "/selectGeography", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@ApiOperation(value = "大屏-地图-地理要素(社会资源),pageNum参数不传则查询所有数据")
|
||||
@JwtSysUser
|
||||
public ResponseResult<IPage<TbYsDlVo>> queryAll(@RequestBody TbYsDlQuery dto) {
|
||||
return ResponseResult.success(this.tbYsDlService.queryAll(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/selectByNr")
|
||||
@ApiOperation(value = "根据关键字查询地理要素")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbYsDlVo>> selectByNr(@RequestParam("keyword") String keyword) {
|
||||
return ResponseResult.success(this.tbYsDlService.selectByNr(keyword));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过主键查询单条数据")
|
||||
@GetMapping("{id}")
|
||||
public ResponseResult<TbYsDlVo> queryById(@PathVariable("id") String id) {
|
||||
return ResponseResult.success(this.tbYsDlService.queryById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增地理要素数据")
|
||||
@PostMapping
|
||||
public ResponseResult<Void> add(@RequestBody TbYsDlDto dto) {
|
||||
this.tbYsDlService.insert(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑地理要素数据")
|
||||
@PutMapping
|
||||
@Log(title = "编辑地理要素数据", businessType = BusinessType.INSERT)
|
||||
public ResponseResult<Void> edit(@RequestBody TbYsDlDto dto) {
|
||||
this.tbYsDlService.update(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除")
|
||||
@DeleteMapping("{id}")
|
||||
@Log(title = "删除地理要素数据", businessType = BusinessType.INSERT)
|
||||
public ResponseResult<Void> deleteById(@PathVariable("id") String id) {
|
||||
this.tbYsDlService.deleteById(id);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/selectVideoServo")
|
||||
@ApiOperation(value = "大屏-巡组气泡框-视频随动")
|
||||
@JwtSysUser
|
||||
public ResponseResult<List<TbYsDl>> selectVideoServo(@RequestBody TbYsDl tbYsDl) {
|
||||
return ResponseResult.success(this.tbYsDlService.selectVideoServo(tbYsDl));
|
||||
}
|
||||
|
||||
@GetMapping("/selectDlys")
|
||||
@ApiOperation(value = "根据名称查询地理要素")
|
||||
@JwtSysUser
|
||||
public ResponseResult<TbYsDl> selectDlys(@RequestParam String ysmc) {
|
||||
return ResponseResult.success(this.tbYsDlService.selectDlys(ysmc));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,132 @@
|
||||
package com.mosty.yszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgAndGlbmDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgByJwdDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgGlbmDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgGlbmVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgVo;
|
||||
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.core.business.entity.vo.Base64Str;
|
||||
import com.mosty.common.token.JwtSysUser;
|
||||
import com.mosty.yszx.service.TbYsGajgService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/18
|
||||
* 要素中心--公安机关要素
|
||||
**/
|
||||
@Api(tags = "要素中心--公安机关要素")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbYsGajg")
|
||||
public class TbYsGajgController {
|
||||
|
||||
private final TbYsGajgService tbYsGajgService;
|
||||
|
||||
@ApiOperation("公安机关要素新增")
|
||||
@JwtSysUser
|
||||
@Log(title = "公安机关要素新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping("add")
|
||||
public ResponseResult<Integer> insertEntity(@RequestBody TbYsGajgDto dto) {
|
||||
return ResponseResult.success(this.tbYsGajgService.insertEntity(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("公安机关要素新增--添加关联部门")
|
||||
@JwtSysUser
|
||||
@Log(title = "公安机关要素新增--添加关联部门", businessType = BusinessType.INSERT)
|
||||
@PostMapping("addGajg")
|
||||
public ResponseResult<Integer> addGajg(@RequestBody TbYsGajgAndGlbmDto dto) {
|
||||
return ResponseResult.success(this.tbYsGajgService.addGajg(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("公安机关要素修改--修改关联部门")
|
||||
@JwtSysUser
|
||||
@Log(title = "公安机关要素修改--修改关联部门", businessType = BusinessType.INSERT)
|
||||
@PostMapping("editGajg")
|
||||
public ResponseResult<Void> editGajg(@RequestBody TbYsGajgAndGlbmDto dto) {
|
||||
this.tbYsGajgService.editGajg(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("公安机关要素修改")
|
||||
@JwtSysUser
|
||||
@Log(title = "公安机关要素修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseResult<Void> updateEntity(@RequestBody TbYsGajgDto dto) {
|
||||
this.tbYsGajgService.updateEntity(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据来源id 和来源表名修改 公安机关要素")
|
||||
@JwtSysUser
|
||||
@Log(title = "根据来源id 和来源表名 修改 公安机关要素", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("update")
|
||||
public ResponseResult<Void> updateEntityByLY(@RequestBody TbYsGajgDto dto) {
|
||||
this.tbYsGajgService.updateEntityByLY(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("公安机关要素详情查询")
|
||||
@JwtSysUser
|
||||
@GetMapping("{id}")
|
||||
public ResponseResult<TbYsGajgVo> getInfo(@PathVariable("id") String id) {
|
||||
return ResponseResult.success(this.tbYsGajgService.getInfo(id));
|
||||
}
|
||||
|
||||
@ApiOperation("公安机关要素查询列表,pageNum参数不传查询所有列表")
|
||||
@JwtSysUser
|
||||
@PostMapping("getList")
|
||||
public ResponseResult<IPage<TbYsGajgVo>> getPageList(@RequestBody TbYsGajgQuery dto) {
|
||||
return ResponseResult.success(this.tbYsGajgService.getPageList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询公安机关列表(包含关联部门ID)")
|
||||
@JwtSysUser
|
||||
@PostMapping("getGajgList")
|
||||
public ResponseResult<List<TbYsGajgGlbmVo>> getGajgList(@RequestBody TbYsGajgQuery dto) {
|
||||
return ResponseResult.success(this.tbYsGajgService.getGajgList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("删除公安机关要素")
|
||||
@JwtSysUser
|
||||
@DeleteMapping("{id}")
|
||||
public ResponseResult<Void> delEntity(@PathVariable("id") String id) {
|
||||
this.tbYsGajgService.delEntity(id);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据来源id 和来源表名 删除公安机关要素")
|
||||
@JwtSysUser
|
||||
@Log(title = "根据来源id 和来源表名 删除公安机关要素", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public ResponseResult<Void> delEntity(@RequestBody TbYsGajgDto dto) {
|
||||
this.tbYsGajgService.delEntity(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据经纬度判断所属公安机关")
|
||||
@JwtSysUser
|
||||
@PostMapping("getGajgByJwd")
|
||||
public ResponseResult<TbYsGajgVo> getGajgByJwd(@RequestBody TbYsGajgByJwdDto dto) {
|
||||
return ResponseResult.success(this.tbYsGajgService.getGajgByJwd(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询关联部门")
|
||||
@JwtSysUser
|
||||
@PostMapping("getGlbmList/{id}")
|
||||
public ResponseResult<List<TbYsGajgGlbmDto>> getGlbmList(@PathVariable("id") String id) {
|
||||
return ResponseResult.success(this.tbYsGajgService.getGlbmList(id));
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.mosty.yszx.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDelDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsRyDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRy;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjQuery;
|
||||
import com.mosty.base.model.vo.yszx.*;
|
||||
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.yszx.service.TbYsAjService;
|
||||
import com.mosty.yszx.service.TbYsRyService;
|
||||
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;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/11/28
|
||||
* 要素中心-人员要素接口
|
||||
**/
|
||||
@Api(tags = "要素中心-人员要素接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbYsRy")
|
||||
public class TbYsRyController {
|
||||
|
||||
private final TbYsRyService tbYsRyService;
|
||||
|
||||
@ApiOperation("查询人员详情")
|
||||
@JwtSysUser
|
||||
@GetMapping("getRyInfo")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sfzh", value = "身份证号", required = true)
|
||||
})
|
||||
public ResponseResult<TbYsRyVo> getRyInfo(String sfzh) {
|
||||
return ResponseResult.success(this.tbYsRyService.getRyInfo(sfzh));
|
||||
}
|
||||
|
||||
@ApiOperation("添加人员要素")
|
||||
@PostMapping("addRyYs")
|
||||
public ResponseResult<TbYsRyVo> addRyYs(@RequestBody TbYsRyDto dto) {
|
||||
this.tbYsRyService.addRyYs(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改人员要素")
|
||||
@PostMapping("updateRyYs")
|
||||
public ResponseResult<TbYsRyVo> updateRyYs(@RequestBody TbYsRyDto dto) {
|
||||
this.tbYsRyService.updateRyYs(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改人员标签要素")
|
||||
@PostMapping("updateRyBqYs")
|
||||
public ResponseResult<Void> updateRyBqYs(@RequestBody TbYsRyBqUpdateDto dto) {
|
||||
this.tbYsRyService.updateRyBqYs(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改人员电话要素")
|
||||
@PostMapping("updateRyDhys")
|
||||
public ResponseResult<Void> updateRyDhys(@RequestBody TbYsRyDhUpdateDto dto) {
|
||||
this.tbYsRyService.updateRyDhys(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
package com.mosty.yszx.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
|
||||
import com.mosty.base.model.entity.lzother.ZhjmxfXfqwXfqyGzdw;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtPageOneQuery;
|
||||
import com.mosty.base.utils.CameraPreviewUtil;
|
||||
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.dto.yszx.TbYsSxtDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsSxt;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtQuery;
|
||||
import com.mosty.yszx.service.TbYsSxtService;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/18
|
||||
* 要素中心-摄像头接口
|
||||
**/
|
||||
@Api(tags = "要素中心-摄像头接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/tbYsSxt")
|
||||
public class TbYsSxtController {
|
||||
|
||||
private final TbYsSxtService tbYsSxtService;
|
||||
|
||||
@ApiOperation("摄像头新增")
|
||||
@Log(title = "摄像头新增", businessType = BusinessType.INSERT)
|
||||
@PostMapping("add")
|
||||
public ResponseResult<Integer> insertEntity(@RequestBody TbYsSxtDto dto) {
|
||||
return ResponseResult.success(this.tbYsSxtService.insertEntity(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("摄像头修改")
|
||||
@JwtSysUser
|
||||
@Log(title = "摄像头修改", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("update")
|
||||
public ResponseResult<Void> updateEntity(@RequestBody TbYsSxtDto dto) {
|
||||
this.tbYsSxtService.updateEntity(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("查询摄像头列表--分页")
|
||||
@JwtSysUser
|
||||
@GetMapping("getPageList")
|
||||
public ResponseResult<IPage<TbYsSxt>> getPageList(TbYsSxtQuery dto) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getPageList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询摄像头列表--不分页")
|
||||
@JwtSysUser
|
||||
@GetMapping("getList")
|
||||
public ResponseResult<List<TbYsSxt>> getList(TbYsSxtNoPageQuery dto) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getList(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询摄像头详情")
|
||||
@JwtSysUser
|
||||
@GetMapping("{id}")
|
||||
public ResponseResult<TbYsSxt> getList(@PathVariable("id") String id) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getInfo(id));
|
||||
}
|
||||
|
||||
@ApiOperation("根据设备编号查询摄像头详情")
|
||||
@JwtSysUser
|
||||
@GetMapping("getInfoBySbbh/{sbbh}")
|
||||
public ResponseResult<TbYsSxtDto> getInfoBySbbh(@PathVariable("sbbh") String sbbh) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getInfoBySbbh(sbbh));
|
||||
}
|
||||
|
||||
@ApiOperation("删除摄像头信息")
|
||||
@JwtSysUser
|
||||
@DeleteMapping("{id}")
|
||||
public ResponseResult<TbYsSxt> delEntity(@PathVariable("id") String id) {
|
||||
this.tbYsSxtService.delEntity(id);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("查询摄像头-事件中心")
|
||||
@JwtSysUser
|
||||
@Log(title = "查询摄像头-事件中心", businessType = BusinessType.OTHER)
|
||||
@GetMapping("getSjList")
|
||||
public ResponseResult<List<TbYsSxt>> getSjList(String jd, String wd, String sjid) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getSjList(jd, wd, sjid));
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有的感知源的设备编号")
|
||||
@JwtSysUser
|
||||
@PostMapping("getSxtBhList")
|
||||
public ResponseResult<List<String>> getSxtBhList(@RequestBody List<String> ids) {
|
||||
return ResponseResult.success(this.tbYsSxtService.getSxtBhList(ids));
|
||||
}
|
||||
|
||||
@ApiOperation("添加泸州感知源数据")
|
||||
@JwtSysUser
|
||||
@PostMapping("addLzGzy")
|
||||
public ResponseResult<Void> addLzGzy(@RequestBody ZhjmxfXfqwXfqyGzdw dto) {
|
||||
this.tbYsSxtService.addLzGzy(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("查询感知源信息")
|
||||
@JwtSysUser
|
||||
@PostMapping("selectGzy")
|
||||
public ResponseResult<TbYsSxtDto> selectGzy(@RequestBody TbYsSxtPageOneQuery dto) {
|
||||
return ResponseResult.success(this.tbYsSxtService.selectGzy(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("摄像头更新经纬度")
|
||||
@JwtSysUser
|
||||
@GetMapping("updateJwd")
|
||||
public ResponseResult<Void> updateJwd() {
|
||||
this.tbYsSxtService.updateJwd();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("更新泸州感知源数据")
|
||||
@Log(title = "更新泸州感知源数据", businessType = BusinessType.OTHER)
|
||||
@GetMapping("updateLzGzy")
|
||||
@JwtSysUser
|
||||
public ResponseResult<String> updateLzGzy() {
|
||||
this.tbYsSxtService.updateLzGzy();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取HLS地址")
|
||||
@Log(title = "查询HLS地址", businessType = BusinessType.OTHER)
|
||||
@GetMapping("previewURLs")
|
||||
@JwtSysUser
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "sbbh", value = "设备编号", dataType = "String"),
|
||||
@ApiImplicitParam(name = "protocol", value = "协议类型( 0-udp,1-tcp),默认为tcp,在protocol设置为rtsp或者rtmp时有效", dataType = "String"),
|
||||
})
|
||||
public ResponseResult<String> previewURLs(String sbbh,String protocol) {
|
||||
if(StringUtils.isBlank(protocol)){
|
||||
protocol = "hls";
|
||||
}
|
||||
String getCamsApi = "/api/video/v1/cameras/previewURLs";
|
||||
String result = "";
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("cameraIndexCode", sbbh);
|
||||
jsonBody.put("streamType", 0);
|
||||
jsonBody.put("protocol", protocol);
|
||||
jsonBody.put("transmode", 0);
|
||||
jsonBody.put("expand", "transcode=0");
|
||||
result = CameraPreviewUtil.getCameraPreviewURL(getCamsApi, jsonBody);
|
||||
return ResponseResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取监控点回放取流URL")
|
||||
@Log(title = "获取监控点回放取流URL", businessType = BusinessType.OTHER)
|
||||
@PatchMapping("playbackURLs")
|
||||
@JwtSysUser
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "sbbh", value = "设备编号", dataType = "String"),
|
||||
@ApiImplicitParam(name = "beginTime", value = "开始查询时间(ISO8601格式yyyy-MM-dd'T'HH:mm:ss.SSSzzz,和结束时间相差不超过三天)", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束查询时间(ISO8601格式yyyy-MM-dd'T'HH:mm:ss.SSSzzz,和开始时间相差不超过三天)", dataType = "String"),
|
||||
@ApiImplicitParam(name = "protocol", value = "协议类型( 0-udp,1-tcp),默认为tcp,在protocol设置为rtsp或者rtmp时有效", dataType = "String"),
|
||||
})
|
||||
public ResponseResult<String> playbackURLs(String sbbh,String beginTime,String endTime,String protocol) {
|
||||
if(StringUtils.isBlank(protocol)){
|
||||
protocol = "hls";
|
||||
}
|
||||
String getCamsApi = "/api/video/v1/cameras/playbackURLs";
|
||||
String result = "";
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("cameraIndexCode", sbbh);
|
||||
jsonBody.put("beginTime",beginTime+"+08:00");
|
||||
jsonBody.put("endTime",endTime+"+08:00");
|
||||
jsonBody.put("recordLocation", 0);
|
||||
jsonBody.put("protocol", protocol);
|
||||
jsonBody.put("needReturnClipInfo", true);
|
||||
jsonBody.put("expand", "transcode=0");
|
||||
result = CameraPreviewUtil.getCameraPreviewURL(getCamsApi, jsonBody);
|
||||
return ResponseResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("根据监控点编号进行云台操作")
|
||||
@Log(title = "根据监控点编号进行云台操作", businessType = BusinessType.OTHER)
|
||||
@PatchMapping("controlling")
|
||||
@JwtSysUser
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "sbbh", value = "设备编号", dataType = "String"),
|
||||
@ApiImplicitParam(name = "action", value = "开始或停止操作(0 开始 1 停止)", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "command", value = "控制命令(不区分大小写) 说明: LEFT 左转 RIGHT 右转 UP 上转 DOWN 下转 ZOOM_IN 焦距变大 ZOOM_OUT 焦距变小 LEFT_UP 左上 LEFT_DOWN 左下 RIGHT_UP 右上 RIGHT_DOWN 右下 FOCUS_NEAR 焦点前移 FOCUS_FAR 焦点后移 IRIS_ENLARGE 光圈扩大 IRIS_REDUCE 光圈缩小 以下命令presetIndex不可为空: GOTO_PRESET到预置点", dataType = "String"),
|
||||
@ApiImplicitParam(name = "speed", value = "云台速度(取值范围1-100,默认40)", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "presetIndex", value = "预置点编号(取值范围为1-128)", dataType = "Integer"),
|
||||
})
|
||||
public ResponseResult<String> controlling(String sbbh,Integer action,String command,Integer speed,Integer presetIndex) {
|
||||
String getCamsApi = "/api/video/v1/ptzs/controlling";
|
||||
String result = "";
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("cameraIndexCode", sbbh);
|
||||
jsonBody.put("action", action);
|
||||
jsonBody.put("command", command);
|
||||
jsonBody.put("speed", speed);
|
||||
jsonBody.put("presetIndex", presetIndex);
|
||||
result = CameraPreviewUtil.getCameraPreviewURL(getCamsApi, jsonBody);
|
||||
return ResponseResult.success(result);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsDl;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 要素-地理要素表(TbYsDl)表数据库访问层
|
||||
*
|
||||
* @author zhangHaiJun
|
||||
* @since 2022-07-12 10:08:34
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbYsDlMapper extends BaseMapper<TbYsDl> {
|
||||
|
||||
@ApiOperation("查询列表分页")
|
||||
List<TbYsDl> getPageList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询列表数据总和")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询所有数据不分页")
|
||||
List<TbYsDl> getList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询地理要素详情")
|
||||
TbYsDl getInfoById(String id);
|
||||
|
||||
@ApiOperation("添加地理要素数据")
|
||||
void insertEntity(TbYsDl dl);
|
||||
|
||||
@ApiOperation("修改地理要素信息")
|
||||
void updateEntity(TbYsDl dl);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajgGlbm;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/8/26
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbYsGajgGlbmMapper extends BaseMapper<TbYsGajgGlbm> {
|
||||
|
||||
@ApiOperation("删除关联部门")
|
||||
void deleteGlbm(@Param("id") String id);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajg;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/20
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbYsGajgMapper extends BaseMapper<TbYsGajg> {
|
||||
|
||||
@ApiOperation("新增公安机关要素")
|
||||
int insertEntity(TbYsGajg gajg);
|
||||
|
||||
@ApiOperation("获取公安机关详情")
|
||||
TbYsGajg getInfoById(String id);
|
||||
|
||||
@ApiOperation("修改公安机关要素")
|
||||
void updateEntity(TbYsGajg gajg);
|
||||
|
||||
@ApiOperation("查询公安机关总数")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询公安机关列表分页")
|
||||
List<TbYsGajg> getListPage(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询公安机关列表-不分页")
|
||||
List<TbYsGajg> getList(Map<String, Object> map);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRyBq;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface TbYsRyBqMapper extends BaseMapper<TbYsRyBq> {
|
||||
|
||||
@ApiOperation("删除人员标签")
|
||||
void deleteByRyId(@Param("id") String id);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRyDh;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbYsRyDhMapper extends BaseMapper<TbYsRyDh> {
|
||||
|
||||
@ApiOperation("删除人员电话")
|
||||
void deleteByRyId(String id);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRy;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TbYsRyMapper extends BaseMapper<TbYsRy> {
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsSxt;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/19
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbYsSxtMapper extends BaseMapper<TbYsSxt> {
|
||||
|
||||
@ApiOperation("添加摄像头信息")
|
||||
int insertEntity(TbYsSxt sxt);
|
||||
|
||||
@ApiOperation("修改摄像头信息")
|
||||
void updateEntity(TbYsSxt sxt);
|
||||
|
||||
@ApiOperation("查询摄像头的详细信息")
|
||||
TbYsSxt getInfoById(String id);
|
||||
|
||||
@ApiOperation("查询摄像头列表总数")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询摄像头列表--分页")
|
||||
List<TbYsSxt> getPageList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询摄像头列表--不分页·")
|
||||
List<TbYsSxt> getList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询摄像头-事件中心")
|
||||
List<TbYsSxt> getSjList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询摄像头的详细信息")
|
||||
TbYsSxt queryBySjlyid(String sjlyid);
|
||||
|
||||
@ApiOperation("清空摄像头数据")
|
||||
void deleteAll();
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.entity.yszx.TbYsXsaj;
|
||||
import com.mosty.base.model.vo.yszx.TbYsAjVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/21
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbYsXsajMapper extends BaseMapper<TbYsXsaj> {
|
||||
|
||||
@ApiOperation("新增行事案件")
|
||||
void insertXsaj(TbYsXsaj xs);
|
||||
|
||||
@ApiOperation("查询行事案件详情")
|
||||
TbYsXsaj selectXsAjById(String id);
|
||||
|
||||
@ApiOperation("修改行事案件")
|
||||
void updateXsEntity(TbYsXsaj xs);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.mosty.yszx.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDelDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsXzaj;
|
||||
import com.mosty.base.model.vo.yszx.TbYsAjVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/21
|
||||
**/
|
||||
@Mapper
|
||||
public interface TbYsXzajMapper extends BaseMapper<TbYsXzaj> {
|
||||
|
||||
@ApiOperation("新增行政案件")
|
||||
void insertXzaj(TbYsXzaj xz);
|
||||
|
||||
@ApiOperation("查询行政案件详情")
|
||||
TbYsXzaj selectXzAjById(String id);
|
||||
|
||||
@ApiOperation("修改行政案件")
|
||||
void updateXzEntity(TbYsXzaj xz);
|
||||
|
||||
@ApiOperation("获取案件总数")
|
||||
int getCount(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("获取案件列表")
|
||||
List<TbYsAjVo> getList(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("查询案件不分页")
|
||||
List<TbYsAjVo> getListAll(Map<String, Object> map);
|
||||
|
||||
@ApiOperation("删除案件信息")
|
||||
void delAj(TbYsAjDelDto dto);
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.mosty.yszx.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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.mosty.yszx.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.yszx.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 元对象字段填充控制器
|
||||
* https://baomidou.com/guide/auto-fill-metainfo.html
|
||||
*/
|
||||
@Bean
|
||||
public MetaObjectHandler metaObjectHandler() {
|
||||
return new CreateAndUpdateMetaObjectHandler();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.mosty.yszx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.model.dto.base.GetDeptListDTO;
|
||||
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.vo.base.DeptInfoVo;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
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 DeptInfoVo getOrgByDeptId(String deptid) {
|
||||
if (StringUtils.isBlank(deptid)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByDeptId(deptid);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("根据部门ID查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("根据部门ID查询部门信息异常");
|
||||
}
|
||||
return responseResult.getData();
|
||||
}
|
||||
|
||||
// 根据部门编码查询部门信息
|
||||
public DeptInfoVo getOrgByOrgcode(String orgcode) {
|
||||
if (StringUtils.isBlank(orgcode)) {
|
||||
return null;
|
||||
}
|
||||
ResponseResult<DeptInfoVo> responseResult = mostyBaseFeignService.getOrgByOrgcode(orgcode);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("根据部门ID查询部门信息异常 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("根据部门ID查询部门信息异常");
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.mosty.yszx.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;
|
||||
|
||||
// 发送任务给各个用户
|
||||
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();
|
||||
}
|
||||
|
||||
// 获取任务信息
|
||||
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();
|
||||
}
|
||||
|
||||
// 修改旧的指令任务状态为未读
|
||||
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("修改任务状态失败!!");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.mosty.yszx.remote;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mosty.base.model.dto.sjzx.TbSjSpbfDTO;
|
||||
import com.mosty.base.feign.service.MostySjzxFeignService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 事件中心远程调用
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbSjzxAdaptRemoteService {
|
||||
|
||||
private final MostySjzxFeignService mostySjzxFeignService;
|
||||
|
||||
// 保存视频播放日志
|
||||
public void tbSjSpbfAdd(TbSjSpbfDTO dto) {
|
||||
ResponseResult<Integer> responseResult = mostySjzxFeignService.tbSjSpbfAdd(dto);
|
||||
if (responseResult == null || !responseResult.isSuccess()) {
|
||||
log.error("保存视频播放日志失败 responseResult = {}", JSON.toJSONString(responseResult));
|
||||
throw new BusinessException("保存视频播放日志失败");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.mosty.yszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDelDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDto;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsAjVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/21
|
||||
**/
|
||||
public interface TbYsAjService {
|
||||
|
||||
@ApiOperation("案件新增")
|
||||
void addAj(TbYsAjDto dto);
|
||||
|
||||
@ApiOperation("案件修改")
|
||||
void updateAj(TbYsAjDto dto);
|
||||
|
||||
@ApiOperation("分页获取案件列表")
|
||||
IPage<TbYsAjVo> getPageList(TbYsAjQuery dto);
|
||||
|
||||
@ApiOperation("不分页获取案件列表")
|
||||
List<TbYsAjVo> getList(TbYsAjNoPageQuery dto);
|
||||
|
||||
@ApiOperation("删除案件信息")
|
||||
void delAj(TbYsAjDelDto dto);
|
||||
|
||||
@ApiOperation("获取案件数据--热力图")
|
||||
List<Map<String,Object>> getAjHotMap(TbYsAjNoPageQuery dto);
|
||||
|
||||
@ApiOperation("获取案件详情")
|
||||
TbYsAjVo getInfo(String id, String ajfl);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.mosty.yszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsDl;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
要素-地理要素表(TbYsDl)表服务接口
|
||||
*
|
||||
* @author zhangHaiJun
|
||||
* @since 2022-07-12 10:08:38
|
||||
*/
|
||||
public interface TbYsDlService {
|
||||
|
||||
@ApiOperation("查询所有数据")
|
||||
IPage<TbYsDlVo> queryAll(TbYsDlQuery dto);
|
||||
|
||||
@ApiOperation("通过ID查询单条数据")
|
||||
TbYsDlVo queryById(String id);
|
||||
|
||||
@ApiOperation("新增数据")
|
||||
void insert(TbYsDlDto tbYsDl);
|
||||
|
||||
@ApiOperation("修改数据")
|
||||
void update(TbYsDlDto tbYsDl);
|
||||
|
||||
@ApiOperation("通过主键删除数据")
|
||||
void deleteById(String id);
|
||||
|
||||
@ApiOperation("大屏-巡组气泡框-视频随动")
|
||||
List<TbYsDl> selectVideoServo(TbYsDl tbYsDl);
|
||||
|
||||
@ApiOperation("根据关键字查询")
|
||||
List<TbYsDlVo> selectByNr(String keyword);
|
||||
|
||||
@ApiOperation("根据名称查询地理要素")
|
||||
TbYsDl selectDlys(String ysmc);
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
package com.mosty.yszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgAndGlbmDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgByJwdDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgGlbmDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajg;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgGlbmVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgVo;
|
||||
import com.mosty.common.core.business.entity.vo.Base64Str;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/20
|
||||
**/
|
||||
public interface TbYsGajgService {
|
||||
|
||||
@ApiOperation("公安机关要素新增")
|
||||
int insertEntity(TbYsGajgDto dto);
|
||||
|
||||
@ApiOperation("公安机关要素修改")
|
||||
void updateEntity(TbYsGajgDto dto);
|
||||
|
||||
@ApiOperation("根据来源修改公安机关要素")
|
||||
void updateEntityByLY(TbYsGajgDto dto);
|
||||
|
||||
@ApiOperation("公安机关要素详情查询")
|
||||
TbYsGajgVo getInfo(String id);
|
||||
|
||||
@ApiOperation("查询公安机关列表")
|
||||
IPage<TbYsGajgVo> getPageList(TbYsGajgQuery dto);
|
||||
|
||||
@ApiOperation("删除公安机关要素")
|
||||
void delEntity(String id);
|
||||
|
||||
@ApiOperation("删除公安机关要素")
|
||||
void delEntity(TbYsGajgDto dto);
|
||||
|
||||
@ApiOperation("根据经纬度判断所属公安机关")
|
||||
TbYsGajgVo getGajgByJwd(TbYsGajgByJwdDto dto);
|
||||
|
||||
@ApiOperation("公安机关要素新增--添加关联部门")
|
||||
int addGajg(TbYsGajgAndGlbmDto dto);
|
||||
|
||||
@ApiOperation("公安机关要素修改--修改关联部门")
|
||||
void editGajg(TbYsGajgAndGlbmDto dto);
|
||||
|
||||
@ApiOperation("查询公安机关关联部门")
|
||||
List<TbYsGajgGlbmDto> getGlbmList(String id);
|
||||
|
||||
@ApiOperation("查询公安机关列表(包含关联部门ID)")
|
||||
List<TbYsGajgGlbmVo> getGajgList(TbYsGajgQuery dto);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.mosty.yszx.service;
|
||||
|
||||
import com.mosty.base.model.dto.yszx.TbYsRyDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyBqUpdateDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyDhUpdateDto;
|
||||
import com.mosty.base.model.vo.yszx.TbYsRyVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
public interface TbYsRyService {
|
||||
|
||||
@ApiOperation("查询人员详情")
|
||||
TbYsRyVo getRyInfo(String sfzh);
|
||||
|
||||
@ApiOperation("添加人员要素")
|
||||
void addRyYs(TbYsRyDto dto);
|
||||
|
||||
@ApiOperation("修改人员要素")
|
||||
void updateRyYs(TbYsRyDto dto);
|
||||
|
||||
@ApiOperation("修改人员标签要素")
|
||||
void updateRyBqYs(TbYsRyBqUpdateDto dto);
|
||||
|
||||
@ApiOperation("修改人员电话要素")
|
||||
void updateRyDhys(TbYsRyDhUpdateDto dto);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.mosty.yszx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.mosty.base.model.dto.yszx.TbYsSxtDto;
|
||||
import com.mosty.base.model.entity.lzother.ZhjmxfXfqwXfqyGzdw;
|
||||
import com.mosty.base.model.entity.yszx.TbYsSxt;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtPageOneQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtQuery;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/19
|
||||
**/
|
||||
public interface TbYsSxtService {
|
||||
|
||||
@ApiOperation("摄像头新增")
|
||||
int insertEntity(TbYsSxtDto dto);
|
||||
|
||||
@ApiOperation("摄像头修改")
|
||||
void updateEntity(TbYsSxtDto dto);
|
||||
|
||||
@ApiOperation("查询摄像头分页列表")
|
||||
IPage<TbYsSxt> getPageList(TbYsSxtQuery dto);
|
||||
|
||||
@ApiOperation("查询摄像头列表---不分页")
|
||||
List<TbYsSxt> getList(TbYsSxtNoPageQuery dto);
|
||||
|
||||
@ApiOperation("查询摄像头详情信息")
|
||||
TbYsSxt getInfo(String id);
|
||||
|
||||
@ApiOperation("删除摄像头信息")
|
||||
void delEntity(String id);
|
||||
|
||||
@ApiOperation("查询摄像头-事件中心")
|
||||
List<TbYsSxt> getSjList(String jd ,String wd ,String sjid);
|
||||
|
||||
@ApiOperation("摄像头新增")
|
||||
int insertEntity(TbYsSxt sxt);
|
||||
|
||||
@ApiOperation("查询摄像头详情信息")
|
||||
TbYsSxt queryBySjlyid(String sjlyid);
|
||||
|
||||
@ApiOperation("根据设备编号查询摄像头详情")
|
||||
TbYsSxtDto getInfoBySbbh(String sbbh);
|
||||
|
||||
@ApiOperation("获取所有的感知源的设备编号")
|
||||
List<String> getSxtBhList(List<String> ids);
|
||||
|
||||
@ApiOperation("添加泸州感知源数据")
|
||||
void addLzGzy(ZhjmxfXfqwXfqyGzdw dto);
|
||||
|
||||
@ApiOperation("查询感知源信息")
|
||||
TbYsSxtDto selectGzy(TbYsSxtPageOneQuery dto);
|
||||
|
||||
@ApiOperation("摄像头更新经纬度")
|
||||
void updateJwd();
|
||||
|
||||
@ApiOperation("更新泸州感知源数据")
|
||||
void updateLzGzy();
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
package com.mosty.yszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mosty.base.utils.GeoHashKit;
|
||||
import com.mosty.base.utils.JtsUtils;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.common.base.util.StringUtils;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.common.util.PermissionsUtil;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDelDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsAjDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsXsaj;
|
||||
import com.mosty.base.model.entity.yszx.TbYsXzaj;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsAjQuery;
|
||||
import com.mosty.base.model.vo.yszx.TbYsAjVo;
|
||||
import com.mosty.yszx.mapper.TbYsXsajMapper;
|
||||
import com.mosty.yszx.mapper.TbYsXzajMapper;
|
||||
import com.mosty.yszx.remote.TbBaseAdaptRemoteService;
|
||||
import com.mosty.yszx.service.TbYsAjService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/21
|
||||
**/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbYsAjServiceImpl implements TbYsAjService {
|
||||
|
||||
private final TbYsXsajMapper tbYsXsajMapper;
|
||||
private final TbYsXzajMapper tbYsXzajMapper;
|
||||
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
|
||||
|
||||
@Override
|
||||
public void addAj(TbYsAjDto dto) {
|
||||
String id = UUIDGenerator.getUUID();
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(dto.getSsbmid());
|
||||
if ("1".equals(dto.getAjfl())) {
|
||||
TbYsXsaj xs = new TbYsXsaj();
|
||||
BeanUtils.copyProperties(dto, xs);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
xs.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
xs.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
xs.setJsnr(dto.getAjmc() + " " + dto.getAjbh() + " " + dto.getDzmc() +
|
||||
" " + dto.getAymc() + " " + dto.getAjnr());
|
||||
xs.setId(id);
|
||||
xs.setXtSjly("1");
|
||||
if (dept != null) {
|
||||
xs.setSsbm(dept.getDeptname());
|
||||
xs.setSsbmid(dept.getDeptid());
|
||||
xs.setSsbmdm(dept.getDeptcode());
|
||||
xs.setSsxgajdm(dept.getFxjcode());
|
||||
xs.setSsxgajid(dept.getFxjid());
|
||||
xs.setSsxgaj(dept.getFxjname());
|
||||
xs.setSssgaj(dept.getDszname());
|
||||
xs.setSssgajdm(dept.getDszcode());
|
||||
xs.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.tbYsXsajMapper.insertXsaj(xs);
|
||||
} else if ("2".equals(dto.getAjfl())) {
|
||||
TbYsXzaj xz = new TbYsXzaj();
|
||||
BeanUtils.copyProperties(dto, xz);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
xz.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
xz.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
xz.setJsnr(dto.getAjmc() + " " + dto.getAjbh() + " " + dto.getDzmc() +
|
||||
" " + dto.getAymc() + " " + dto.getAjnr());
|
||||
xz.setId(id);
|
||||
xz.setXtSjly("1");
|
||||
if (dept != null) {
|
||||
xz.setSsbm(dept.getDeptname());
|
||||
xz.setSsbmid(dept.getDeptid());
|
||||
xz.setSsbmdm(dept.getDeptcode());
|
||||
xz.setSsxgajdm(dept.getFxjcode());
|
||||
xz.setSsxgajid(dept.getFxjid());
|
||||
xz.setSsxgaj(dept.getFxjname());
|
||||
xz.setSssgaj(dept.getDszname());
|
||||
xz.setSssgajdm(dept.getDszcode());
|
||||
xz.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.tbYsXzajMapper.insertXzaj(xz);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAj(TbYsAjDto dto) {
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(dto.getSsbmid());
|
||||
if ("1".equals(dto.getAjfl())) {
|
||||
TbYsXsaj xs = new TbYsXsaj();
|
||||
BeanUtils.copyProperties(dto, xs);
|
||||
if (xs.getJd() != null && xs.getWd() != null) {
|
||||
xs.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
xs.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
if (dept != null) {
|
||||
xs.setSsbm(dept.getDeptname());
|
||||
xs.setSsbmid(dept.getDeptid());
|
||||
xs.setSsbmdm(dept.getDeptcode());
|
||||
xs.setSsxgajdm(dept.getFxjcode());
|
||||
xs.setSsxgajid(dept.getFxjid());
|
||||
xs.setSsxgaj(dept.getFxjname());
|
||||
xs.setSssgaj(dept.getDszname());
|
||||
xs.setSssgajdm(dept.getDszcode());
|
||||
xs.setSssgajid(dept.getDszid());
|
||||
}this.tbYsXsajMapper.updateXsEntity(xs);
|
||||
xs = this.tbYsXsajMapper.selectXsAjById(xs.getId());
|
||||
xs.setJsnr(dto.getAjmc() + " " + dto.getAjbh() + " " + dto.getDzmc() +
|
||||
" " + dto.getAymc() + " " + dto.getAjnr());
|
||||
this.tbYsXsajMapper.updateXsEntity(xs);
|
||||
} else if ("2".equals(dto.getAjfl())) {
|
||||
TbYsXzaj xz = new TbYsXzaj();
|
||||
BeanUtils.copyProperties(dto, xz);
|
||||
if (xz.getJd() != null && xz.getWd() != null) {
|
||||
xz.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
xz.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
if (dept != null) {
|
||||
xz.setSsbm(dept.getDeptname());
|
||||
xz.setSsbmid(dept.getDeptid());
|
||||
xz.setSsbmdm(dept.getDeptcode());
|
||||
xz.setSsxgajdm(dept.getFxjcode());
|
||||
xz.setSsxgajid(dept.getFxjid());
|
||||
xz.setSsxgaj(dept.getFxjname());
|
||||
xz.setSssgaj(dept.getDszname());
|
||||
xz.setSssgajdm(dept.getDszcode());
|
||||
xz.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.tbYsXzajMapper.updateXzEntity(xz);
|
||||
xz = this.tbYsXzajMapper.selectXzAjById(xz.getId());
|
||||
xz.setJsnr(dto.getAjmc() + " " + dto.getAjbh() + " " + dto.getDzmc() +
|
||||
" " + dto.getAymc() + " " + dto.getAjnr());
|
||||
this.tbYsXzajMapper.updateXzEntity(xz);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbYsAjVo> getPageList(TbYsAjQuery dto) {
|
||||
if (StringUtils.isNotBlank(dto.getStartTime())) {
|
||||
dto.setStartTime(dto.getStartTime() + " 00:00:00");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getEndTime())) {
|
||||
dto.setEndTime(dto.getEndTime() + " 23:59:59");
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("pageIndex", (dto.getPageNum() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
map.put("dto", dto);
|
||||
UserInfo user = UserInfoManager.get();
|
||||
String useSql = PermissionsUtil.createSql("", user);
|
||||
map.put("useSql", useSql);
|
||||
int count = this.tbYsXzajMapper.getCount(map);
|
||||
List<TbYsAjVo> list = this.tbYsXzajMapper.getList(map);
|
||||
IPage<TbYsAjVo> page = new Page<>();
|
||||
page.setRecords(list);
|
||||
page.setTotal(count);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsAjVo> getList(TbYsAjNoPageQuery dto) {
|
||||
if (StringUtils.isNotBlank(dto.getStartTime())) {
|
||||
dto.setStartTime(dto.getStartTime() + " 00:00:00");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getEndTime())) {
|
||||
dto.setEndTime(dto.getEndTime() + " 23:59:59");
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("dto", dto);
|
||||
UserInfo user = UserInfoManager.get();
|
||||
String useSql = PermissionsUtil.createSql("", user);
|
||||
map.put("useSql", useSql);
|
||||
return this.tbYsXzajMapper.getListAll(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAj(TbYsAjDelDto dto) {
|
||||
this.tbYsXzajMapper.delAj(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getAjHotMap(TbYsAjNoPageQuery dto) {
|
||||
if (StringUtils.isNotBlank(dto.getStartTime())) {
|
||||
dto.setStartTime(dto.getStartTime() + " 00:00:00");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getEndTime())) {
|
||||
dto.setEndTime(dto.getEndTime() + " 23:59:59");
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("dto", dto);
|
||||
UserInfo user = UserInfoManager.get();
|
||||
String useSql = PermissionsUtil.createSql("", user);
|
||||
map.put("useSql", useSql);
|
||||
List<TbYsAjVo> list = this.tbYsXzajMapper.getListAll(map);
|
||||
List<Map<String, Object>> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
Map<String, Object> mp = new HashMap<>();
|
||||
mp.put("lng", item.getJd());
|
||||
mp.put("lat", item.getWd());
|
||||
mp.put("count", 1);
|
||||
rList.add(mp);
|
||||
});
|
||||
return rList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsAjVo getInfo(String id, String ajfl) {
|
||||
TbYsAjVo vo = new TbYsAjVo();
|
||||
if ("1".equals(ajfl)) {
|
||||
TbYsXsaj xs = this.tbYsXsajMapper.selectXsAjById(id);
|
||||
BeanUtils.copyProperties(xs, vo);
|
||||
return vo;
|
||||
} else if ("2".equals(ajfl)) {
|
||||
TbYsXzaj xz = this.tbYsXzajMapper.selectXzAjById(id);
|
||||
BeanUtils.copyProperties(xz, vo);
|
||||
return vo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,238 @@
|
||||
package com.mosty.yszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
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.utils.GeoHashKit;
|
||||
import com.mosty.base.utils.JtsUtils;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlQuery;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.common.util.PermissionsUtil;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsDlDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsDl;
|
||||
import com.mosty.yszx.mapper.TbYsDlMapper;
|
||||
import com.mosty.yszx.remote.TbBaseAdaptRemoteService;
|
||||
import com.mosty.yszx.service.TbYsDlService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 要素-地理要素表(TbYsDl)表服务实现类
|
||||
*
|
||||
* @author zhangHaiJun
|
||||
* @since 2022-07-12 10:08:40
|
||||
*/
|
||||
@Service("tbYsDlService")
|
||||
public class TbYsDlServiceImpl extends ServiceImpl<TbYsDlMapper, TbYsDl>
|
||||
implements TbYsDlService {
|
||||
|
||||
@Resource
|
||||
private TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
|
||||
|
||||
@Override
|
||||
public IPage<TbYsDlVo> queryAll(TbYsDlQuery dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("dto", dto);
|
||||
UserInfo user = UserInfoManager.getUser();
|
||||
String useSql = user != null ? PermissionsUtil.createSql("", user) : "";
|
||||
map.put("useSql", useSql);
|
||||
IPage<TbYsDlVo> page;
|
||||
if (dto.getPageNum() != null && dto.getPageSize() != null) {
|
||||
page = new Page<>(dto.getPageNum(), dto.getPageSize());
|
||||
map.put("pageIndex", (dto.getPageNum() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
int count = this.baseMapper.getCount(map);
|
||||
List<TbYsDl> list = this.baseMapper.getPageList(map);
|
||||
List<TbYsDlVo> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsDlVo vo = new TbYsDlVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
rList.add(vo);
|
||||
});
|
||||
page.setRecords(rList);
|
||||
page.setTotal(count);
|
||||
} else {
|
||||
page = new Page<>();
|
||||
List<TbYsDl> list = this.baseMapper.getList(map);
|
||||
List<TbYsDlVo> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsDlVo vo = new TbYsDlVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
rList.add(vo);
|
||||
});
|
||||
page.setRecords(rList);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsDlVo queryById(String id) {
|
||||
TbYsDl item = this.baseMapper.getInfoById(id);
|
||||
TbYsDlVo vo = null;
|
||||
if (item != null) {
|
||||
vo = new TbYsDlVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setDtm(JtsUtils.decodePolygon(item.getDtm()));
|
||||
vo.setZb(new BigDecimal[]{item.getJd(), item.getWd()});
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(TbYsDlDto dto) {
|
||||
TbYsDl dl = new TbYsDl();
|
||||
BeanUtils.copyProperties(dto, dl);
|
||||
dl.setId(UUIDGenerator.getUUID());
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
dl.setZb(JtsUtils.getPoint(dl.getJd(), dl.getWd()));
|
||||
dl.setZbhash(GeoHashKit.encode(dl.getJd(), dl.getWd()));
|
||||
}
|
||||
if (dto.getQy() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
dl.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
dl.setJsnr(dto.getYsmc() + " " + dto.getYsjc() + " " + dto.getYswzXz()
|
||||
+ " " + dto.getYswzBc());
|
||||
dl.setXtSjly("1");
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmid());
|
||||
if (dept != null) {
|
||||
dl.setSsbm(dept.getDeptname());
|
||||
dl.setSsbmid(dept.getDeptid());
|
||||
dl.setSsbmdm(dept.getDeptcode());
|
||||
dl.setSsxgajdm(dept.getFxjcode());
|
||||
dl.setSsxgajid(dept.getFxjid());
|
||||
dl.setSsxgaj(dept.getFxjname());
|
||||
dl.setSssgaj(dept.getDszname());
|
||||
dl.setSssgajdm(dept.getDszcode());
|
||||
dl.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.baseMapper.insertEntity(dl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(TbYsDlDto dto) {
|
||||
TbYsDl dl = new TbYsDl();
|
||||
BeanUtils.copyProperties(dto, dl);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
dl.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
dl.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (qw != null) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
dl.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
this.baseMapper.updateEntity(dl);
|
||||
dl = this.baseMapper.getInfoById(dl.getId());
|
||||
dl.setJsnr(dl.getYsmc() + " " + dl.getYsjc() + " " + dl.getYswzXz() +
|
||||
" " + dl.getYswzBc());
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(dto.getSsbmid());
|
||||
if (dept != null) {
|
||||
dl.setSsbmdm(dept.getDeptid());
|
||||
dl.setSsbm(dept.getDeptname());
|
||||
dl.setSsxgaj(dept.getFxjname());
|
||||
dl.setSsxgajdm(dept.getFxjid());
|
||||
dl.setSssgaj(dept.getDszname());
|
||||
dl.setSssgajdm(dept.getDszid());
|
||||
}
|
||||
this.baseMapper.updateEntity(dl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
this.baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsDl> selectVideoServo(TbYsDl tbYsDl) {
|
||||
//地理位置
|
||||
String dlsql = "( \n" +
|
||||
"6371 * acos( \n" +
|
||||
"cos(radians(jd))\n" +
|
||||
"* cos( radians( " + tbYsDl.getJd() + ") )\n" +
|
||||
"* cos(radians( " + tbYsDl.getWd() + " ) - radians(wd))\n" +
|
||||
"+ sin( radians(jd) ) \n" +
|
||||
"* sin( radians(" + tbYsDl.getJd() + ") ) \n" +
|
||||
") \n" +
|
||||
")";
|
||||
// UserInfo userInfo = UserInfoManager.get();
|
||||
// PermissionsUtil.queryWrapperUtil(queryWrapper, userInfo);
|
||||
QueryWrapper<TbYsDl> queryWrapper = new QueryWrapper<>();
|
||||
tbYsDl.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(tbYsDl.getSsbmdm(), null));
|
||||
|
||||
List<TbYsDl> tbYsDlList = baseMapper.selectList((Wrapper<TbYsDl>) queryWrapper
|
||||
.like(StringUtils.isNotBlank(tbYsDl.getYsdl()), "ysdl", tbYsDl.getYsdl())
|
||||
.like(StringUtils.isNotBlank(tbYsDl.getYszl()), "yszl", tbYsDl.getYszl())
|
||||
.likeRight(StringUtils.isNotBlank(tbYsDl.getSsbmdm()), "ssbmdm", tbYsDl.getSsbmdm())
|
||||
.like(StringUtils.isNotBlank(tbYsDl.getYsxl()), "ysxl", tbYsDl.getYsxl())
|
||||
.le(StringUtils.isNotBlank(dlsql), dlsql, tbYsDl.getCxjl())
|
||||
.eq("xt_sjzt", 1)
|
||||
);
|
||||
return tbYsDlList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsDlVo> selectByNr(String keyword) {
|
||||
List<TbYsDl> list = this.baseMapper.selectList(
|
||||
new LambdaQueryWrapper<TbYsDl>()
|
||||
.like(TbYsDl::getJsnr, keyword)
|
||||
.eq(TbYsDl::getXtScbz, "0")
|
||||
);
|
||||
List<TbYsDlVo> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsDlVo vo = new TbYsDlVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setDtm(JtsUtils.decodePolygon(item.getDtm()));
|
||||
vo.setZb(new BigDecimal[]{item.getJd(), item.getWd()});
|
||||
rList.add(vo);
|
||||
});
|
||||
return rList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsDl selectDlys(String ysmc) {
|
||||
return this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsDl>()
|
||||
.eq(TbYsDl::getYsmc, ysmc)
|
||||
.eq(TbYsDl::getXtSjzt, "1")
|
||||
.last(" limit 1")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,675 @@
|
||||
package com.mosty.yszx.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.base.GetDeptListDTO;
|
||||
import com.mosty.base.model.dto.rwzx.TbRwTaskDto;
|
||||
import com.mosty.base.model.dto.rwzx.TbRwTaskUserDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgAndGlbmDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgByJwdDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgDto;
|
||||
import com.mosty.base.model.dto.yszx.TbYsGajgGlbmDto;
|
||||
import com.mosty.base.model.entity.rwzx.TbRwTask;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgGlbmVo;
|
||||
import com.mosty.base.utils.*;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
|
||||
import com.mosty.common.core.business.entity.vo.Base64Str;
|
||||
import com.mosty.common.token.UserInfo;
|
||||
import com.mosty.common.token.UserInfoManager;
|
||||
import com.mosty.common.util.PermissionsUtil;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajg;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajgGlbm;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgVo;
|
||||
import com.mosty.yszx.mapper.TbYsGajgGlbmMapper;
|
||||
import com.mosty.yszx.mapper.TbYsGajgMapper;
|
||||
import com.mosty.yszx.remote.TbBaseAdaptRemoteService;
|
||||
import com.mosty.yszx.remote.TbRwzxAdaptRemoteService;
|
||||
import com.mosty.yszx.service.TbYsGajgService;
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/20
|
||||
**/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbYsGajgServiceImpl extends ServiceImpl<TbYsGajgMapper, TbYsGajg> implements TbYsGajgService {
|
||||
|
||||
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
|
||||
private final TbYsGajgGlbmMapper tbYsGajgGlbmMapper;
|
||||
private final TbRwzxAdaptRemoteService tbRwzxAdaptRemoteService;
|
||||
|
||||
|
||||
@Override
|
||||
public int addGajg(TbYsGajgAndGlbmDto dto) {
|
||||
TbYsGajg gajg = new TbYsGajg();
|
||||
BeanUtils.copyProperties(dto, gajg);
|
||||
gajg.setId(UUIDGenerator.getUUID());
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
gajg.setZb(JtsUtils.getPoint(gajg.getJd(), gajg.getWd()));
|
||||
gajg.setZbhash(GeoHashKit.encode(gajg.getJd(), gajg.getWd()));
|
||||
}
|
||||
if (dto.getQy() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dto.getQy1() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm1(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
if (dto.getQy2() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy2();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm2(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
gajg.setJsnr(dto.getGajgmc() + " " + dto.getGajgjc() + " " + dto.getWzXz() + " " + dto.getWzBc());
|
||||
gajg.setXtSjly("1");
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
gajg.setSsbm(dept.getDeptname());
|
||||
gajg.setSsbmid(dept.getDeptid());
|
||||
gajg.setSsbmdm(dept.getDeptcode());
|
||||
gajg.setSsxgajdm(dept.getFxjcode());
|
||||
gajg.setSsxgajid(dept.getFxjid());
|
||||
gajg.setSsxgaj(dept.getFxjname());
|
||||
gajg.setSssgaj(dept.getDszname());
|
||||
gajg.setSssgajdm(dept.getDszcode());
|
||||
gajg.setSssgajid(dept.getDszid());
|
||||
}
|
||||
List<TbYsGajgGlbmDto> dtoList = dto.getGlbmDtoList();
|
||||
dtoList.forEach(item -> {
|
||||
TbYsGajgGlbm bm = new TbYsGajgGlbm();
|
||||
bm.setId(UUIDGenerator.getUUID());
|
||||
bm.setGajgId(gajg.getId());
|
||||
DeptInfoVo vo = this.tbBaseAdaptRemoteService.getOrgByOrgcode(item.getSsbmdm());
|
||||
if (vo != null) {
|
||||
bm.setSsbmdm(vo.getDeptcode());
|
||||
bm.setSsbm(vo.getDeptname());
|
||||
bm.setSsbmid(vo.getDeptid());
|
||||
bm.setSsxgaj(vo.getFxjname());
|
||||
bm.setSsxgajid(vo.getFxjid());
|
||||
bm.setSsxgajdm(vo.getFxjcode());
|
||||
bm.setSssgaj(vo.getDszname());
|
||||
bm.setSssgajdm(vo.getDszcode());
|
||||
bm.setSssgajid(vo.getDszid());
|
||||
}
|
||||
bm.setXtSjly("1");
|
||||
this.tbYsGajgGlbmMapper.insert(bm);
|
||||
});
|
||||
gajg.setXtSjly("1");
|
||||
// 添加关联部门
|
||||
return this.baseMapper.insertEntity(gajg);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void editGajg(TbYsGajgAndGlbmDto dto) {
|
||||
TbYsGajg gajg = new TbYsGajg();
|
||||
BeanUtils.copyProperties(dto, gajg);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
gajg.setZb(JtsUtils.getPoint(gajg.getJd(), gajg.getWd()));
|
||||
gajg.setZbhash(GeoHashKit.encode(gajg.getJd(), gajg.getWd()));
|
||||
}
|
||||
if (dto.getQy() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dto.getQy1() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm1(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
if (dto.getQy2() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy2();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm2(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
gajg.setJsnr(dto.getGajgmc() + " " + dto.getGajgjc() + " " + dto.getWzXz() + " " + dto.getWzBc());
|
||||
gajg.setXtSjly("1");
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
gajg.setSsbm(dept.getDeptname());
|
||||
gajg.setSsbmid(dept.getDeptid());
|
||||
gajg.setSsbmdm(dept.getDeptcode());
|
||||
gajg.setSsxgajdm(dept.getFxjcode());
|
||||
gajg.setSsxgajid(dept.getFxjid());
|
||||
gajg.setSsxgaj(dept.getFxjname());
|
||||
gajg.setSssgaj(dept.getDszname());
|
||||
gajg.setSssgajdm(dept.getDszcode());
|
||||
gajg.setSssgajid(dept.getDszid());
|
||||
}
|
||||
List<TbYsGajgGlbmDto> dtoList = dto.getGlbmDtoList();
|
||||
// 删除之前的配置
|
||||
this.deleteGlbm(gajg.getId());
|
||||
dtoList.forEach(item -> {
|
||||
TbYsGajgGlbm bm = new TbYsGajgGlbm();
|
||||
bm.setId(UUIDGenerator.getUUID());
|
||||
bm.setGajgId(gajg.getId());
|
||||
DeptInfoVo vo = this.tbBaseAdaptRemoteService.getOrgByOrgcode(item.getSsbmdm());
|
||||
if (vo != null) {
|
||||
bm.setSsbmdm(vo.getDeptcode());
|
||||
bm.setSsbm(vo.getDeptname());
|
||||
bm.setSsbmid(vo.getDeptid());
|
||||
bm.setSsxgaj(vo.getFxjname());
|
||||
bm.setSsxgajid(vo.getFxjid());
|
||||
bm.setSsxgajdm(vo.getFxjcode());
|
||||
bm.setSssgaj(vo.getDszname());
|
||||
bm.setSssgajdm(vo.getDszcode());
|
||||
bm.setSssgajid(vo.getDszid());
|
||||
}
|
||||
bm.setXtSjly("1");
|
||||
this.tbYsGajgGlbmMapper.insert(bm);
|
||||
});
|
||||
gajg.setXtSjly("1");
|
||||
// 添加关联部门
|
||||
this.baseMapper.updateEntity(gajg);
|
||||
// 添加任务提醒
|
||||
UserInfo user = UserInfoManager.get();
|
||||
this.addTask(gajg, user);
|
||||
}
|
||||
|
||||
// 添加任务提醒功能
|
||||
private void addTask(TbYsGajg gajg, UserInfo user) {
|
||||
TbRwTaskDto dto = new TbRwTaskDto();
|
||||
String rwmc = "公安机关位置变更提醒";
|
||||
String rwnr = gajg.getGajgmc() + "信息发生变更,请知晓!!";
|
||||
dto.setRwmc(rwmc).setRwnr(rwnr)
|
||||
.setRwjsdx("02").setSfaqwc("0").setRwlx("1").setRwxl("06").setRwjjcd("3")
|
||||
.setRwms("2").setSsbmdm(gajg.getSsbmdm()).setSsbm(gajg.getSsbm()).setRwxxlx("WZBG").setSsbmid(gajg.getSsbmid());
|
||||
if (user != null) {
|
||||
dto.setCjrid(String.valueOf(user.getUserId())).setCjrxm(user.getUserName())
|
||||
.setCjrsfzh(user.getIdEntityCard()).setSsbm(user.getDeptName()).setSsbmdm(String.valueOf(user.getDeptId()));
|
||||
} else {
|
||||
dto.setCjrid("-1").setCjrxm("系统").setCjrsfzh("000000");
|
||||
}
|
||||
// 添加执行人
|
||||
List<TbRwTaskUserDto> userDtoList = new ArrayList<>();
|
||||
TbRwTaskUserDto userDto = new TbRwTaskUserDto();
|
||||
userDto.setRwzflx("02").setJsbmdm(gajg.getSssgajdm()).setJsbmmc(gajg.getSssgaj());
|
||||
userDtoList.add(userDto);
|
||||
dto.setUserDtoList(userDtoList);
|
||||
this.tbRwzxAdaptRemoteService.addRw(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsGajgGlbmDto> getGlbmList(String id) {
|
||||
List<TbYsGajgGlbm> list = this.tbYsGajgGlbmMapper.selectList(
|
||||
new LambdaQueryWrapper<TbYsGajgGlbm>()
|
||||
.eq(TbYsGajgGlbm::getXtSjzt, "1")
|
||||
.eq(TbYsGajgGlbm::getGajgId, id)
|
||||
);
|
||||
List<TbYsGajgGlbmDto> rList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsGajgGlbmDto dto = new TbYsGajgGlbmDto();
|
||||
BeanUtils.copyProperties(item, dto);
|
||||
rList.add(dto);
|
||||
});
|
||||
return rList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsGajgGlbmVo> getGajgList(TbYsGajgQuery dto) {
|
||||
List<String> ysxlList = StringUtils.isEmpty(dto.getYsxl()) ? null : Arrays.asList(dto.getYsxl().split(","));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
|
||||
map.put("dto", dto);
|
||||
// UserInfo user = UserInfoManager.getUser();
|
||||
// String useSql = user != null ? PermissionsUtil.createSql("", user) : "";
|
||||
// map.put("useSql", useSql);
|
||||
map.put("ysxlList", ysxlList);
|
||||
List<TbYsGajg> list = this.baseMapper.getList(map);
|
||||
List<TbYsGajgGlbmVo> voList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsGajgGlbmVo vo = new TbYsGajgGlbmVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
// 查询关联部门
|
||||
List<TbYsGajgGlbmDto> glbmList = this.getGlbmList(item.getId());
|
||||
List<String> glbms = (glbmList != null && glbmList.size() != 0) ?
|
||||
glbmList.stream().map(TbYsGajgGlbmDto::getSsbmid).collect(Collectors.toList()) : new ArrayList<>();
|
||||
glbms.add(item.getSsbmid());
|
||||
vo.setGlbmSsbmdmList(glbms);
|
||||
voList.add(vo);
|
||||
});
|
||||
return voList;
|
||||
}
|
||||
|
||||
private void deleteGlbm(String id) {
|
||||
this.tbYsGajgGlbmMapper.deleteGlbm(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertEntity(TbYsGajgDto dto) {
|
||||
TbYsGajg gajg = new TbYsGajg();
|
||||
BeanUtils.copyProperties(dto, gajg);
|
||||
gajg.setId(UUIDGenerator.getUUID());
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
gajg.setZb(JtsUtils.getPoint(gajg.getJd(), gajg.getWd()));
|
||||
gajg.setZbhash(GeoHashKit.encode(gajg.getJd(), gajg.getWd()));
|
||||
}
|
||||
if (dto.getQy() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dto.getQy1() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm1(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
if (dto.getQy2() != null) {
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy2();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm2(JtsUtils.getPolygon(list));
|
||||
}
|
||||
}
|
||||
gajg.setJsnr(dto.getGajgmc() + " " + dto.getGajgjc() + " " + dto.getWzXz() + " " + dto.getWzBc());
|
||||
gajg.setXtSjly("1");
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
gajg.setSsbm(dept.getDeptname());
|
||||
gajg.setSsbmid(dept.getDeptid());
|
||||
gajg.setSsbmdm(dept.getDeptcode());
|
||||
gajg.setSsxgajdm(dept.getFxjcode());
|
||||
gajg.setSsxgajid(dept.getFxjid());
|
||||
gajg.setSsxgaj(dept.getFxjname());
|
||||
gajg.setSssgaj(dept.getDszname());
|
||||
gajg.setSssgajdm(dept.getDszcode());
|
||||
gajg.setSssgajid(dept.getDszid());
|
||||
}
|
||||
return this.baseMapper.insertEntity(gajg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(TbYsGajgDto dto) {
|
||||
TbYsGajg gajg = new TbYsGajg();
|
||||
BeanUtils.copyProperties(dto, gajg);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
gajg.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
gajg.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
// 一分钟范围
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
// 三分钟范围
|
||||
ArrayList<BigDecimal[]> list1 = new ArrayList<>();
|
||||
List<BigDecimal> qw1 = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw1)) {
|
||||
for (int i = 0; i < qw1.size(); i++) {
|
||||
if (i != qw1.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw1.get(i);
|
||||
des[1] = qw1.get(i + 1);
|
||||
list1.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list1.size() > 0) {
|
||||
gajg.setDtm1(JtsUtils.getPolygon(list1));
|
||||
}
|
||||
// 三分钟范围
|
||||
ArrayList<BigDecimal[]> list2 = new ArrayList<>();
|
||||
List<BigDecimal> qw2 = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw2)) {
|
||||
for (int i = 0; i < qw2.size(); i++) {
|
||||
if (i != qw2.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw2.get(i);
|
||||
des[1] = qw2.get(i + 1);
|
||||
list2.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list2.size() > 0) {
|
||||
gajg.setDtm2(JtsUtils.getPolygon(list2));
|
||||
}
|
||||
this.baseMapper.updateEntity(gajg);
|
||||
gajg = this.baseMapper.getInfoById(gajg.getId());
|
||||
gajg.setJsnr(gajg.getGajgmc() + " " + gajg.getGajgjc() + " " + gajg.getWzXz() + " " + gajg.getWzBc());
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByDeptId(dto.getSsbmid());
|
||||
if (dept != null) {
|
||||
gajg.setSsbm(dept.getDeptname());
|
||||
gajg.setSsbmid(dept.getDeptid());
|
||||
gajg.setSsbmdm(dept.getDeptcode());
|
||||
gajg.setSsxgajdm(dept.getFxjcode());
|
||||
gajg.setSsxgajid(dept.getFxjid());
|
||||
gajg.setSsxgaj(dept.getFxjname());
|
||||
gajg.setSssgaj(dept.getDszname());
|
||||
gajg.setSssgajdm(dept.getDszcode());
|
||||
gajg.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.baseMapper.updateEntity(gajg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntityByLY(TbYsGajgDto dto) {
|
||||
TbYsGajg gajg = this.baseMapper.selectOne(new LambdaQueryWrapper<TbYsGajg>()
|
||||
.eq(TbYsGajg::getLyid, dto.getLyid())
|
||||
.eq(TbYsGajg::getLybm, dto.getLybm()));
|
||||
dto.setId(gajg.getId());
|
||||
BeanUtils.copyProperties(dto, gajg);
|
||||
if (dto.getJd() != null && dto.getWd() != null) {
|
||||
gajg.setZb(JtsUtils.getPoint(dto.getJd(), dto.getWd()));
|
||||
gajg.setZbhash(GeoHashKit.encode(dto.getJd(), dto.getWd()));
|
||||
}
|
||||
// 一分钟圈层
|
||||
ArrayList<BigDecimal[]> list = new ArrayList<>();
|
||||
List<BigDecimal> qw = dto.getQy();
|
||||
if (!CollectionUtils.isEmpty(qw)) {
|
||||
for (int i = 0; i < qw.size(); i++) {
|
||||
if (i != qw.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw.get(i);
|
||||
des[1] = qw.get(i + 1);
|
||||
list.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
gajg.setDtm(JtsUtils.getPolygon(list));
|
||||
}
|
||||
// 三分钟圈层
|
||||
ArrayList<BigDecimal[]> list1 = new ArrayList<>();
|
||||
List<BigDecimal> qw1 = dto.getQy1();
|
||||
if (!CollectionUtils.isEmpty(qw1)) {
|
||||
for (int i = 0; i < qw1.size(); i++) {
|
||||
if (i != qw1.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw1.get(i);
|
||||
des[1] = qw1.get(i + 1);
|
||||
list1.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list1.size() > 0) {
|
||||
gajg.setDtm1(JtsUtils.getPolygon(list1));
|
||||
}
|
||||
// 五分钟圈层
|
||||
ArrayList<BigDecimal[]> list2 = new ArrayList<>();
|
||||
List<BigDecimal> qw2 = dto.getQy2();
|
||||
if (!CollectionUtils.isEmpty(qw2)) {
|
||||
for (int i = 0; i < qw2.size(); i++) {
|
||||
if (i != qw2.size() - 1 && i % 2 == 0) {
|
||||
BigDecimal[] des = new BigDecimal[2];
|
||||
des[0] = qw2.get(i);
|
||||
des[1] = qw2.get(i + 1);
|
||||
list2.add(des);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list2.size() > 0) {
|
||||
gajg.setDtm2(JtsUtils.getPolygon(list2));
|
||||
}
|
||||
this.baseMapper.updateEntity(gajg);
|
||||
gajg = this.baseMapper.getInfoById(gajg.getId());
|
||||
gajg.setJsnr(gajg.getGajgmc() + " " + gajg.getGajgjc() + " " + gajg.getWzXz() + " " + gajg.getWzBc());
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
gajg.setSsbm(dept.getDeptname());
|
||||
gajg.setSsbmid(dept.getDeptid());
|
||||
gajg.setSsbmdm(dept.getDeptcode());
|
||||
gajg.setSsxgajdm(dept.getFxjcode());
|
||||
gajg.setSsxgajid(dept.getFxjid());
|
||||
gajg.setSsxgaj(dept.getFxjname());
|
||||
gajg.setSssgaj(dept.getDszname());
|
||||
gajg.setSssgajdm(dept.getDszcode());
|
||||
gajg.setSssgajid(dept.getDszid());
|
||||
}
|
||||
this.baseMapper.updateEntity(gajg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsGajgVo getInfo(String id) {
|
||||
TbYsGajg item = this.baseMapper.getInfoById(id);
|
||||
TbYsGajgVo vo = null;
|
||||
if (item != null) {
|
||||
vo = new TbYsGajgVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setDtm(JtsUtils.decodePolygon(item.getDtm()));
|
||||
vo.setDtm1(JtsUtils.decodePolygon(item.getDtm1()));
|
||||
vo.setDtm2(JtsUtils.decodePolygon(item.getDtm2()));
|
||||
vo.setZb(new BigDecimal[]{item.getJd(), item.getWd()});
|
||||
vo.setGlbmDtoList(
|
||||
this.tbYsGajgGlbmMapper.selectList(
|
||||
new LambdaQueryWrapper<TbYsGajgGlbm>()
|
||||
.eq(TbYsGajgGlbm::getGajgId, vo.getId())
|
||||
.eq(TbYsGajgGlbm::getXtSjzt, "1")
|
||||
)
|
||||
);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbYsGajgVo> getPageList(TbYsGajgQuery dto) {
|
||||
List<String> ysxlList = StringUtils.isEmpty(dto.getYsxl()) ? null : Arrays.asList(dto.getYsxl().split(","));
|
||||
IPage<TbYsGajgVo> page;
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(), null));
|
||||
map.put("dto", dto);
|
||||
// UserInfo user = UserInfoManager.getUser();
|
||||
// String useSql = user != null ? PermissionsUtil.createSql("", user) : "";
|
||||
// map.put("useSql", useSql);
|
||||
map.put("ysxlList", ysxlList);
|
||||
if (dto.getPageNum() != null && dto.getPageSize() != null) {
|
||||
page = new Page<>(dto.getPageNum(), dto.getPageSize());
|
||||
map.put("pageIndex", (dto.getPageNum() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
int count = this.baseMapper.getCount(map);
|
||||
List<TbYsGajg> list = this.baseMapper.getListPage(map);
|
||||
List<TbYsGajgVo> voList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsGajgVo vo = new TbYsGajgVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setDtm(JtsUtils.decodePolygon(item.getDtm()));
|
||||
vo.setDtm1(JtsUtils.decodePolygon(item.getDtm1()));
|
||||
vo.setDtm2(JtsUtils.decodePolygon(item.getDtm2()));
|
||||
vo.setZb(new BigDecimal[]{item.getJd(), item.getWd()});
|
||||
voList.add(vo);
|
||||
});
|
||||
page.setTotal(count);
|
||||
page.setRecords(voList);
|
||||
} else {
|
||||
page = new Page<>();
|
||||
List<TbYsGajg> list = this.baseMapper.getList(map);
|
||||
List<TbYsGajgVo> voList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
TbYsGajgVo vo = new TbYsGajgVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setDtm(JtsUtils.decodePolygon(item.getDtm()));
|
||||
vo.setDtm1(JtsUtils.decodePolygon(item.getDtm1()));
|
||||
vo.setDtm2(JtsUtils.decodePolygon(item.getDtm2()));
|
||||
vo.setZb(new BigDecimal[]{item.getJd(), item.getWd()});
|
||||
voList.add(vo);
|
||||
});
|
||||
page.setRecords(voList);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delEntity(String id) {
|
||||
TbYsGajg item = this.baseMapper.getInfoById(id);
|
||||
if (item != null) {
|
||||
item.setXtScbz("1");
|
||||
}
|
||||
this.baseMapper.updateEntity(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delEntity(TbYsGajgDto dto) {
|
||||
TbYsGajg tbYsGajg = this.baseMapper.selectOne(new LambdaQueryWrapper<TbYsGajg>()
|
||||
.eq(TbYsGajg::getLyid, dto.getLyid())
|
||||
.eq(TbYsGajg::getLybm, dto.getLybm()));
|
||||
if (tbYsGajg != null) {
|
||||
tbYsGajg.setXtScbz("1");
|
||||
}
|
||||
this.baseMapper.updateEntity(tbYsGajg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsGajgVo getGajgByJwd(TbYsGajgByJwdDto dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
TbYsGajgQuery query = new TbYsGajgQuery();
|
||||
query.setYsdl(dto.getYsdl());
|
||||
query.setYszl(dto.getYszl());
|
||||
query.setYsxl(dto.getYsxl());
|
||||
map.put("dto", query);
|
||||
List<TbYsGajg> list = this.baseMapper.getList(map);
|
||||
for (TbYsGajg item : list) {
|
||||
List<BigDecimal[]> jwdList = JtsUtils.decodePolygon(item.getDtm());
|
||||
Coordinate[] coordinates = new Coordinate[jwdList.size()];
|
||||
for (int i = 0; i < jwdList.size(); i++) {
|
||||
BigDecimal[] jwd = jwdList.get(i);
|
||||
Coordinate coor = new Coordinate();
|
||||
coor.x = jwd[0].doubleValue();
|
||||
coor.y = jwd[1].doubleValue();
|
||||
coordinates[i] = coor;
|
||||
}
|
||||
boolean flag = Kit.isInGeometry(coordinates, dto.getJd() + "," + dto.getWd());
|
||||
if (flag) {
|
||||
TbYsGajgVo vo = new TbYsGajgVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.mosty.yszx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mosty.base.model.dto.yszx.TbYsRyDto;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRy;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRyBq;
|
||||
import com.mosty.base.model.entity.yszx.TbYsRyDh;
|
||||
import com.mosty.base.model.vo.yszx.*;
|
||||
import com.mosty.yszx.mapper.TbYsRyBqMapper;
|
||||
import com.mosty.yszx.mapper.TbYsRyDhMapper;
|
||||
import com.mosty.yszx.mapper.TbYsRyMapper;
|
||||
import com.mosty.yszx.service.TbYsRyService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbYsRyServiceImpl extends ServiceImpl<TbYsRyMapper, TbYsRy>
|
||||
implements TbYsRyService {
|
||||
|
||||
private final TbYsRyDhMapper tbYsRyDhMapper;
|
||||
private final TbYsRyBqMapper tbYsRyBqMapper;
|
||||
|
||||
@Override
|
||||
public TbYsRyVo getRyInfo(String sfzh) {
|
||||
TbYsRy ry = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsRy>()
|
||||
.eq(TbYsRy::getZjhm, sfzh)
|
||||
.eq(TbYsRy::getXtSjzt, "1")
|
||||
);
|
||||
if (ry != null) {
|
||||
TbYsRyVo vo = new TbYsRyVo();
|
||||
BeanUtils.copyProperties(ry, vo);
|
||||
// 查询人员电话
|
||||
List<TbYsRyDh> dhList = this.tbYsRyDhMapper.selectList(
|
||||
new LambdaQueryWrapper<TbYsRyDh>()
|
||||
.eq(TbYsRyDh::getRyid, ry.getId())
|
||||
.eq(TbYsRyDh::getXtSjzt, "1")
|
||||
);
|
||||
List<TbYsRyDhVo> dhVos = new ArrayList<>();
|
||||
dhList.forEach(dh -> {
|
||||
TbYsRyDhVo dhVo = new TbYsRyDhVo();
|
||||
BeanUtils.copyProperties(dh, dhVo);
|
||||
dhVos.add(dhVo);
|
||||
});
|
||||
vo.setDhList(dhVos);
|
||||
// 查询人员标签
|
||||
List<TbYsRyBq> bqList = this.tbYsRyBqMapper.selectList(
|
||||
new LambdaQueryWrapper<TbYsRyBq>()
|
||||
.eq(TbYsRyBq::getRyid, ry.getId())
|
||||
.eq(TbYsRyBq::getXtSjzt, "1")
|
||||
);
|
||||
List<TbYsRyBqVo> bqVos = new ArrayList<>();
|
||||
bqList.forEach(bq -> {
|
||||
TbYsRyBqVo bqVo = new TbYsRyBqVo();
|
||||
BeanUtils.copyProperties(bq, bqVo);
|
||||
bqVos.add(bqVo);
|
||||
});
|
||||
vo.setBqList(bqVos);
|
||||
return vo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRyYs(TbYsRyDto dto) {
|
||||
TbYsRy ry = new TbYsRy();
|
||||
BeanUtils.copyProperties(dto, ry);
|
||||
this.baseMapper.insert(ry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRyYs(TbYsRyDto dto) {
|
||||
TbYsRy ry = new TbYsRy();
|
||||
BeanUtils.copyProperties(dto, ry);
|
||||
this.baseMapper.updateById(ry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRyBqYs(TbYsRyBqUpdateDto dto) {
|
||||
TbYsRy ry = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsRy>()
|
||||
.eq(TbYsRy::getZjhm, dto.getSfzh())
|
||||
.eq(TbYsRy::getXtSjzt, "1")
|
||||
);
|
||||
if (ry != null) {
|
||||
// 删除人员标签(新加的数据)
|
||||
this.tbYsRyBqMapper.deleteByRyId(ry.getId());
|
||||
// 新增人员标签
|
||||
TbYsRyBq bq = new TbYsRyBq();
|
||||
bq.setRyid(ry.getId());
|
||||
bq.setZjzl("1");
|
||||
bq.setZjhm(ry.getZjhm());
|
||||
bq.setBqdm(dto.getBqdm());
|
||||
bq.setBqmc(dto.getBqmc());
|
||||
bq.setBqrq(new Date());
|
||||
bq.setXtSjly("1");
|
||||
this.tbYsRyBqMapper.insert(bq);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRyDhys(TbYsRyDhUpdateDto dto) {
|
||||
TbYsRy ry = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsRy>()
|
||||
.eq(TbYsRy::getZjhm, dto.getSfzh())
|
||||
.eq(TbYsRy::getXtSjzt, "1")
|
||||
);
|
||||
if (ry != null) {
|
||||
// 删除人员电话(新加的数据)
|
||||
this.tbYsRyDhMapper.deleteByRyId(ry.getId());
|
||||
for (int i = 0; i < dto.getList().size(); i++) {
|
||||
Map<String, String> map = dto.getList().get(i);
|
||||
// 新增人员电话
|
||||
TbYsRyDh dh = new TbYsRyDh();
|
||||
dh.setRyid(ry.getId());
|
||||
dh.setZjzl("1");
|
||||
dh.setXm(ry.getXm());
|
||||
dh.setZjhm(ry.getZjhm());
|
||||
dh.setLxdh(map.get("lxdh"));
|
||||
dh.setImsi(map.get("imsi"));
|
||||
dh.setXtSjly("1");
|
||||
this.tbYsRyDhMapper.insert(dh);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,370 @@
|
||||
package com.mosty.yszx.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.hikvision.artemis.sdk.ArtemisHttpUtil;
|
||||
import com.mosty.base.model.dto.sjzx.TbSjSpbfDTO;
|
||||
import com.mosty.base.model.dto.yszx.Cameras;
|
||||
import com.mosty.base.model.dto.yszx.TbYsSxtDto;
|
||||
import com.mosty.base.model.entity.lzother.ZhjmxfXfqwXfqyGzdw;
|
||||
import com.mosty.base.model.entity.yszx.TbYsGajg;
|
||||
import com.mosty.base.model.entity.yszx.TbYsSxt;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtNoPageQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtPageOneQuery;
|
||||
import com.mosty.base.model.query.yszx.TbYsSxtQuery;
|
||||
import com.mosty.base.model.vo.base.DeptInfoVo;
|
||||
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
|
||||
import com.mosty.base.utils.CameraPreviewUtil;
|
||||
import com.mosty.base.utils.UUIDGenerator;
|
||||
import com.mosty.yszx.mapper.TbYsGajgMapper;
|
||||
import com.mosty.yszx.mapper.TbYsSxtMapper;
|
||||
import com.mosty.yszx.remote.TbBaseAdaptRemoteService;
|
||||
import com.mosty.yszx.remote.TbSjzxAdaptRemoteService;
|
||||
import com.mosty.yszx.service.TbYsSxtService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
//import org.locationtech.jts.geom.Geometry;
|
||||
//import org.locationtech.jts.io.WKTReader;
|
||||
//import org.geotools.geometry.jts.JTSFactoryFinder;
|
||||
|
||||
/**
|
||||
* @author dw
|
||||
* @since 2022/7/19
|
||||
**/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TbYsSxtServiceImpl extends ServiceImpl<TbYsSxtMapper, TbYsSxt> implements TbYsSxtService {
|
||||
|
||||
private final TbSjzxAdaptRemoteService tbSjzxAdaptRemoteService;
|
||||
private final TbBaseAdaptRemoteService tbBaseAdaptRemoteService;
|
||||
private final TbYsGajgMapper tbYsGajgMapper;
|
||||
|
||||
@Override
|
||||
public int insertEntity(TbYsSxtDto dto) {
|
||||
TbYsSxt sxt = new TbYsSxt();
|
||||
BeanUtils.copyProperties(dto, sxt);
|
||||
sxt.setId(UUIDGenerator.getUUID());
|
||||
sxt.setJsnr(sxt.getSbbh() + " " + sxt.getSbmc() + " " + sxt.getCsmc() + " " + sxt.getDzmc());
|
||||
sxt.setXtSjly("1");
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
sxt.setSsbmdm(dept.getDeptcode());
|
||||
sxt.setSsbmid(dept.getDeptid());
|
||||
sxt.setSsbm(dept.getDeptname());
|
||||
sxt.setSsxgaj(dept.getFxjname());
|
||||
sxt.setSsxgajid(dept.getFxjid());
|
||||
sxt.setSsxgajdm(dept.getFxjcode());
|
||||
sxt.setSssgaj(dept.getDszname());
|
||||
sxt.setSssgajid(dept.getDszid());
|
||||
sxt.setSssgajdm(dept.getDszid());
|
||||
}
|
||||
return this.baseMapper.insertEntity(sxt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(TbYsSxtDto dto) {
|
||||
TbYsSxt sxt = new TbYsSxt();
|
||||
BeanUtils.copyProperties(dto, sxt);
|
||||
|
||||
this.baseMapper.updateEntity(sxt);
|
||||
sxt = this.baseMapper.getInfoById(sxt.getId());
|
||||
sxt.setJsnr(sxt.getSbbh() + " " + sxt.getSbmc() + " " + sxt.getCsmc() + " " + sxt.getDzmc());
|
||||
DeptInfoVo dept = this.tbBaseAdaptRemoteService.getOrgByOrgcode(dto.getSsbmdm());
|
||||
if (dept != null) {
|
||||
sxt.setSsbmdm(dept.getDeptid());
|
||||
sxt.setSsbm(dept.getDeptname());
|
||||
sxt.setSsxgaj(dept.getFxjname());
|
||||
sxt.setSsxgajdm(dept.getFxjid());
|
||||
sxt.setSssgaj(dept.getDszname());
|
||||
sxt.setSssgajdm(dept.getDszid());
|
||||
}
|
||||
this.baseMapper.updateEntity(sxt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TbYsSxt> getPageList(TbYsSxtQuery dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(),null));
|
||||
map.put("pageIndex", (dto.getPageNum() - 1) * dto.getPageSize());
|
||||
map.put("pageSize", dto.getPageSize());
|
||||
map.put("dto", dto);
|
||||
|
||||
int count = this.baseMapper.getCount(map);
|
||||
List<TbYsSxt> list = this.baseMapper.getPageList(map);
|
||||
IPage<TbYsSxt> page = new Page<>(dto.getPageNum(), dto.getPageSize());
|
||||
page.setTotal(count);
|
||||
page.setRecords(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsSxt> getList(TbYsSxtNoPageQuery dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
dto.setSsbmdm(this.tbBaseAdaptRemoteService.getSsbm(dto.getSsbmdm(),null));
|
||||
map.put("dto", dto);
|
||||
return this.baseMapper.getList(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsSxt getInfo(String id) {
|
||||
return this.baseMapper.getInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delEntity(String id) {
|
||||
TbYsSxt sxt = this.baseMapper.getInfoById(id);
|
||||
if (sxt != null) {
|
||||
sxt.setXtScbz("1");
|
||||
this.baseMapper.updateEntity(sxt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbYsSxt> getSjList(String jd, String wd, String sjid) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("jd", jd);
|
||||
map.put("wd", wd);
|
||||
List<TbYsSxt> tbYsSxt = this.baseMapper.getSjList(map);
|
||||
if (!CollectionUtils.isEmpty(tbYsSxt)) {
|
||||
for (TbYsSxt tb : tbYsSxt) {
|
||||
TbSjSpbfDTO tbSjSpbf = new TbSjSpbfDTO();
|
||||
tbSjSpbf.setId(UUIDGenerator.getUUID());
|
||||
tbSjSpbf.setSjId(sjid);
|
||||
tbSjSpbf.setSxtId(tb.getId());
|
||||
tbSjSpbf.setBfkssj(new Date());
|
||||
tbSjSpbf.setSsbm(tb.getSsbm());
|
||||
tbSjSpbf.setSsbmdm(tb.getSsbmdm());
|
||||
tbSjSpbf.setSsxgaj(tb.getSsxgaj());
|
||||
tbSjSpbf.setSsxgajdm(tb.getSsxgajdm());
|
||||
tbSjSpbf.setSssgaj(tb.getSssgaj());
|
||||
tbSjSpbf.setSssgajdm(tb.getSssgajdm());
|
||||
tbSjzxAdaptRemoteService.tbSjSpbfAdd(tbSjSpbf);
|
||||
}
|
||||
}
|
||||
return tbYsSxt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertEntity(TbYsSxt sxt) {
|
||||
return this.baseMapper.insertEntity(sxt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsSxt queryBySjlyid(String sjlyid) {
|
||||
return this.baseMapper.queryBySjlyid(sjlyid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsSxtDto getInfoBySbbh(String sbbh) {
|
||||
TbYsSxt sxt = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsSxt>()
|
||||
.eq(TbYsSxt::getSbbh, sbbh)
|
||||
.last(" limit 1")
|
||||
);
|
||||
if (sxt != null) {
|
||||
TbYsSxtDto dto = new TbYsSxtDto();
|
||||
BeanUtils.copyProperties(sxt, dto);
|
||||
return dto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSxtBhList(List<String> ids) {
|
||||
List<String> rList = new ArrayList<>();
|
||||
ids.forEach(id -> {
|
||||
TbYsSxt sxt = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsSxt>()
|
||||
.eq(TbYsSxt::getXtSjzt, "1")
|
||||
.eq(TbYsSxt::getSbbh, id)
|
||||
.last("limit 1")
|
||||
);
|
||||
if (sxt == null) {
|
||||
rList.add(id);
|
||||
}
|
||||
});
|
||||
return rList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLzGzy(ZhjmxfXfqwXfqyGzdw dto) {
|
||||
TbYsSxt sxt = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsSxt>()
|
||||
.eq(TbYsSxt::getXtSjzt, "1")
|
||||
.eq(TbYsSxt::getSbbh, dto.getSbbh())
|
||||
.last(" limit 1")
|
||||
);
|
||||
if (sxt != null) return;
|
||||
sxt = new TbYsSxt();
|
||||
sxt.setSjlyid(dto.getId());
|
||||
sxt.setJkdbgbh(dto.getSbbh());
|
||||
sxt.setSbbh(dto.getSbbh());
|
||||
sxt.setSbmc(dto.getSbmc());
|
||||
sxt.setCsmc(dto.getCsmc());
|
||||
sxt.setIpdz(dto.getIpdz());
|
||||
sxt.setIpv6dz(dto.getIpv6dz());
|
||||
sxt.setJd(dto.getDqjd());
|
||||
sxt.setWd(dto.getDqwd());
|
||||
sxt.setXzqhdm(dto.getAzddXzqhdm());
|
||||
sxt.setDzmc(StringUtils.isEmpty(dto.getAzddDzmc()) ? dto.getSbmc() : dto.getAzddDzmc());
|
||||
sxt.setSblxdm(dto.getGzsblxdm());
|
||||
sxt.setJsfxdm(dto.getJsfxdm());
|
||||
sxt.setJsqysm(dto.getJsqysm());
|
||||
sxt.setSxjwzlxdm(dto.getSxjwzlxdm());
|
||||
sxt.setSxjytdm(dto.getSxjytdm());
|
||||
sxt.setSbzt("1");
|
||||
sxt.setXtSjly("1");
|
||||
sxt.setSblx("01");
|
||||
sxt.setJsnr(sxt.getSbbh() + " " + sxt.getSbmc() + " " + sxt.getCsmc() + " " + sxt.getDzmc());
|
||||
sxt.setSsxgaj(dto.getSsfxjmc());
|
||||
sxt.setSsxgajdm(dto.getSsfxjdm());
|
||||
sxt.setSssgaj(dto.getSsdszmc());
|
||||
sxt.setSssgajdm(dto.getSsdszdm());
|
||||
// TODO 计算所属辖区位置
|
||||
this.baseMapper.insertEntity(sxt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbYsSxtDto selectGzy(TbYsSxtPageOneQuery dto) {
|
||||
TbYsSxt sxt = this.baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<TbYsSxt>()
|
||||
.eq(TbYsSxt::getSbmc, dto.getSbmc())
|
||||
.eq(TbYsSxt::getJd, dto.getJd())
|
||||
.eq(TbYsSxt::getWd, dto.getWd())
|
||||
.eq(TbYsSxt::getXtSjzt, "1")
|
||||
.last(" limit 1")
|
||||
);
|
||||
if (sxt != null) {
|
||||
TbYsSxtDto vo = new TbYsSxtDto();
|
||||
BeanUtils.copyProperties(sxt, vo);
|
||||
return vo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJwd() {
|
||||
//获取经纬度为空为0数据
|
||||
LambdaQueryWrapper<TbYsSxt> wp = new LambdaQueryWrapper<>();
|
||||
wp.ne(TbYsSxt::getJd, 0).ne(TbYsSxt::getWd, 0);
|
||||
wp.notLike(TbYsSxt::getSsbm, "派出所").or(w -> w.isNull(TbYsSxt::getSsbm));
|
||||
List<TbYsSxt> tbYsSxts = this.baseMapper.selectList(wp);
|
||||
if (!CollectionUtils.isEmpty(tbYsSxts)) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
TbYsGajgQuery query = new TbYsGajgQuery();
|
||||
query.setGajgmc("派出所");
|
||||
map.put("dto", query);
|
||||
List<String> ysxlList = new ArrayList<String>() {{
|
||||
this.add("001001004");
|
||||
}};
|
||||
map.put("ysxlList", ysxlList);
|
||||
List<TbYsGajg> tbYsGajgs = this.tbYsGajgMapper.getList(map);
|
||||
// if (!CollectionUtils.isEmpty(tbYsGajgs)) {
|
||||
// for (TbYsSxt tb : tbYsSxts) {
|
||||
// if (tb.getJd() != null || tb.getWd() != null) {
|
||||
// for (TbYsGajg tbYsGajg : tbYsGajgs) {
|
||||
// if (!StringUtils.isEmpty(tbYsGajg.getDtm())) {
|
||||
// String wktPoly = tbYsGajg.getDtm().toString();
|
||||
// WKTReader reader = new WKTReader(JTSFactoryFinder.getGeometryFactory());
|
||||
// Geometry geometry;
|
||||
// try {
|
||||
// geometry = reader.read(wktPoly);
|
||||
// Geometry geometryOut = reader.read("POINT(" + tb.getJd() + " " + tb.getWd() + ")");
|
||||
// boolean isSsd = geometry.contains(geometryOut);
|
||||
// if (isSsd) {
|
||||
// tb.setSsbm(tbYsGajg.getGajgjc());
|
||||
// tb.setSsbmdm(tbYsGajg.getSsbmdm());
|
||||
// tb.setSsbmid(tbYsGajg.getSsbmid());
|
||||
// TbYsSxtDto dto = new TbYsSxtDto();
|
||||
// BeanUtils.copyProperties(tb, dto);
|
||||
// this.updateEntity(dto);
|
||||
// break;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateLzGzy() {
|
||||
this.baseMapper.deleteAll();
|
||||
saveGzy(1);
|
||||
|
||||
}
|
||||
|
||||
public void saveGzy(Integer pageNo) {
|
||||
final String getCamsApi = "/api/resource/v1/cameras";
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("pageNo", pageNo);
|
||||
jsonBody.put("pageSize", 1000);
|
||||
jsonBody.put("treeCode", 0);
|
||||
String result = CameraPreviewUtil.getCameraPreviewURL(getCamsApi, jsonBody);// post请求application/json类型参数
|
||||
if (!StringUtils.isEmpty(result)) {
|
||||
Cameras cameras = JSONObject.parseObject(result, Cameras.class);
|
||||
if (cameras.getCode().equals("0") && cameras.getData() != null) {
|
||||
List<Cameras.listInfo> list = cameras.getData().getList();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(v -> {
|
||||
if (!StringUtils.isEmpty(v.getCapabilitySetName()) && v.getCapabilitySetName().indexOf("Face") < 0) {
|
||||
// if (v.getStatus() == 1) {
|
||||
ZhjmxfXfqwXfqyGzdw entity = new ZhjmxfXfqwXfqyGzdw();
|
||||
entity.setId(UUIDGenerator.getUUID());
|
||||
entity.setSbbh(v.getGbIndexCode());
|
||||
entity.setSbmc(v.getName());
|
||||
entity.setCsmc("海康威视");
|
||||
entity.setDqjd(StringUtils.isEmpty(v.getLongitude()) ? null : new BigDecimal(v.getLongitude()));
|
||||
entity.setDqwd(StringUtils.isEmpty(v.getLatitude()) ? null : new BigDecimal(v.getLatitude()));
|
||||
// entity.setAzddDzmc(v.getName());
|
||||
entity.setGzsblxdm("01");
|
||||
entity.setCjsjlxdm("01");
|
||||
entity.setSxjytdm("1");
|
||||
entity.setSsdszmc("四川省雅安市公安局");
|
||||
entity.setSsdszdm("511800000000");
|
||||
entity.setSsstmc("四川省公安厅");
|
||||
entity.setSsstdm("510000000000");
|
||||
if (!StringUtils.isEmpty(v.getGbIndexCode()) && v.getGbIndexCode().length() >= 6) {
|
||||
String xzqh = v.getGbIndexCode().substring(0, 6);
|
||||
entity.setAzddXzqhdm(xzqh);
|
||||
switch (xzqh) {
|
||||
case "511825":
|
||||
entity.setSsfxjmc("四川省雅安市天全县公安局");
|
||||
entity.setSsfxjdm(xzqh + "000000");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!StringUtils.isEmpty(entity.getSsfxjmc())) {
|
||||
this.addLzGzy(entity);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
Integer page = (int) Math.ceil((double) cameras.getData().getTotal() / (double) cameras.getData().getPageSize());
|
||||
System.out.println(pageNo);
|
||||
if (page > pageNo) {
|
||||
this.saveGzy(pageNo + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user