车辆管理

master
微醺 2024-09-21 10:15:20 +08:00
parent f2c3f5aa78
commit 3ea5243279
39 changed files with 1349 additions and 16 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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
*/ */

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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());
}
}

View File

@ -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("车辆删除成功");
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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.;
// }
}

View File

@ -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);
}
}

View File

@ -0,0 +1,2 @@
Spring Boot Version: ${spring-boot.version}
Spring Application Name: ${spring.application.name}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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>

View File

@ -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;