开发管理后台车辆管理模块部分接口和订单模块部分接口
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.feignClient.PlaybackMsgClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:37 |
| | | */ |
| | | public class PlaybackMsgClientFallbackFactory implements FallbackFactory<PlaybackMsgClient> { |
| | | @Override |
| | | public PlaybackMsgClient create(Throwable cause) { |
| | | return new PlaybackMsgClient() { |
| | | |
| | | @Override |
| | | public R<UPPlaybackMsgStartupAckVo> playbackMsgStartup(Integer inferiorPlatformId, String vehicleNo, Long startTime, Long endTime) { |
| | | return R.fail("远程录像回放请求失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R playbackMsgControl(Integer inferiorPlatformId, String vehicleNo, Integer controlType, Integer fastTime) { |
| | | return R.fail("远程录像回放控制失败:" + cause); |
| | | } |
| | | |
| | | |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.feignClient.RealVideoMsgClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:18 |
| | | */ |
| | | public class RealVideoMsgClientFallbackFactory implements FallbackFactory<RealVideoMsgClient> { |
| | | @Override |
| | | public RealVideoMsgClient create(Throwable cause) { |
| | | return new RealVideoMsgClient() { |
| | | @Override |
| | | public R<UPRealvideoMsgStartupAckVo> startupRealVideo(Integer inferiorPlatformId, String vehicleNo) { |
| | | return R.fail("发起实时音视频请求失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRealLocationClient; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 19:06 |
| | | */ |
| | | public class UPExgMsgRealLocationClientFallbackFactory implements FallbackFactory<UPExgMsgRealLocationClient> { |
| | | |
| | | @Override |
| | | public UPExgMsgRealLocationClient create(Throwable cause) { |
| | | return new UPExgMsgRealLocationClient(){ |
| | | |
| | | @Override |
| | | public R<List<OrderTravelVo>> getOrderTravel(String vehicleNo, Long start, Long end) { |
| | | return R.fail("获取订单行程轨迹失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.factory.PlaybackMsgClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:36 |
| | | */ |
| | | @FeignClient(contextId = "PlaybackMsgClient", value = ServiceNameConstants.DATA_INTERCHANGE_SERVICE, fallbackFactory = PlaybackMsgClientFallbackFactory.class) |
| | | public interface PlaybackMsgClient { |
| | | |
| | | |
| | | /** |
| | | * 远程录像回放请求 |
| | | * |
| | | * @param inferiorPlatformId |
| | | * @param vehicleNo |
| | | * @return |
| | | */ |
| | | @PostMapping("/playbackMsg/playbackMsgStartup") |
| | | R<UPPlaybackMsgStartupAckVo> playbackMsgStartup(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | @RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 远程录像回放控制 |
| | | * |
| | | * @param inferiorPlatformId 平台唯一码 |
| | | * @param vehicleNo 车牌号 |
| | | * @param controlType 控制类型 |
| | | * @param fastTime 快进快退倍数 |
| | | * @return |
| | | */ |
| | | @PostMapping("/playbackMsg/playbackMsgControl") |
| | | R playbackMsgControl(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | @RequestParam("controlType") Integer controlType, @RequestParam("fastTime") Integer fastTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.factory.RealVideoMsgClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:17 |
| | | */ |
| | | @FeignClient(contextId = "RealVideoMsgClient", value = ServiceNameConstants.DATA_INTERCHANGE_SERVICE, fallbackFactory = RealVideoMsgClientFallbackFactory.class) |
| | | public interface RealVideoMsgClient { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 发起实时音视频请求 |
| | | * |
| | | * @param vehicleNo 车牌号 |
| | | * @return |
| | | */ |
| | | @PostMapping("/realVideoMsg/startupRealVideo") |
| | | R<UPRealvideoMsgStartupAckVo> startupRealVideo(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.factory.UPExgMsgRealLocationClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 19:06 |
| | | */ |
| | | @FeignClient(contextId = "UPExgMsgRealLocationClient", value = ServiceNameConstants.DATA_INTERCHANGE_SERVICE, fallbackFactory = UPExgMsgRealLocationClientFallbackFactory.class) |
| | | public interface UPExgMsgRealLocationClient { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单行程轨迹 |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | @PostMapping("/upExgMsgRealLocation/getOrderTravel") |
| | | R<List<OrderTravelVo>> getOrderTravel(@RequestParam("vehicleNo") String vehicleNo, @RequestParam("start") Long start, |
| | | @RequestParam("end") Long end); |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 18:53 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class OrderTravelVo { |
| | | @ApiModelProperty(value = "经度") |
| | | private BigDecimal longitude; |
| | | @ApiModelProperty(value = "纬度") |
| | | private BigDecimal latitude; |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:33 |
| | | */ |
| | | @Data |
| | | public class UPPlaybackMsgStartupAckVo { |
| | | |
| | | private String id; |
| | | /** |
| | | * 下级平台唯一标识 |
| | | */ |
| | | private Integer inferiorPlatformId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Long createTime; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | private Integer vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | private Integer dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | private Integer dataLength; |
| | | /** |
| | | * 企业视频服务器IP地址 |
| | | */ |
| | | private String serverIP; |
| | | /** |
| | | * 企业视频服务端口号 |
| | | */ |
| | | private int serverPort; |
| | | /** |
| | | * 应答结果 |
| | | * 0x00: 成功 |
| | | * 0x01: 失败 |
| | | * 0x02: 不支持 |
| | | * 0x03: 会话结束 |
| | | * 0x04: 失效口令错误 |
| | | * 0x05: 不满足跨域条件 |
| | | */ |
| | | private int result; |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:22 |
| | | */ |
| | | @Data |
| | | public class UPRealvideoMsgStartupAckVo { |
| | | |
| | | private String id; |
| | | /** |
| | | * 下级平台唯一标识 |
| | | */ |
| | | private Integer inferiorPlatformId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Long createTime; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | private Integer vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | private Integer dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | private Integer dataLength; |
| | | /** |
| | | * 应答结果 |
| | | * 0x00: 成功 |
| | | * 0x01: 失败 |
| | | * 0x02: 不支持 |
| | | * 0x03: 会话结束 |
| | | * 0x04: 失效口令错误 |
| | | * 0x05: 不满足跨域条件 |
| | | */ |
| | | private int result; |
| | | /** |
| | | * 企业视频服务器IP地址 |
| | | */ |
| | | private String serverIP; |
| | | /** |
| | | * 企业视频服务端口号 |
| | | */ |
| | | private int serverPort; |
| | | } |
| | |
| | | com.ruoyi.dataInterchange.api.factory.UPExgMsgRegisterClientFallbackFactory |
| | | com.ruoyi.dataInterchange.api.factory.UPExgMsgReportDriverInfoClientFallbackFactory |
| | | com.ruoyi.dataInterchange.api.factory.RealVideoMsgClientFallbackFactory |
| | | com.ruoyi.dataInterchange.api.factory.UPExgMsgRealLocationClientFallbackFactory |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | * @Date 2025/3/17 11:29 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("t_car") |
| | | public class Car { |
| | | /** |
| | |
| | | * 车牌号 |
| | | */ |
| | | @TableField("vehicle_number") |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String vehicleNumber; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | @TableField("license_plate_color") |
| | | @ApiModelProperty(value = "车牌颜色") |
| | | private String licensePlateColor; |
| | | /** |
| | | * 所属企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | @ApiModelProperty(value = "所属企业id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 企业名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String enterpriseName; |
| | | /** |
| | | * 载客数 |
| | | */ |
| | | @TableField("passenger_capacity") |
| | | @ApiModelProperty(value = "载客数") |
| | | private String passengerCapacity; |
| | | /** |
| | | * 车辆品牌 |
| | | */ |
| | | @TableField("brand") |
| | | @ApiModelProperty(value = "车辆品牌") |
| | | private String brand; |
| | | /** |
| | | * 车辆品牌型号 |
| | | */ |
| | | @TableField("brand_model") |
| | | @ApiModelProperty(value = "车辆品牌型号") |
| | | private String brandModel; |
| | | /** |
| | | * 车辆类型 |
| | | */ |
| | | @TableField("vehicle_type") |
| | | @ApiModelProperty(value = "车辆类型") |
| | | private String vehicleType; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driver_id") |
| | | @ApiModelProperty(value = "司机id") |
| | | private Integer driverId; |
| | | /** |
| | | * 车身颜色 |
| | | */ |
| | | @TableField("vehicle_color") |
| | | @ApiModelProperty(value = "车身颜色") |
| | | private String vehicleColor; |
| | | /** |
| | | * 经营区域 |
| | | */ |
| | | @TableField("operating_area") |
| | | @ApiModelProperty(value = "经营区域") |
| | | private String operatingArea; |
| | | /** |
| | | * 运营类型 |
| | | */ |
| | | @TableField("operate_type") |
| | | @ApiModelProperty(value = "运营类型") |
| | | private String operateType; |
| | | /** |
| | | * 发动机号 |
| | | */ |
| | | @TableField("engine_number") |
| | | @ApiModelProperty(value = "发动机号") |
| | | private String engineNumber; |
| | | /** |
| | | * 车辆VIN码 |
| | | */ |
| | | @TableField("vin") |
| | | @ApiModelProperty(value = "车辆VIN码") |
| | | private String vin; |
| | | /** |
| | | * 注册日期 |
| | | */ |
| | | @TableField("registration_date") |
| | | @ApiModelProperty(value = "注册日期") |
| | | private String registrationDate; |
| | | /** |
| | | * 燃料类型 |
| | | */ |
| | | @TableField("fuel_type") |
| | | @ApiModelProperty(value = "燃料类型") |
| | | private String fuelType; |
| | | /** |
| | | * 发动机排量 |
| | | */ |
| | | @TableField("engine_capacity") |
| | | @ApiModelProperty(value = "发动机排量") |
| | | private String engineCapacity; |
| | | /** |
| | | * 运输证发证机关 |
| | | */ |
| | | @TableField("transport_license_issuing_authority") |
| | | @ApiModelProperty(value = "运输证发证机关") |
| | | private String transportLicenseIssuingAuthority; |
| | | /** |
| | | * 运输证有效期开始时间 |
| | | */ |
| | | @TableField("transport_certificate_start") |
| | | @ApiModelProperty(value = "运输证有效期开始时间") |
| | | private String transportCertificateStart; |
| | | /** |
| | | * 运输证有效期结束时间 |
| | | */ |
| | | @TableField("transport_certificate_end") |
| | | @ApiModelProperty(value = "运输证有效期结束时间") |
| | | private String transportCertificateEnd; |
| | | /** |
| | | * 车辆初次登记时间 |
| | | */ |
| | | @TableField("initial_registration_time") |
| | | @ApiModelProperty(value = "车辆初次登记时间") |
| | | private String initialRegistrationTime; |
| | | /** |
| | | * 车辆检修状态 |
| | | */ |
| | | @TableField("vehicle_maintenance_status") |
| | | @ApiModelProperty(value = "车辆检修状态") |
| | | private String vehicleMaintenanceStatus; |
| | | /** |
| | | * 车辆年审状态 |
| | | */ |
| | | @TableField("annual_review_status") |
| | | @ApiModelProperty(value = "车辆年审状态") |
| | | private String annualReviewStatus; |
| | | /** |
| | | * 卫星定位装置品牌 |
| | | */ |
| | | @TableField("gps_brand") |
| | | @ApiModelProperty(value = "卫星定位装置品牌") |
| | | private String gpsBrand; |
| | | /** |
| | | * 卫星定位装置型号 |
| | | */ |
| | | @TableField("gps_model") |
| | | @ApiModelProperty(value = "卫星定位装置型号") |
| | | private String gpsModel; |
| | | /** |
| | | * 卫星定位装置IMEI号 |
| | | */ |
| | | @TableField("gps_imei") |
| | | @ApiModelProperty(value = "卫星定位装置IMEI号") |
| | | private String gpsImei; |
| | | /** |
| | | * 卫星定位装置安装日期 |
| | | */ |
| | | @TableField("gps_installation_date") |
| | | @ApiModelProperty(value = "卫星定位装置安装日期") |
| | | private String gpsInstallationDate; |
| | | /** |
| | | * 运价类型编码 |
| | | */ |
| | | @TableField("rate_type_number") |
| | | @ApiModelProperty(value = "运价类型编码") |
| | | private String rateTypeNumber; |
| | | /** |
| | | * 运输证字号 |
| | | */ |
| | | @TableField("transport_certificate_number") |
| | | @ApiModelProperty(value = "运输证字号") |
| | | private String transportCertificateNumber; |
| | | /** |
| | | * 车辆状态(1=在线,2=异常,3=离线,4=故障) |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty(value = "车辆状态(1=在线,2=异常,3=离线,4=故障)") |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * 司机名称 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "司机名称") |
| | | private String driverName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:41 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("t_order") |
| | | public class Order { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "id") |
| | | private Integer id; |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @TableField("code") |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | /** |
| | | * 车辆id |
| | | */ |
| | | @TableField("car_id") |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Integer carId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String vehicleNumber; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "车牌颜色") |
| | | private String licensePlateColor; |
| | | /** |
| | | * 驾驶员id |
| | | */ |
| | | @TableField("driver_id") |
| | | @ApiModelProperty(value = "驾驶员id") |
| | | private Integer driverId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "司机姓名") |
| | | private String driverName; |
| | | /** |
| | | * 企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | @ApiModelProperty(value = "企业id") |
| | | private Integer enterpriseId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "企业名称") |
| | | private String enterpriseName; |
| | | /** |
| | | * 下单地 |
| | | */ |
| | | @TableField("order_place") |
| | | @ApiModelProperty(value = "下单地") |
| | | private String orderPlace; |
| | | /** |
| | | * 上车点 |
| | | */ |
| | | @TableField("boarding_point") |
| | | @ApiModelProperty(value = "上车点") |
| | | private String boardingPoint; |
| | | /** |
| | | * 下车点 |
| | | */ |
| | | @TableField("drop_off_point") |
| | | @ApiModelProperty(value = "下车点") |
| | | private String dropOffPoint; |
| | | /** |
| | | * 载客里程 |
| | | */ |
| | | @TableField("passenger_mileage") |
| | | @ApiModelProperty(value = "载客里程") |
| | | private String passengerMileage; |
| | | /** |
| | | * 订单时间 |
| | | */ |
| | | @TableField("order_time") |
| | | @ApiModelProperty(value = "订单时间") |
| | | private String orderTime; |
| | | /** |
| | | * 派单时间 |
| | | */ |
| | | @TableField("order_delivery_time") |
| | | @ApiModelProperty(value = "派单时间") |
| | | private String orderDeliveryTime; |
| | | /** |
| | | * 订单金额 |
| | | */ |
| | | @TableField("order_amount") |
| | | @ApiModelProperty(value = "订单金额") |
| | | private String orderAmount; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | @TableField("payment_amount") |
| | | @ApiModelProperty(value = "支付金额") |
| | | private String paymentAmount; |
| | | /** |
| | | * 运价类型编号 |
| | | */ |
| | | @TableField("tariff_type") |
| | | @ApiModelProperty(value = "运价类型编号") |
| | | private String tariffType; |
| | | /** |
| | | * 支付方式 |
| | | */ |
| | | @TableField("payment_mode") |
| | | @ApiModelProperty(value = "支付方式") |
| | | private String paymentMode; |
| | | /** |
| | | * 乘客备注 |
| | | */ |
| | | @TableField("remark") |
| | | @ApiModelProperty(value = "乘客备注") |
| | | private String remark; |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.PlaybackMsgClient; |
| | | import com.ruoyi.dataInterchange.api.feignClient.RealVideoMsgClient; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRealLocationClient; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @RestController |
| | | @RequestMapping("/car") |
| | | public class CarController { |
| | | |
| | | @Resource |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | @Resource |
| | | private IEnterpriseService enterpriseService; |
| | | |
| | | @Resource |
| | | private RealVideoMsgClient realVideoMsgClient; |
| | | |
| | | @Resource |
| | | private PlaybackMsgClient playbackMsgClient; |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationClient upExgMsgRealLocationClient; |
| | | |
| | | |
| | | @GetMapping("/getCarList") |
| | | @ApiOperation(value = "获取车辆列表", tags = {"车辆管理"}) |
| | | public R<PageInfo<CarListResp>> getCarList(CarListReq carListReq) { |
| | | PageInfo<CarListResp> carList = carService.getCarList(carListReq); |
| | | return R.ok(carList); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarInfo/{id}") |
| | | @ApiOperation(value = "获取车辆详情", tags = {"车辆管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true) |
| | | }) |
| | | public R<Car> getCarInfo(@PathVariable("id") Integer id){ |
| | | Car car = carService.getById(id); |
| | | if(null == car){ |
| | | return R.fail("失败"); |
| | | } |
| | | Driver driver = driverService.getOne(new LambdaQueryWrapper<Driver>().eq(Driver::getVehicleNumber, car.getVehicleNumber()).eq(Driver::getStatus, 1)); |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | car.setEnterpriseName(enterprise.getName()); |
| | | car.setDriverName(driver.getName()); |
| | | return R.ok(car); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getRealVideo/{id}") |
| | | @ApiOperation(value = "获取实时音视频", tags = {"车辆管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true) |
| | | }) |
| | | public R<RealVideoResp> getRealVideo(@PathVariable("id") Integer id){ |
| | | Car car = carService.getById(id); |
| | | if(null == car){ |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | R<UPRealvideoMsgStartupAckVo> msgStartupAckVoR = realVideoMsgClient.startupRealVideo(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber()); |
| | | if(200 == msgStartupAckVoR.getCode()){ |
| | | UPRealvideoMsgStartupAckVo data = msgStartupAckVoR.getData(); |
| | | RealVideoResp resp = new RealVideoResp(); |
| | | resp.setServerIp(data.getServerIP()); |
| | | resp.setServerPort(data.getServerPort()); |
| | | return R.ok(resp); |
| | | } |
| | | return R.fail(msgStartupAckVoR.getMsg()); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getPlaybackVideo") |
| | | @ApiOperation(value = "获取音视频回放", tags = {"车辆管理"}) |
| | | public R<RealVideoResp> getPlaybackVideo(PlaybackVideoReq req){ |
| | | Car car = carService.getById(req.getId()); |
| | | if(null == car){ |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | R<UPPlaybackMsgStartupAckVo> startupAckVoR = playbackMsgClient.playbackMsgStartup(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber(), |
| | | req.getStartTime(), req.getEndTime()); |
| | | if(200 == startupAckVoR.getCode()){ |
| | | UPPlaybackMsgStartupAckVo data = startupAckVoR.getData(); |
| | | RealVideoResp resp = new RealVideoResp(); |
| | | resp.setServerIp(data.getServerIP()); |
| | | resp.setServerPort(data.getServerPort()); |
| | | return R.ok(resp); |
| | | } |
| | | return R.fail(startupAckVoR.getMsg()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/playbackMsgControl") |
| | | @ApiOperation(value = "音视频回放远程控制", tags = {"车辆管理"}) |
| | | public R playbackMsgControl(PlaybackMsgControlReq req){ |
| | | Car car = carService.getById(req.getId()); |
| | | if(null == car){ |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | return playbackMsgClient.playbackMsgControl(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber(), |
| | | req.getControlType(), req.getFastTime()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getCarTravel") |
| | | @ApiOperation(value = "获取车辆行程轨迹", tags = {"车辆管理"}) |
| | | public R<List<OrderTravelVo>> getCarTravel(CarTravelReq req){ |
| | | Car car = carService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getVehicleNumber, req.getVehicleNumber())); |
| | | Long startTime; |
| | | Long endTime; |
| | | if(null != req.getStartTime() && null != req.getEndTime()){ |
| | | startTime = req.getStartTime(); |
| | | endTime = req.getEndTime(); |
| | | }else{ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | startTime = now.minusMinutes(1).toEpochSecond(ZoneOffset.ofHours(8)); |
| | | endTime = now.toEpochSecond(ZoneOffset.ofHours(8)); |
| | | } |
| | | R<List<OrderTravelVo>> orderTravel = upExgMsgRealLocationClient.getOrderTravel(car.getVehicleNumber(), startTime, endTime); |
| | | return orderTravel; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.PlaybackMsgClient; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRealLocationClient; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.api.model.Order; |
| | | import com.ruoyi.system.query.OrderListReq; |
| | | import com.ruoyi.system.query.RealVideoResp; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import com.ruoyi.system.service.IOrderService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:50 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | public class OrderController { |
| | | |
| | | @Resource |
| | | private IOrderService orderService; |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | @Resource |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private IEnterpriseService enterpriseService; |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationClient upExgMsgRealLocationClient; |
| | | |
| | | @Resource |
| | | private PlaybackMsgClient playbackMsgClient; |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getOrderList") |
| | | @ApiOperation(value = "获取订单列表", tags = {"车辆管理", "订单管理"}) |
| | | public R<PageInfo<Order>> getOrderList(OrderListReq req){ |
| | | PageInfo<Order> orderList = orderService.getOrderList(req); |
| | | return R.ok(orderList); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getOrderInfo/{id}") |
| | | @ApiOperation(value = "获取订单详情", tags = {"订单管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true) |
| | | }) |
| | | public R<Order> getOrderInfo(@PathVariable("id") Integer id){ |
| | | Order order = orderService.getById(id); |
| | | if(null == order){ |
| | | return R.fail("失败"); |
| | | } |
| | | Driver driver = driverService.getById(order.getDriverId()); |
| | | Car car = carService.getById(order.getCarId()); |
| | | Enterprise enterprise = enterpriseService.getById(order.getEnterpriseId()); |
| | | order.setDriverName(driver.getName()); |
| | | order.setVehicleNumber(car.getVehicleNumber()); |
| | | order.setEnterpriseName(enterprise.getName()); |
| | | return R.ok(order); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getOrderTravel") |
| | | @ApiOperation(value = "获取订单行程轨迹", tags = {"订单管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true) |
| | | }) |
| | | public R<List<OrderTravelVo>> getOrderTravel(@PathVariable("id") Integer id){ |
| | | Order order = orderService.getById(id); |
| | | if(null == order){ |
| | | return R.fail("失败"); |
| | | } |
| | | Car car = carService.getById(order.getCarId()); |
| | | LocalDateTime dateTime = LocalDateTime.parse(order.getOrderTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | long startTime = dateTime.toEpochSecond(ZoneOffset.ofHours(8)); |
| | | long endTime = dateTime.plusDays(1).toEpochSecond(ZoneOffset.ofHours(8)); |
| | | R<List<OrderTravelVo>> orderTravel = upExgMsgRealLocationClient.getOrderTravel(car.getVehicleNumber(), startTime, endTime); |
| | | return orderTravel; |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getOrderMonitoring") |
| | | @ApiOperation(value = "获取订单监控", tags = {"订单管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true) |
| | | }) |
| | | public R<RealVideoResp> getOrderMonitoring(@PathVariable("id") Integer id){ |
| | | Order order = orderService.getById(id); |
| | | if(null == order){ |
| | | return R.fail("失败"); |
| | | } |
| | | Car car = carService.getById(order.getCarId()); |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | LocalDateTime dateTime = LocalDateTime.parse(order.getOrderTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | long startTime = dateTime.toEpochSecond(ZoneOffset.ofHours(8)); |
| | | long endTime = dateTime.plusDays(1).toEpochSecond(ZoneOffset.ofHours(8)); |
| | | R<UPPlaybackMsgStartupAckVo> startupAckVoR = playbackMsgClient.playbackMsgStartup(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber(), |
| | | startTime, endTime); |
| | | if(200 == startupAckVoR.getCode()){ |
| | | UPPlaybackMsgStartupAckVo data = startupAckVoR.getData(); |
| | | RealVideoResp resp = new RealVideoResp(); |
| | | resp.setServerIp(data.getServerIP()); |
| | | resp.setServerPort(data.getServerPort()); |
| | | return R.ok(resp); |
| | | } |
| | | return R.fail(startupAckVoR.getMsg()); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.query.CarListReq; |
| | | import com.ruoyi.system.query.CarListResp; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:37 |
| | | */ |
| | | public interface CarMapper extends BaseMapper<Car> { |
| | | |
| | | |
| | | /** |
| | | * 获取车辆列表数据 |
| | | * |
| | | * @param pageInfo |
| | | * @param carListReq |
| | | * @return |
| | | */ |
| | | PageInfo<CarListResp> getCarList(PageInfo<CarListResp> pageInfo, @Param("item") CarListReq carListReq); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Order; |
| | | import com.ruoyi.system.query.OrderListReq; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:51 |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | |
| | | /** |
| | | * 获取订单列表 |
| | | * @param pageInfo |
| | | * @param req |
| | | * @return |
| | | */ |
| | | PageInfo<Order> getOrderList(PageInfo<Order> pageInfo, @Param("item") OrderListReq req); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 15:27 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarListReq extends BasePage { |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty(value = "公司名称") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "所属车主") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "车身颜色") |
| | | private String carColor; |
| | | @ApiModelProperty(value = "车辆经营区域") |
| | | private String area; |
| | | @ApiModelProperty(value = "车辆型号") |
| | | private String brandModel; |
| | | @ApiModelProperty(value = "载客人数") |
| | | private Integer startNum; |
| | | @ApiModelProperty(value = "载客人数") |
| | | private Integer endNum; |
| | | @ApiModelProperty(value = "运营类型") |
| | | private String operateType; |
| | | @ApiModelProperty(value = "车辆状态") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 15:32 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarListResp { |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty(value = "车牌颜色") |
| | | private String licensePlateColor; |
| | | @ApiModelProperty(value = "车辆所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "核定载客") |
| | | private Integer passengerCapacity; |
| | | @ApiModelProperty(value = "车辆型号") |
| | | private String brandModel; |
| | | @ApiModelProperty(value = "车辆类型") |
| | | private String vehicleType; |
| | | @ApiModelProperty(value = "车主") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "车身颜色") |
| | | private String vehicleColor; |
| | | @ApiModelProperty(value = "车辆注册日期") |
| | | private String registrationDate; |
| | | @ApiModelProperty(value = "车辆经营区域") |
| | | private String operatingArea; |
| | | @ApiModelProperty(value = "车辆运营类型") |
| | | private String operateType; |
| | | @ApiModelProperty(value = "车辆状态(1=在线,2=异常,3=离线,4=故障)") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 19:40 |
| | | */ |
| | | @Data |
| | | public class CarTravelReq { |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty("开始时间(秒)") |
| | | private Long startTime; |
| | | @ApiModelProperty("结束时间(秒)") |
| | | private Long endTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:53 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class OrderListReq extends BasePage { |
| | | @ApiModelProperty(value = "派单时间") |
| | | private String orderDeliveryTimeStart; |
| | | @ApiModelProperty(value = "派单时间") |
| | | private String orderDeliveryTimeEnd; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "车辆号牌") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty(value = "驾驶员姓名") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "公司名称") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "上车地点") |
| | | private String boardingPoint; |
| | | @ApiModelProperty(value = "下车地点") |
| | | private String dropOffPoint; |
| | | @ApiModelProperty(value = "里程范围") |
| | | private BigDecimal passengerMileageStart; |
| | | @ApiModelProperty(value = "里程范围") |
| | | private BigDecimal passengerMileageEnd; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:18 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PlaybackMsgControlReq { |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "控制类型 0x00: 正常回放\n" + |
| | | "\t * 0x01: 暂停回放\n" + |
| | | "\t * 0x02: 结束回放\n" + |
| | | "\t * 0x03: 快进回放\n" + |
| | | "\t * 0x04: 关键帧快退回放\n" + |
| | | "\t * 0x05: 拖动回放\n" + |
| | | "\t * 0x06: 关键帧播放") |
| | | private Integer controlType; |
| | | @ApiModelProperty(value = "快进快退倍数 0x00: 无效\n" + |
| | | "\t * 0x01: 1倍\n" + |
| | | "\t * 0x02: 2倍\n" + |
| | | "\t * 0x03: 4倍\n" + |
| | | "\t * 0x04: 8倍\n" + |
| | | "\t * 0x05: 16倍") |
| | | private Integer fastTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:04 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class PlaybackVideoReq { |
| | | @ApiModelProperty(value = "车辆id") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "开始时间(秒)") |
| | | private Long startTime; |
| | | @ApiModelProperty(value = "结束时间(秒)") |
| | | private Long endTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 16:03 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class RealVideoResp { |
| | | @ApiModelProperty("视频服务器ip") |
| | | private String serverIp; |
| | | @ApiModelProperty("视频服务器端口号") |
| | | private Integer serverPort; |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.query.CarListReq; |
| | | import com.ruoyi.system.query.CarListResp; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * 定时任务存储最新的车辆数据 |
| | | */ |
| | | void taskSaveNewCar(); |
| | | |
| | | |
| | | /** |
| | | * 获取车辆列表数据 |
| | | * |
| | | * @param carListReq |
| | | * @return |
| | | */ |
| | | PageInfo<CarListResp> getCarList(CarListReq carListReq); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Order; |
| | | import com.ruoyi.system.query.OrderListReq; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:51 |
| | | */ |
| | | public interface IOrderService extends IService<Order> { |
| | | |
| | | |
| | | /** |
| | | * 获取订单列表 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | PageInfo<Order> getOrderList(OrderListReq req); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRegisterClient; |
| | | import com.ruoyi.dataInterchange.api.model.enums.VehicleColorEnum; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgRegisterVo; |
| | |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.mapper.CarMapper; |
| | | import com.ruoyi.system.query.CarListReq; |
| | | import com.ruoyi.system.query.CarListResp; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | |
| | | } |
| | | this.saveBatch(carList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取车辆列表数据 |
| | | * |
| | | * @param carListReq |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<CarListResp> getCarList(CarListReq carListReq) { |
| | | PageInfo<CarListResp> pageInfo = new PageInfo<>(carListReq.getPageCurr(), carListReq.getPageSize()); |
| | | return this.baseMapper.getCarList(pageInfo, carListReq); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Order; |
| | | import com.ruoyi.system.mapper.OrderMapper; |
| | | import com.ruoyi.system.query.OrderListReq; |
| | | import com.ruoyi.system.service.IOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 17:52 |
| | | */ |
| | | @Service |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService { |
| | | |
| | | |
| | | /** |
| | | * 获取订单列表 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | public PageInfo<Order> getOrderList(OrderListReq req) { |
| | | PageInfo<Order> pageInfo = new PageInfo<>(req.getPageCurr(), req.getPageSize()); |
| | | return this.baseMapper.getOrderList(pageInfo, req); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.CarMapper"> |
| | | |
| | | <select id="getCarList" resultType="com.ruoyi.system.query.CarListResp"> |
| | | select |
| | | a.id, |
| | | a.vehicle_number as vehicleNumber, |
| | | a.license_plate_color as licensePlateColor, |
| | | c.name as enterpriseName, |
| | | a.passenger_capacity as passengerCapacity, |
| | | a.brand_model as brandModel, |
| | | a.vehicle_type as vehicleType, |
| | | b.name as driverName, |
| | | a.vehicle_color as vehicleColor, |
| | | a.registration_date as registrationDate, |
| | | a.operating_area as operatingArea, |
| | | a.operate_type as operateType, |
| | | a.status |
| | | from t_car a |
| | | left join t_driver b on (a.vehicle_number = b.vehicle_number and b.status = 1) |
| | | left join t_enterprise c on (a.enterprise_id = c.id) |
| | | <where> |
| | | <if test="null != item.vehicleNumber and '' != item.vehicleNumber"> |
| | | and a.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%') |
| | | </if> |
| | | <if test="null != item.enterpriseName and '' != item.enterpriseName"> |
| | | and c.name like CONCAT('%', #{item.enterpriseName}, '%') |
| | | </if> |
| | | <if test="null != item.driverName and '' != item.driverName"> |
| | | and b.name like CONCAT('%', #{item.driverName}, '%') |
| | | </if> |
| | | <if test="null != item.carColor and '' != item.carColor"> |
| | | and a.vehicle_color like CONCAT('%', #{item.carColor}, '%') |
| | | </if> |
| | | <if test="null != item.area and '' != item.area"> |
| | | and a.operating_area like CONCAT('%', #{item.area}, '%') |
| | | </if> |
| | | <if test="null != item.brandModel and '' != item.brandModel"> |
| | | and a.brand_model like CONCAT('%', #{item.brandModel}, '%') |
| | | </if> |
| | | <if test="null != item.startNum and null != item.endNum"> |
| | | and a.passenger_capacity between #{item.startNum} and #{item.endNum} |
| | | </if> |
| | | <if test="null != item.operateType and '' != item.operateType"> |
| | | and a.operate_type like CONCAT('%', #{item.operateType}, '%') |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and a.status = #{item.status} |
| | | </if> |
| | | </where> |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.OrderMapper"> |
| | | |
| | | <select id="getOrderList" resultType="com.ruoyi.system.api.model.Order"> |
| | | select |
| | | a.id, |
| | | a.code, |
| | | b.vehicle_number as vehicleNumber, |
| | | b.license_plate_color as licensePlateColor, |
| | | d.name as enterpriseName, |
| | | a.boarding_point, |
| | | a.drop_off_point, |
| | | a.passenger_mileage, |
| | | c.name as driverName, |
| | | a.order_delivery_time, |
| | | a.order_amount |
| | | from t_order a |
| | | left join t_car b on (a.car_id = b.id) |
| | | left join t_driver c on (a.driver_id = c.id) |
| | | left join t_enterprise d on (a.enterprise_id = d.id) |
| | | <where> |
| | | <if test="null != item.orderDeliveryTimeStart and '' != item.orderDeliveryTimeStart and null != item.orderDeliveryTimeEnd and '' != item.orderDeliveryTimeEnd"> |
| | | and a.order_delivery_time between #{item.orderDeliveryTimeStart} and #{item.orderDeliveryTimeEnd} |
| | | </if> |
| | | <if test="null != item.code and '' != item.code"> |
| | | and a.code like CONCAT('%', #{item.code}, '%') |
| | | </if> |
| | | <if test="null != item.vehicleNumber and '' != item.vehicleNumber"> |
| | | and b.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%') |
| | | </if> |
| | | <if test="null != item.driverName and '' != item.driverName"> |
| | | and c.name like CONCAT('%', #{item.driverName}, '%') |
| | | </if> |
| | | <if test="null != item.enterpriseName and '' != item.enterpriseName"> |
| | | and d.name like CONCAT('%', #{item.enterpriseName}, '%') |
| | | </if> |
| | | <if test="null != item.boardingPoint and '' != item.boardingPoint"> |
| | | and a.boarding_point like CONCAT('%', #{item.boardingPoint}, '%') |
| | | </if> |
| | | <if test="null != item.dropOffPoint and '' != item.dropOffPoint"> |
| | | and a.drop_off_point like CONCAT('%', #{item.dropOffPoint}, '%') |
| | | </if> |
| | | <if test="null != item.passengerMileageStart and null != item.passengerMileageEnd"> |
| | | and a.passenger_mileage between #{item.passengerMileageStart} and #{item.passengerMileageEnd} |
| | | </if> |
| | | </where> |
| | | order by a.order_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.ruoyi.dataInterchange.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import com.ruoyi.dataInterchange.dao.UPPlaybackMsgControlAckDao; |
| | | import com.ruoyi.dataInterchange.dao.UPPlaybackMsgStartupAckDao; |
| | | import com.ruoyi.dataInterchange.model.UPPlaybackMsgControlAck; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/playbackMsgStartup") |
| | | public R<UPPlaybackMsgStartupAck> playbackMsgStartup(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | @RequestParam("startTime") LocalDateTime startTime, @RequestParam("endTime") LocalDateTime endTime) { |
| | | public R<UPPlaybackMsgStartupAckVo> playbackMsgStartup(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | @RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime) { |
| | | R r = downPlaybackMsgStartupService.playbackMsgStartup(inferiorPlatformId, vehicleNo, startTime, endTime); |
| | | if (200 != r.getCode()) { |
| | | return r; |
| | |
| | | num++; |
| | | continue; |
| | | } |
| | | if (null != upPlaybackMsgStartupAck || num >= 30) { |
| | | return R.ok(upPlaybackMsgStartupAck); |
| | | if(null != upPlaybackMsgStartupAck){ |
| | | int result = upPlaybackMsgStartupAck.getResult(); |
| | | switch (result){ |
| | | case 0: |
| | | UPPlaybackMsgStartupAckVo vo = new UPPlaybackMsgStartupAckVo(); |
| | | BeanUtils.copyProperties(upPlaybackMsgStartupAck, vo); |
| | | return R.ok(vo); |
| | | case 1: |
| | | return R.fail("失败"); |
| | | case 2: |
| | | return R.fail("不支持"); |
| | | case 3: |
| | | return R.fail("会话结束"); |
| | | case 4: |
| | | return R.fail("失效口令错误"); |
| | | case 5: |
| | | return R.fail("不满足跨域条件"); |
| | | default: |
| | | return R.fail("失败"); |
| | | } |
| | | } |
| | | if (num >= 30) { |
| | | return R.fail("失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/playbackMsgControl") |
| | | public R<Integer> playbackMsgControl(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | public R playbackMsgControl(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo, |
| | | @RequestParam("controlType") Integer controlType, @RequestParam("fastTime") Integer fastTime) { |
| | | R r = downPlaybackMsgControlService.playbackMsgControl(inferiorPlatformId, vehicleNo, controlType, fastTime); |
| | | if (200 != r.getCode()) { |
| | |
| | | package com.ruoyi.dataInterchange.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import com.ruoyi.dataInterchange.dao.UPRealvideoMsgEndAckDao; |
| | | import com.ruoyi.dataInterchange.dao.UPRealvideoMsgStartupAckDao; |
| | | import com.ruoyi.dataInterchange.model.UPRealvideoMsgEndAck; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/startupRealVideo") |
| | | public R<UPRealvideoMsgStartupAck> startupRealVideo(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo) { |
| | | public R<UPRealvideoMsgStartupAckVo> startupRealVideo(@RequestParam("inferiorPlatformId") Integer inferiorPlatformId, @RequestParam("vehicleNo") String vehicleNo) { |
| | | R realVideo = downRealvideoMsgStartupService.startupRealVideo(inferiorPlatformId, vehicleNo); |
| | | if (realVideo.getCode() != 200) { |
| | | return realVideo; |
| | |
| | | num++; |
| | | continue; |
| | | } |
| | | if (null != realvideoMsgStartupAck || num >= 30) { |
| | | return R.ok(realvideoMsgStartupAck); |
| | | if (null != realvideoMsgStartupAck) { |
| | | int result = realvideoMsgStartupAck.getResult(); |
| | | switch (result){ |
| | | case 0: |
| | | UPRealvideoMsgStartupAckVo vo = new UPRealvideoMsgStartupAckVo(); |
| | | BeanUtils.copyProperties(realvideoMsgStartupAck, vo); |
| | | return R.ok(vo); |
| | | case 1: |
| | | return R.fail("失败"); |
| | | case 2: |
| | | return R.fail("不支持"); |
| | | case 3: |
| | | return R.fail("会话结束"); |
| | | case 4: |
| | | return R.fail("失效口令错误"); |
| | | case 5: |
| | | return R.fail("不满足跨域条件"); |
| | | default: |
| | | return R.fail("失败"); |
| | | } |
| | | } |
| | | if (num >= 30) { |
| | | return R.fail("失败"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgRealLocationDao; |
| | | import com.ruoyi.dataInterchange.model.GnssData; |
| | | import com.ruoyi.dataInterchange.model.UPExgMsgRealLocation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 18:59 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/upExgMsgRealLocation") |
| | | public class UPExgMsgRealLocationController { |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationDao upExgMsgRealLocationDao; |
| | | |
| | | |
| | | /** |
| | | * 获取订单行程轨迹 |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | @PostMapping("/getOrderTravel") |
| | | public R<List<OrderTravelVo>> getOrderTravel(@RequestParam("vehicleNo") String vehicleNo, @RequestParam("start") Long start, |
| | | @RequestParam("end") Long end){ |
| | | List<UPExgMsgRealLocation> list = upExgMsgRealLocationDao.findByVehicleNoAndCreateTimeBetween(vehicleNo, start, end); |
| | | List<OrderTravelVo> orderTravelVos = new ArrayList<>(); |
| | | for (UPExgMsgRealLocation upExgMsgRealLocation : list) { |
| | | GnssData gnssData = upExgMsgRealLocation.getGnssData(); |
| | | OrderTravelVo vo = new OrderTravelVo(); |
| | | vo.setLatitude(new BigDecimal(gnssData.getLat()).divide(new BigDecimal(1000000))); |
| | | vo.setLongitude(new BigDecimal(gnssData.getLon()).divide(new BigDecimal(1000000))); |
| | | orderTravelVos.add(vo); |
| | | } |
| | | return R.ok(orderTravelVos); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/7 16:38 |
| | | */ |
| | | @Repository |
| | | public interface UPExgMsgRealLocationDao extends ElasticsearchRepository<UPExgMsgRealLocation, String> { |
| | | |
| | | |
| | | /** |
| | | * 查询有效时间段车辆的定位数据 |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | List<UPExgMsgRealLocation> findByVehicleNoAndCreateTimeBetween(String vehicleNo, Long start, Long end); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * @param vehicleNo |
| | | * @return |
| | | */ |
| | | public R playbackMsgStartup(Integer inferiorPlatformId, String vehicleNo, LocalDateTime startTime, LocalDateTime endTime) { |
| | | public R playbackMsgStartup(Integer inferiorPlatformId, String vehicleNo, Long startTime, Long endTime) { |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (!channel.isActive()) { |
| | | return R.fail("失败"); |
| | |
| | | downPlaybackMsgStartup.setAvttemType(0X00); |
| | | downPlaybackMsgStartup.setStreamType(0); |
| | | downPlaybackMsgStartup.setMemType(0); |
| | | downPlaybackMsgStartup.setPlaybackStartTime(startTime.toEpochSecond(ZoneOffset.ofHours(8))); |
| | | downPlaybackMsgStartup.setPlaybackEndTime(endTime.toEpochSecond(ZoneOffset.ofHours(8))); |
| | | downPlaybackMsgStartup.setPlaybackStartTime(startTime); |
| | | downPlaybackMsgStartup.setPlaybackEndTime(endTime); |
| | | downPlaybackMsgStartup.setAuthorizeCode(authorizeMsgStartup.getAuthorizeCode1()); |
| | | downPlaybackMsgStartup.setGnssData(""); |
| | | byte[] body = downPlaybackMsgStartup.encode(); |