diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java new file mode 100644 index 00000000..9d791634 --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/original/GardsGPSData.java @@ -0,0 +1,44 @@ +package org.jeecg.modules.base.entity.original; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName("ORIGINAL.GARDS_GPS_DATA") +public class GardsGPSData implements Serializable { + + @TableField(value = "STATION_ID") + private Integer stationId; + + @TableField(value = "STATION_CODE") + private String stationCode; + + @TableField(value = "GPS_ID") + private Integer gpsId; + + @TableField(value = "LON") + private Double lon; + + @TableField(value = "LAT") + private Double lat; + + @TableField(value = "RECORD_TIME") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date recordTime; + + @TableField(value = "TIME_SPAN") + private Integer timeSpan; + + @TableField(value = "MODDATE") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date moddate; + +} diff --git a/jeecg-module-app/src/main/java/org/jeecg/modules/controller/StationController.java b/jeecg-module-app/src/main/java/org/jeecg/modules/controller/StationController.java index a78c4412..e7ccf2b5 100644 --- a/jeecg-module-app/src/main/java/org/jeecg/modules/controller/StationController.java +++ b/jeecg-module-app/src/main/java/org/jeecg/modules/controller/StationController.java @@ -7,10 +7,12 @@ import org.jeecg.modules.entity.StationOperation; import org.jeecg.modules.entity.SysUserFocusStationStation; import org.jeecg.modules.feignclient.StationService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; import java.util.List; @RestController @@ -84,6 +86,14 @@ public class StationController { return result; } - + // /stationOperation/getSelfStationGPS + @GetMapping("/stationOperation/getSelfStationGPS") + @ApiOperation(value = "查询台站运行轨迹", notes = "查询台站运行轨迹") + public Result getSelfStationGPS(String stationCode, + @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, + @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) { + Result result = stationService.getSelfStationGPS(stationCode, startDate, endDate); + return result; + } } diff --git a/jeecg-module-app/src/main/java/org/jeecg/modules/feignclient/StationService.java b/jeecg-module-app/src/main/java/org/jeecg/modules/feignclient/StationService.java index 53f7f53f..5e3ad6d1 100644 --- a/jeecg-module-app/src/main/java/org/jeecg/modules/feignclient/StationService.java +++ b/jeecg-module-app/src/main/java/org/jeecg/modules/feignclient/StationService.java @@ -4,10 +4,12 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.modules.entity.StationOperation; import org.jeecg.modules.entity.SysUserFocusStationStation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.Date; import java.util.List; @Component @@ -35,4 +37,8 @@ public interface StationService { @GetMapping("/sysUserFocusStation/findUserFocusByUserIdApp") Result findUserFocusByUserId(@RequestParam String userId); + @GetMapping("/stationOperation/getSelfStationGPS") + Result getSelfStationGPS(@RequestParam("stationCode") String stationCode, + @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, + @RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate); } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/controller/StationOperationController.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/controller/StationOperationController.java index 8d5c46f3..95ca38bd 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/controller/StationOperationController.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/controller/StationOperationController.java @@ -8,8 +8,10 @@ import org.jeecg.modules.entity.data.StationOperation; import org.jeecg.modules.service.IStationOperationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; @RestController @@ -97,4 +99,13 @@ public class StationOperationController { result.setResult(mapUrl); return result; } + + @GetMapping("getSelfStationGPS") + @ApiOperation(value = "查询自建台站运行轨迹", notes = "查询自建台站运行轨迹") + public Result getSelfStationGPS(@RequestParam("stationCode") String stationCode, + @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, + @RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) { + return stationOperationService.getSelfStationGPS(stationCode, startDate, endDate); + } + } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/SelfStationGPSData.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/SelfStationGPSData.java new file mode 100644 index 00000000..f46fcacb --- /dev/null +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/entity/data/SelfStationGPSData.java @@ -0,0 +1,28 @@ +package org.jeecg.modules.entity.data; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class SelfStationGPSData implements Serializable { + + private String stationCode; + + private Double lon; + + private Double lat; + + /** + * 时间间隔 单位是秒 + */ + private Integer timeSpan; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date recordDate; + +} diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationOperationMapper.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationOperationMapper.java index d2a1fbd7..292d6f41 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationOperationMapper.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/StationOperationMapper.java @@ -1,7 +1,14 @@ package org.jeecg.modules.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.entity.data.SelfStationGPSData; import org.jeecg.modules.entity.data.StationOperation; +import java.util.List; + public interface StationOperationMapper extends BaseMapper { + + List getSelfStationGPS(@Param(value = "stationCode") String stationCode, @Param(value = "startTime") String startTime, @Param(value = "endTime") String endTime); + } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationOperationMapper.xml b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationOperationMapper.xml new file mode 100644 index 00000000..433789fc --- /dev/null +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/stationOperationMapper.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/IStationOperationService.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/IStationOperationService.java index 4b5d80a6..c5edd232 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/IStationOperationService.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/IStationOperationService.java @@ -5,6 +5,7 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.modules.entity.data.PointVo; import org.jeecg.modules.entity.data.StationOperation; +import java.util.Date; import java.util.List; public interface IStationOperationService extends IService { @@ -57,4 +58,6 @@ public interface IStationOperationService extends IService { */ Result getDataProvisionEfficiency(); + Result getSelfStationGPS(String stationCode, Date startDate, Date endDate); + } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java index 2cf66ee6..c4bcfe0a 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java @@ -491,4 +491,28 @@ public class StationOperationServiceImpl extends ServiceImpl stationGPSDataList = this.baseMapper.getSelfStationGPS(stationCode, startTime, endTime); + result.setSuccess(true); + result.setResult(stationGPSDataList); + return result; + } + }