车辆管理
parent
f2c3f5aa78
commit
3ea5243279
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.auth;
|
package com.muyu;
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.gateway;
|
package com.muyu;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -6,7 +6,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 验证码
|
* @description: 验证码
|
||||||
* @Date 2023-11-12 下午 03:36
|
* @Date 2023-11-12 下午 03:36
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>cloud-modules-car</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-modules-car车辆模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</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>
|
||||||
|
</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,21 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统模块
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
//@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class CloudCarApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(CloudCarApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.car.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
import com.muyu.car.service.SysCarCompanyService;
|
||||||
|
import com.muyu.car.service.SysCarService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 信息操作处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/company")
|
||||||
|
@Tag(name = "SysCarCompanyController", description = "系统参数配置")
|
||||||
|
public class SysCarCompanyController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCarCompanyService sysCarCompanyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业表
|
||||||
|
*/
|
||||||
|
@PostMapping("selectCompany")
|
||||||
|
public Result selectCompany(){
|
||||||
|
return Result.success(sysCarCompanyService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,111 @@
|
||||||
|
package com.muyu.car.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
import com.muyu.car.service.SysCarCompanyService;
|
||||||
|
import com.muyu.car.service.SysCarService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.catalina.security.SecurityUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 信息操作处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/manage")
|
||||||
|
@Tag(name = "SysCarController", description = "系统参数配置")
|
||||||
|
public class SysCarController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysCarCompanyService sysCarCompanyService;
|
||||||
|
@Autowired
|
||||||
|
private SysCarService sysCarService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表2
|
||||||
|
* @param carDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("CarListShow")
|
||||||
|
public Result<List<CarVO>> CarListShow(@RequestBody CarDTO carDTO){
|
||||||
|
return Result.success(sysCarService.CarListShow(carDTO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param carId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("CarListShowByCarId")
|
||||||
|
public Result<List<CarVO>> CarListShowByCarId(@RequestParam("carId") Long carId){
|
||||||
|
return Result.success(sysCarService.CarListShowByCarId(carId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表1
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("CarList")
|
||||||
|
@Operation(summary = "查询列表",description = "车辆管理列表")
|
||||||
|
public Result<TableDataInfo<CarVO>> CarList(@RequestBody CarVO carVO){
|
||||||
|
startPage();
|
||||||
|
return getDataTable(sysCarService.carList(carVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆添加
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("insertCar")
|
||||||
|
public Result insertCar(@RequestBody CarVO carVO){
|
||||||
|
String key = RandomUtil.randomNumbers(9);
|
||||||
|
// 随机生成车架号
|
||||||
|
carVO.setCarFrame(key);
|
||||||
|
// 随机生成VIN码
|
||||||
|
String key2 = RandomUtil.randomNumbers(17);
|
||||||
|
carVO.setCarVin(key2);
|
||||||
|
//
|
||||||
|
carVO.setUserId(SecurityUtils.getUserId());
|
||||||
|
sysCarService.insertCar(carVO);
|
||||||
|
return Result.success("车辆添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆修改
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("updataCar")
|
||||||
|
public Result updataCar(@RequestBody CarVO carVO){
|
||||||
|
sysCarService.updateById(carVO);
|
||||||
|
return Result.success("车辆修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆删除
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("deleteCar")
|
||||||
|
public Result deleteCar(@RequestParam("ids") List<Long> ids){
|
||||||
|
sysCarService.deleteCar(ids);
|
||||||
|
return Result.success("车辆删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_company")
|
||||||
|
public class CarCompany {
|
||||||
|
/**
|
||||||
|
* 企业表
|
||||||
|
*/
|
||||||
|
@TableId(value = "company_id",type = IdType.AUTO)
|
||||||
|
private Long companyId;
|
||||||
|
/**
|
||||||
|
* 企业名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_car_message")
|
||||||
|
public class CarMessage {
|
||||||
|
/**
|
||||||
|
* 报文表
|
||||||
|
*/
|
||||||
|
@TableId(value = "message_id",type = IdType.AUTO)
|
||||||
|
private Long messageId;
|
||||||
|
/**
|
||||||
|
* 车辆编码
|
||||||
|
*/
|
||||||
|
private String messageCode;
|
||||||
|
/**
|
||||||
|
* 车辆报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
/**
|
||||||
|
* 开始位下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
/**
|
||||||
|
* 结束位下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
/**
|
||||||
|
* 数据类型
|
||||||
|
*/
|
||||||
|
private String messageDataType;
|
||||||
|
/**
|
||||||
|
* 固定值
|
||||||
|
*/
|
||||||
|
private double fixedValue;
|
||||||
|
/**
|
||||||
|
* 最小值
|
||||||
|
*/
|
||||||
|
private double minimumValue;
|
||||||
|
/**
|
||||||
|
* 最大值
|
||||||
|
*/
|
||||||
|
private double maximumValue;
|
||||||
|
/**
|
||||||
|
* 模版id
|
||||||
|
*/
|
||||||
|
private Long templateId;
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_message_type")
|
||||||
|
public class CarMessageType {
|
||||||
|
/**
|
||||||
|
* 报文
|
||||||
|
*/
|
||||||
|
@TableId(value = "message_type_id",type = IdType.AUTO)
|
||||||
|
private Integer messageTypeId;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageCode;
|
||||||
|
/**
|
||||||
|
* 报文名称
|
||||||
|
*/
|
||||||
|
private String messageName;
|
||||||
|
/**
|
||||||
|
* 报文分类
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
/**
|
||||||
|
* 报文字段类型
|
||||||
|
*/
|
||||||
|
private String messageClass;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_template")
|
||||||
|
public class CarTemplate {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版表
|
||||||
|
*/
|
||||||
|
@TableId(value = "template_id",type = IdType.AUTO)
|
||||||
|
private Integer templateId;
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String templateName;
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String templateDescribe;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.muyu.car.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_car")
|
||||||
|
public class SysCar {
|
||||||
|
/**
|
||||||
|
* 车辆表
|
||||||
|
*/
|
||||||
|
@TableId(value = "car_id",type = IdType.AUTO)
|
||||||
|
private Long carId;
|
||||||
|
/**
|
||||||
|
* 车架号
|
||||||
|
*/
|
||||||
|
private String carFrame;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carCoed;
|
||||||
|
/**
|
||||||
|
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
||||||
|
*/
|
||||||
|
private Integer carColor;
|
||||||
|
/**
|
||||||
|
* VIN码
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
/**
|
||||||
|
* 驾车人
|
||||||
|
*/
|
||||||
|
private Long carUserId;
|
||||||
|
/**
|
||||||
|
* 车主
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 车辆配置
|
||||||
|
*/
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
/** 车辆品牌 */
|
||||||
|
@Excel(name = "车辆品牌")
|
||||||
|
private String carBrand;
|
||||||
|
|
||||||
|
/** 车辆型号 */
|
||||||
|
@Excel(name = "车辆型号")
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 年审日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date audditTime;
|
||||||
|
/**
|
||||||
|
* 行驶证到期日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date licenseTime;
|
||||||
|
/**
|
||||||
|
* 保险到期日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date insuranceTime;
|
||||||
|
/**
|
||||||
|
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||||
|
*/
|
||||||
|
private Integer carStatus;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createdTime;
|
||||||
|
/**
|
||||||
|
* 当前档位
|
||||||
|
*/
|
||||||
|
private Integer carGears;
|
||||||
|
|
||||||
|
|
||||||
|
/** 最后一次连线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date carLastJoinTime;
|
||||||
|
|
||||||
|
/** 最后一次离线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date carLastOfflineTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muyu.car.domain.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class CarDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VIN码
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
private String typeName;
|
||||||
|
/**
|
||||||
|
* 能源类型 1.电动 2.纯油 3.混动
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer energyType;
|
||||||
|
/**
|
||||||
|
* 档的类型 1.手动 2.自动
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer gearType;
|
||||||
|
|
||||||
|
private Integer pageNum = 1;
|
||||||
|
private Integer pageSize = 3;
|
||||||
|
|
||||||
|
/** 最后一次连线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date carLastJoinTime;
|
||||||
|
|
||||||
|
/** 最后一次离线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date carLastOfflineTime;
|
||||||
|
/**
|
||||||
|
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||||
|
*/
|
||||||
|
private Integer carStatus;
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.muyu.car.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "t_car",autoResultMap = true)
|
||||||
|
public class CarVO {
|
||||||
|
/**
|
||||||
|
* 车辆表
|
||||||
|
*/
|
||||||
|
@TableId(value = "car_id",type = IdType.AUTO)
|
||||||
|
private Integer carId;
|
||||||
|
/**
|
||||||
|
* 车架号
|
||||||
|
*/
|
||||||
|
private String carFrame;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carCoed;
|
||||||
|
/**
|
||||||
|
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
||||||
|
*/
|
||||||
|
private Integer carColor;
|
||||||
|
/**
|
||||||
|
* VIN码
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
/**
|
||||||
|
* 驾车人
|
||||||
|
*/
|
||||||
|
private Long carUserId;
|
||||||
|
/**
|
||||||
|
* 车主
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 车辆配置
|
||||||
|
*/
|
||||||
|
private Integer typeId;
|
||||||
|
/**
|
||||||
|
* 年审日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date audditTime;
|
||||||
|
/**
|
||||||
|
* 行驶证到期日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date licenseTime;
|
||||||
|
/**
|
||||||
|
* 保险到期日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date insuranceTime;
|
||||||
|
/**
|
||||||
|
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||||
|
*/
|
||||||
|
private Integer carStatus;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createdTime;
|
||||||
|
/**
|
||||||
|
* 当前档位
|
||||||
|
*/
|
||||||
|
private Integer carGears;
|
||||||
|
|
||||||
|
/** 车辆品牌 */
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
private String carBrand;
|
||||||
|
|
||||||
|
/** 最后一次连线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date carLastJoinTime;
|
||||||
|
|
||||||
|
/** 最后一次离线时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date carLastOfflineTime;
|
||||||
|
|
||||||
|
|
||||||
|
/** 所属企业 */
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/** 车辆车型(如客车,卡车,公交车等) */
|
||||||
|
private String carType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源类型 1.电动 2.纯油 3.混动
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer energyType;
|
||||||
|
/**
|
||||||
|
* 档的类型 1.手动 2.自动
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer gearType;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.car.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.car.domain.CarCompany;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置mybatis配置
|
||||||
|
* @Date 2023-11-13 上午 10:05
|
||||||
|
*/
|
||||||
|
public interface SysCarCompanyMapper extends BaseMapper<CarCompany> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.car.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.car.domain.SysCar;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置mybatis配置
|
||||||
|
* @Date 2023-11-13 上午 10:05
|
||||||
|
*/
|
||||||
|
public interface SysCarMapper extends BaseMapper<CarVO> {
|
||||||
|
/**
|
||||||
|
* 车辆列表
|
||||||
|
* @param queryWrapper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> carList(LambdaQueryWrapper<CarVO> queryWrapper);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表2
|
||||||
|
* @param carDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> CarListShow(CarDTO carDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param carId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> CarListShowByCarId(@Param("carId") Long carId);
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.car.service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.car.domain.CarCompany;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置plus业务层
|
||||||
|
* @Date 2023-11-13 上午 10:06
|
||||||
|
*/
|
||||||
|
public interface SysCarCompanyService extends IService<CarCompany> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//List<CarCompany> selectCompany();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.muyu.car.service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.car.domain.CarCompany;
|
||||||
|
import com.muyu.car.domain.SysCar;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置plus业务层
|
||||||
|
* @Date 2023-11-13 上午 10:06
|
||||||
|
*/
|
||||||
|
public interface SysCarService extends IService<CarVO> {
|
||||||
|
/**
|
||||||
|
* 车辆列表
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> carList(CarVO carVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆添加
|
||||||
|
* @param carVO
|
||||||
|
*/
|
||||||
|
void insertCar(CarVO carVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteCar(List<Long> ids);
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 车辆修改
|
||||||
|
// * @param carVO
|
||||||
|
// */
|
||||||
|
// void updataCar(CarVO carVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表2
|
||||||
|
* @param carDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> CarListShow(CarDTO carDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param carId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarVO> CarListShowByCarId(Long carId);
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.car.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.car.domain.CarCompany;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
import com.muyu.car.mapper.SysCarCompanyMapper;
|
||||||
|
import com.muyu.car.mapper.SysCarMapper;
|
||||||
|
import com.muyu.car.service.SysCarCompanyService;
|
||||||
|
import com.muyu.car.service.SysCarService;
|
||||||
|
import com.muyu.common.redis.service.RedisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置plus业务实现层
|
||||||
|
* @Date 2023-11-13 上午 10:06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysCarCompanyServiceImpl extends ServiceImpl<SysCarCompanyMapper, CarCompany>
|
||||||
|
implements SysCarCompanyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
@Autowired
|
||||||
|
private SysCarCompanyMapper sysCarCompanyMapper;
|
||||||
|
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public List<CarCompany> selectCompany() {
|
||||||
|
// return sysCarCompanyMapper.;
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.muyu.car.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.car.domain.CarCompany;
|
||||||
|
import com.muyu.car.domain.SysCar;
|
||||||
|
import com.muyu.car.domain.dto.CarDTO;
|
||||||
|
import com.muyu.car.domain.vo.CarVO;
|
||||||
|
import com.muyu.car.mapper.SysCarMapper;
|
||||||
|
import com.muyu.car.service.SysCarService;
|
||||||
|
import com.muyu.common.redis.service.RedisService;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zmw
|
||||||
|
* @description: 配置plus业务实现层
|
||||||
|
* @Date 2023-11-13 上午 10:06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, CarVO>
|
||||||
|
implements SysCarService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
@Autowired
|
||||||
|
private SysCarMapper carMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表
|
||||||
|
* @param carVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CarVO> carList(CarVO carVO) {
|
||||||
|
|
||||||
|
// MPJLambdaWrapper<CarVO> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
// carMapper.selectJoinList(CarVO.class,
|
||||||
|
// queryWrapper.selectAll(CarVO.class)// 主表查询所有
|
||||||
|
// .select(Type::getTypeName)// 获取附表的字段
|
||||||
|
// .select(Type::getEnergyType)
|
||||||
|
// .select(Type::getGearType)
|
||||||
|
// .leftJoin(Type.class,Type::getTypeId,Car::getTypeId)// 左链接
|
||||||
|
// );
|
||||||
|
// // vin码--精确
|
||||||
|
// if(StringUtils.isNotEmpty(carVO.getCarVin())){
|
||||||
|
// queryWrapper.eq(CarVO::getCarVin,carVO.getCarVin());
|
||||||
|
// }
|
||||||
|
// // 车辆型号
|
||||||
|
// if(StringUtils.isNotEmpty(carVO.getTypeName())){
|
||||||
|
// queryWrapper.like(CarVO::getTypeName,carVO.getTypeName());
|
||||||
|
// }
|
||||||
|
// // 能源类型 1.电动 2.纯油 3.混动
|
||||||
|
// if(carVO.getEnergyType()>0){
|
||||||
|
// queryWrapper.eq(CarVO::getEnergyType,carVO.getEnergyType());
|
||||||
|
// }
|
||||||
|
// // 档的类型 1.手动 2.自动
|
||||||
|
// if(carVO.getGearType()>0){
|
||||||
|
// queryWrapper.eq(CarVO::getGearType,carVO.getGearType());
|
||||||
|
// }
|
||||||
|
// // 自定义列表查询
|
||||||
|
//// @Select("")
|
||||||
|
//// this.list(queryWrapper);
|
||||||
|
// // mybatis列表查询
|
||||||
|
// //return carMapper.carList(queryWrapper);
|
||||||
|
// // 单表的列表查询
|
||||||
|
// this.list(
|
||||||
|
// new LambdaQueryWrapper<CarVO>()
|
||||||
|
// .eq(StringUtils.isNotEmpty(carVO.getCarVin()),CarVO::getCarVin,carVO.getCarVin())
|
||||||
|
// .eq(carVO.getEnergyType()>0,CarVO::getEnergyType,carVO.getEnergyType())
|
||||||
|
// .eq(carVO.getGearType()>0,CarVO::getGearType,carVO.getGearType())
|
||||||
|
// .like(StringUtils.isNotEmpty(carVO.getTypeName()),CarVO::getTypeName,carVO.getTypeName())
|
||||||
|
// );
|
||||||
|
// return this.list(queryWrapper);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆添加
|
||||||
|
* @param carVO
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void insertCar(CarVO carVO) {
|
||||||
|
carMapper.insert(carVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 车辆修改
|
||||||
|
// * @param carVO
|
||||||
|
// */
|
||||||
|
// @Override
|
||||||
|
// public void updataCar(CarVO carVO) {
|
||||||
|
// carMapper.updateById(carVO);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆列表2
|
||||||
|
* @param carDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CarVO> CarListShow(CarDTO carDTO) {
|
||||||
|
return carMapper.CarListShow(carDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param carId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CarVO> CarListShowByCarId(Long carId) {
|
||||||
|
return carMapper.CarListShowByCarId(carId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteCar(List<Long> ids) {
|
||||||
|
carMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -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/cloud-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<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.muyu" 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>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,78 @@
|
||||||
|
<?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.muyu.car.mapper.SysCarMapper">
|
||||||
|
|
||||||
|
<!-- 车辆列表 -->
|
||||||
|
<select id="carList" resultType="com.muyu.car.domain.vo.CarVO">
|
||||||
|
SELECT
|
||||||
|
tc.*,
|
||||||
|
tt.energy_type,
|
||||||
|
tt.gear_type,
|
||||||
|
tt.type_name
|
||||||
|
FROM
|
||||||
|
`t_car` tc
|
||||||
|
LEFT JOIN `t_type` tt ON tc.type_id = tt.type_id
|
||||||
|
<where>
|
||||||
|
<if test="carVin != null and carVin != ''">
|
||||||
|
and tc.car_vin = #{carVin}
|
||||||
|
</if>
|
||||||
|
<if test="typeName != null and typeName != ''">
|
||||||
|
and tt.type_name like concat('%',#{typeName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="energyType != null and energyType > 0 ">
|
||||||
|
and tt.energy_type = #{energyType}
|
||||||
|
</if>
|
||||||
|
<if test="gearType != null and gearType > 0 ">
|
||||||
|
and tt.gear_type = #{gearType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="CarListShow" resultType="com.muyu.car.domain.vo.CarVO">
|
||||||
|
SELECT
|
||||||
|
tc.*,
|
||||||
|
tt.energy_type,
|
||||||
|
tt.gear_type,
|
||||||
|
tt.type_name
|
||||||
|
FROM
|
||||||
|
`t_car` tc
|
||||||
|
LEFT JOIN `t_type` tt ON tc.type_id = tt.type_id
|
||||||
|
<where>
|
||||||
|
<if test="carVin != null and carVin != ''">
|
||||||
|
and tc.car_vin = #{carVin}
|
||||||
|
</if>
|
||||||
|
<if test="carLastJoinTime != null and carLastJoinTime != ''">
|
||||||
|
and tc.car_last_join_time = #{carLastJoinTime}
|
||||||
|
</if>
|
||||||
|
<if test="carLastOfflineTime != null and carLastOfflineTime != ''">
|
||||||
|
and tc.car_last_offline_time = #{carVin}
|
||||||
|
</if>
|
||||||
|
<if test="typeName != null and typeName != ''">
|
||||||
|
and tt.type_name like concat('%',#{typeName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="energyType != null and energyType > 0 ">
|
||||||
|
and tt.energy_type = #{energyType}
|
||||||
|
</if>
|
||||||
|
<if test="gearType != null and gearType > 0 ">
|
||||||
|
and tt.gear_type = #{gearType}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 通过id查询 -->
|
||||||
|
<select id="CarListShowByCarId" resultType="com.muyu.car.domain.vo.CarVO">
|
||||||
|
SELECT
|
||||||
|
tc.*,
|
||||||
|
tt.energy_type,
|
||||||
|
tt.gear_type,
|
||||||
|
tt.type_name
|
||||||
|
FROM
|
||||||
|
`t_car` tc
|
||||||
|
LEFT JOIN `t_type` tt ON tc.type_id = tt.type_id
|
||||||
|
where tc.car_id = #{carId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.file;
|
package com.muyu;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.gen;
|
package com.muyu;
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.system;
|
package com.muyu;
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
@ -11,7 +11,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 授权角色返回结果集
|
* @description: 授权角色返回结果集
|
||||||
* @Date 2023-6-19 下午 02:50
|
* @Date 2023-6-19 下午 02:50
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 部门树返回结果集
|
* @description: 部门树返回结果集
|
||||||
* @Date 2023-6-19 下午 02:52
|
* @Date 2023-6-19 下午 02:52
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 个人信息模型对象
|
* @description: 个人信息模型对象
|
||||||
* @Date 2023-6-19 下午 02:05
|
* @Date 2023-6-19 下午 02:05
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 角色返回菜单树
|
* @description: 角色返回菜单树
|
||||||
* @Date 2023-6-19 下午 02:40
|
* @Date 2023-6-19 下午 02:40
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 用户详细信息
|
* @description: 用户详细信息
|
||||||
* @Date 2023-6-19 下午 02:45
|
* @Date 2023-6-19 下午 02:45
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 用户信息结果集
|
* @description: 用户信息结果集
|
||||||
* @Date 2023-6-19 下午 02:42
|
* @Date 2023-6-19 下午 02:42
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.system.domain.SysConfig;
|
import com.muyu.system.domain.SysConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 配置mybatis配置
|
* @description: 配置mybatis配置
|
||||||
* @Date 2023-11-13 上午 10:05
|
* @Date 2023-11-13 上午 10:05
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,7 +6,7 @@ import com.muyu.system.domain.SysConfig;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 配置plus业务层
|
* @description: 配置plus业务层
|
||||||
* @Date 2023-11-13 上午 10:06
|
* @Date 2023-11-13 上午 10:06
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author zmw
|
||||||
* @description: 配置plus业务实现层
|
* @description: 配置plus业务实现层
|
||||||
* @Date 2023-11-13 上午 10:06
|
* @Date 2023-11-13 上午 10:06
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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-fault</module>
|
<module>cloud-modules-fault</module>
|
||||||
|
<module>cloud-modules-car</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>cloud-modules</artifactId>
|
<artifactId>cloud-modules</artifactId>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.modules.monitor;
|
package com.muyu;
|
||||||
|
|
||||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
Loading…
Reference in New Issue