feat():连接车辆管理
parent
347018d602
commit
122049419c
|
@ -0,0 +1,112 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-modules-car</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- XllJob定时任务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-xxl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-rabbit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common System-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.car;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class CarApplication {
|
||||||
|
public static void main(String[] args){
|
||||||
|
SpringApplication.run(CarApplication.class,args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.muyu.car.controller;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.muyu.car.domain.CarInformation;
|
||||||
|
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationListReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||||
|
import com.muyu.car.service.CarInformationService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.annotation.RequestScope;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/carinformation")
|
||||||
|
@Tag(name = "车辆信息管理控制层" ,description = "进行车辆管理基础业务操作")
|
||||||
|
public class CarInformationController {
|
||||||
|
@Resource
|
||||||
|
private CarInformationService carInformationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆管理列表
|
||||||
|
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||||
|
* 搜索-->(车辆唯一VIN carInformationVIN 精确查
|
||||||
|
* 车辆类型ID carTypeId 精确查
|
||||||
|
* 车辆电子围栏外键ID carInformationFence 精确查
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
* carInformationState 精确查
|
||||||
|
* 车辆电机厂商 carInformationMotorManufacturer 模糊查
|
||||||
|
* 车辆电机型号 carInformationMotorModel 精确查
|
||||||
|
* 车辆电池厂商 carInformationBatteryManufacturer 模糊查
|
||||||
|
* 车辆电池型号 carInformationBatteryModel 精确查
|
||||||
|
* )
|
||||||
|
* 分页--> 分页页数 pageNum 分页条数 pageSize
|
||||||
|
*
|
||||||
|
* @param carInformationListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectCarInformationList")
|
||||||
|
@Operation(summary = "企业车辆管理列表")
|
||||||
|
public Result<PageInfo<CarInformation>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
||||||
|
PageInfo<CarInformation> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
||||||
|
log.info("企业车辆管理列表查询",carInformationListReq,pageInfo);
|
||||||
|
return Result.success(pageInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆添加管理
|
||||||
|
* @param carInformationAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/addCarInformation")
|
||||||
|
@Operation(summary = "企业车辆添加管理")
|
||||||
|
public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){
|
||||||
|
return carInformationService.addCarInformation(carInformationAddReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆删除
|
||||||
|
* @param carInformationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/delBycarInformationId/{carInformationId}")
|
||||||
|
@Operation(summary = "企业车辆删除")
|
||||||
|
public Result delBycarInformationId(@Validated @PathVariable("carInformationId") Integer carInformationId){
|
||||||
|
return carInformationService.delBycarInformationId(carInformationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆修改管理
|
||||||
|
* @param carInformationUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updatecarInformation")
|
||||||
|
@Operation(summary = "企业车辆修改管理")
|
||||||
|
public Result updatecarInformation(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq) {
|
||||||
|
log.info(carInformationUpdReq);
|
||||||
|
return carInformationService.updatecarInformation(carInformationUpdReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To 电子围栏负责人
|
||||||
|
* 查询企业车辆 carInformationID 和 carInformationLicensePlate
|
||||||
|
* 无参
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/selectCarInformationIdAndLicensePlate")
|
||||||
|
@Operation(summary = "查询企业车辆 carInformationID 和 carInformationLicensePlate")
|
||||||
|
public Result<List<CarInformation>> selectCarInformationIdAndLicensePlate(){
|
||||||
|
List<CarInformation> carInformations = carInformationService.selectBycarInformationIDAndLicensePlate();
|
||||||
|
return Result.success(carInformations);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.muyu.car.controller;
|
||||||
|
|
||||||
|
import com.muyu.car.domain.CarMessage;
|
||||||
|
import com.muyu.car.service.CarMessageService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/carMessage")
|
||||||
|
@Tag(name = "信息报文模块" )
|
||||||
|
public class CarMessageController {
|
||||||
|
@Resource
|
||||||
|
private CarMessageService carMessageService;
|
||||||
|
/**
|
||||||
|
* 根据所属车类别 解析 车辆报文模板
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectCarMessageList")
|
||||||
|
@Operation(summary = "报文模板展示列表")
|
||||||
|
public Result<List<CarMessage>> selectCarMessageList(){
|
||||||
|
List<CarMessage> carMessages = carMessageService.selectCarMessageList();
|
||||||
|
return Result.success(carMessages);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加车辆报文规则
|
||||||
|
*/
|
||||||
|
@PostMapping("/insertCarMessage")
|
||||||
|
@Operation(summary = "添加报文信息")
|
||||||
|
public Result insertCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||||
|
Result carMessage1 = carMessageService.insertCarMessage(carMessage);
|
||||||
|
return Result.success(carMessage1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车辆报文规则
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@PostMapping("/delectByCarMessageId")
|
||||||
|
@Operation(summary = "删除报文信息")
|
||||||
|
public Result delectByCarMessageId(Integer carMessageId){
|
||||||
|
Result carMessage1 = carMessageService.delectByCarMessageId(carMessageId);
|
||||||
|
return Result.success(carMessage1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆报文规则
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateCarMessage")
|
||||||
|
@Operation(summary = "修改报文信息")
|
||||||
|
public Result updateCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||||
|
Result carMessage1 = carMessageService.updateCarMessage(carMessage);
|
||||||
|
return Result.success(carMessage1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "企业车辆管理实体类",autoResultMap = true)
|
||||||
|
public class CarInformation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆ID
|
||||||
|
*/
|
||||||
|
private Long carInformationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆唯一VIN
|
||||||
|
* 固定(不可修改)
|
||||||
|
*/
|
||||||
|
private String carInformationVIN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
* 固定(不可修改)
|
||||||
|
*/
|
||||||
|
private String carInformationLicensePlate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carInformationBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
private String carInformationColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆驾驶员
|
||||||
|
*/
|
||||||
|
private String carInformationDriver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车检到期日期
|
||||||
|
* 固定(不可修改)
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||||
|
private Date carInformationExamineEnddata;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机厂商
|
||||||
|
*/
|
||||||
|
private String carInformationMotorManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机型号
|
||||||
|
*/
|
||||||
|
private String carInformationMotorModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池厂商
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池型号
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电子围栏外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点车辆 (0否默认 1是 )
|
||||||
|
*/
|
||||||
|
private Integer carInformationFocus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
*/
|
||||||
|
private Integer carInformationState;
|
||||||
|
|
||||||
|
|
||||||
|
//车辆类型表
|
||||||
|
/**
|
||||||
|
* 车辆类型ID
|
||||||
|
*/
|
||||||
|
private Integer carTypeId;
|
||||||
|
/**
|
||||||
|
* 车辆类型名
|
||||||
|
*/
|
||||||
|
private String carTypeName;
|
||||||
|
|
||||||
|
//电子围栏
|
||||||
|
/**
|
||||||
|
*电子围栏ID
|
||||||
|
*/
|
||||||
|
private Integer fenceid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏名
|
||||||
|
*/
|
||||||
|
private String fencename;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "车辆报文模板实体类",autoResultMap = true)
|
||||||
|
public class CarMessage {
|
||||||
|
//报文类型模块表
|
||||||
|
/**
|
||||||
|
* 自增主键
|
||||||
|
*/
|
||||||
|
private Long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
/**
|
||||||
|
* 报文名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
//报文拆分位置主表
|
||||||
|
/**
|
||||||
|
* 自增主键
|
||||||
|
*/
|
||||||
|
private Long carMessageId;
|
||||||
|
/**
|
||||||
|
* 车辆类型外键
|
||||||
|
*/
|
||||||
|
private Integer carMessageCartype;
|
||||||
|
/**
|
||||||
|
* 车辆报文类型外键
|
||||||
|
*/
|
||||||
|
private Integer carMessageType;
|
||||||
|
/**
|
||||||
|
* 开始位下标
|
||||||
|
*/
|
||||||
|
private Integer carMessageStartIndex;
|
||||||
|
/**
|
||||||
|
* 结束位下标
|
||||||
|
*/
|
||||||
|
private Integer carMessageEndIndex;
|
||||||
|
/**
|
||||||
|
* 报文数据类型 (固定值 区间随机值)
|
||||||
|
*/
|
||||||
|
private String messageTypeClass;
|
||||||
|
/**
|
||||||
|
* 报文是否开启故障检测(0默认未开启 1开启)
|
||||||
|
*/
|
||||||
|
private Integer carMessageState;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
private Long messageTypeId ;
|
||||||
|
private String messageTypeCode ;
|
||||||
|
private String messageTypeName ;
|
||||||
|
private String messageTypeBelongs ;
|
||||||
|
private String messageTypeClass ;
|
||||||
|
private Long carMessageId ;
|
||||||
|
private Integer carMessageCartype ;
|
||||||
|
private Integer carMessageType ;
|
||||||
|
private Integer carMessageStartIndex ;
|
||||||
|
private Integer carMessageEndIndex ;
|
||||||
|
private Integer carMessageState ;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.muyu.car.domain.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "车辆管理信息添加对象")
|
||||||
|
public class CarInformationAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆唯一VIN
|
||||||
|
*/
|
||||||
|
private String carInformationVIN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carInformationLicensePlate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carInformationBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
private String carInformationColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆驾驶员
|
||||||
|
*/
|
||||||
|
private String carInformationDriver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车检到期日期
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||||
|
private String carInformationExamineEnddata;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机厂商
|
||||||
|
*/
|
||||||
|
private String carInformationMotorManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机型号
|
||||||
|
*/
|
||||||
|
private String carInformationMotorModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池厂商
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池型号
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电子围栏外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.muyu.car.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@Tag(name="车辆管理列表请求对象")
|
||||||
|
public class CarInformationListReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆唯一VIN
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆唯一VIN",
|
||||||
|
type = "String"
|
||||||
|
)
|
||||||
|
private String carInformationVIN;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型ID
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆类型ID",
|
||||||
|
type = "Interger"
|
||||||
|
)
|
||||||
|
private Integer carTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电子围栏外键ID
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆电子围栏外键ID",
|
||||||
|
type = "Interger"
|
||||||
|
)
|
||||||
|
private Integer carInformationFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)",
|
||||||
|
type = "Interger"
|
||||||
|
)
|
||||||
|
private Integer carInformationState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机厂商
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆电机厂商",
|
||||||
|
type = "String"
|
||||||
|
)
|
||||||
|
private String carInformationMotorManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机型号
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆电机型号",
|
||||||
|
type = "String"
|
||||||
|
)
|
||||||
|
private String carInformationMotorModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池厂商
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆电池厂商",
|
||||||
|
type = "String"
|
||||||
|
)
|
||||||
|
private String carInformationBatteryManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池型号
|
||||||
|
*/
|
||||||
|
@Schema(
|
||||||
|
description = "车辆电池型号",
|
||||||
|
type = "String"
|
||||||
|
)
|
||||||
|
private String carInformationBatteryModel;
|
||||||
|
|
||||||
|
//分页页数
|
||||||
|
private Integer pageNum = 1;
|
||||||
|
//分页条数
|
||||||
|
private Integer pageSize = 5;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muyu.car.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@Tag(name = "车辆管理修改操作请求对象")
|
||||||
|
public class CarInformationUpdReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆管理主键", type = "Long")
|
||||||
|
private Long carInformationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆品牌", type = "String")
|
||||||
|
private String carInformationBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆颜色", type = "String")
|
||||||
|
private String carInformationColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆驾驶员
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆驾驶员", type = "String")
|
||||||
|
private String carInformationDriver;
|
||||||
|
/**
|
||||||
|
* 车辆电机厂商
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆电机厂商", type = "String")
|
||||||
|
private String carInformationMotorManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机型号
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆电机型号", type = "String")
|
||||||
|
private String carInformationMotorModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池厂商
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆电池厂商", type = "String")
|
||||||
|
private String carInformationBatteryManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池型号
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆电池型号", type = "String")
|
||||||
|
private String carInformationBatteryModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电子围栏外键ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆电子围栏外键ID", type = "Integer")
|
||||||
|
private Integer carInformationFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键ID
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||||
|
private Integer carInformationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点车辆 (0否默认 1是 )
|
||||||
|
*/
|
||||||
|
@Schema(title = "是否重点车辆 (0否默认 1是 )", type = "Integer")
|
||||||
|
private Integer carInformationFocus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
*/
|
||||||
|
@Schema(title = "启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)", type = "Integer")
|
||||||
|
private Integer carInformationState;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.muyu.car.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.car.domain.CarInformation;
|
||||||
|
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationListReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CarInformationMapper {
|
||||||
|
/**
|
||||||
|
* 企业车辆管理列表
|
||||||
|
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||||
|
* 搜索-->(车辆唯一VIN carInformationVIN 精确查
|
||||||
|
* 车辆类型ID carTypeId 精确查
|
||||||
|
* 车辆电子围栏外键ID carInformationFence 精确查
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
* carInformationState 精确查
|
||||||
|
* 车辆电机厂商 carInformationMotorManufacturer 模糊查
|
||||||
|
* 车辆电机型号 carInformationMotorModel 精确查
|
||||||
|
* 车辆电池厂商 carInformationBatteryManufacturer 模糊查
|
||||||
|
* 车辆电池型号 carInformationBatteryModel 精确查
|
||||||
|
* )
|
||||||
|
* 分页--> 分页页数 pageNum 分页条数 pageSize
|
||||||
|
* @param carInformationListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆添加管理
|
||||||
|
* @param carInformationAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆删除
|
||||||
|
* @param carInformationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer delBycarInformationId(Integer carInformationId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆修改管理
|
||||||
|
* @param carInformationUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To 电子围栏负责人
|
||||||
|
* 查询企业车辆 carInformationID 和 carInformationLicensePlate
|
||||||
|
* 无参
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarInformation> selectBycarInformationIDAndLicensePlate();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.muyu.car.mapper;
|
||||||
|
|
||||||
|
import com.muyu.car.domain.CarMessage;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CarMessageMapper {
|
||||||
|
/**
|
||||||
|
* 根据所属车类别 解析 车辆报文模板
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarMessage> selectCarMessageList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加车辆报文规则
|
||||||
|
*/
|
||||||
|
Integer insertCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车辆报文规则
|
||||||
|
*/
|
||||||
|
Integer deleteByCarMessageId(Integer carMessageId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆报文规则
|
||||||
|
*/
|
||||||
|
Integer updateCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.car.service;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.muyu.car.domain.CarInformation;
|
||||||
|
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationListReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CarInformationService {
|
||||||
|
/**
|
||||||
|
* 企业车辆管理列表
|
||||||
|
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||||
|
* 搜索-->(车辆唯一VIN carInformationVIN 精确查
|
||||||
|
* 车辆类型ID carTypeId 精确查
|
||||||
|
* 车辆电子围栏外键ID carInformationFence 精确查
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
* carInformationState 精确查
|
||||||
|
* 车辆电机厂商 carInformationMotorManufacturer 模糊查
|
||||||
|
* 车辆电机型号 carInformationMotorModel 精确查
|
||||||
|
* 车辆电池厂商 carInformationBatteryManufacturer 模糊查
|
||||||
|
* 车辆电池型号 carInformationBatteryModel 精确查
|
||||||
|
* )
|
||||||
|
* 分页--> 分页页数 pageNum 分页条数 pageSize
|
||||||
|
* @param carInformationListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆添加管理
|
||||||
|
* @param carInformationAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆删除
|
||||||
|
* @param carInformationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result delBycarInformationId(Integer carInformationId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业车辆修改管理
|
||||||
|
* @param carInformationUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To 电子围栏负责人
|
||||||
|
* 查询企业车辆 carInformationID 和 carInformationLicensePlate
|
||||||
|
* 无参
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarInformation> selectBycarInformationIDAndLicensePlate();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.car.service;
|
||||||
|
|
||||||
|
import com.muyu.car.domain.CarMessage;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CarMessageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据所属车类别 解析 车辆报文模板
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarMessage> selectCarMessageList();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加车辆报文规则
|
||||||
|
*/
|
||||||
|
Result insertCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车辆报文规则
|
||||||
|
*/
|
||||||
|
Result delectByCarMessageId(Integer carMessageId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆报文规则
|
||||||
|
*/
|
||||||
|
Result updateCarMessage(CarMessage carMessage);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.muyu.car.service.Impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.muyu.car.domain.CarInformation;
|
||||||
|
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationListReq;
|
||||||
|
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||||
|
import com.muyu.car.mapper.CarInformationMapper;
|
||||||
|
import com.muyu.car.service.CarInformationService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CarInformationServiceImpl implements CarInformationService {
|
||||||
|
@Resource
|
||||||
|
private CarInformationMapper carInformationMapper;
|
||||||
|
@Autowired
|
||||||
|
private HttpServletResponse response;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq) {
|
||||||
|
PageHelper.startPage(carInformationListReq.getPageNum(),carInformationListReq.getPageSize());
|
||||||
|
List<CarInformation> carInformations = carInformationMapper.selectCarInformationList(carInformationListReq);
|
||||||
|
PageInfo<CarInformation> pageInfo = new PageInfo<>(carInformations);
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result addCarInformation(CarInformationAddReq carInformationAddReq) {
|
||||||
|
Integer addCarInformation = carInformationMapper.addCarInformation(carInformationAddReq);
|
||||||
|
if(addCarInformation > 0){
|
||||||
|
return Result.success(addCarInformation,"添加车辆成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"添加车辆失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result delBycarInformationId(Integer carInformationId) {
|
||||||
|
Integer delBycarInformationId = carInformationMapper.delBycarInformationId(carInformationId);
|
||||||
|
if (delBycarInformationId > 0){
|
||||||
|
return Result.success(delBycarInformationId ,"删除车辆成功");
|
||||||
|
}
|
||||||
|
return Result.success(402,"删除车辆失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updatecarInformation(CarInformationUpdReq carInformationUpdReq) {
|
||||||
|
Integer updatecarInformation = carInformationMapper.updatecarInformation(carInformationUpdReq);
|
||||||
|
if (updatecarInformation > 0){
|
||||||
|
return Result.success(updatecarInformation,"修改车辆信息成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"修改车辆信息失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CarInformation> selectBycarInformationIDAndLicensePlate() {
|
||||||
|
return carInformationMapper.selectBycarInformationIDAndLicensePlate();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.muyu.car.service.Impl;
|
||||||
|
|
||||||
|
import com.muyu.car.domain.CarMessage;
|
||||||
|
import com.muyu.car.mapper.CarMessageMapper;
|
||||||
|
import com.muyu.car.service.CarMessageService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CarMessageServiceImpl implements CarMessageService {
|
||||||
|
@Resource
|
||||||
|
private CarMessageMapper carMessageMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CarMessage> selectCarMessageList() {
|
||||||
|
return carMessageMapper.selectCarMessageList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result insertCarMessage(CarMessage carMessage) {
|
||||||
|
Integer inserted = carMessageMapper.insertCarMessage(carMessage);
|
||||||
|
if (inserted > 0){
|
||||||
|
return Result.success(inserted,"添加成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result delectByCarMessageId(Integer carMessageId) {
|
||||||
|
Integer deleteByCarMessageId = carMessageMapper.deleteByCarMessageId(carMessageId);
|
||||||
|
if (deleteByCarMessageId >0){
|
||||||
|
return Result.success(carMessageId ,"删除成功");
|
||||||
|
}
|
||||||
|
return Result.error(402,"删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updateCarMessage(CarMessage carMessage) {
|
||||||
|
Integer integer = carMessageMapper.updateCarMessage(carMessage);
|
||||||
|
if(integer > 0)
|
||||||
|
{
|
||||||
|
return Result.success(carMessage,"修改成功");
|
||||||
|
}
|
||||||
|
return Result.error( 402,"修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,177 @@
|
||||||
|
<?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">
|
||||||
|
|
||||||
|
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
||||||
|
|
||||||
|
<mapper namespace="com.muyu.car.mapper.CarInformationMapper">
|
||||||
|
|
||||||
|
<resultMap id="carInformationResult" type="com.muyu.car.domain.CarInformation">
|
||||||
|
<result column="car_information_id" property="carInformationId"/>
|
||||||
|
<result column="car_information_VIN" property="carInformationVIN"/>
|
||||||
|
<result column="car_information_license_plate" property="carInformationLicensePlate"/>
|
||||||
|
<result column="car_information_brand" property="carInformationBrand"/>
|
||||||
|
<result column="car_information_color" property="carInformationColor"/>
|
||||||
|
<result column="car_information_driver" property="carInformationDriver"/>
|
||||||
|
<result column="car_information_examine_enddata" property="carInformationExamineEnddata"/>
|
||||||
|
<result column="car_information_motor_manufacturer" property="carInformationMotorManufacturer"/>
|
||||||
|
<result column="car_information_motor_model" property="carInformationMotorModel"/>
|
||||||
|
<result column="car_information_battery_manufacturer" property="carInformationBatteryManufacturer"/>
|
||||||
|
<result column="car_information_battery_model" property="carInformationBatteryModel"/>
|
||||||
|
<result column="car_information_fence" property="carInformationFence"/>
|
||||||
|
<result column="car_information_type" property="carInformationType"/>
|
||||||
|
<result column="car_information_focus" property="carInformationFocus"/>
|
||||||
|
<result column="car_information_state" property="carInformationState"/>
|
||||||
|
<result column="car_type_id" property="carTypeId"/>
|
||||||
|
<result column="car_type_name" property="carTypeName"/>
|
||||||
|
</resultMap>
|
||||||
|
<sql id="carinformationSql">
|
||||||
|
SELECT
|
||||||
|
car_information_id,
|
||||||
|
car_information_VIN,
|
||||||
|
car_information_license_plate,
|
||||||
|
car_information_brand,
|
||||||
|
car_information_color,
|
||||||
|
car_information_driver,
|
||||||
|
car_information_examine_enddata,
|
||||||
|
car_information_motor_manufacturer,
|
||||||
|
car_information_motor_model,
|
||||||
|
car_information_battery_manufacturer,
|
||||||
|
car_information_battery_model,
|
||||||
|
car_information_fence,
|
||||||
|
car_information_type,
|
||||||
|
car_information_focus,
|
||||||
|
car_information_state
|
||||||
|
FROM `car_information`
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCarInformationList" resultMap="carInformationResult" >
|
||||||
|
SELECT
|
||||||
|
car_information_id , car_information_VIN , car_information_license_plate,
|
||||||
|
car_information_brand , car_information_color , car_information_driver,
|
||||||
|
car_information_examine_enddata , car_information_motor_manufacturer , car_information_motor_model,
|
||||||
|
car_information_battery_manufacturer, car_information_battery_model , car_information_fence,
|
||||||
|
car_information_type , car_information_focus , car_information_state,
|
||||||
|
car_type_id , car_type_name ,
|
||||||
|
id , name
|
||||||
|
FROM `car_information`
|
||||||
|
LEFT JOIN `car_type`
|
||||||
|
ON `car_information`.car_information_type = `car_type`.car_type_id
|
||||||
|
LEFT JOIN `car_fence`
|
||||||
|
ON `car_information`.car_information_fence = `car_fence`.id
|
||||||
|
<where>
|
||||||
|
<if test= "carInformationVIN != null and carInformationVIN!='' " >
|
||||||
|
AND `car_information`.car_information_VIN = #{carInformationVIN}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carTypeId != null" >
|
||||||
|
AND `car_information`. car_information_type = #{carTypeId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationFence != null" >
|
||||||
|
AND `car_information`.car_information_fence = #{carInformationFence}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationState != null " >
|
||||||
|
AND `car_information`.car_information_state = #{carInformationState}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer !=''" >
|
||||||
|
AND instr(`car_information`.car_information_motor_manufacturer , #{carInformationMotorManufacturer})
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationMotorModel != null and carInformationMotorModel !='' " >
|
||||||
|
AND `car_information`.car_information_motor_model = #{carInformationMotorModel}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer != '' " >
|
||||||
|
AND instr(`car_information`.car_information_battery_manufacturer , #{carInformationBatteryManufacturer})
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test= "carInformationBatteryModel != null and carInformationBatteryModel != '' " >
|
||||||
|
AND `car_information`.car_information_battery_model = #{carInformationBatteryModel}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBycarInformationIDAndLicensePlate" resultType="com.muyu.car.domain.CarInformation">
|
||||||
|
SELECT
|
||||||
|
car_information_id ,
|
||||||
|
car_information_license_plate
|
||||||
|
FROM `car_information`
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="addCarInformation">
|
||||||
|
INSERT INTO `car_information`
|
||||||
|
(
|
||||||
|
<if test= "carInformationVIN != null and carInformationVIN!='' " >car_information_VIN,</if>
|
||||||
|
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> car_information_license_plate,</if>
|
||||||
|
<if test= "carInformationBrand != null and carInformationBrand!='' " >car_information_brand, </if>
|
||||||
|
<if test= "carInformationColor != null and carInformationColor!='' " > car_information_color, </if>
|
||||||
|
<if test= "carInformationDriver != null and carInformationDriver!='' " > car_information_driver, </if>
|
||||||
|
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > car_information_examine_enddata, </if>
|
||||||
|
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >car_information_motor_manufacturer, </if>
|
||||||
|
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " >car_information_motor_model, </if>
|
||||||
|
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " >car_information_battery_manufacturer, </if>
|
||||||
|
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " >car_information_battery_model, </if>
|
||||||
|
<if test= "carInformationFence != null " >car_information_fence, </if>
|
||||||
|
<if test= "carInformationType != null " >car_information_type </if> )
|
||||||
|
VALUES (
|
||||||
|
<if test= "carInformationVIN != null and carInformationVIN!='' " >#{carInformationVIN},</if>
|
||||||
|
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> #{carInformationLicensePlate},</if>
|
||||||
|
<if test= "carInformationBrand != null and carInformationBrand!='' " > #{carInformationBrand} , </if>
|
||||||
|
<if test= "carInformationColor != null and carInformationColor!='' " > #{carInformationColor}, </if>
|
||||||
|
<if test= "carInformationDriver != null and carInformationDriver!='' " > #{carInformationDriver}, </if>
|
||||||
|
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > #{carInformationExamineEnddata}, </if>
|
||||||
|
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >#{carInformationMotorManufacturer}, </if>
|
||||||
|
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " > #{carInformationMotorModel}, </if>
|
||||||
|
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " > #{carInformationBatteryManufacturer}, </if>
|
||||||
|
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " > #{carInformationBatteryModel}, </if>
|
||||||
|
<if test= "carInformationFence != null " >#{carInformationFence}, </if>
|
||||||
|
<if test= "carInformationType != null " > #{carInformationType} </if> );
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatecarInformation">
|
||||||
|
UPDATE `car_information`
|
||||||
|
SET
|
||||||
|
`car_information_VIN` = #{carInformationVIN},
|
||||||
|
|
||||||
|
`car_information_license_plate` = #{carInformationLicensePlate},
|
||||||
|
|
||||||
|
`car_information_brand` = #{carInformationBrand},
|
||||||
|
|
||||||
|
`car_information_color` = #{carInformationColor},
|
||||||
|
|
||||||
|
`car_information_driver` = #{carInformationDriver},
|
||||||
|
|
||||||
|
`car_information_examine_enddata` = #{carInformationExamineEnddata},
|
||||||
|
|
||||||
|
`car_information_motor_manufacturer` = #{carInformationMotorManufacturer},
|
||||||
|
|
||||||
|
`car_information_motor_model` = #{carInformationMotorModel} ,
|
||||||
|
|
||||||
|
`car_information_battery_manufacturer` = #{carInformationBatteryManufacturer},
|
||||||
|
|
||||||
|
`car_information_battery_model` = #{carInformationBatteryModel},
|
||||||
|
|
||||||
|
`car_information_fence` = #{carInformationFence},
|
||||||
|
|
||||||
|
`car_information_type` = #{carInformationType}
|
||||||
|
|
||||||
|
WHERE `car_information_id` = #{carInformationId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="delBycarInformationId">
|
||||||
|
DELETE FROM `car_information`
|
||||||
|
WHERE `car_information`.car_information_id= #{carInformationId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,94 @@
|
||||||
|
<?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">
|
||||||
|
|
||||||
|
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
||||||
|
|
||||||
|
<mapper namespace="com.muyu.car.mapper.CarMessageMapper">
|
||||||
|
<resultMap id="carMessageResult" type="com.muyu.car.domain.CarMessage">
|
||||||
|
<result property="messageTypeId" column="message_type_id"/>
|
||||||
|
<result property="messageTypeCode" column="message_type_code"/>
|
||||||
|
<result property="messageTypeName" column="message_type_name"/>
|
||||||
|
<result property="messageTypeBelongs" column="message_type_belongs"/>
|
||||||
|
<result property="messageTypeClass" column="message_type_class"/>
|
||||||
|
<result property="carMessageId" column="car_message_id"/>
|
||||||
|
<result property="carMessageCartype" column="car_message_cartype"/>
|
||||||
|
<result property="carMessageType" column="car_message_type"/>
|
||||||
|
<result property="carMessageStartIndex" column="car_message_start_index"/>
|
||||||
|
<result property="carMessageEndIndex" column="car_message_end_index"/>
|
||||||
|
<result property="carMessageState" column= "car_message_state"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertCarMessage">
|
||||||
|
INSERT INTO `car_message` (
|
||||||
|
car_message_cartype,
|
||||||
|
car_message_type,
|
||||||
|
car_message_start_index,
|
||||||
|
car_message_end_index,
|
||||||
|
message_type_class,
|
||||||
|
car_message_state
|
||||||
|
)
|
||||||
|
VALUES(
|
||||||
|
#{carMessageCartype},
|
||||||
|
#{carMessageType},
|
||||||
|
#{carMessageStartIndex},
|
||||||
|
#{carMessageEndIndex},
|
||||||
|
#{messageTypeClass},
|
||||||
|
#{carMessageState}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCarMessage">
|
||||||
|
UPDATE `car_message`
|
||||||
|
SET
|
||||||
|
<if test="carMessageCartype != null" >
|
||||||
|
car_message_cartype = #{carMessageCartype} ,
|
||||||
|
</if>
|
||||||
|
<if test="carMessageType != null">
|
||||||
|
car_message_type = #{carMessageType} ,
|
||||||
|
</if>
|
||||||
|
<if test="carMessageStartIndex != null">
|
||||||
|
car_message_start_index = #{carMessageStartIndex} ,
|
||||||
|
</if>
|
||||||
|
<if test="carMessageEndIndex != null">
|
||||||
|
car_message_end_index = #{carMessageEndIndex} ,
|
||||||
|
</if>
|
||||||
|
<if test="messageTypeClass != null and messageTypeClass !=''">
|
||||||
|
message_type_class = #{messageTypeClass} ,
|
||||||
|
</if>
|
||||||
|
<if test="carMessageState != null ">
|
||||||
|
car_message_state = #{carMessageState}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteByCarMessageId">
|
||||||
|
DELETE FROM `car_message`
|
||||||
|
WHERE `car_message`.car_message_id = #{carMessageId}
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectCarMessageList" resultMap="carMessageResult">
|
||||||
|
SELECT
|
||||||
|
car_message_id,
|
||||||
|
car_message_cartype,
|
||||||
|
car_message_type,
|
||||||
|
car_message_start_index,
|
||||||
|
car_message_end_index,
|
||||||
|
message_type_class,
|
||||||
|
car_message_state,
|
||||||
|
message_type_id,
|
||||||
|
message_type_code,
|
||||||
|
message_type_name,
|
||||||
|
message_type_belongs,
|
||||||
|
car_type_id,
|
||||||
|
car_type_name
|
||||||
|
FROM `car_message`
|
||||||
|
LEFT JOIN `car_message_type`
|
||||||
|
ON `car_message`.car_message_type = `car_message_type`.message_type_id
|
||||||
|
LEFT JOIN `car_type`
|
||||||
|
ON `car_message` .car_message_cartype = `car_type`.car_type_id
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -10,6 +10,7 @@ import com.muyu.warn.domain.WarnLogs;
|
||||||
import com.muyu.warn.domain.WarnStrategy;
|
import com.muyu.warn.domain.WarnStrategy;
|
||||||
import com.muyu.warn.service.WarnLogsService;
|
import com.muyu.warn.service.WarnLogsService;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.Data;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -70,35 +71,40 @@ public class WarnLogsController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增预警日志
|
* 新增预警日志
|
||||||
|
* @param warnLogs 新增预警日志信息
|
||||||
|
* @return 新增结果
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("platform:logs:add")
|
@RequiresPermissions("platform:logs:add")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Integer> add(
|
public Result<Integer> add(
|
||||||
@Validated @RequestBody WarnLogs warnLogs)
|
@Validated @RequestBody WarnLogs warnLogs
|
||||||
{
|
){
|
||||||
if (warnLogsService.checkIdUnique(warnLogs)) {
|
if (warnLogsService.checkIdUnique(warnLogs)){
|
||||||
return error("新增 预警日志 '" + warnLogs + "'失败,预警日志已存在");
|
return error("新增 预警日志 '"+ warnLogs +"' 失败,预警日志已存在 ");
|
||||||
}
|
}
|
||||||
return toAjax(warnLogsService.save(warnLogs));
|
return toAjax(warnLogsService.save(warnLogs));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改预警日志
|
* 修改预警日志
|
||||||
|
* @param warnLogs 修改预警日志信息
|
||||||
|
* @return 修改结果
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("platform:logs:edit")
|
@RequiresPermissions("platform:logs:edit")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result<Integer> edit(
|
public Result<Integer> edit(
|
||||||
@Validated @RequestBody WarnLogs warnLogs)
|
@Validated @RequestBody WarnLogs warnLogs
|
||||||
{
|
){
|
||||||
if (!warnLogsService.checkIdUnique(warnLogs)) {
|
if (!warnLogsService.checkIdUnique(warnLogs)){
|
||||||
return error("修改 预警日志 '" + warnLogs + "'失败,预警日志不存在");
|
return error("修改 预警日志'"+ warnLogs +"'失败,预警日志不存在");
|
||||||
}
|
}
|
||||||
// warnLogs.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
return toAjax(warnLogsService.updateById(warnLogs));
|
return toAjax(warnLogsService.updateById(warnLogs));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除预警日志
|
* 删除预警日志
|
||||||
|
* @param ids 删除预警日志id
|
||||||
|
* @return 删除结果
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("platform:logs:remove")
|
@RequiresPermissions("platform:logs:remove")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.warn.domain.car.CartType;
|
import com.muyu.warn.domain.car.CartType;
|
||||||
import com.muyu.warn.domain.WarnStrategy;
|
import com.muyu.warn.domain.WarnStrategy;
|
||||||
|
import com.muyu.warn.domain.req.WarnStrategyReq;
|
||||||
import com.muyu.warn.service.WarnStrategyService;
|
import com.muyu.warn.service.WarnStrategyService;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -110,4 +111,10 @@ public class WarnStrategyController extends BaseController
|
||||||
return Result.success(warnStrategyService.findByCarType());
|
return Result.success(warnStrategyService.findByCarType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("platform:strategy:strategytype")
|
||||||
|
@PostMapping("/strategyType/{ids}")
|
||||||
|
public Result<List<WarnStrategyReq>> selectStrategyType(@PathVariable("ids") Long ids){
|
||||||
|
return Result.success(warnStrategyService.selectStrategyType(ids));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,18 +29,18 @@ public class WarnLogs {
|
||||||
* 预警日志id
|
* 预警日志id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "预警日志id", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "预警日志id", cellType = Excel.ColumnType.NUMERIC)
|
||||||
@TableId( type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Long id ;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 车辆vin码
|
* 车辆vin码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "车辆vin码")
|
@Excel(name = "车辆vin码")
|
||||||
private String vin ;
|
private String vin;
|
||||||
/**
|
/**
|
||||||
* 规则id
|
* 规则id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "规则id")
|
@Excel(name = "规则id")
|
||||||
private Long warnRuleId ;
|
private Long warnRuleId;
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,39 +21,15 @@ import lombok.NoArgsConstructor;
|
||||||
@TableName("warn_rule")
|
@TableName("warn_rule")
|
||||||
public class WarnRule {
|
public class WarnRule {
|
||||||
|
|
||||||
/**
|
@TableId(type = IdType.AUTO)
|
||||||
* 规则id
|
private Long id;
|
||||||
*/
|
private String ruleName;
|
||||||
@TableId( type = IdType.AUTO)
|
private Long strategyId;
|
||||||
private Long id ;
|
private Long msgTypeId;
|
||||||
/**
|
private Long slideTime;
|
||||||
* 规则名称
|
private Long slideFrequency;
|
||||||
*/
|
private Long maxValue;
|
||||||
private String ruleName ;
|
private Long minValue;
|
||||||
/**
|
|
||||||
* 策略id
|
|
||||||
*/
|
|
||||||
private Long strategyId ;
|
|
||||||
/**
|
|
||||||
* 报文数据类型id
|
|
||||||
*/
|
|
||||||
private Long msgTypeId ;
|
|
||||||
/**
|
|
||||||
* 滑窗时间
|
|
||||||
*/
|
|
||||||
private Long slideTime ;
|
|
||||||
/**
|
|
||||||
* 滑窗频率
|
|
||||||
*/
|
|
||||||
private Long slideFrequency ;
|
|
||||||
/**
|
|
||||||
* 最大值
|
|
||||||
*/
|
|
||||||
private Long maxValue ;
|
|
||||||
/**
|
|
||||||
* 最小值
|
|
||||||
*/
|
|
||||||
private Long minValue ;
|
|
||||||
// /**
|
// /**
|
||||||
// * 创建人
|
// * 创建人
|
||||||
// */
|
// */
|
||||||
|
|
|
@ -22,22 +22,14 @@ import lombok.NoArgsConstructor;
|
||||||
public class WarnStrategy {
|
public class WarnStrategy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略id
|
* 策略Id
|
||||||
*/
|
*/
|
||||||
@TableId( type = IdType.AUTO)
|
@TableId( type = IdType.AUTO)
|
||||||
private Long id ;
|
private Long id;
|
||||||
/**
|
|
||||||
* 车辆类型id
|
|
||||||
*/
|
|
||||||
private Long carTypeId ;
|
private Long carTypeId ;
|
||||||
/**
|
|
||||||
* 策略名称
|
|
||||||
*/
|
|
||||||
private String strategyName ;
|
private String strategyName ;
|
||||||
/**
|
|
||||||
* 报文模版id
|
|
||||||
*/
|
|
||||||
private Long msgId ;
|
private Long msgId ;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 创建人
|
// * 创建人
|
||||||
// */
|
// */
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.muyu.warn.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:蓬叁
|
||||||
|
* @Package:com.muyu.warn.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:WarnStrategyReq
|
||||||
|
* @Date:2024/9/25 下午10:28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class WarnStrategyReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
*/
|
||||||
|
private String carTypeId;
|
||||||
|
/**
|
||||||
|
* 策略名称
|
||||||
|
*/
|
||||||
|
private String strategyName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -3,7 +3,9 @@ package com.muyu.warn.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.warn.domain.car.CartType;
|
import com.muyu.warn.domain.car.CartType;
|
||||||
import com.muyu.warn.domain.WarnStrategy;
|
import com.muyu.warn.domain.WarnStrategy;
|
||||||
|
import com.muyu.warn.domain.req.WarnStrategyReq;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -18,4 +20,6 @@ import java.util.List;
|
||||||
public interface WarnStrategyMapper extends BaseMapper<WarnStrategy> {
|
public interface WarnStrategyMapper extends BaseMapper<WarnStrategy> {
|
||||||
|
|
||||||
List<CartType> findByCarType();
|
List<CartType> findByCarType();
|
||||||
|
|
||||||
|
List<WarnStrategyReq> selectStrategyType(@Param("ids") Long ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.warn.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.warn.domain.car.CartType;
|
import com.muyu.warn.domain.car.CartType;
|
||||||
import com.muyu.warn.domain.WarnStrategy;
|
import com.muyu.warn.domain.WarnStrategy;
|
||||||
|
import com.muyu.warn.domain.req.WarnStrategyReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -38,4 +39,6 @@ public interface WarnStrategyService extends IService<WarnStrategy> {
|
||||||
Boolean checkIdUnique(WarnStrategy warnStrategy);
|
Boolean checkIdUnique(WarnStrategy warnStrategy);
|
||||||
|
|
||||||
List<CartType> findByCarType();
|
List<CartType> findByCarType();
|
||||||
|
|
||||||
|
List<WarnStrategyReq> selectStrategyType(Long ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.warn.domain.car.CartType;
|
import com.muyu.warn.domain.car.CartType;
|
||||||
import com.muyu.warn.domain.WarnStrategy;
|
import com.muyu.warn.domain.WarnStrategy;
|
||||||
|
import com.muyu.warn.domain.req.WarnStrategyReq;
|
||||||
import com.muyu.warn.mapper.WarnStrategyMapper;
|
import com.muyu.warn.mapper.WarnStrategyMapper;
|
||||||
import com.muyu.warn.service.WarnStrategyService;
|
import com.muyu.warn.service.WarnStrategyService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -82,4 +83,9 @@ public class WarnStrategyServiceImpl
|
||||||
return warnStrategyMapper.findByCarType();
|
return warnStrategyMapper.findByCarType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WarnStrategyReq> selectStrategyType(Long ids) {
|
||||||
|
return warnStrategyMapper.selectStrategyType(ids);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,14 @@
|
||||||
from
|
from
|
||||||
car_type
|
car_type
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectStrategyType" resultType="com.muyu.warn.domain.req.WarnStrategyReq">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
car_type_id,
|
||||||
|
strategy_name
|
||||||
|
from
|
||||||
|
warn_strategy
|
||||||
|
where
|
||||||
|
car_type_id = #{ids}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<module>cloud-modules-gen</module>
|
<module>cloud-modules-gen</module>
|
||||||
<module>cloud-modules-file</module>
|
<module>cloud-modules-file</module>
|
||||||
<module>cloud-modules-warn</module>
|
<module>cloud-modules-warn</module>
|
||||||
|
<module>cloud-modules-car</module>
|
||||||
<module>cloud-test</module>
|
<module>cloud-test</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue