车辆信息管理数据更新
parent
127b55f11f
commit
075dbffcfc
|
@ -0,0 +1,39 @@
|
|||
package com.god.base.server.common.domainConstants;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Hbase常量
|
||||
*/
|
||||
public class HBaseConstant {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String HBASE_TABLE_NAME = "vehicle_info";
|
||||
/**
|
||||
* 表名前缀
|
||||
*/
|
||||
public static final String HBASE_TABLE_PREFIX = "vehicle_info_";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.god.base.server.common.domainConstants;
|
||||
|
||||
/**
|
||||
* RabbitMQ常量
|
||||
* @ClassName RabbitConstant
|
||||
*/
|
||||
public class RabbitConstant {
|
||||
/**
|
||||
* 故障处理队列
|
||||
*/
|
||||
public static final String FAULT_HANDLER_QUEUE = "fault_handler_queue";
|
||||
/**
|
||||
* 围栏处理队列
|
||||
*/
|
||||
public static final String FENCE_HANDLER_QUEUE = "fence_handler_queue";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.god.base.server.common.domainConstants;
|
||||
|
||||
|
||||
/**
|
||||
* TimeConstant
|
||||
* 一天的时间戳
|
||||
*/
|
||||
public class TimeConstant {
|
||||
/**
|
||||
* 一天的时间戳
|
||||
*/
|
||||
public static final Integer DAY_MILLISECOND = 86400000;
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package com.god.base.server.common.domainConstants;
|
||||
|
||||
/**
|
||||
* @ClassName VehicleConstant
|
||||
* @Author WenHao.Sao
|
||||
*/
|
||||
public class VehicleConstant {
|
||||
|
||||
/**
|
||||
* 分包符
|
||||
*/
|
||||
public static final String DATA_PACK_SEPARATOR = "#$&*";
|
||||
/**
|
||||
* 报文起始位
|
||||
*/
|
||||
public static final String MSG_START = "7E";
|
||||
/**
|
||||
* 报文结束符
|
||||
*/
|
||||
public static final String MSG_END= "7E";
|
||||
/**
|
||||
* 连接信息vin
|
||||
*/
|
||||
public static final String START_VIN_SUF = "START_VIN";
|
||||
/**
|
||||
* 连接信息VIN
|
||||
*/
|
||||
public static final String START_VIN_SUCCESS_SUF = "SUCCESS_CIN:";
|
||||
/**
|
||||
* 车辆信息报文前缀
|
||||
*/
|
||||
public static final String VEHICLE_MSG_SUF = "VEHICLE_MSG:";
|
||||
/**
|
||||
* 车辆关闭报文前缀
|
||||
*/
|
||||
public static final String VEHICLE_STOP_SUF = "VEHICLE_STOP:";
|
||||
/**
|
||||
* 连接启动信息
|
||||
*/
|
||||
public static final String NETTY_CONNECT = "CONNECT";
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String NETTY_WILL_CLOSE = "CLOSE";
|
||||
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
//
|
||||
// public static final String
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.god.base.server.common.domain.Car;
|
||||
import com.god.base.server.common.domain.VehicleMessage;
|
||||
import com.god.base.server.common.domain.request.CarRequest;
|
||||
import com.god.base.server.mapper.CarMapper;
|
||||
import com.god.base.server.service.CarService;
|
||||
import com.god.base.server.util.AopConfig;
|
||||
import com.god.common.core.domain.Result;
|
||||
import com.god.common.core.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.web.controller.BaseController;
|
||||
import com.god.common.core.web.page.TableDataInfo;
|
||||
import com.god.common.log.annotation.Log;
|
||||
import com.god.common.log.enums.BusinessType;
|
||||
import com.god.common.security.annotation.RequiresPermissions;
|
||||
|
@ -39,18 +39,20 @@ public class CarController extends BaseController {
|
|||
@Autowired
|
||||
private AopConfig aopConfig;
|
||||
|
||||
@Autowired
|
||||
private CarMapper carMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆信息管理列表
|
||||
* 根据vin查询车辆信息管理列表
|
||||
*/
|
||||
@RequiresPermissions
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Car>> list(@RequestBody CarRequest carRequest){
|
||||
@GetMapping("/list/{vinId}")
|
||||
public Result<Car> list(@PathVariable String vinId){
|
||||
|
||||
startPage();//设置请求分页数据
|
||||
List<Car> list = carService.selectCarInfoList(carRequest);
|
||||
Car list = carService.selectCarInfoList(vinId);
|
||||
|
||||
return getDataTable(list);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,7 +95,7 @@ public class CarController extends BaseController {
|
|||
*/
|
||||
@Log(title = "车辆信息管理" , businessType = BusinessType.UPDATE) //修改
|
||||
@PostMapping("/updCar")
|
||||
public Result<Car> updCar(@PathVariable @Validated Car car){
|
||||
public Result updCar(@PathVariable @Validated Car car){
|
||||
log.info("功能介绍修改车辆,请求方式:{},请求路径:{},请求参数:{}",
|
||||
request.getMethod(),
|
||||
request.getRequestURL(),
|
||||
|
@ -138,7 +140,7 @@ public class CarController extends BaseController {
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response , Car car , CarRequest carRequest)
|
||||
{
|
||||
List<Car> list = carService.selectCarInfoList(carRequest);
|
||||
List<Car> list = carMapper.getList((int) car.getUserId());
|
||||
ExcelUtil<Car> util = new ExcelUtil<>(Car.class);
|
||||
//对list数据源将其里面的数据导入到excel表单
|
||||
util.exportExcel(response,list,"车辆信息管理");
|
||||
|
|
|
@ -32,17 +32,25 @@ public interface CarMapper extends BaseMapper<Car> {
|
|||
"\tJOIN t_car_type ON t_car.car_type_id = t_car_type.id where t_car.user_id = #{userId1}")
|
||||
List<Car> getList(@Param("userId1") int userId);
|
||||
|
||||
@Select("select * from t_car where 1=1 " +
|
||||
"<if test=\"carVinId != null and carVinId != ''\"> and car_vin_id = #{carVinId}</if>" +
|
||||
"<if test=\"carTypeId != null \"> and car_type_id = #{carTypeId}</if>" +
|
||||
"<if test=\"fenceId != null and fenceId != ''\"> and fence_id = #{fenceId}</if>" +
|
||||
"<if test=\"status != null \"> and status = #{status}</if>" +
|
||||
"<if test=\"motorManufacturer != null and motorManufacturer != ''\"> and motor_manufacturer = #{motorManufacturer}</if>" +
|
||||
"<if test=\"batteryManufacturer != null and batteryManufacturer != ''\"> and battery_manufacturer = #{batteryManufacturer}</if>" +
|
||||
"<if test=\"motorNumber != null and motorNumber != ''\"> and motor_number = #{motorNumber}</if>" +
|
||||
"<if test=\"batteryNumber != null and batteryNumber != ''\"> and battery_number = #{batteryNumber}</if>"
|
||||
)
|
||||
List<Car> selectCarInfoList(Car car);
|
||||
// @Select("select * from t_car where 1=1 " +
|
||||
// "<if test=\"carVinId != null and carVinId != ''\"> and car_vin_id = #{carVinId}</if>" +
|
||||
// "<if test=\"carTypeId != null \"> and car_type_id = #{carTypeId}</if>" +
|
||||
// "<if test=\"fenceId != null and fenceId != ''\"> and fence_id = #{fenceId}</if>" +
|
||||
// "<if test=\"status != null \"> and status = #{status}</if>" +
|
||||
// "<if test=\"motorManufacturer != null and motorManufacturer != ''\"> and motor_manufacturer = #{motorManufacturer}</if>" +
|
||||
// "<if test=\"batteryManufacturer != null and batteryManufacturer != ''\"> and battery_manufacturer = #{batteryManufacturer}</if>" +
|
||||
// "<if test=\"motorNumber != null and motorNumber != ''\"> and motor_number = #{motorNumber}</if>" +
|
||||
// "<if test=\"batteryNumber != null and batteryNumber != ''\"> and battery_number = #{batteryNumber}</if>"
|
||||
// )
|
||||
// List<Car> selectCarInfoList(Car car);
|
||||
|
||||
/**
|
||||
* 根据vin进行查询管理信息
|
||||
* @param vinId
|
||||
* @return
|
||||
*/
|
||||
|
||||
Car HuiCarSelect(@Param("vinId") String vinId);
|
||||
|
||||
/**
|
||||
* 车辆管理信息查询
|
||||
|
@ -56,4 +64,6 @@ public interface CarMapper extends BaseMapper<Car> {
|
|||
Integer getOnlineCarCount();
|
||||
|
||||
Integer getUnOnlineCount();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.god.base.server.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.god.base.server.common.domain.Car;
|
||||
import com.god.base.server.common.domain.VehicleMessage;
|
||||
import com.god.base.server.common.domain.request.CarRequest;
|
||||
import com.god.common.core.domain.Result;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -18,7 +17,7 @@ public interface CarService extends IService<Car> {
|
|||
Result<List<Car>> carList(@Param("userId") String userId);
|
||||
|
||||
|
||||
List<Car> selectCarInfoList(CarRequest carRequest);
|
||||
Car selectCarInfoList(@Param("vinId") String vinId);
|
||||
|
||||
Result<List<VehicleMessage>> onlineVehicle();
|
||||
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package com.god.base.server.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.god.base.server.common.domain.Car;
|
||||
import com.god.base.server.common.domain.VehicleMessage;
|
||||
import com.god.base.server.common.domain.request.CarRequest;
|
||||
import com.god.base.server.common.domainConstants.RedisConstant;
|
||||
import com.god.base.server.mapper.CarMapper;
|
||||
import com.god.base.server.service.CarService;
|
||||
import com.god.common.core.domain.Result;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -51,47 +48,59 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements CarSe
|
|||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 查询车辆信息管理列表
|
||||
// *
|
||||
// * @param carRequest 车辆信息管理
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<Car> selectCarInfoList(CarRequest carRequest) {
|
||||
// LambdaQueryWrapper<Car> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// //判断vin是否为空
|
||||
// if (StringUtils.isNotEmpty(carRequest.getCarVinId())){
|
||||
// //模糊查询 vin
|
||||
// lambdaQueryWrapper.like(Car::getCarVinId, carRequest.getCarVinId());
|
||||
// }
|
||||
// //模糊查询 车辆类型
|
||||
// lambdaQueryWrapper.like(Car::getCarTypeId, carRequest.getCarTypeId());
|
||||
// //模糊查询 电子围栏
|
||||
// lambdaQueryWrapper.like(Car::getFenceId, carRequest.getFenceId());
|
||||
// //模糊查询 车辆状态
|
||||
// lambdaQueryWrapper.like(Car::getStatus, carRequest.getStatus());
|
||||
// if (StringUtils.isNotEmpty(carRequest.getBatteryManufacturer())){
|
||||
// //模糊查询 电池厂商
|
||||
// lambdaQueryWrapper.like(Car::getBatteryManufacturer, carRequest.getBatteryManufacturer());
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(carRequest.getMotorManufacturer())){
|
||||
// //模糊查询 电机厂商
|
||||
// lambdaQueryWrapper.like(Car::getMotorManufacturer, carRequest.getMotorManufacturer());
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(carRequest.getMotorNumber())){
|
||||
// //模糊查询 电机编号
|
||||
// lambdaQueryWrapper.like(Car::getMotorNumber, carRequest.getMotorNumber());
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(carRequest.getBatteryNumber())){
|
||||
// //模糊查询 电池编号
|
||||
// lambdaQueryWrapper.like(Car::getBatteryNumber, carRequest.getBatteryNumber());
|
||||
// }
|
||||
//
|
||||
// return carMapper.selectVehicleInfoList(carRequest);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆信息管理列表
|
||||
*
|
||||
* @param carRequest 车辆信息管理
|
||||
* 查询车辆信息管理列表信息
|
||||
* @param vinId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Car> selectCarInfoList(CarRequest carRequest) {
|
||||
LambdaQueryWrapper<Car> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//判断vin是否为空
|
||||
if (StringUtils.isNotEmpty(carRequest.getCarVinId())){
|
||||
//模糊查询 vin
|
||||
lambdaQueryWrapper.like(Car::getCarVinId, carRequest.getCarVinId());
|
||||
}
|
||||
//模糊查询 车辆类型
|
||||
lambdaQueryWrapper.like(Car::getCarTypeId, carRequest.getCarTypeId());
|
||||
//模糊查询 电子围栏
|
||||
lambdaQueryWrapper.like(Car::getFenceId, carRequest.getFenceId());
|
||||
//模糊查询 车辆状态
|
||||
lambdaQueryWrapper.like(Car::getStatus, carRequest.getStatus());
|
||||
if (StringUtils.isNotEmpty(carRequest.getBatteryManufacturer())){
|
||||
//模糊查询 电池厂商
|
||||
lambdaQueryWrapper.like(Car::getBatteryManufacturer, carRequest.getBatteryManufacturer());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(carRequest.getMotorManufacturer())){
|
||||
//模糊查询 电机厂商
|
||||
lambdaQueryWrapper.like(Car::getMotorManufacturer, carRequest.getMotorManufacturer());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(carRequest.getMotorNumber())){
|
||||
//模糊查询 电机编号
|
||||
lambdaQueryWrapper.like(Car::getMotorNumber, carRequest.getMotorNumber());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(carRequest.getBatteryNumber())){
|
||||
//模糊查询 电池编号
|
||||
lambdaQueryWrapper.like(Car::getBatteryNumber, carRequest.getBatteryNumber());
|
||||
}
|
||||
|
||||
return carMapper.selectVehicleInfoList(carRequest);
|
||||
public Car selectCarInfoList(String vinId) {
|
||||
return carMapper.HuiCarSelect(vinId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据VIN 编辑管理修改车辆信息数据
|
||||
* @param entity
|
||||
|
|
|
@ -55,4 +55,9 @@
|
|||
select count(*)
|
||||
from t_car
|
||||
</select>
|
||||
<!-- 根据vin查询当前对象的所有信息-->
|
||||
<select id="HuiCarSelect" resultType="com.god.base.server.common.domain.Car">
|
||||
<include refid="selectVehicleInfoVo"/>
|
||||
where car_vin_id = #{vinId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue