车辆管理初始化
parent
fa85bb90ca
commit
0a6f6fbace
|
@ -0,0 +1,64 @@
|
||||||
|
package com.god.base.server.common.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池箱信息表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName("t_battery_box")
|
||||||
|
public class BatteryBox {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池箱主键
|
||||||
|
*/
|
||||||
|
private long batteryBoxId;
|
||||||
|
/**
|
||||||
|
* 电池包编码
|
||||||
|
*/
|
||||||
|
private String batteryBoxBatteryPackCoding;
|
||||||
|
/**
|
||||||
|
* 电池包型名称
|
||||||
|
*/
|
||||||
|
private String batteryBoxName;
|
||||||
|
/**
|
||||||
|
* 电池型号编号
|
||||||
|
*/
|
||||||
|
private String batteryBoxNumber;
|
||||||
|
/**
|
||||||
|
* 实际容量
|
||||||
|
*/
|
||||||
|
private String batteryBoxActualCapacity;
|
||||||
|
/**
|
||||||
|
* 实际电压
|
||||||
|
*/
|
||||||
|
private String batteryBoxVirtualVoltage;
|
||||||
|
/**
|
||||||
|
* 实际质量
|
||||||
|
*/
|
||||||
|
private String batteryBoxActualMass;
|
||||||
|
/**
|
||||||
|
* 出厂时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat
|
||||||
|
private Date batteryBoxDate;
|
||||||
|
/**
|
||||||
|
* 所在电池组编码
|
||||||
|
*/
|
||||||
|
private long cellId;
|
||||||
|
/**
|
||||||
|
* 所在车辆VIN
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.god.base.server.common.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池箱型号
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName("t_batteryBox_model")
|
||||||
|
public class BatteryBoxModel {
|
||||||
|
/**
|
||||||
|
* 电池箱型号主键
|
||||||
|
*/
|
||||||
|
private long batteryBoxModelId;
|
||||||
|
/**
|
||||||
|
* 型号名称
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelName;
|
||||||
|
/**
|
||||||
|
* 型号编号
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelNumber;
|
||||||
|
/**
|
||||||
|
* 电池包规格代码
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelPackSpecificationCode;
|
||||||
|
/**
|
||||||
|
* 电池品牌
|
||||||
|
*/
|
||||||
|
private int batteryBoxModelBrand;
|
||||||
|
/**
|
||||||
|
* 温度探针总数
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelTemperatureProbePopulation;
|
||||||
|
/**
|
||||||
|
* 模块串并联方式
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelModuleSeriesParallelMode;
|
||||||
|
/**
|
||||||
|
* 模块个数
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelNumberOfModules;
|
||||||
|
/**
|
||||||
|
* 生产厂商名称
|
||||||
|
*/
|
||||||
|
private String batteryBoxModelManufacturerName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
package com.god.base.server.common.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.god.base.server.common.domain.request.CarRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_car")
|
||||||
|
public class Car {
|
||||||
|
/**
|
||||||
|
* 车辆Vin 主键
|
||||||
|
*/
|
||||||
|
private String carVinId;
|
||||||
|
/**
|
||||||
|
* 单位id
|
||||||
|
*/
|
||||||
|
private long userId;
|
||||||
|
/**
|
||||||
|
* 车辆类型id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
* 电池箱信息id
|
||||||
|
*/
|
||||||
|
private long batteryBoxId;
|
||||||
|
/**
|
||||||
|
* 电池组id
|
||||||
|
*/
|
||||||
|
private long cellId;
|
||||||
|
/**
|
||||||
|
* 单体电池id
|
||||||
|
*/
|
||||||
|
private long batteryCellId;
|
||||||
|
/**
|
||||||
|
* 电池组模块id
|
||||||
|
*/
|
||||||
|
private long batteryPackInformationId;
|
||||||
|
/**
|
||||||
|
* 电子围栏ID
|
||||||
|
*/
|
||||||
|
private long fenceId;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carNumber;
|
||||||
|
/**
|
||||||
|
* 驱动机主键
|
||||||
|
*/
|
||||||
|
private long driveMotorId;
|
||||||
|
/**
|
||||||
|
* 车辆总里程
|
||||||
|
*/
|
||||||
|
private String carMileage;
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat
|
||||||
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 电池厂商
|
||||||
|
*/
|
||||||
|
private String batteryManufacturer;
|
||||||
|
/**
|
||||||
|
* 电机厂商
|
||||||
|
*/
|
||||||
|
private String motorManufacturer;
|
||||||
|
/**
|
||||||
|
* 电机编号
|
||||||
|
*/
|
||||||
|
private String motorNumber;
|
||||||
|
/**
|
||||||
|
* 电池编号
|
||||||
|
*/
|
||||||
|
private String batteryNumber;
|
||||||
|
/**
|
||||||
|
* 逻辑删除
|
||||||
|
*/
|
||||||
|
private int isDelete;
|
||||||
|
|
||||||
|
|
||||||
|
public static Car addReqBuild(CarRequest carRequest){
|
||||||
|
return Car.builder()
|
||||||
|
//把所有的属性点都加上
|
||||||
|
.carVinId(carRequest.getCarVinId())
|
||||||
|
.carTypeId(carRequest.getCarTypeId())
|
||||||
|
.batteryManufacturer(carRequest.getBatteryManufacturer())
|
||||||
|
.motorManufacturer(carRequest.getMotorManufacturer())
|
||||||
|
.motorNumber(carRequest.getMotorNumber())
|
||||||
|
.batteryNumber(carRequest.getBatteryNumber())
|
||||||
|
.batteryNumber(carRequest.getBatteryNumber())
|
||||||
|
.build()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.god.base.server.common.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName("t_carT_type")
|
||||||
|
public class CarType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型主建
|
||||||
|
*/
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 类型名称
|
||||||
|
*/
|
||||||
|
private String carTypename;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.god.base.server.common.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@TableName("t_fence")
|
||||||
|
public class Fence {
|
||||||
|
/**
|
||||||
|
* 围栏id
|
||||||
|
*/
|
||||||
|
private String fenceId;
|
||||||
|
/**
|
||||||
|
* 围栏经纬度串(逗号拼接字符串)
|
||||||
|
*/
|
||||||
|
private String fenceAddress;
|
||||||
|
/**
|
||||||
|
* 标签编号
|
||||||
|
*/
|
||||||
|
private String labelId;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private String updateTime;
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.god.base.server.common.domain.request;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NotNull
|
||||||
|
public class CarRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆Vin 主键
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "车辆vin不能为空")
|
||||||
|
private String carVinId;
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "车辆类型不能为空")
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
* 电子围栏ID
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "电子围栏不能为空")
|
||||||
|
private long fenceId;
|
||||||
|
/**
|
||||||
|
* 电池厂商
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "电池厂商不能为空")
|
||||||
|
private String batteryManufacturer;
|
||||||
|
/**
|
||||||
|
* 电机厂商
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "电机厂商不能为空")
|
||||||
|
private String motorManufacturer;
|
||||||
|
/**
|
||||||
|
* 电机编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "电机编号不能为空")
|
||||||
|
private String motorNumber;
|
||||||
|
/**
|
||||||
|
* 电池编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "电池编号不能为空")
|
||||||
|
private String batteryNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9803
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: god-car-base
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: nacos.god.com:8848
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: nacos.god.com:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.god.system.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="./logs/god-car-base"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.god" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -59,6 +59,17 @@
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-security</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
@ -93,4 +104,4 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -17,6 +17,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class GodCarBaseApplication {
|
public class GodCarBaseApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(com.god.base.server.GodCarBaseApplication .class, args);
|
SpringApplication.run(GodCarBaseApplication.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.god.base.server.controller;
|
||||||
|
import com.god.base.server.common.domain.Car;
|
||||||
|
import com.god.base.server.common.domain.request.CarRequest;
|
||||||
|
import com.god.base.server.service.CarService;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/car")
|
||||||
|
@Log4j2
|
||||||
|
public class CarController {
|
||||||
|
@Autowired
|
||||||
|
private CarService carService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆信息查看
|
||||||
|
*/
|
||||||
|
@GetMapping("carList/{userId}")
|
||||||
|
public R<?> carList(@PathVariable String userId){
|
||||||
|
log.info("请求参数" + userId);
|
||||||
|
R<List<Car>> carList = carService.carList(userId);
|
||||||
|
log.info("响应参数" + carList);
|
||||||
|
return R.ok(carList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加车辆
|
||||||
|
*/
|
||||||
|
@PostMapping("/addCar")
|
||||||
|
public R<String> addCarP(@RequestBody @Validated CarRequest carRequest){
|
||||||
|
log.info("请求参数" + carRequest);
|
||||||
|
boolean save = carService.save(Car.addReqBuild(carRequest));
|
||||||
|
log.info("响应参数" + save);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改车辆的连接 进行上报
|
||||||
|
*/
|
||||||
|
@PostMapping("/updCar/{vinId}")
|
||||||
|
public R updCat(@PathVariable @Validated String vinId){
|
||||||
|
log.info("请求参数" + vinId);
|
||||||
|
carService.updateById(vinId);
|
||||||
|
log.info("响应参数" + vinId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除
|
||||||
|
*/
|
||||||
|
@PostMapping("/delCar/{vinId}")
|
||||||
|
public R delCar(@PathVariable String vinId){
|
||||||
|
log.info("请求参数" + vinId);
|
||||||
|
boolean b = carService.removeById(vinId);
|
||||||
|
log.info("响应参数" + b);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实时轨迹
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public R sSgj(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.god.base.server.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.god.base.server.common.domain.Car;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CarMapper extends BaseMapper<Car> {
|
||||||
|
|
||||||
|
List<Car> getList(@Param("userId1") Long userId1);
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.god.base.server.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.god.base.server.common.domain.Car;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理层
|
||||||
|
*/
|
||||||
|
public interface CarService extends IService<Car> {
|
||||||
|
|
||||||
|
|
||||||
|
R<List<Car>> carList(@Param("userId") String userId);
|
||||||
|
|
||||||
|
void updateById(@Param("vinId") String vinId);
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<el-button type="primay" class="sub-btn" @click="handleStart">开始搭建围栏</el-button>
|
||||||
|
|
||||||
|
<div class="map-paint-box2" v-show="clockBox">
|
||||||
|
<button class="btn" onclick="startWrite">开始绘制</button>
|
||||||
|
<button class="btn" onclick="clearWrite()">清除</button>
|
||||||
|
<button class="btn" onclick="finishWrite">完成绘制</button>
|
||||||
|
<button class="btn" onclick="polyEditor.close()">结束编辑</button>
|
||||||
|
centers: ["116.400274 , 39.9322"],
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var map = new AMap.Map("contatiner",{
|
||||||
|
center:[116.400274 , 39.905812],
|
||||||
|
zoom: 14,
|
||||||
|
viewMode: '2D',
|
||||||
|
});
|
||||||
|
//初始化地图
|
||||||
|
function initMap() {
|
||||||
|
throw AMapLoader.load({
|
||||||
|
key: "",//申请好的web端开发者key , 首次调用load时必填
|
||||||
|
version: "2.0",//指定要加载的JSAPI 的版本 , 缺省是默认
|
||||||
|
AMapUI: {
|
||||||
|
version: '1.1',
|
||||||
|
plugins: ['control/BasicControl']
|
||||||
|
}
|
||||||
|
}).then((AMap)=> {
|
||||||
|
new AMap.Map("container", {
|
||||||
|
resizeRnable: true,
|
||||||
|
zoom: 16,
|
||||||
|
center: [104.560921999, 31.45646]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//初始化围栏信息
|
||||||
|
function handleAStart(){
|
||||||
|
allPloy = []
|
||||||
|
//现从后端获取已经建立的围栏,展示在地图上存到curr
|
||||||
|
clickBox.value - true // z展示操作按钮
|
||||||
|
AMapLoader.load({
|
||||||
|
key:"",
|
||||||
|
version:"2.2",
|
||||||
|
plugins
|
||||||
|
})
|
||||||
|
});
|
||||||
|
//直接在地图建立新的围栏
|
||||||
|
let ployEditor;
|
||||||
|
ployEditor.on('add' , function (){
|
||||||
|
polyEditor.addAdsorbpolygons = function (polygon) {
|
||||||
|
|
||||||
|
};
|
||||||
|
polyEditor.addAdsorbpolygons(polygon);
|
||||||
|
var ployOverlays = []
|
||||||
|
ployOverlays.push(polygon)
|
||||||
|
allPloy.push(polygon)
|
||||||
|
var currentPoly = polygon
|
||||||
|
polygon.constructor('dblclick',()=>{
|
||||||
|
var polyOverlays = []
|
||||||
|
var currentPoly = polygon
|
||||||
|
polyEditor.setTarget = function (polygon) {
|
||||||
|
|
||||||
|
};
|
||||||
|
polyEditor.setTarget(polygon);
|
||||||
|
polyOverlays.push(polygon)
|
||||||
|
polyEditor.open();
|
||||||
|
}).cath(e=>{
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
function clearWrite(){
|
||||||
|
allpoy.somee((one,index)=>{
|
||||||
|
if (one==currentPoly){
|
||||||
|
allPloy.push()
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
|
||||||
|
<title>地图显示</title>
|
||||||
|
<style>
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
#container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container"></div>
|
||||||
|
<!-- 加载地图JSAPI脚本 -->
|
||||||
|
<script src="https://webapi.amap.com/maps?v=2.0&key=1dc6c2a01b67ed7f982a49fc89ac3190"></script>
|
||||||
|
<script>
|
||||||
|
var map = new AMap.Map('container', {
|
||||||
|
viewMode: '3D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D'
|
||||||
|
zoom:11, // 初始化地图层级
|
||||||
|
center: [116.397428, 39.90923] // 初始化地图中心点
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<style>
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
#container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>多边形的绘制和编辑</title>
|
||||||
|
<link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
|
||||||
|
<script src="https://webapi.amap.com/maps?v=2.0&key=1dc6c2a01b67ed7f982a49fc89ac3190&plugin=AMap.PolygonEditor"></script>
|
||||||
|
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container"></div>
|
||||||
|
<div class="input-card" style="width: 120px">
|
||||||
|
<button class="btn" onclick="polyEditor.open()" style="margin-bottom: 5px">开始编辑</button>
|
||||||
|
<button class="btn" onclick="polyEditor.close()">结束编辑</button>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var map = new AMap.Map("container", {
|
||||||
|
center: [116.400274, 39.905812],
|
||||||
|
zoom: 14,
|
||||||
|
viewMode: '3D',
|
||||||
|
});
|
||||||
|
|
||||||
|
var path = [
|
||||||
|
[116.403322, 39.920255],
|
||||||
|
[116.410703, 39.897555],
|
||||||
|
[116.402292, 39.892353],
|
||||||
|
[116.389846, 39.891365]
|
||||||
|
]
|
||||||
|
var path1 = [
|
||||||
|
[116.453322, 39.920255],
|
||||||
|
[116.460703, 39.897555],
|
||||||
|
[116.452292, 39.892353],
|
||||||
|
[116.439846, 39.891365]
|
||||||
|
]
|
||||||
|
|
||||||
|
var polygon = new AMap.Polygon({
|
||||||
|
path: path,
|
||||||
|
strokeColor: "#FF33FF",
|
||||||
|
strokeWeight: 6,
|
||||||
|
strokeOpacity: 0.2,
|
||||||
|
fillOpacity: 0.4,
|
||||||
|
fillColor: '#1791fc',
|
||||||
|
zIndex: 50,
|
||||||
|
bubble: true,
|
||||||
|
})
|
||||||
|
var polygon1 = new AMap.Polygon({
|
||||||
|
path: path1,
|
||||||
|
strokeColor: "green",
|
||||||
|
strokeWeight: 6,
|
||||||
|
strokeOpacity: 0.2,
|
||||||
|
fillOpacity: 0.4,
|
||||||
|
fillColor: '#1791fc',
|
||||||
|
zIndex: 50,
|
||||||
|
bubble: true,
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
map.add([polygon, polygon1])
|
||||||
|
|
||||||
|
// 缩放地图到合适的视野级别
|
||||||
|
map.setFitView()
|
||||||
|
var polyEditor;
|
||||||
|
// var polyEditor = new AMap.PolyEditor(map, polygon)
|
||||||
|
// polyEditor = new AMap.PolygonEditor(map)
|
||||||
|
polyEditor = new AMap.PolygonEditor(map, polygon);
|
||||||
|
polyEditor.addAdsorbPolygons(polygon1)
|
||||||
|
polyEditor.open();
|
||||||
|
// polyEditor.close();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,145 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--引入高德地图sdk-->
|
||||||
|
<!--"@amap/amap-jsapi-loader": "^1.0.1"-->
|
||||||
|
<!--html 展示操作按钮-->
|
||||||
|
<el-button type="primary" class="sub-btn" @click="handleStart">开始建围栏</el-button>点击开始建立围栏后,围栏操作按钮才可见
|
||||||
|
|
||||||
|
<div class="map-paint-box2" v-show="clickBox">
|
||||||
|
<button class="btn" onclick="startWrite">开始绘制</button>
|
||||||
|
<button class="btn" onclick="clearWrite">清除</button>
|
||||||
|
<button class="btn" onclick="finishWrite">完成绘制</button>
|
||||||
|
<button class="btn" onclick="polyEditor.open()" style="margin-bottom: 5px">开始编辑</button>
|
||||||
|
<button class="btn" onclick="polyEditor.close()">结束编辑</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var map = new AMap.Map("container", {
|
||||||
|
center: [116.400274, 39.905812],
|
||||||
|
zoom: 14,
|
||||||
|
viewMode: '3D',
|
||||||
|
});
|
||||||
|
//初始化地图:
|
||||||
|
function initMap() {
|
||||||
|
AMapLoader.load({
|
||||||
|
key:"", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||||
|
version:"2.0", // 指定要加载的 JSAPI 的版本,缺省时默认1.4.15
|
||||||
|
AMapUI: {
|
||||||
|
version: '1.1',
|
||||||
|
plugins:['control/BasicControl']
|
||||||
|
} // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||||
|
}).then((AMap)=>{
|
||||||
|
map.value = new AMap.Map("container",{ //设置地图容器id
|
||||||
|
resizeEnable: true, //是否监控地图容器尺寸变化
|
||||||
|
zoom: 16, //初始化地图层级、
|
||||||
|
center: [104.560920999, 31.4560470000]
|
||||||
|
});
|
||||||
|
}).catch(e=>{
|
||||||
|
console.log(e);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//初始化围栏信息
|
||||||
|
function handleStart() {
|
||||||
|
allPoly = []
|
||||||
|
//先从后端获取已经建立的围栏,展示在地图上存到currentOrgWeilan
|
||||||
|
clickBox.value = true //展示操作按钮
|
||||||
|
AMapLoader.load({
|
||||||
|
key:"", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||||
|
version:"2.0",
|
||||||
|
plugins:['AMap.PolygonEditor','AMap.Polygon'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||||
|
}).then((AMap)=>{
|
||||||
|
polyEditor = new AMap.PolygonEditor(map.value);
|
||||||
|
if (currentOrgWeilan.length > 0) {
|
||||||
|
// 复现该组织下的围栏数据
|
||||||
|
for (let one of currentOrgWeilan ) {
|
||||||
|
let path = []
|
||||||
|
let arr = one.regionScope.split(',')
|
||||||
|
for (var i of arr) {
|
||||||
|
let itemLatLng = []
|
||||||
|
let oneArr = i.split('_')
|
||||||
|
itemLatLng.push(Number(oneArr[0]), Number(oneArr[1]))
|
||||||
|
path.push(itemLatLng)
|
||||||
|
}
|
||||||
|
//围栏数据处理 并展示
|
||||||
|
var polygon = new AMap.Polygon({
|
||||||
|
path: path
|
||||||
|
})
|
||||||
|
allPoly.push(polygon)
|
||||||
|
}
|
||||||
|
map.value.add(allPoly)
|
||||||
|
map.value.setFitView(allPoly);
|
||||||
|
polyEditor.addAdsorbPolygons(allPoly)
|
||||||
|
for (let one of allPoly) {
|
||||||
|
// 双击某个围栏可以进行编辑
|
||||||
|
one.on('dblclick', () => {
|
||||||
|
polyOverlays = []
|
||||||
|
currentPoly = one
|
||||||
|
polyEditor.setTarget(one);
|
||||||
|
polyOverlays.push(one)
|
||||||
|
polyEditor.open();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 直接在地图建立新的围栏
|
||||||
|
polyEditor.on('add', function () {
|
||||||
|
var polygon = data.target;
|
||||||
|
polyEditor.addAdsorbPolygons(polygon);
|
||||||
|
polyOverlays = []
|
||||||
|
polyOverlays.push(polygon)
|
||||||
|
allPoly.push(polygon)
|
||||||
|
currentPoly = polygon // currentPoly 存放当前双击围栏,不然点其他操作时总是会操作到最后创建的围栏
|
||||||
|
polygon.on('dblclick', () => {
|
||||||
|
polyOverlays = []
|
||||||
|
currentPoly = polygon
|
||||||
|
polyEditor.setTarget(polygon);
|
||||||
|
polyOverlays.push(polygon)
|
||||||
|
polyEditor.open();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}).catch(e=>{
|
||||||
|
console.log(e);
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
function startWrite() {
|
||||||
|
polyEditor.close();
|
||||||
|
polyEditor.setTarget();
|
||||||
|
polyEditor.open();
|
||||||
|
polyPointArr = []
|
||||||
|
}
|
||||||
|
function clearWrite() {
|
||||||
|
allPoly.some((one,index)=> {
|
||||||
|
if (one==currentPoly) {
|
||||||
|
allPoly.splice(index,1)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
map.value.remove(polyOverlays)
|
||||||
|
polyEditor.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
async function finishWrite() {
|
||||||
|
polyEditor.close()
|
||||||
|
for (var item of allPoly) {
|
||||||
|
let polyAr = item.getPath()
|
||||||
|
let str = '',allStrArr = [], allStr=''
|
||||||
|
for (var one of polyAr) {
|
||||||
|
str = one.lng+'_'+one.lat
|
||||||
|
allStrArr.push(str)
|
||||||
|
}
|
||||||
|
allStr=allStrArr.join(',');
|
||||||
|
polyPointArr.push(allStr)
|
||||||
|
}
|
||||||
|
//polyPointArr是围栏角坐标集合,可以传给后端判断是否在坐标围栏内
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,82 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="https://webapi.amap.com/maps?v=1.4.15&key=1dc6c2a01b67ed7f982a49fc89ac3190&plugin=AMap.MouseTool"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var map = new AMap.Map('container', {
|
||||||
|
center: [121.548181, 29.806906],
|
||||||
|
zoom: 15
|
||||||
|
});
|
||||||
|
|
||||||
|
var path = [
|
||||||
|
[121.546266, 29.80975],
|
||||||
|
[121.54543, 29.806845],
|
||||||
|
[121.548713, 29.806752],
|
||||||
|
[121.549957, 29.809508]
|
||||||
|
]
|
||||||
|
|
||||||
|
var polygon = new AMap.Polygon({
|
||||||
|
path: path,
|
||||||
|
strokeColor: "#1E9FFF",
|
||||||
|
strokeWeight: 2,
|
||||||
|
strokeStyle: 'dashed',
|
||||||
|
strokeOpacity: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
fillColor: '#1E9FFF',
|
||||||
|
zIndex: 50,
|
||||||
|
})
|
||||||
|
|
||||||
|
map.add(polygon)
|
||||||
|
// 缩放地图到合适的视野级别
|
||||||
|
map.setFitView([polygon])
|
||||||
|
|
||||||
|
|
||||||
|
var map = new AMap.Map('container', {
|
||||||
|
zoom: 14
|
||||||
|
});
|
||||||
|
|
||||||
|
var mouseTool = new AMap.MouseTool(map);
|
||||||
|
|
||||||
|
//监听draw事件可获取画好的覆盖物
|
||||||
|
var overlays = [];
|
||||||
|
mouseTool.on('draw', function (e) {
|
||||||
|
//绘制多边形;
|
||||||
|
overlays.push(e.obj);
|
||||||
|
//获取坐标;
|
||||||
|
console.log(e.obj.getPath());
|
||||||
|
//格式化坐标;
|
||||||
|
var polyPoints = e.obj.getPath();
|
||||||
|
var arr = "";
|
||||||
|
for (var i = 0; i < polyPoints.length; i++) {
|
||||||
|
arr += polyPoints[i].lng + "," + polyPoints[i].lat + ";";
|
||||||
|
}
|
||||||
|
console.log(arr);//121.540994,29.870174;121.55138,29.858116;121.55756,29.874193;
|
||||||
|
})
|
||||||
|
|
||||||
|
//多边形样式;
|
||||||
|
mouseTool.polygon({
|
||||||
|
strokeColor: "#1E9FFF",
|
||||||
|
strokeWeight: 2,
|
||||||
|
strokeStyle: 'dashed',
|
||||||
|
strokeOpacity: 1,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
fillColor: '#1E9FFF',
|
||||||
|
zIndex: 50,
|
||||||
|
});
|
||||||
|
|
||||||
|
//清除覆盖物;
|
||||||
|
var radios = document.getElementsByName('func');
|
||||||
|
document.getElementById('clear').onclick = function () {
|
||||||
|
map.remove(overlays)
|
||||||
|
overlays = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -4,9 +4,11 @@ server:
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
# main:
|
||||||
|
# allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: god-car-base
|
name: god-car-management
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?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.god.base.server.mapper.CarMapper">
|
||||||
|
|
||||||
|
<!-- 车辆列表-->
|
||||||
|
<select id="getList" resultType="com.god.base.server.common.domain.Car">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
t_car
|
||||||
|
JOIN t_car_type ON t_car.car_type_id = t_car_type.id
|
||||||
|
JOIN t_batterybox ON t_car.batterybox_id = t_batterybox.batterybox_id
|
||||||
|
JOIN t_cell ON t_car.cell_id = t_cell.cell_id
|
||||||
|
JOIN t_batterycell ON t_car.batterycell_id = t_batterycell.batterycell_id
|
||||||
|
JOIN t_batterypackinformation ON t_car.batterypackinformation_id = t_batterypackinformation.batterypackinformation_id
|
||||||
|
JOIN t_drive_motor ON t_car.drive_motor_id = t_drive_motor.drive_motor_id
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue