1、增加swagger配置
This commit is contained in:
parent
8ea3443791
commit
a80ebd353a
18
pom.xml
18
pom.xml
|
@ -104,6 +104,24 @@
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.7.18</version>
|
<version>5.7.18</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
|
<version>2.9.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!--swagger-ui.html模式 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>2.9.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!--doc.html模式 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||||
|
<version>1.9.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableSwagger2
|
||||||
@MapperScan("com.hisense.monitormanage.mapper")
|
@MapperScan("com.hisense.monitormanage.mapper")
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.hisense.monitormanage.config;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Bean;//
|
||||||
|
import org.springframework.context.annotation.Configuration;//
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;//
|
||||||
|
import springfox.documentation.builders.PathSelectors;//
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;//
|
||||||
|
import springfox.documentation.service.ApiInfo;//
|
||||||
|
import springfox.documentation.service.Contact;//
|
||||||
|
import springfox.documentation.spi.DocumentationType;//
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;//
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author admin
|
||||||
|
* @version 1.0.0
|
||||||
|
* @ClassName SwaggerConfig.java
|
||||||
|
* @Description swagger配置类
|
||||||
|
* @createTime 2022年05月17日 09:39:00
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableSwagger2
|
||||||
|
public class SwaggerConfig {
|
||||||
|
|
||||||
|
@Value("${swagger.enable:false}")
|
||||||
|
private boolean enable;
|
||||||
|
@Bean
|
||||||
|
public Docket createRestApi(){
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.enable(enable)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("com.hisense.monitormanage.controller"))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build()
|
||||||
|
.apiInfo(apiInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
//构建 api文档的详细信息函数,注意这里的注解引用的是哪个
|
||||||
|
private ApiInfo apiInfo() {
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
//页面标题
|
||||||
|
.title("Spring Boot Swagger2 接口文档")
|
||||||
|
//创建人
|
||||||
|
.contact(new Contact("Hisense", "", "332163564@qq.com"))
|
||||||
|
//版本号
|
||||||
|
.version("1.0")
|
||||||
|
//描述
|
||||||
|
.description("API 描述")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -4,7 +4,11 @@ import com.hisense.monitormanage.dto.*;
|
||||||
import com.hisense.monitormanage.entity.*;
|
import com.hisense.monitormanage.entity.*;
|
||||||
import com.hisense.monitormanage.mapper.*;
|
import com.hisense.monitormanage.mapper.*;
|
||||||
import com.hisense.monitormanage.service.*;
|
import com.hisense.monitormanage.service.*;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
@ -276,55 +280,64 @@ public class Controller {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//道路统计数据与排名
|
//道路统计数据与排名
|
||||||
@RequestMapping("roadData")
|
@GetMapping("roadData")
|
||||||
|
@ApiOperation("道路统计数据与排名,根据后台dt调用接口")
|
||||||
public List<Map> roadData(){
|
public List<Map> roadData(){
|
||||||
return monitorService.roadData();
|
return monitorService.roadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//启迪中台
|
//启迪中台
|
||||||
//登录
|
//登录
|
||||||
@RequestMapping("qidiToken")
|
@GetMapping("qidiToken")
|
||||||
|
@ApiOperation("启迪数据中台登录获取token")
|
||||||
public String qidiToken(){
|
public String qidiToken(){
|
||||||
return monitorService.qidiToken();
|
return monitorService.qidiToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
//渣土车轨迹数据
|
//渣土车轨迹数据
|
||||||
@RequestMapping("resCatalogApplyZTYS")
|
@GetMapping("resCatalogApplyZTYS")
|
||||||
|
@ApiOperation("获取渣土车轨迹数据,根据后台UPLOADTIME调用接口")
|
||||||
public List<Map> resCatalogApply(){
|
public List<Map> resCatalogApply(){
|
||||||
return monitorService.resCatalogApplyZTYS();
|
return monitorService.resCatalogApplyZTYS();
|
||||||
}
|
}
|
||||||
|
|
||||||
//环卫车轨迹数据
|
//环卫车轨迹数据
|
||||||
@RequestMapping("resCatalogApplyHJWS")
|
@GetMapping("resCatalogApplyHJWS")
|
||||||
|
@ApiOperation("环卫车轨迹数据,根据后台updatetime调用接口")
|
||||||
public List<Map> resCatalogApplyHJWS(){
|
public List<Map> resCatalogApplyHJWS(){
|
||||||
return monitorService.resCatalogApplyHJWS();
|
return monitorService.resCatalogApplyHJWS();
|
||||||
}
|
}
|
||||||
|
|
||||||
//工地信息
|
//工地信息
|
||||||
@RequestMapping("resCatalogApplyGDYS")
|
@GetMapping("resCatalogApplyGDYS")
|
||||||
|
@ApiOperation("获取工地信息-表中获取")
|
||||||
public List<Map> resCatalogApplyGDYS(){
|
public List<Map> resCatalogApplyGDYS(){
|
||||||
return monitorService.resCatalogApplyGDYS();
|
return monitorService.resCatalogApplyGDYS();
|
||||||
}
|
}
|
||||||
|
|
||||||
//环卫车辆数据1,基础
|
//环卫车辆数据1,基础
|
||||||
@RequestMapping("resCatalogApplyHJWSBase")
|
@GetMapping("resCatalogApplyHJWSBase")
|
||||||
|
@ApiOperation("环卫车辆数据1,基础--根据后台updatetime调用接口")
|
||||||
public List<Map> resCatalogApplyHJWSBase(){
|
public List<Map> resCatalogApplyHJWSBase(){
|
||||||
return monitorService.resCatalogApplyHJWSBase();
|
return monitorService.resCatalogApplyHJWSBase();
|
||||||
}
|
}
|
||||||
//环卫车辆数据1,作业
|
//环卫车辆数据1,作业
|
||||||
@RequestMapping("resCatalogApplyHJWSZY")
|
@GetMapping("resCatalogApplyHJWSZY")
|
||||||
|
@ApiOperation("环卫车辆数据1,作业--根据后台ZYRQ调用接口")
|
||||||
public List<Map> resCatalogApplyHJWSZY(){
|
public List<Map> resCatalogApplyHJWSZY(){
|
||||||
return monitorService.resCatalogApplyHJWSZY();
|
return monitorService.resCatalogApplyHJWSZY();
|
||||||
}
|
}
|
||||||
|
|
||||||
//环卫道路明细数据
|
//环卫道路明细数据
|
||||||
@RequestMapping("resCatalogApplyHJWSRoad")
|
@GetMapping("resCatalogApplyHJWSRoad")
|
||||||
|
@ApiOperation("环卫道路明细数据,根据后台updatetime调用接口")
|
||||||
public List<Map> resCatalogApplyHJWSRoad(){
|
public List<Map> resCatalogApplyHJWSRoad(){
|
||||||
return monitorService.resCatalogApplyHJWSRoad();
|
return monitorService.resCatalogApplyHJWSRoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取渣土车轨迹并保存到t_trail_sediment
|
//获取渣土车轨迹并保存到t_trail_sediment
|
||||||
@RequestMapping(value = "saveResCatalogApplyZTYS")
|
@GetMapping(value = "saveResCatalogApplyZTYS")
|
||||||
|
@ApiOperation("取渣土车轨迹并保存到t_trail_sediment,根据后台UPLOADTIME调用接口")
|
||||||
public Result resCatalogApplyZTYS(){
|
public Result resCatalogApplyZTYS(){
|
||||||
|
|
||||||
boolean result = sedimentTrailService.batchSaveSedimentTrail();
|
boolean result = sedimentTrailService.batchSaveSedimentTrail();
|
||||||
|
@ -336,7 +349,15 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息
|
//根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息
|
||||||
@RequestMapping(value = "listSedimentTrailByPoints")
|
@GetMapping(value = "listSedimentTrailByPoints")
|
||||||
|
@ApiOperation("渣土车轨迹信息,根据经纬度和半径从表中查询")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "start", value = "开始时间,2021-08-03 10:17:23", paramType = "String"),
|
||||||
|
@ApiImplicitParam(name = "end", value = "结束时间,2021-08-03 12:17:23", paramType = "String")
|
||||||
|
})
|
||||||
public Result listSedimentTrailByPoints(
|
public Result listSedimentTrailByPoints(
|
||||||
@RequestParam(value="longitude") double longitude,
|
@RequestParam(value="longitude") double longitude,
|
||||||
@RequestParam(value="latitude") double latitude,
|
@RequestParam(value="latitude") double latitude,
|
||||||
|
@ -344,27 +365,29 @@ public class Controller {
|
||||||
@RequestParam(value="start") String start,
|
@RequestParam(value="start") String start,
|
||||||
@RequestParam(value = "end") String end
|
@RequestParam(value = "end") String end
|
||||||
){
|
){
|
||||||
System.out.println("listSedimentTrailByPoints......");
|
|
||||||
Map<String,List<SedimentTrail>> map = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end);
|
Map<String,List<SedimentTrail>> map = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end);
|
||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("passengerFlow")
|
|
||||||
//测试获取最新的客流列表,从接口获取
|
//测试获取最新的客流列表,从接口获取
|
||||||
|
@GetMapping("passengerFlow")
|
||||||
|
@ApiOperation("获取最新的客流列表,测试接口,调用接口获取")
|
||||||
public List<Map> passengerFlow(){
|
public List<Map> passengerFlow(){
|
||||||
List<Map> list = passengerFlowService.passengerFlow();
|
List<Map> list = passengerFlowService.passengerFlow();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取最新的实时客流列表,从表获取
|
//获取最新的实时客流列表,从表获取
|
||||||
@RequestMapping("listPassengerFlow")
|
@GetMapping("listPassengerFlow")
|
||||||
|
@ApiOperation("获取最新的实时客流列表,从表获取")
|
||||||
public List<PassengerFlow> listPassengerFlow(){
|
public List<PassengerFlow> listPassengerFlow(){
|
||||||
List<PassengerFlow> list = passengerFlowService.listPassengerFlow();
|
List<PassengerFlow> list = passengerFlowService.listPassengerFlow();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取实时客流并保存到表t_passenger_flow
|
//获取实时客流并保存到表t_passenger_flow
|
||||||
@RequestMapping("savePassengerFlow")
|
@GetMapping("savePassengerFlow")
|
||||||
|
@ApiOperation("获取实时客流并保存到表t_passenger_flow,调用接口")
|
||||||
public Result savePassengerFlow(){
|
public Result savePassengerFlow(){
|
||||||
List<Map> list = passengerFlowService.passengerFlow();
|
List<Map> list = passengerFlowService.passengerFlow();
|
||||||
boolean result = passengerFlowService.savePassengerFlow(list);
|
boolean result = passengerFlowService.savePassengerFlow(list);
|
||||||
|
@ -375,8 +398,15 @@ public class Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据输入的经纬度和查询的半径(米)和hourId查询游客总数
|
//根据输入的经纬度和查询的半径(米)和timeId查询游客总数
|
||||||
@RequestMapping("getPassengerNum")
|
@GetMapping("getPassengerNum")
|
||||||
|
@ApiOperation("查询游客总数,根据经纬度和半径米、timeId从表中查询")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "String"),
|
||||||
|
})
|
||||||
public Result getPassengerNum(
|
public Result getPassengerNum(
|
||||||
@RequestParam(value="longitude") double longitude,
|
@RequestParam(value="longitude") double longitude,
|
||||||
@RequestParam(value="latitude") double latitude,
|
@RequestParam(value="latitude") double latitude,
|
||||||
|
@ -387,7 +417,8 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询并保存环卫车轨迹到表t_trail_sanitation
|
//查询并保存环卫车轨迹到表t_trail_sanitation
|
||||||
@RequestMapping("saveTrailSanitation")
|
@GetMapping("saveTrailSanitation")
|
||||||
|
@ApiOperation("保存环卫车轨迹到表t_trail_sanitation,根据后台updatetime调用接口")
|
||||||
public Result saveTrailSanitation(){
|
public Result saveTrailSanitation(){
|
||||||
boolean result = trailSanitationService.saveTrailSanitation();
|
boolean result = trailSanitationService.saveTrailSanitation();
|
||||||
if(result){
|
if(result){
|
||||||
|
@ -398,7 +429,15 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据输入的经纬度和查询的半径(米)时间查询范围内的环卫车轨迹信息
|
//根据输入的经纬度和查询的半径(米)时间查询范围内的环卫车轨迹信息
|
||||||
@RequestMapping(value = "listTrailSanitationByPoints")
|
@GetMapping(value = "listTrailSanitationByPoints")
|
||||||
|
@ApiOperation("查询范围内环卫车轨迹信息,根据经纬度、半径米,时间从表中查询")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "double"),
|
||||||
|
@ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "start", value = "开始时间,2021-03-17 00:00:00", paramType = "String"),
|
||||||
|
@ApiImplicitParam(name = "end", value = "结束时间,2021-03-22 00:00:00", paramType = "String"),
|
||||||
|
})
|
||||||
public Result listTrailSanitationByPoints(
|
public Result listTrailSanitationByPoints(
|
||||||
@RequestParam(value="longitude") double longitude,
|
@RequestParam(value="longitude") double longitude,
|
||||||
@RequestParam(value="latitude") double latitude,
|
@RequestParam(value="latitude") double latitude,
|
||||||
|
@ -406,23 +445,24 @@ public class Controller {
|
||||||
@RequestParam(value="start") String start,
|
@RequestParam(value="start") String start,
|
||||||
@RequestParam(value = "end") String end
|
@RequestParam(value = "end") String end
|
||||||
){
|
){
|
||||||
// System.out.println("listTrailSanitationByPoints......");
|
|
||||||
List<TrailSanitation> list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end);
|
List<TrailSanitation> list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询道路污染数据
|
//查询道路污染数据
|
||||||
@RequestMapping(value="listRoadData")
|
|
||||||
//输入参考:2022-05-10 00:00:00,只能查询当前日期前一天及以前的
|
//输入参考:2022-05-10 00:00:00,只能查询当前日期前一天及以前的
|
||||||
|
@GetMapping(value="listRoadData")
|
||||||
|
@ApiOperation("查询道路污染数据,根据dt从表中查询,参考输入-2022-05-10 00:00:00,只能查询当前日期前一天及以前的")
|
||||||
public Result listRoadData(@RequestParam(value="dt") String dt){
|
public Result listRoadData(@RequestParam(value="dt") String dt){
|
||||||
List<RoadData> list = roadDataService.listRoadData(dt);
|
List<RoadData> list = roadDataService.listRoadData(dt);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询工地信息,根据经纬度和半径查询
|
//查询工地信息,根据经纬度和半径查询
|
||||||
@RequestMapping(value = "listBuildingSiteByPoints")
|
@GetMapping(value = "listBuildingSiteByPoints")
|
||||||
|
@ApiOperation("查询工地信息,根据经纬度和半径从表中查询")
|
||||||
public Result listBuildingSiteByPoints(double longitude,double latitude,Integer raidus){
|
public Result listBuildingSiteByPoints(double longitude,double latitude,Integer raidus){
|
||||||
List<BuildingSite> list = new ArrayList<>();
|
List<BuildingSite> list = new ArrayList<>();
|
||||||
|
|
||||||
list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,raidus);
|
list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,raidus);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package com.hisense.monitormanage.controller;
|
package com.hisense.monitormanage.controller;
|
||||||
|
|
||||||
|
import com.hisense.monitormanage.entity.CaseCityLaw;
|
||||||
import com.hisense.monitormanage.service.SJZTService;
|
import com.hisense.monitormanage.service.SJZTService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -9,15 +12,29 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api(tags = "数交中台-城市执法案件")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("api/project")
|
@RequestMapping("api/project")
|
||||||
public class SJZTController {
|
public class SJZTController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SJZTService sjztService;
|
private SJZTService sjztService;
|
||||||
|
|
||||||
|
//从接口获取案件数据
|
||||||
|
@ApiOperation("从接口获取案件数据")
|
||||||
@GetMapping("listSJZTDatas")
|
@GetMapping("listSJZTDatas")
|
||||||
public List<Map> listSJZTDatas(){
|
public List<Map> listSJZTDatas(){
|
||||||
return sjztService.listSJZTDatas();
|
return sjztService.listSJZTDatas();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//测试保存
|
||||||
|
@GetMapping("batchSaveSJZT")
|
||||||
|
public void batchSaveSJZT(){
|
||||||
|
sjztService.batchSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
//从表中查询案件数据,需要根据要求增加条件
|
||||||
|
@GetMapping("listSJZT")
|
||||||
|
public List<CaseCityLaw> listSJZT(){
|
||||||
|
return sjztService.listSJZT();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,11 @@ package com.hisense.monitormanage.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@ -13,11 +17,13 @@ import java.time.LocalDateTime;
|
||||||
* @Description 城市执法案件类
|
* @Description 城市执法案件类
|
||||||
* @createTime 2022年05月13日 15:32:00
|
* @createTime 2022年05月13日 15:32:00
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("t_case_cityLaw")
|
||||||
public class CaseCityLaw {
|
public class CaseCityLaw {
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
private Long id;
|
private Long id;
|
||||||
private String ajbs;
|
|
||||||
private String rwh;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime ajjlsj;
|
private LocalDateTime ajjlsj;
|
||||||
private String dzms;
|
private String dzms;
|
||||||
|
@ -26,140 +32,29 @@ public class CaseCityLaw {
|
||||||
private String wtlymc;
|
private String wtlymc;
|
||||||
private String ajlxbs;
|
private String ajlxbs;
|
||||||
private String ajlxmc;
|
private String ajlxmc;
|
||||||
private String wtlxbs;
|
|
||||||
private String wtlxmc;
|
|
||||||
private String dlbs;
|
private String dlbs;
|
||||||
private String dlmc;
|
private String dlmc;
|
||||||
private String xlbs;
|
private String xlbs;
|
||||||
private String xlmc;
|
private String xlmc;
|
||||||
private String wtlxdm;
|
|
||||||
private String bjbm;
|
|
||||||
private String qbs;
|
private String qbs;
|
||||||
private String qmc;
|
private String qmc;
|
||||||
private String jdbs;
|
private String jdbs;
|
||||||
private String jdmc;
|
private String jdmc;
|
||||||
private String sqbs;
|
private String sqbs;
|
||||||
private String sqmc;
|
private String sqmc;
|
||||||
private String wgbs;
|
private String xzb;
|
||||||
private String wgmc;
|
private String yzb;
|
||||||
private String zrwgbs;
|
|
||||||
private String zrwgmc;
|
|
||||||
private String dlbs2;
|
|
||||||
private String dlmc2;
|
|
||||||
private String dllxbs;
|
|
||||||
private String dllxmc;
|
|
||||||
private double xzb;
|
|
||||||
private double yzb;
|
|
||||||
private String hdsxbs;
|
|
||||||
private String wtdjbs;
|
|
||||||
private String wtdjmc;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime pqsj;
|
private LocalDateTime pqsj;
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime ajjssj;
|
private LocalDateTime ajjssj;
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime ajzfsj;
|
private LocalDateTime ajzfsj;
|
||||||
private String ywbs;
|
|
||||||
private String ywmc;
|
|
||||||
private String tlxsys;
|
|
||||||
private String latjbs;
|
|
||||||
private String latjmc;
|
|
||||||
private String jatjbs;
|
|
||||||
private String jatjmc;
|
|
||||||
private String ajxsbh;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime ajzxhdsj;
|
|
||||||
private String ajgkbs;
|
|
||||||
private String jjhts;
|
|
||||||
private String jjyqs;
|
|
||||||
private String yjzbbs;
|
|
||||||
private String yjzbmc;
|
|
||||||
private String ejzbbs;
|
|
||||||
private String ejzbmc;
|
|
||||||
private String mqsbzrzt;
|
|
||||||
private String zsqybs;
|
|
||||||
private String zsqymc;
|
|
||||||
private String zsjdbs;
|
|
||||||
private String zsjdmc;
|
|
||||||
private String zssqbs;
|
|
||||||
private String zssqmc;
|
|
||||||
private String dxlx;
|
|
||||||
private String dxly;
|
|
||||||
private String dxsbrxm;
|
|
||||||
private String sfbmbs;
|
|
||||||
private String czsxcqjaaqjacqwjayqja;
|
private String czsxcqjaaqjacqwjayqja;
|
||||||
private String sbtpsl;
|
private String sbtpsl;
|
||||||
private String cztpsl;
|
private String cztpsl;
|
||||||
private String clssqy;
|
|
||||||
private String clssgs;
|
|
||||||
private String sbqy;
|
|
||||||
private String sfxhfsf;
|
|
||||||
private String sqbhfsf;
|
|
||||||
private String mydmyybbmy;
|
|
||||||
private String hfnr;
|
|
||||||
private String bslly;
|
|
||||||
private String sfggdxl;
|
|
||||||
private String bmyly;
|
|
||||||
private String zjbjs;
|
|
||||||
private String tsyqs;
|
|
||||||
private String jalxbs;
|
|
||||||
private String zdajshztzzy;
|
|
||||||
private String sfzdajzzy;
|
|
||||||
private String zflas;
|
|
||||||
private String zfajh;
|
|
||||||
private String zfrwh;
|
|
||||||
private String czgwbs;
|
|
||||||
private String czgw;
|
|
||||||
private String dbs;
|
|
||||||
private String dfdbs;
|
|
||||||
private String asdfdbs;
|
|
||||||
private String csdfdbs;
|
|
||||||
private String mydpf;
|
|
||||||
private String glajbs;
|
|
||||||
private String yqcs;
|
|
||||||
private String gzcs;
|
|
||||||
private String jxid;
|
|
||||||
private String jxmc;
|
|
||||||
private String csbs;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime dbsj;
|
|
||||||
private String dbrybs;
|
|
||||||
private String dbryxm;
|
|
||||||
private String fjfz;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime ldsj;
|
|
||||||
private String sfdybs;
|
|
||||||
private String cxbls;
|
|
||||||
private String ldbs;
|
|
||||||
private String ldmc;
|
|
||||||
private String xybs;
|
|
||||||
private String xymc;
|
|
||||||
private String gdlxbs;
|
|
||||||
private String gdlx;
|
|
||||||
private String zajrwh;
|
|
||||||
private String zajbzw1zrw0zrw1ptrw;
|
|
||||||
private String zxpccgh;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime scpqsj;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime zhycpqsj;
|
|
||||||
private String bqzd;
|
|
||||||
private String dpbs;
|
|
||||||
private String wjlxid;
|
|
||||||
private String bjys;
|
|
||||||
private String ztys;
|
|
||||||
private String sbrssbm;
|
|
||||||
private String yczjdzpwgkehtbs1htg0whtg;
|
|
||||||
private String yczjdzpwgkehtcs;
|
|
||||||
private String wgxggajfsdgaryhdpch;
|
|
||||||
private String wgxggdhhm;
|
|
||||||
private String xflb;
|
|
||||||
private String yjjbajje;
|
|
||||||
private String yqajstgyqdzpdbjrw1;
|
|
||||||
private String sqjaj;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime operatetime;
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private LocalDateTime updatetime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,7 @@ import java.util.Map;
|
||||||
* @createTime 2022年05月13日 16:22:00
|
* @createTime 2022年05月13日 16:22:00
|
||||||
*/
|
*/
|
||||||
public interface CaseCityLawMapper extends BaseMapper<CaseCityLaw> {
|
public interface CaseCityLawMapper extends BaseMapper<CaseCityLaw> {
|
||||||
|
//public void batchSave(List<Map> list);
|
||||||
public void batchSave(List<Map> list);
|
public void batchSave(List<Map> list);
|
||||||
|
public void singleSave(Map map);
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,7 +639,7 @@ public class MonitorService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//渣土车轨迹数据
|
//渣土车轨迹数据,最新的
|
||||||
public List<Map> resCatalogApplyZTYS () {
|
public List<Map> resCatalogApplyZTYS () {
|
||||||
String token = this.qidiToken();
|
String token = this.qidiToken();
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
|
|
@ -3,7 +3,11 @@ package com.hisense.monitormanage.service;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
|
||||||
|
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.hisense.monitormanage.entity.CaseCityLaw;
|
||||||
import com.hisense.monitormanage.mapper.CaseCityLawMapper;
|
import com.hisense.monitormanage.mapper.CaseCityLawMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -83,21 +87,10 @@ public class SJZTService {
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
JSONObject search = new JSONObject();
|
JSONObject search = new JSONObject();
|
||||||
search.put("opt","LIKE");
|
search.put("opt","LIKE");
|
||||||
search.put("key","AJJLSJ");
|
search.put("key","WTLYMC");
|
||||||
// search.put("val",this.dateStr());
|
// search.put("val",this.dateStr());
|
||||||
search.put("val","2017");
|
search.put("val","微信举报");
|
||||||
|
|
||||||
// search.put("opt","EQ");
|
|
||||||
// search.put("key","SPEED");
|
|
||||||
// search.put("val","0");
|
|
||||||
// JSONArray searchArray = new JSONArray();
|
|
||||||
// searchArray.add(search);
|
|
||||||
// String encode = "";
|
|
||||||
// try {
|
|
||||||
// encode = URLEncoder.encode(JSONObject.toJSONString(searchArray), "UTF-8").replace("+", "%20");
|
|
||||||
// } catch (UnsupportedEncodingException e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
map.put("json",search);
|
map.put("json",search);
|
||||||
int i = 1;
|
int i = 1;
|
||||||
int roundCount = 0;
|
int roundCount = 0;
|
||||||
|
@ -114,7 +107,6 @@ public class SJZTService {
|
||||||
JSONObject jsonObject = responseEntity.getBody();
|
JSONObject jsonObject = responseEntity.getBody();
|
||||||
count = jsonObject.getIntValue("count");
|
count = jsonObject.getIntValue("count");
|
||||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||||
log.info("[listSJZTDatas] 返回数据的数量:{}",jsonArray.size());
|
|
||||||
maps.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
maps.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
||||||
i++;
|
i++;
|
||||||
roundCount = i*10000;
|
roundCount = i*10000;
|
||||||
|
@ -123,11 +115,12 @@ public class SJZTService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} while(roundCount <=count);
|
} while(roundCount <=count);
|
||||||
System.out.println(maps.size());
|
|
||||||
|
log.info("[listSJZTDatas] 返回数据的数量:{}",maps.size());
|
||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
//保存案件数据
|
//从接口获取案件数据并保存
|
||||||
public void batchSave(){
|
public void batchSave(){
|
||||||
String token = this.sjztToken();
|
String token = this.sjztToken();
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
@ -137,6 +130,7 @@ public class SJZTService {
|
||||||
JSONObject search = new JSONObject();
|
JSONObject search = new JSONObject();
|
||||||
search.put("opt","LIKE");
|
search.put("opt","LIKE");
|
||||||
search.put("key","AJJLSJ");
|
search.put("key","AJJLSJ");
|
||||||
|
// search.put("val",this.dateStr());
|
||||||
search.put("val","2017");
|
search.put("val","2017");
|
||||||
|
|
||||||
map.put("json",search);
|
map.put("json",search);
|
||||||
|
@ -163,14 +157,24 @@ public class SJZTService {
|
||||||
}
|
}
|
||||||
} while(roundCount <=count);
|
} while(roundCount <=count);
|
||||||
System.out.println(mapList.size());
|
System.out.println(mapList.size());
|
||||||
List<List<Map>> lists = Lists.partition(mapList,200);
|
|
||||||
|
IdentifierGenerator identifierGenerator=new DefaultIdentifierGenerator();
|
||||||
|
mapList.forEach(m-> m.put("id",identifierGenerator.nextId(new Object())));//给id赋值
|
||||||
|
|
||||||
|
List<List<Map>> lists = Lists.partition(mapList,50);
|
||||||
try{
|
try{
|
||||||
lists.forEach(l->caseCityLawMapper.batchSave(l));
|
lists.forEach(l->caseCityLawMapper.batchSave(l));
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
log.error("[SJZTService batchsave Exception]:",e.getMessage());
|
log.error("[SJZTService batchsave Exception]:",e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CaseCityLaw> listSJZT(){
|
||||||
|
QueryWrapper<CaseCityLaw> wrapper = new QueryWrapper<>();
|
||||||
|
return caseCityLawMapper.selectList(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||||
|
|
|
@ -11,7 +11,7 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.name=defaultDataSource
|
spring.datasource.name=defaultDataSource
|
||||||
# 数据库连接地址
|
# 数据库连接地址
|
||||||
#spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
#spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=GMT%2B8
|
spring.datasource.url=jdbc:mysql://15.72.183.91:3306/monitor_manage?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# 数据库用户名&密码:
|
# 数据库用户名&密码:
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=w@CmM1mBVQkPhdrc
|
spring.datasource.password=w@CmM1mBVQkPhdrc
|
||||||
|
@ -21,4 +21,6 @@ hwx.file.work-path=D:/tupian/
|
||||||
hwx.file.pic-host=http://127.0.0.1:7009
|
hwx.file.pic-host=http://127.0.0.1:7009
|
||||||
spring.resources.static-locations=classpath:/static,classpath:/public,file:${hwx.file.work-path}
|
spring.resources.static-locations=classpath:/static,classpath:/public,file:${hwx.file.work-path}
|
||||||
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
|
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
|
||||||
|
#??????swagger,true???false??
|
||||||
|
swagger.enable=true
|
||||||
|
|
||||||
|
|
|
@ -4,19 +4,35 @@
|
||||||
|
|
||||||
<insert id="batchSave" parameterType="java.util.List">
|
<insert id="batchSave" parameterType="java.util.List">
|
||||||
INSERT INTO t_case_citylaw
|
INSERT INTO t_case_citylaw
|
||||||
(ajjlsj,dzms,wtms,wtlybs,wtlymc,ajlxbs,ajlxmc,dlbs,dlmc,xlbs,xlmc,qbs,qmc,jdbs,
|
(id,ajjlsj,dzms,wtms,wtlybs,wtlymc,ajlxbs,ajlxmc,dlbs,dlmc,xlbs,xlmc,qbs,qmc,jdbs,
|
||||||
jdmc,sqbs,sqmc,xab,yzb,pqsj,sjjssj,ajzfsj,casxcqjaaqjacqwjayqja,sbtpsl,catpsl
|
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" separator="," >
|
<foreach collection="list" item="item" separator="," >
|
||||||
(
|
(
|
||||||
#{item.AJJLSJ},#{item.DZMS},#{item.WTMS},#{item.WTLYBS},#{item.WTLYMC},
|
#{item.id},#{item.AJJLSJ},#{item.DZMS},#{item.WTMS},#{item.WTLYBS},#{item.WTLYMC},
|
||||||
#{item.AJLXBS},#{item.AJLXMC},#{item.DLBS},#{item.DLMC},#{item.XLBS},
|
#{item.AJLXBS},#{item.AJLXMC},#{item.DLBS},#{item.DLMC},#{item.XLBS},
|
||||||
#{item.XLMC},#{item.QBS},#{item.QMC},#{item.JDBS},#{item.JDMC},#{item.SQBS},
|
#{item.XLMC},#{item.QBS},#{item.QMC},#{item.JDBS},#{item.JDMC},#{item.SQBS},
|
||||||
#{item.SQMC},#{item.XZB},#{item.YZB},#{item.PQSJ},#{item.AJJSSJ},#{item.AJZFSJ},
|
#{item.SQMC},#{item.XZB},#{item.YZB},#{item.PQSJ},#{item.AJJSSJ},#{item.AJZFSJ},
|
||||||
#{item.CZSXCQJAAQJACQWJAYQJA},#{item.SBTPSL},#{item.CZTPSL}
|
#{item.CZSXCQJAAQJACQWJAYQJA},#{item.SBTPSL},#{item.CZTPSL}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="singleSave" parameterType="java.util.Map">
|
||||||
|
INSERT INTO t_case_citylaw
|
||||||
|
(id,ajjlsj,dzms,wtms,wtlybs,wtlymc,ajlxbs,ajlxmc,dlbs,dlmc,xlbs,xlmc,qbs,qmc,jdbs,
|
||||||
|
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{id},#{AJJLSJ},#{DZMS},#{WTMS},#{WTLYBS},#{WTLYMC},
|
||||||
|
#{AJLXBS},#{AJLXMC},#{DLBS},#{DLMC},#{XLBS},
|
||||||
|
#{XLMC},#{QBS},#{QMC},#{JDBS},#{JDMC},#{SQBS},
|
||||||
|
#{SQMC},#{XZB},#{YZB},#{PQSJ},#{AJJSSJ},#{AJZFSJ},
|
||||||
|
#{itCZSXCQJAAQJACQWJAYQJA},#{SBTPSL},#{CZTPSL}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue