1 文件已重命名
22个文件已修改
2个文件已删除
26个文件已添加
| | |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 账户接口 --> |
| | | <!-- 数据交互接口 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-account</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 订单接口 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 系统其他接口 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-other</artifactId> |
| | | <artifactId>ruoyi-api-dataInterchange</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | |
| | | |
| | | <modules> |
| | | <module>ruoyi-api-system</module> |
| | | <module>ruoyi-api-dataInterchange</module> |
| | | </modules> |
| | | |
| | | <artifactId>ruoyi-api</artifactId> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api</artifactId> |
| | | <version>3.6.2</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ruoyi-api-dataInterchange</artifactId> |
| | | |
| | | <description> |
| | | ruoyi-api-dataInterchange数据交换接口模块 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- RuoYi Common Core--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-core</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName DataUpdateInterceptor |
| | | * @Description 数据更新操作处理 |
| | | * @date 2021-12-15 |
| | | * <p> |
| | | * 注意,之前在此处注入了 JwtTokenUtils |
| | | * <p> |
| | | * 造成spring循环依赖,项目支棱不起来 |
| | | */ |
| | | @Slf4j |
| | | @Configuration |
| | | public class DataUpdateHandlerConfig implements MetaObjectHandler { |
| | | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | |
| | | } |
| | | } |
File was renamed from ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/config/HttpConfig.java |
| | |
| | | package com.ruoyi.dataInterchange.config; |
| | | package com.ruoyi.dataInterchange.api.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.client.RestTemplateBuilder; |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.core.config.GlobalConfig; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName MybatisPlusConfig |
| | | * @Description MybatisPlus相关配置 |
| | | * @date 2020-09-22 11:22、 |
| | | * 直接以实现类作为bean的注入(有事务管理的类) |
| | | * @EnableTransactionManagement(proxyTargetClass = true) |
| | | */ |
| | | @Configuration |
| | | public class MybatisPlusConfig { |
| | | private final DataUpdateHandlerConfig dataUpdateHandler; |
| | | |
| | | @Autowired |
| | | public MybatisPlusConfig(DataUpdateHandlerConfig dataUpdateHandler) { |
| | | this.dataUpdateHandler = dataUpdateHandler; |
| | | } |
| | | |
| | | /** |
| | | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题 |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | /** |
| | | * 自动填充功能 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public GlobalConfig globalConfig() { |
| | | GlobalConfig globalConfig = new GlobalConfig(); |
| | | globalConfig.setMetaObjectHandler(dataUpdateHandler); |
| | | return globalConfig; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRegisterClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgRegisterVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 13:40 |
| | | */ |
| | | public class UPExgMsgRegisterClientFallbackFactory implements FallbackFactory<UPExgMsgRegisterClient> { |
| | | @Override |
| | | public UPExgMsgRegisterClient create(Throwable cause) { |
| | | return new UPExgMsgRegisterClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<List<UPExgMsgRegisterVo>> getUPExgMsgRegisterListIsAfterCreateTime(Long startTime) { |
| | | 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.UPExgMsgReportDriverInfoClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgReportDriverInfoVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:36 |
| | | */ |
| | | public class UPExgMsgReportDriverInfoClientFallbackFactory implements FallbackFactory<UPExgMsgReportDriverInfoClient> { |
| | | @Override |
| | | public UPExgMsgReportDriverInfoClient create(Throwable cause) { |
| | | return new UPExgMsgReportDriverInfoClient() { |
| | | |
| | | |
| | | @Override |
| | | public R<List<UPExgMsgReportDriverInfoVo>> getUPExgMsgReportDriverInfoListIsAfterCreateTime(Long createTime) { |
| | | 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.UPExgMsgRegisterClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgRegisterVo; |
| | | 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/17 13:40 |
| | | */ |
| | | @FeignClient(contextId = "UPExgMsgRegisterClient", value = ServiceNameConstants.DATA_INTERCHANGE_SERVICE, fallbackFactory = UPExgMsgRegisterClientFallbackFactory.class) |
| | | public interface UPExgMsgRegisterClient { |
| | | |
| | | |
| | | /** |
| | | * 查询添加时间大于等于给定时间的车辆基础数据 |
| | | * |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/UPExgMsgRegister/getUPExgMsgRegisterListIsAfterCreateTime") |
| | | R<List<UPExgMsgRegisterVo>> getUPExgMsgRegisterListIsAfterCreateTime(@RequestParam("startTime") Long startTime); |
| | | } |
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.UPExgMsgReportDriverInfoClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgReportDriverInfoVo; |
| | | 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/17 16:36 |
| | | */ |
| | | @FeignClient(contextId = "UPExgMsgReportDriverInfoClient", value = ServiceNameConstants.DATA_INTERCHANGE_SERVICE, fallbackFactory = UPExgMsgReportDriverInfoClientFallbackFactory.class) |
| | | public interface UPExgMsgReportDriverInfoClient { |
| | | |
| | | |
| | | /** |
| | | * 查询添加时间等于或大于给定时间的数据 |
| | | * |
| | | * @param createTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/UPExgMsgReportDriverInfo/getUPExgMsgReportDriverInfoListIsAfterCreateTime") |
| | | R<List<UPExgMsgReportDriverInfoVo>> getUPExgMsgReportDriverInfoListIsAfterCreateTime(@RequestParam("createTime") Long createTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.model.enums; |
| | | |
| | | /** |
| | | * 车辆颜色枚举 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 14:18 |
| | | */ |
| | | public enum VehicleColorEnum { |
| | | BLUE(1, "蓝色"), |
| | | YELLOW(2, "黄色"), |
| | | BLACK(3, "黑色"), |
| | | WHITE(4, "白色"), |
| | | OTHER(9, "其他"), |
| | | ; |
| | | private Integer code; |
| | | private String name; |
| | | |
| | | VehicleColorEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | public static String getName(Integer num) { |
| | | VehicleColorEnum[] values = VehicleColorEnum.values(); |
| | | for (VehicleColorEnum value : values) { |
| | | if (value.code.equals(num)) { |
| | | return value.name; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 13:45 |
| | | */ |
| | | @Data |
| | | public class UPExgMsgRegisterVo { |
| | | /** |
| | | * id |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | private int vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | private int dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | private Integer dataLength; |
| | | /** |
| | | * 平台唯一编号,由平台所在地行政区划代码和平台编号组成 |
| | | */ |
| | | private String platformId; |
| | | /** |
| | | * 车载终端厂商唯一编码,由车载终端厂商所在地行政区划代码和厂商ID组成 |
| | | */ |
| | | private String producerId; |
| | | /** |
| | | * 车载终端型号 |
| | | */ |
| | | private String terminalModelType; |
| | | /** |
| | | * 车载终端编号 |
| | | */ |
| | | private String terminalId; |
| | | /** |
| | | * 车载终端SIM卡电话号码 |
| | | */ |
| | | private String terminalSIMCode; |
| | | /** |
| | | * 下级平台唯一标识 |
| | | */ |
| | | private Integer inferiorPlatformId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Long createTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:38 |
| | | */ |
| | | @Data |
| | | public class UPExgMsgReportDriverInfoVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private String id; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | private String vehicleNo; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | private int vehicleColor; |
| | | /** |
| | | * 子业务类型标识 |
| | | */ |
| | | private int dataType; |
| | | /** |
| | | * 后续数据长度 |
| | | */ |
| | | private int dataLength; |
| | | /** |
| | | * 驾驶员姓名 |
| | | */ |
| | | private String driverName; |
| | | /** |
| | | * 驾驶证编号 |
| | | */ |
| | | private String driverId; |
| | | /** |
| | | * 从业资格证号 |
| | | */ |
| | | private String licence; |
| | | /** |
| | | * 发证机构名称 |
| | | */ |
| | | private String orgName; |
| | | /** |
| | | * 下级平台唯一标识 |
| | | */ |
| | | private Integer inferiorPlatformId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Long createTime; |
| | | } |
New file |
| | |
| | | com.ruoyi.dataInterchange.api.factory.UPExgMsgRegisterClientFallbackFactory |
| | | com.ruoyi.dataInterchange.api.factory.UPExgMsgReportDriverInfoClientFallbackFactory |
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 lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:29 |
| | | */ |
| | | @Data |
| | | @TableName("t_car") |
| | | public class Car { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @TableField("vehicle_number") |
| | | private String vehicleNumber; |
| | | /** |
| | | * 车牌颜色 |
| | | */ |
| | | @TableField("license_plate_color") |
| | | private String licensePlateColor; |
| | | /** |
| | | * 所属企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 载客数 |
| | | */ |
| | | @TableField("passenger_capacity") |
| | | private String passengerCapacity; |
| | | /** |
| | | * 车辆品牌 |
| | | */ |
| | | @TableField("brand") |
| | | private String brand; |
| | | /** |
| | | * 车辆品牌型号 |
| | | */ |
| | | @TableField("brand_model") |
| | | private String brandModel; |
| | | /** |
| | | * 车辆类型 |
| | | */ |
| | | @TableField("vehicle_type") |
| | | private String vehicleType; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driver_id") |
| | | private Integer driverId; |
| | | /** |
| | | * 车身颜色 |
| | | */ |
| | | @TableField("vehicle_color") |
| | | private String vehicleColor; |
| | | /** |
| | | * 经营区域 |
| | | */ |
| | | @TableField("operating_area") |
| | | private String operatingArea; |
| | | /** |
| | | * 运营类型 |
| | | */ |
| | | @TableField("operate_type") |
| | | private String operateType; |
| | | /** |
| | | * 发动机号 |
| | | */ |
| | | @TableField("engine_number") |
| | | private String engineNumber; |
| | | /** |
| | | * 车辆VIN码 |
| | | */ |
| | | @TableField("vin") |
| | | private String vin; |
| | | /** |
| | | * 注册日期 |
| | | */ |
| | | @TableField("registration_date") |
| | | private String registrationDate; |
| | | /** |
| | | * 燃料类型 |
| | | */ |
| | | @TableField("fuel_type") |
| | | private String fuelType; |
| | | /** |
| | | * 发动机排量 |
| | | */ |
| | | @TableField("engine_capacity") |
| | | private String engineCapacity; |
| | | /** |
| | | * 运输证发证机关 |
| | | */ |
| | | @TableField("transport_license_issuing_authority") |
| | | private String transportLicenseIssuingAuthority; |
| | | /** |
| | | * 运输证有效期开始时间 |
| | | */ |
| | | @TableField("transport_certificate_start") |
| | | private String transportCertificateStart; |
| | | /** |
| | | * 运输证有效期结束时间 |
| | | */ |
| | | @TableField("transport_certificate_end") |
| | | private String transportCertificateEnd; |
| | | /** |
| | | * 车辆初次登记时间 |
| | | */ |
| | | @TableField("initial_registration_time") |
| | | private String initialRegistrationTime; |
| | | /** |
| | | * 车辆检修状态 |
| | | */ |
| | | @TableField("vehicle_maintenance_status") |
| | | private String vehicleMaintenanceStatus; |
| | | /** |
| | | * 车辆年审状态 |
| | | */ |
| | | @TableField("annual_review_status") |
| | | private String annualReviewStatus; |
| | | /** |
| | | * 卫星定位装置品牌 |
| | | */ |
| | | @TableField("gps_brand") |
| | | private String gpsBrand; |
| | | /** |
| | | * 卫星定位装置型号 |
| | | */ |
| | | @TableField("gps_model") |
| | | private String gpsModel; |
| | | /** |
| | | * 卫星定位装置IMEI号 |
| | | */ |
| | | @TableField("gps_imei") |
| | | private String gpsImei; |
| | | /** |
| | | * 卫星定位装置安装日期 |
| | | */ |
| | | @TableField("gps_installation_date") |
| | | private String gpsInstallationDate; |
| | | /** |
| | | * 运价类型编码 |
| | | */ |
| | | @TableField("rate_type_number") |
| | | private String rateTypeNumber; |
| | | /** |
| | | * 运输证字号 |
| | | */ |
| | | @TableField("transport_certificate_number") |
| | | private String transportCertificateNumber; |
| | | /** |
| | | * 车辆状态(1=在线,2=异常,3=离线,4=故障) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | } |
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 lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:12 |
| | | */ |
| | | @Data |
| | | @TableName("t_driver") |
| | | public class Driver { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 所属企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 驾驶证号 |
| | | */ |
| | | @TableField("driving_license_number") |
| | | private String drivingLicenseNumber; |
| | | /** |
| | | * 通讯地址 |
| | | */ |
| | | @TableField("mailing_address") |
| | | private String mailingAddress; |
| | | /** |
| | | * 紧急联系人 |
| | | */ |
| | | @TableField("emergency_contact") |
| | | private String emergencyContact; |
| | | /** |
| | | * 紧急联系电话 |
| | | */ |
| | | @TableField("emergency_phone") |
| | | private String emergencyPhone; |
| | | /** |
| | | * 紧急联系人通讯地址 |
| | | */ |
| | | @TableField("emergency_mailing_address") |
| | | private String emergencyMailingAddress; |
| | | /** |
| | | * 婚姻状况 |
| | | */ |
| | | @TableField("marital_status") |
| | | private String maritalStatus; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | @TableField("gender") |
| | | private String gender; |
| | | /** |
| | | * 出生日期 |
| | | */ |
| | | @TableField("birthday") |
| | | private String birthday; |
| | | /** |
| | | * 国籍 |
| | | */ |
| | | @TableField("nation") |
| | | private String nation; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @TableField("nationality") |
| | | private String nationality; |
| | | /** |
| | | * 外语 |
| | | */ |
| | | @TableField("foreign_languages") |
| | | private String foreignLanguages; |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @TableField("education") |
| | | private String education; |
| | | /** |
| | | * 户籍登记机关 |
| | | */ |
| | | @TableField("household_registration_authority") |
| | | private String householdRegistrationAuthority; |
| | | /** |
| | | * 户籍所在地 |
| | | */ |
| | | @TableField("domicile") |
| | | private String domicile; |
| | | /** |
| | | * 签约公司 |
| | | */ |
| | | @TableField("contracting_company") |
| | | private String contractingCompany; |
| | | /** |
| | | * 驾驶员照片 |
| | | */ |
| | | @TableField("avatar_file") |
| | | private String avatarFile; |
| | | /** |
| | | * 驾驶证照片 |
| | | */ |
| | | @TableField("driving_licence_file") |
| | | private String drivingLicenceFile; |
| | | /** |
| | | * 准驾车型 |
| | | */ |
| | | @TableField("quasi_driving_type") |
| | | private String quasiDrivingType; |
| | | /** |
| | | * 初次领取驾驶证日期 |
| | | */ |
| | | @TableField("first_license_date") |
| | | private String firstLicenseDate; |
| | | /** |
| | | * 驾驶证有效开始时间 |
| | | */ |
| | | @TableField("driving_licence_start") |
| | | private String drivingLicenceStart; |
| | | /** |
| | | * 驾驶证有效期结束时间 |
| | | */ |
| | | @TableField("driving_licence_end") |
| | | private String drivingLicenceEnd; |
| | | /** |
| | | * 是否是巡游出租车 |
| | | */ |
| | | @TableField("cruise_taxi") |
| | | private String cruiseTaxi; |
| | | /** |
| | | * 资格证号 |
| | | */ |
| | | @TableField("certification") |
| | | private String certification; |
| | | /** |
| | | * 资格证发证日期 |
| | | */ |
| | | @TableField("certification_issue_date") |
| | | private String certificationIssueDate; |
| | | /** |
| | | * 初次领取资格证日期 |
| | | */ |
| | | @TableField("first_license_certification") |
| | | private String firstLicenseCertification; |
| | | /** |
| | | * 资格证有效期开始时间 |
| | | */ |
| | | @TableField("certification_start") |
| | | private String certificationStart; |
| | | /** |
| | | * 资格证有效期结束时间 |
| | | */ |
| | | @TableField("certification_end") |
| | | private String certificationEnd; |
| | | /** |
| | | * 资格证发证机构名称 |
| | | */ |
| | | @TableField("orgName") |
| | | private String orgName; |
| | | /** |
| | | * 司机平台注册日期 |
| | | */ |
| | | @TableField("registration_date") |
| | | private String registrationDate; |
| | | /** |
| | | * 司机是都在黑名单中 |
| | | */ |
| | | @TableField("blacklist") |
| | | private String blacklist; |
| | | /** |
| | | * 专职驾驶员 |
| | | */ |
| | | @TableField("full_time_driver") |
| | | private String fullTimeDriver; |
| | | /** |
| | | * 营运类型 |
| | | */ |
| | | @TableField("operation_type") |
| | | private String operationType; |
| | | /** |
| | | * 合同有效期开始时间 |
| | | */ |
| | | @TableField("contract_life_start") |
| | | private String contractLifeStart; |
| | | /** |
| | | * 合同有效期结束时间 |
| | | */ |
| | | @TableField("contract_life_end") |
| | | private String contractLifeEnd; |
| | | /** |
| | | * 状态(1=有效,2=无效) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 标识(1=新增,2=修改) |
| | | */ |
| | | @TableField("flag") |
| | | private Integer flag; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @TableField("vehicle_number") |
| | | private String vehicleNumber; |
| | | } |
| | |
| | | */ |
| | | @TableField("ip_whitelist") |
| | | private String ipWhitelist; |
| | | /** |
| | | * 统一社会信用代码 |
| | | */ |
| | | @TableField("credit_identifier") |
| | | private String creditIdentifier; |
| | | /** |
| | | * 紧急联系电话 |
| | | */ |
| | | @TableField("emergency_number") |
| | | private String emergencyNumber; |
| | | /** |
| | | * 经营范围 |
| | | */ |
| | | @TableField("business_scope") |
| | | private String businessScope; |
| | | /** |
| | | * 运营类型 |
| | | */ |
| | | @TableField("operation_type") |
| | | private String operationType; |
| | | /** |
| | | * 通讯地址 |
| | | */ |
| | | @TableField("mailing_address") |
| | | private String mailingAddress; |
| | | /** |
| | | * 注册资本 |
| | | */ |
| | | @TableField("registered_capital") |
| | | private String registeredCapital; |
| | | /** |
| | | * 法人代表 |
| | | */ |
| | | @TableField("legal_representative") |
| | | private String legalRepresentative; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | @TableField("contact_person") |
| | | private String contactPerson; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @TableField("contact_number") |
| | | private String contactNumber; |
| | | /** |
| | | * 状态(1=有效,2=无效) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.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/17 10:27 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class GetEnterpriseListReq extends BasePage { |
| | | @ApiModelProperty("公司名称") |
| | | private String name; |
| | | @ApiModelProperty("经营范围") |
| | | private String businessScope; |
| | | @ApiModelProperty("通讯地址") |
| | | private String mailingAddress; |
| | | @ApiModelProperty("法人代表") |
| | | private String legalRepresentative; |
| | | @ApiModelProperty("车辆运营类型") |
| | | private String operationType; |
| | | } |
| | |
| | | package com.ruoyi.auth.controller; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.auth.form.LoginBody; |
| | | import com.ruoyi.auth.form.RegisterBody; |
| | | import com.ruoyi.auth.service.SysLoginService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * token 控制 |
| | |
| | | private SysUserClient userClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("login") |
| | | public R<?> login(@RequestBody LoginBody form, HttpServletRequest request) { |
| | | // 用户登录 |
| | | LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword(), request); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("token", tokenService.createToken(userInfo)); |
| | | List<SysRole> roles = userInfo.getSysUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return R.fail("请关联角色!"); |
| | | } |
| | | |
| | | map.put("roleName",roles.get(0).getRoleName()); |
| | | map.put("info", userInfo); |
| | | // 修改用户最后登录时间 |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setUserId(userInfo.getSysUser().getUserId()); |
| | | sysUser.setLoginDate(new Date()); |
| | | System.out.println("修改用户登录时间" + sysUser); |
| | | userClient.updateSysUser(sysUser); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loginShop") |
| | | public R<?> loginShop(@RequestBody LoginBody form, HttpServletRequest request) { |
| | | // 用户登录 |
| | | LoginUser userInfo = sysLoginService.loginShop(form.getUsername(), form.getPassword(), request); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("token", tokenService.createToken(userInfo)); |
| | | List<SysRole> roles = userInfo.getSysUser().getRoles(); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("register") |
| | | public R<?> register(@RequestBody RegisterBody registerBody, HttpServletRequest request) { |
| | | // 用户注册 |
| | | sysLoginService.register(registerBody.getUsername(), registerBody.getPassword(), request); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class LoginBody |
| | | { |
| | | public class LoginBody { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | |
| | | * 用户密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 登录平台类型(1=平台,2=门店) |
| | | */ |
| | | private Integer roleType; |
| | | |
| | | public String getUsername() |
| | | { |
| | | public String getUsername() { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | public void setUsername(String username) { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public Integer getRoleType() { |
| | | return roleType; |
| | | } |
| | | |
| | | public void setRoleType(Integer roleType) { |
| | | this.roleType = roleType; |
| | | } |
| | | } |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ServiceNameConstants |
| | | { |
| | | public class ServiceNameConstants { |
| | | /** |
| | | * 认证服务的serviceid |
| | | */ |
| | |
| | | * 文件服务的serviceid |
| | | */ |
| | | public static final String FILE_SERVICE = "ruoyi-file"; |
| | | public static final String ACCOUNT_SERVICE = "ruoyi-account"; |
| | | public static final String OTHER_SERVICE = "ruoyi-other"; |
| | | public static final String ORDER_SERVICE = "ruoyi-order"; |
| | | |
| | | /** |
| | | * 数据交互服务的serviceid |
| | | */ |
| | | public static final String DATA_INTERCHANGE_SERVICE = "ruoyi-dataInterchange"; |
| | | } |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-dataInterchange</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.ruoyi.system; |
| | | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import com.ruoyi.common.security.annotation.EnableCustomConfig; |
| | | import com.ruoyi.common.security.annotation.EnableRyFeignClients; |
| | | import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @EnableCustomConfig |
| | | @MapperScan({"com.ruoyi.system.mapper"}) |
| | | @EnableScheduling//开启定时任务 |
| | | @EnableCustomSwagger2 |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableTransactionManagement |
| | | public class RuoYiSystemApplication |
| | | { |
| | | public class RuoYiSystemApplication { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(RuoYiSystemApplication.class, args); |
| | | System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" + |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:38 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/car") |
| | | public class CarController { |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.api.query.GetEnterpriseListReq; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | 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 io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; /** |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/6 11:01 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取企业 |
| | | * |
| | | * @param username |
| | | * @return |
| | | */ |
| | |
| | | Enterprise username1 = enterpriseService.getOne(new QueryWrapper<Enterprise>().eq("username", username)); |
| | | return R.ok(username1); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getEnterpriseList") |
| | | @ApiOperation(value = "获取公司列表数据", tags = {"公司管理"}) |
| | | public R<PageInfo<Enterprise>> getEnterpriseList(GetEnterpriseListReq req) { |
| | | PageInfo<Enterprise> enterpriseList = enterpriseService.getEnterpriseList(req); |
| | | return R.ok(enterpriseList); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getEnterpriseInfo/{id}") |
| | | @ApiOperation(value = "获取公司详情", tags = {"公司管理"}) |
| | | public R<Enterprise> getEnterpriseInfo(@PathVariable("id") Integer id) { |
| | | Enterprise enterprise = enterpriseService.getById(id); |
| | | return R.ok(enterprise); |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/shopUserStart") |
| | | @ApiOperation(value = "账号管理--禁用/启用", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | public AjaxResult shopUserStart(@RequestBody ShopUserStart shopUserStart) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取当前用户信息 |
| | | */ |
| | |
| | | sysUserVo.setSysUser(sysUser); |
| | | sysUserVo.setRoles(roles); |
| | | sysUserVo.setPermissions(permissions); |
| | | |
| | | return R.ok(sysUserVo); |
| | | } |
| | | |
| | | /** |
| | | * 门店登录使用 |
| | | * |
| | | * @param username |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过用户id查询角色对象 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过手机号集合查询用户 |
| | | * |
| | | * @param phoneList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过手机号查询用户 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过账号查询用户 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加管理员 |
| | | * |
| | | * @param user |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 保存门店员工管理后台账号 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除门店管理员账号 |
| | | * |
| | | * @param objectId |
| | | * @param roleType |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PutMapping("/switchShop/{shopId}") |
| | | @ApiOperation(value = "切换门店", tags = {"门店后台-首页"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过账号和账号权限查询用户 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.Car; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:37 |
| | | */ |
| | | public interface CarMapper extends BaseMapper<Car> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:25 |
| | | */ |
| | | public interface DriverMapper extends BaseMapper<Driver> { |
| | | } |
| | |
| | | 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.Enterprise; |
| | | import com.ruoyi.system.api.query.GetEnterpriseListReq; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/4 18:30 |
| | | */ |
| | | public interface EnterpriseMapper extends BaseMapper<Enterprise> { |
| | | |
| | | |
| | | /** |
| | | * 获取企业列表数据 |
| | | * |
| | | * @param page |
| | | * @param req |
| | | * @return |
| | | */ |
| | | PageInfo<Enterprise> getEnterpriseList(PageInfo<Enterprise> page, @Param("req") GetEnterpriseListReq req); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.Car; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:38 |
| | | */ |
| | | public interface ICarService extends IService<Car> { |
| | | |
| | | |
| | | /** |
| | | * 定时任务存储最新的车辆数据 |
| | | */ |
| | | void taskSaveNewCar(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:26 |
| | | */ |
| | | public interface IDriverService extends IService<Driver> { |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取新驾驶员数据 |
| | | */ |
| | | void taskSaveNewDriver(); |
| | | } |
| | |
| | | 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.Enterprise; |
| | | import com.ruoyi.system.api.query.GetEnterpriseListReq; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/4 18:32 |
| | | */ |
| | | public interface IEnterpriseService extends IService<Enterprise> { |
| | | |
| | | |
| | | /** |
| | | * 获取公司列表数据 |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | PageInfo<Enterprise> getEnterpriseList(GetEnterpriseListReq req); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.Car; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.mapper.CarMapper; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.ZoneOffset; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:38 |
| | | */ |
| | | @Service |
| | | public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarService { |
| | | |
| | | @Resource |
| | | private UPExgMsgRegisterClient upExgMsgRegisterClient; |
| | | |
| | | @Resource |
| | | private IEnterpriseService enterpriseService; |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | |
| | | /** |
| | | * 定时任务存储最新的车辆数据 |
| | | */ |
| | | @Override |
| | | public void taskSaveNewCar() { |
| | | Car car = this.getOne(new LambdaQueryWrapper<Car>().orderByDesc(Car::getCreateTime).last(" limit 0, 1")); |
| | | Long startTime = -1L; |
| | | if (null != car) { |
| | | startTime = car.getCreateTime().toEpochSecond(ZoneOffset.ofHours(8)); |
| | | } |
| | | List<UPExgMsgRegisterVo> list = upExgMsgRegisterClient.getUPExgMsgRegisterListIsAfterCreateTime(startTime).getData(); |
| | | List<Enterprise> list1 = enterpriseService.list(); |
| | | List<Car> carList = new ArrayList<>(); |
| | | for (UPExgMsgRegisterVo vo : list) { |
| | | car = new Car(); |
| | | car.setVehicleNumber(vo.getVehicleNo()); |
| | | car.setLicensePlateColor(VehicleColorEnum.getName(vo.getVehicleColor())); |
| | | Enterprise enterprise = list1.stream().filter(s -> s.getCode().equals(vo.getInferiorPlatformId().toString())).findFirst().get(); |
| | | car.setEnterpriseId(enterprise.getId()); |
| | | Driver driver = driverService.getOne(new LambdaQueryWrapper<Driver>().eq(Driver::getVehicleNumber, vo.getVehicleNo()).eq(Driver::getStatus, 1)); |
| | | if (null != driver) { |
| | | car.setDriverId(driver.getId()); |
| | | } |
| | | car.setGpsModel(vo.getTerminalModelType()); |
| | | car.setGpsImei(vo.getTerminalSIMCode()); |
| | | carList.add(car); |
| | | } |
| | | this.saveBatch(carList); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgReportDriverInfoClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgReportDriverInfoVo; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.mapper.DriverMapper; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:26 |
| | | */ |
| | | @Service |
| | | public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> implements IDriverService { |
| | | |
| | | @Resource |
| | | private UPExgMsgReportDriverInfoClient upExgMsgReportDriverInfoClient; |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | @Resource |
| | | private IEnterpriseService enterpriseService; |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取新驾驶员数据 |
| | | */ |
| | | @Override |
| | | public void taskSaveNewDriver() { |
| | | Driver driver = driverService.getOne(new LambdaQueryWrapper<Driver>().eq(Driver::getStatus, 1).orderByDesc(Driver::getUpdateTime).last(" limit 0, 1")); |
| | | Long createTime = -1L; |
| | | if (null != driver) { |
| | | createTime = driver.getUpdateTime().toEpochSecond(ZoneOffset.ofHours(8)); |
| | | } |
| | | List<UPExgMsgReportDriverInfoVo> list = upExgMsgReportDriverInfoClient.getUPExgMsgReportDriverInfoListIsAfterCreateTime(createTime).getData(); |
| | | List<Enterprise> list1 = enterpriseService.list(); |
| | | List<Driver> driverList = new ArrayList<>(); |
| | | for (UPExgMsgReportDriverInfoVo vo : list) { |
| | | driver = new Driver(); |
| | | driver.setName(vo.getDriverName()); |
| | | driver.setDrivingLicenseNumber(vo.getDriverId()); |
| | | driver.setCertification(vo.getLicence()); |
| | | driver.setOrgName(vo.getOrgName()); |
| | | Enterprise enterprise = list1.stream().filter(s -> s.getCode().equals(vo.getInferiorPlatformId().toString())).findFirst().get(); |
| | | driver.setEnterpriseId(enterprise.getId()); |
| | | driver.setContractingCompany(enterprise.getName()); |
| | | driver.setStatus(1); |
| | | driver.setFlag(1); |
| | | driver.setUpdateTime(LocalDateTime.now()); |
| | | driverList.add(driver); |
| | | } |
| | | this.saveBatch(driverList); |
| | | } |
| | | } |
| | |
| | | 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.Enterprise; |
| | | import com.ruoyi.system.api.query.GetEnterpriseListReq; |
| | | import com.ruoyi.system.mapper.EnterpriseMapper; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | */ |
| | | @Service |
| | | public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper, Enterprise> implements IEnterpriseService { |
| | | |
| | | |
| | | /** |
| | | * 获取公司列表数据 |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<Enterprise> getEnterpriseList(GetEnterpriseListReq req) { |
| | | PageInfo<Enterprise> page = new PageInfo<>(req.getPageCurr(), req.getPageSize()); |
| | | return this.baseMapper.getEnterpriseList(page, req); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.util; |
| | | |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 11:01 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取新车辆数据 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskSaveNewCar() { |
| | | carService.taskSaveNewCar(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取新驾驶员数据 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskSaveNewDriver() { |
| | | driverService.taskSaveNewDriver(); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.EnterpriseMapper"> |
| | | |
| | | <select id="getEnterpriseList" resultType="com.ruoyi.system.api.model.Enterprise"> |
| | | select * |
| | | from t_enterprise |
| | | <where> |
| | | <if test="null != req.name and '' != req.name"> |
| | | and `name` like CONCAT('%', #{req.name}, '%') |
| | | </if> |
| | | <if test="null != req.businessScope and '' != req.businessScope"> |
| | | and business_scope like CONCAT('%', #{req.businessScope}, '%') |
| | | </if> |
| | | <if test="null != req.mailingAddress and '' != req.mailingAddress"> |
| | | and mailing_address like CONCAT('%', #{req.mailingAddress}, '%') |
| | | </if> |
| | | <if test="null != req.legalRepresentative and '' != req.legalRepresentative"> |
| | | and legal_representative like CONCAT('%', #{req.legalRepresentative}, '%') |
| | | </if> |
| | | <if test="null != req.operationType and '' != req.operationType"> |
| | | and operation_type like CONCAT('%', #{req.operationType}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!--lombok--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-elasticsearch</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-dataInterchange</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * 账户模块 |
| | | * 数据交互模块 |
| | | * |
| | | * @author ruoyi |
| | | */ |
New file |
| | |
| | | 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.UPExgMsgRegisterVo; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgRegisterDao; |
| | | import com.ruoyi.dataInterchange.model.UPExgMsgRegister; |
| | | 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.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 13:39 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/UPExgMsgRegister") |
| | | public class UPExgMsgRegisterController { |
| | | |
| | | @Resource |
| | | private UPExgMsgRegisterDao upExgMsgRegisterDao; |
| | | |
| | | |
| | | /** |
| | | * 查询添加时间大于等于给定时间的车辆基础数据 |
| | | * |
| | | * @param startTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/getUPExgMsgRegisterListIsAfterCreateTime") |
| | | public R<List<UPExgMsgRegisterVo>> getUPExgMsgRegisterListIsAfterCreateTime(@RequestParam("startTime") Long startTime) { |
| | | List<UPExgMsgRegisterVo> voList = new ArrayList<>(); |
| | | if (-1 == startTime) { |
| | | Iterator<UPExgMsgRegister> iterator = upExgMsgRegisterDao.findAll().iterator(); |
| | | while (iterator.hasNext()) { |
| | | UPExgMsgRegister register = iterator.next(); |
| | | UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo(); |
| | | BeanUtils.copyProperties(register, vo); |
| | | voList.add(vo); |
| | | } |
| | | |
| | | } else { |
| | | List<UPExgMsgRegister> list = upExgMsgRegisterDao.findByCreateTimeIsAfter(startTime); |
| | | for (UPExgMsgRegister register : list) { |
| | | UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo(); |
| | | BeanUtils.copyProperties(register, vo); |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | return R.ok(voList); |
| | | } |
| | | } |
New file |
| | |
| | | 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.UPExgMsgReportDriverInfoVo; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgReportDriverInfoAckDao; |
| | | import com.ruoyi.dataInterchange.model.UPExgMsgReportDriverInfoAck; |
| | | 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.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/UPExgMsgReportDriverInfo") |
| | | public class UPExgMsgReportDriverInfoController { |
| | | |
| | | |
| | | @Resource |
| | | private UPExgMsgReportDriverInfoAckDao upExgMsgReportDriverInfoAckDao; |
| | | |
| | | |
| | | /** |
| | | * 查询添加时间等于或大于给定时间的数据 |
| | | * |
| | | * @param createTime |
| | | * @return |
| | | */ |
| | | @PostMapping("/getUPExgMsgReportDriverInfoListIsAfterCreateTime") |
| | | public R<List<UPExgMsgReportDriverInfoVo>> getUPExgMsgReportDriverInfoListIsAfterCreateTime(@RequestParam("createTime") Long createTime) { |
| | | List<UPExgMsgReportDriverInfoVo> voList = new ArrayList<>(); |
| | | if (-1 == createTime) { |
| | | Iterator<UPExgMsgReportDriverInfoAck> iterator = upExgMsgReportDriverInfoAckDao.findAll().iterator(); |
| | | while (iterator.hasNext()) { |
| | | UPExgMsgReportDriverInfoAck next = iterator.next(); |
| | | UPExgMsgReportDriverInfoVo vo = new UPExgMsgReportDriverInfoVo(); |
| | | BeanUtils.copyProperties(next, vo); |
| | | voList.add(vo); |
| | | } |
| | | } else { |
| | | List<UPExgMsgReportDriverInfoAck> list = upExgMsgReportDriverInfoAckDao.findByCreateTimeIsAfter(createTime); |
| | | for (UPExgMsgReportDriverInfoAck upExgMsgReportDriverInfoAck : list) { |
| | | UPExgMsgReportDriverInfoVo vo = new UPExgMsgReportDriverInfoVo(); |
| | | BeanUtils.copyProperties(upExgMsgReportDriverInfoAck, vo); |
| | | voList.add(vo); |
| | | } |
| | | } |
| | | return R.ok(voList); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 17:29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/UPExgMsgTakeEwayBill") |
| | | public class UPExgMsgTakeEwayBillController { |
| | | } |
| | |
| | | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/7 16:10 |
| | |
| | | * @return |
| | | */ |
| | | UPExgMsgRegister findByVehicleNo(String vehicleNo); |
| | | |
| | | |
| | | /** |
| | | * 查询添加时间大于等于给定时间的数据 |
| | | * |
| | | * @param createTime |
| | | * @return |
| | | */ |
| | | List<UPExgMsgRegister> findByCreateTimeIsAfter(Long createTime); |
| | | } |
| | |
| | | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/7 17:12 |
| | |
| | | * @return |
| | | */ |
| | | UPExgMsgReportDriverInfoAck findByVehicleNo(String vehicleNo); |
| | | |
| | | |
| | | /** |
| | | * 查询等于或者大于给定时间的数据 |
| | | * |
| | | * @param createTime |
| | | * @return |
| | | */ |
| | | List<UPExgMsgReportDriverInfoAck> findByCreateTimeIsAfter(Long createTime); |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.model.enu; |
| | | |
| | | |
| | | /** |
| | | * 报警类型 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/13 12:02 |
| | | */ |
| | | public enum WarnType { |
| | | OVERSPEED_ALARM(0x0001, "超速报警"), |
| | | FATIGUE_DRIVING_ALARM(0x0002, "疲劳驾驶报警"), |
| | | EMERGENCY_ALARM(0x0003, "紧急报警"), |
| | | ENTER_THE_DESIGNATED_AREA_TO_ALERT(0x0004, "进入指定区域报警"), |
| | | LEAVE_THE_DESIGNATED_AREA_TO_CALL_THE_POLICE(0x0005, "离开指定区域报警"), |
| | | ROAD_BLOCKING_ALARM(0x0006, "路段堵塞报警"), |
| | | DANGEROUS_ROAD_WARNING(0x0007, "危险路段报警"), |
| | | CROSSING_ALARM(0x0008, "越界报警"), |
| | | BURGLAR_ALARM(0x0009, "盗警"), |
| | | ROBBERY_POLICE(0x000A, "劫警"), |
| | | OFF_COURSE_ALARM(0x000B, "偏离路线报警"), |
| | | VEHICLE_MOVEMENT_ALARM(0x000C, "车辆移动报警"), |
| | | OVERTIME_DRIVING_ALARM(0x000D, "超时驾驶报警"), |
| | | OTHER_ALARM(0x00FF, "其他报警"); |
| | | private Integer code; |
| | | |
| | | private String name; |
| | | |
| | | |
| | | WarnType(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | if (null == register) { |
| | | upExgMsgRegisterDao.save(upExgMsgRegister); |
| | | } |
| | | //上报驾驶员身份识别信息请求 |
| | | UPExgMsgReportDriverInfoAck byVehicleNo = upExgMsgReportDriverInfoAckDao.findByVehicleNo(upExgMsgRegister.getVehicleNo()); |
| | | if (null == byVehicleNo) { |
| | | down_exg_msg_report_driver_info(ctx, inferiorPlatformId, upExgMsgRegister.getVehicleNo(), upExgMsgRegister.getVehicleColor()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时获取司机基础信息 |
| | | */ |
| | | public void taskReportDriverInfo() { |
| | | Iterator<UPExgMsgRegister> iterator = upExgMsgRegisterDao.findAll().iterator(); |
| | | while (iterator.hasNext()) { |
| | | UPExgMsgRegister register = iterator.next(); |
| | | |
| | | //上报驾驶员身份识别信息请求 |
| | | UPExgMsgReportDriverInfoAck byVehicleNo = upExgMsgReportDriverInfoAckDao.findByVehicleNo(register.getVehicleNo()); |
| | | if (null == byVehicleNo) { |
| | | down_exg_msg_report_driver_info(register.getInferiorPlatformId(), register.getVehicleNo(), register.getVehicleColor()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 上报驾驶员身份识别信息请求 |
| | | * |
| | | * @param ctx |
| | | */ |
| | | public void down_exg_msg_report_driver_info(ChannelHandlerContext ctx, int inferiorPlatformId, String vehicleNo, int VehicleColor) { |
| | | public void down_exg_msg_report_driver_info(int inferiorPlatformId, String vehicleNo, int VehicleColor) { |
| | | DOWNExgMsgReportDriverInfo downExgMsgReportDriverInfo = new DOWNExgMsgReportDriverInfo(); |
| | | downExgMsgReportDriverInfo.setVehicleNo(vehicleNo); |
| | | downExgMsgReportDriverInfo.setVehicleColor(VehicleColor); |
| | | downExgMsgReportDriverInfo.setDataType(DataType.DOWN_EXG_MSG_REPORT_DRIVER_INFO.getCode()); |
| | | downExgMsgReportDriverInfo.setDataLength(0); |
| | | byte[] body = downExgMsgReportDriverInfo.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_EXG_MSG_REPORT_DRIVER_INFO.getCode(), body); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_EXG_MSG.getCode(), body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | |
| | | downExgMsgTakeEwaybillReq.setDataLength(0); |
| | | |
| | | byte[] body = downExgMsgTakeEwaybillReq.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_EXG_MSG_TAKE_EWAYBILL_REQ.getCode(), body); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_EXG_MSG.getCode(), body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | |
| | | downWarnMsgUrgeTodoReq.setDataType(DataType.DOWN_WARN_MSG_URGE_TODO_REQ.getCode()); |
| | | downWarnMsgUrgeTodoReq.setDataLength(92); |
| | | byte[] body = downWarnMsgUrgeTodoReq.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_WARN_MSG_URGE_TODO_REQ.getCode(), body); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_WARN_MSG.getCode(), body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | |
| | | @Resource |
| | | private WarnMsgService warnMsgService; |
| | | |
| | | /** |
| | | * 定时任务获取驾驶员信息 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskReportDriverInfo() { |
| | | exgMsgService.taskReportDriverInfo(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务获取电子运单信息 |