新增车辆实时状态功能

master
luojian 2024-12-18 11:19:11 +08:00
parent 7347a9c4e4
commit df04c7f159
15 changed files with 594 additions and 2 deletions

View File

@ -0,0 +1,105 @@
package com.cpxt.web.controller.biz;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.cpxt.biz.domain.BizCarState;
import com.cpxt.biz.service.IBizCarStateService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cpxt.common.annotation.Log;
import com.cpxt.common.core.controller.BaseController;
import com.cpxt.common.core.domain.AjaxResult;
import com.cpxt.common.enums.BusinessType;
import com.cpxt.common.utils.poi.ExcelUtil;
import com.cpxt.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2024-12-18
*/
@RestController
@RequestMapping("/system/state")
public class BizCarStateController extends BaseController
{
@Autowired
private IBizCarStateService bizCarStateService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:list')")
@GetMapping("/list")
public TableDataInfo list(BizCarState bizCarState)
{
startPage();
List<BizCarState> list = bizCarStateService.selectBizCarStateList(bizCarState);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:export')")
@Log(title = "车辆实时状态", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BizCarState bizCarState)
{
List<BizCarState> list = bizCarStateService.selectBizCarStateList(bizCarState);
ExcelUtil<BizCarState> util = new ExcelUtil<BizCarState>(BizCarState.class);
util.exportExcel(response, list, "车辆实时状态数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(bizCarStateService.selectBizCarStateById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:add')")
@Log(title = "车辆实时状态", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BizCarState bizCarState)
{
return toAjax(bizCarStateService.insertBizCarState(bizCarState));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:edit')")
@Log(title = "车辆实时状态", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BizCarState bizCarState)
{
return toAjax(bizCarStateService.updateBizCarState(bizCarState));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:state:remove')")
@Log(title = "车辆实时状态", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(bizCarStateService.deleteBizCarStateByIds(ids));
}
}

View File

@ -6,9 +6,11 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/cpxtdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# url: jdbc:mysql://localhost:3306/cpxtdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.0.49:3306/cpxtdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 1234
# password: 1234
password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -49,10 +49,12 @@ public class BizCar
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -53,10 +53,12 @@ public class BizCarModel
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -0,0 +1,291 @@
package com.cpxt.biz.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.cpxt.common.annotation.Excel;
import com.cpxt.common.core.domain.BaseEntity;
/**
* biz_car_state
*
* @author ruoyi
* @date 2024-12-18
*/
@Data
public class BizCarState
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 车辆ID */
@Excel(name = "车辆ID")
private Long carId;
/** 车牌号 */
@Excel(name = "车牌号")
private String carNo;
/** 定位设备ID */
@Excel(name = "定位设备ID")
private String vin;
/** 真实车牌号 */
@Excel(name = "真实车牌号")
private String vehicleNo;
/** 系统中使用车牌号 */
@Excel(name = "系统中使用车牌号")
private String regName;
/** 定位时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "定位时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date gpsTime;
/** 速度 */
@Excel(name = "速度")
private Long speed;
/** 里程 */
@Excel(name = "里程")
private BigDecimal odometer;
/** 纬度WGS-84坐标系 */
@Excel(name = "纬度", readConverterExp = "W=GS-84坐标系")
private BigDecimal lat;
/** 经度WGS-84坐标系 */
@Excel(name = "经度", readConverterExp = "W=GS-84坐标系")
private BigDecimal lon;
/** 车头方向0-360 0正北 顺时针递加 */
@Excel(name = "车头方向0-360 0正北 顺时针递加")
private Integer direction;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 车辆位置 */
@Excel(name = "车辆位置")
private String placeName;
/** 省 */
@Excel(name = "省")
private String provice;
/** 市 */
@Excel(name = "市")
private String city;
/** 区 */
@Excel(name = "区")
private String district;
/** 路名信息 */
@Excel(name = "路名信息")
private String roadName;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t1;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t2;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t3;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t4;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t5;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t6;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t7;
/** 温度 */
@Excel(name = "温度")
private BigDecimal t8;
/** 纬度2 */
@Excel(name = "纬度2")
private BigDecimal lat02;
/** 经度2 */
@Excel(name = "经度2")
private BigDecimal lon02;
/** 地标名称 */
@Excel(name = "地标名称")
private String areaName;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time1;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time2;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time3;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time4;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time5;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time6;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time7;
/** 温度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "温度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date time8;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h1;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h2;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h3;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h4;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h5;
/** 温度 */
@Excel(name = "温度")
private BigDecimal h6;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h7;
/** 湿度 */
@Excel(name = "湿度")
private BigDecimal h8;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht1;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht2;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht3;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht4;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht5;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht6;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht7;
/** 湿度采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "湿度采集时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date ht8;
/** 设备类型 */
@Excel(name = "设备类型")
private String deviceTypeStr;
/** 设备编号 */
@Excel(name = "设备编号")
private String equipCode;
/** 当前油量 */
@Excel(name = "当前油量")
private String oil;
/** 海拔高度 单位米 */
@Excel(name = "海拔高度 单位米")
private Long height;
/** 停车时长 单位秒 */
@Excel(name = "停车时长 单位秒")
private Integer stopSec;
/** ACC状态 0无 1关 2开 */
@Excel(name = "ACC状态 0无 1关 2开")
private Integer acc;
/** 油量欧姆值 */
@Excel(name = "油量欧姆值")
private String ohm;
/** 当前ACC状态 */
@Excel(name = "当前ACC状态")
private Integer curAccSta;
/** 中心识别码 */
@Excel(name = "中心识别码")
private String commIds;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}

View File

@ -48,10 +48,12 @@ public class BizCustomer
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -39,9 +39,11 @@ public class BizCustomerRoute
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -61,10 +61,12 @@ public class BizCustomerShop
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -40,10 +40,12 @@ public class BizCustomerUser
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -61,10 +61,12 @@ public class BizCustomerWarehouse extends BaseEntity
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -76,10 +76,12 @@ public class BizDriver
private Integer status;
/** 创建时间 */
@Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -257,9 +257,11 @@ public class BizOrder
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间")
private Date createTime;
/** 更新时间 */
@Excel(name = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;

View File

@ -0,0 +1,17 @@
package com.cpxt.biz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cpxt.biz.domain.BizCarState;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author ruoyi
* @date 2024-12-18
*/
@Mapper
public interface BizCarStateMapper extends BaseMapper<BizCarState>
{
}

View File

@ -0,0 +1,61 @@
package com.cpxt.biz.service;
import com.cpxt.biz.domain.BizCarState;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2024-12-18
*/
public interface IBizCarStateService
{
/**
*
*
* @param id
* @return
*/
public BizCarState selectBizCarStateById(Long id);
/**
*
*
* @param bizCarState
* @return
*/
public List<BizCarState> selectBizCarStateList(BizCarState bizCarState);
/**
*
*
* @param bizCarState
* @return
*/
public int insertBizCarState(BizCarState bizCarState);
/**
*
*
* @param bizCarState
* @return
*/
public int updateBizCarState(BizCarState bizCarState);
/**
*
*
* @param ids
* @return
*/
public int deleteBizCarStateByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBizCarStateById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.cpxt.biz.service.impl;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cpxt.biz.domain.BizCarState;
import com.cpxt.biz.mapper.BizCarStateMapper;
import com.cpxt.biz.service.IBizCarStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service
*
* @author ruoyi
* @date 2024-12-18
*/
@Service
public class BizCarStateServiceImpl implements IBizCarStateService
{
@Autowired
private BizCarStateMapper bizCarStateMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BizCarState selectBizCarStateById(Long id)
{
return bizCarStateMapper.selectById(id);
}
/**
*
*
* @param bizCarState
* @return
*/
@Override
public List<BizCarState> selectBizCarStateList(BizCarState bizCarState)
{
LambdaQueryWrapper<BizCarState> queryWrapper = new LambdaQueryWrapper<>();
return bizCarStateMapper.selectList(queryWrapper);
}
/**
*
*
* @param bizCarState
* @return
*/
@Override
public int insertBizCarState(BizCarState bizCarState)
{
return bizCarStateMapper.insert(bizCarState);
}
/**
*
*
* @param bizCarState
* @return
*/
@Override
public int updateBizCarState(BizCarState bizCarState)
{
return bizCarStateMapper.updateById(bizCarState);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBizCarStateByIds(Long[] ids)
{
return bizCarStateMapper.deleteBatchIds(Arrays.asList(ids));
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBizCarStateById(Long id)
{
return bizCarStateMapper.deleteById(id);
}
}