修改配置,车辆管理
This commit is contained in:
@ -321,8 +321,8 @@ ys7:
|
||||
app-key: xxx
|
||||
app-secret: xxx
|
||||
job:
|
||||
capture-enabled: true # 控制是否启用萤石抓拍任务
|
||||
device-sync-enabled: true # 控制是否同步萤石设备
|
||||
capture-enabled: false # 控制是否启用萤石抓拍任务
|
||||
device-sync-enabled: false # 控制是否同步萤石设备
|
||||
# 斯巴达算法
|
||||
sparta:
|
||||
url: http://119.3.204.120:8040
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
package org.dromara.job.once;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.manager.ys7manager.vo.Ys7QueryDeviceResponseVo;
|
||||
import org.dromara.other.service.IOthYs7DeviceService;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 同步摄像头设备数据
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025/6/13 11:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FullSyncYs7DeviceData implements CommandLineRunner {
|
||||
|
||||
@Resource
|
||||
private Ys7Manager ys7Manager;
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceService ys7DeviceService;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
log.info("开始同步摄像头设备数据");
|
||||
try {
|
||||
List<Ys7QueryDeviceResponseVo> ys7QueryDeviceList = ys7Manager.queryAllDeviceList();
|
||||
Boolean result = ys7DeviceService.saveOrUpdateByDeviceList(ys7QueryDeviceList);
|
||||
if (result) {
|
||||
log.info("摄像头设备数据同步成功");
|
||||
} else {
|
||||
log.info("没有需要同步的设备");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("摄像头设备数据同步失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -162,6 +162,12 @@ public class PgsProgressPlanServiceImpl extends ServiceImpl<PgsProgressPlanMappe
|
||||
Long id = progressPlan.getId();
|
||||
List<PgsProgressPlanDetailCreateDto> detailList = req.getDetailList();
|
||||
if (CollUtil.isNotEmpty(detailList)) {
|
||||
// 判断详情数量是否合法
|
||||
boolean isAnyEmpty = detailList.stream()
|
||||
.allMatch(detail -> detail.getPlanNumber().compareTo(BigDecimal.ZERO) <= 0);
|
||||
if (isAnyEmpty) {
|
||||
throw new ServiceException("新增进度计划详情失败,请进行均分", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
List<PgsProgressPlanDetail> newDetailList = detailList.stream().map(detail -> {
|
||||
PgsProgressPlanDetail progressPlanDetail = new PgsProgressPlanDetail();
|
||||
BeanUtils.copyProperties(detail, progressPlanDetail);
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package org.dromara.vehicle.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.vehicle.domain.bo.VehVehicleInfoBo;
|
||||
import org.dromara.vehicle.domain.vo.VehVehicleInfoVo;
|
||||
import org.dromara.vehicle.service.IVehVehicleInfoService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/vehicle/vehicleInfo")
|
||||
public class VehVehicleInfoController extends BaseController {
|
||||
|
||||
private final IVehVehicleInfoService vehVehicleInfoService;
|
||||
|
||||
/**
|
||||
* 查询车辆信息列表
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<VehVehicleInfoVo> list(VehVehicleInfoBo bo, PageQuery pageQuery) {
|
||||
return vehVehicleInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆信息列表
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:export")
|
||||
@Log(title = "车辆信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(VehVehicleInfoBo bo, HttpServletResponse response) {
|
||||
List<VehVehicleInfoVo> list = vehVehicleInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "车辆信息", VehVehicleInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车辆信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<VehVehicleInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(vehVehicleInfoService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆信息
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:add")
|
||||
@Log(title = "车辆信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody VehVehicleInfoBo bo) {
|
||||
return toAjax(vehVehicleInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆信息
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:edit")
|
||||
@Log(title = "车辆信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody VehVehicleInfoBo bo) {
|
||||
return toAjax(vehVehicleInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("vehicle:vehicleInfo:remove")
|
||||
@Log(title = "车辆信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(vehVehicleInfoService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package org.dromara.vehicle.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆信息对象 veh_vehicle_info
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("veh_vehicle_info")
|
||||
public class VehVehicleInfo extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
private String vehicleType;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 座位数
|
||||
*/
|
||||
private Integer seatCount;
|
||||
|
||||
/**
|
||||
* 燃料类型
|
||||
*/
|
||||
private String fuelType;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车长(米)
|
||||
*/
|
||||
private BigDecimal vehicleLength;
|
||||
|
||||
/**
|
||||
* 车宽(米)
|
||||
*/
|
||||
private BigDecimal vehicleWidth;
|
||||
|
||||
/**
|
||||
* 车高(米)
|
||||
*/
|
||||
private BigDecimal vehicleHeight;
|
||||
|
||||
/**
|
||||
* 轴距(米)
|
||||
*/
|
||||
private BigDecimal wheelBase;
|
||||
|
||||
/**
|
||||
* 轮距(米)
|
||||
*/
|
||||
private BigDecimal wheelTrack;
|
||||
|
||||
/**
|
||||
* 车辆性质
|
||||
*/
|
||||
private String ownerType;
|
||||
|
||||
/**
|
||||
* 租赁方信息
|
||||
*/
|
||||
private String rentalCompany;
|
||||
|
||||
/**
|
||||
* 登记证书编号(车管所登记凭证)
|
||||
*/
|
||||
private String registrationCertNo;
|
||||
|
||||
/**
|
||||
* 登记日期
|
||||
*/
|
||||
private LocalDate registerDate;
|
||||
|
||||
/**
|
||||
* 购置日期
|
||||
*/
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
/**
|
||||
* 购置价格
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 保险到期时间
|
||||
*/
|
||||
private LocalDate insuranceExpiry;
|
||||
|
||||
/**
|
||||
* 年检到期时间
|
||||
*/
|
||||
private LocalDate inspectionExpiry;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,158 @@
|
||||
package org.dromara.vehicle.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.vehicle.domain.VehVehicleInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆信息业务对象 veh_vehicle_info
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = VehVehicleInfo.class, reverseConvertGenerate = false)
|
||||
public class VehVehicleInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotNull(message = "项目ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@NotBlank(message = "车牌号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@NotBlank(message = "车辆品牌不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
@NotBlank(message = "车辆类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String vehicleType;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@NotBlank(message = "车辆颜色不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 座位数
|
||||
*/
|
||||
@NotNull(message = "座位数不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Integer seatCount;
|
||||
|
||||
/**
|
||||
* 燃料类型
|
||||
*/
|
||||
@NotBlank(message = "燃料类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String fuelType;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@NotBlank(message = "车辆状态不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车长(米)
|
||||
*/
|
||||
private BigDecimal vehicleLength;
|
||||
|
||||
/**
|
||||
* 车宽(米)
|
||||
*/
|
||||
private BigDecimal vehicleWidth;
|
||||
|
||||
/**
|
||||
* 车高(米)
|
||||
*/
|
||||
private BigDecimal vehicleHeight;
|
||||
|
||||
/**
|
||||
* 轴距(米)
|
||||
*/
|
||||
private BigDecimal wheelBase;
|
||||
|
||||
/**
|
||||
* 轮距(米)
|
||||
*/
|
||||
private BigDecimal wheelTrack;
|
||||
|
||||
/**
|
||||
* 车辆性质
|
||||
*/
|
||||
@NotBlank(message = "车辆性质不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String ownerType;
|
||||
|
||||
/**
|
||||
* 租赁方信息
|
||||
*/
|
||||
private String rentalCompany;
|
||||
|
||||
/**
|
||||
* 登记证书编号(车管所登记凭证)
|
||||
*/
|
||||
private String registrationCertNo;
|
||||
|
||||
/**
|
||||
* 登记日期
|
||||
*/
|
||||
private LocalDate registerDate;
|
||||
|
||||
/**
|
||||
* 购置日期
|
||||
*/
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
/**
|
||||
* 购置价格
|
||||
*/
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 保险到期时间
|
||||
*/
|
||||
private LocalDate insuranceExpiry;
|
||||
|
||||
/**
|
||||
* 年检到期时间
|
||||
*/
|
||||
private LocalDate inspectionExpiry;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
package org.dromara.vehicle.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.dromara.vehicle.domain.VehVehicleInfo;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息视图对象 veh_vehicle_info
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = VehVehicleInfo.class)
|
||||
public class VehVehicleInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@ExcelProperty(value = "车牌号")
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@ExcelProperty(value = "车辆品牌")
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
@ExcelProperty(value = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@ExcelProperty(value = "车辆颜色")
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 座位数
|
||||
*/
|
||||
@ExcelProperty(value = "座位数")
|
||||
private Integer seatCount;
|
||||
|
||||
/**
|
||||
* 燃料类型
|
||||
*/
|
||||
@ExcelProperty(value = "燃料类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "veh_vehicle_fuel_type")
|
||||
private String fuelType;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@ExcelProperty(value = "车辆状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "veh_vehicle_status")
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车长(米)
|
||||
*/
|
||||
@ExcelProperty(value = "车长", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "米=")
|
||||
private BigDecimal vehicleLength;
|
||||
|
||||
/**
|
||||
* 车宽(米)
|
||||
*/
|
||||
@ExcelProperty(value = "车宽", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "米=")
|
||||
private BigDecimal vehicleWidth;
|
||||
|
||||
/**
|
||||
* 车高(米)
|
||||
*/
|
||||
@ExcelProperty(value = "车高", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "米=")
|
||||
private BigDecimal vehicleHeight;
|
||||
|
||||
/**
|
||||
* 轴距(米)
|
||||
*/
|
||||
@ExcelProperty(value = "轴距", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "米=")
|
||||
private BigDecimal wheelBase;
|
||||
|
||||
/**
|
||||
* 轮距(米)
|
||||
*/
|
||||
@ExcelProperty(value = "轮距", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "米=")
|
||||
private BigDecimal wheelTrack;
|
||||
|
||||
/**
|
||||
* 车辆性质
|
||||
*/
|
||||
@ExcelProperty(value = "车辆性质", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "veh_vehicle_owner_type")
|
||||
private String ownerType;
|
||||
|
||||
/**
|
||||
* 租赁方信息
|
||||
*/
|
||||
@ExcelProperty(value = "租赁方信息")
|
||||
private String rentalCompany;
|
||||
|
||||
/**
|
||||
* 登记证书编号(车管所登记凭证)
|
||||
*/
|
||||
@ExcelProperty(value = "登记证书编号", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "车=管所登记凭证")
|
||||
private String registrationCertNo;
|
||||
|
||||
/**
|
||||
* 登记日期
|
||||
*/
|
||||
@ExcelProperty(value = "登记日期")
|
||||
private LocalDate registerDate;
|
||||
|
||||
/**
|
||||
* 购置日期
|
||||
*/
|
||||
@ExcelProperty(value = "购置日期")
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
/**
|
||||
* 购置价格
|
||||
*/
|
||||
@ExcelProperty(value = "购置价格")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/**
|
||||
* 保险到期时间
|
||||
*/
|
||||
@ExcelProperty(value = "保险到期时间")
|
||||
private LocalDate insuranceExpiry;
|
||||
|
||||
/**
|
||||
* 年检到期时间
|
||||
*/
|
||||
@ExcelProperty(value = "年检到期时间")
|
||||
private LocalDate inspectionExpiry;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
@ExcelProperty(value = "附件ID")
|
||||
private String fileIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.vehicle.mapper;
|
||||
|
||||
import org.dromara.vehicle.domain.VehVehicleInfo;
|
||||
import org.dromara.vehicle.domain.vo.VehVehicleInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 车辆信息Mapper接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
public interface VehVehicleInfoMapper extends BaseMapperPlus<VehVehicleInfo, VehVehicleInfoVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.vehicle.service;
|
||||
|
||||
import org.dromara.vehicle.domain.vo.VehVehicleInfoVo;
|
||||
import org.dromara.vehicle.domain.bo.VehVehicleInfoBo;
|
||||
import org.dromara.vehicle.domain.VehVehicleInfo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息Service接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
public interface IVehVehicleInfoService extends IService<VehVehicleInfo>{
|
||||
|
||||
/**
|
||||
* 查询车辆信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 车辆信息
|
||||
*/
|
||||
VehVehicleInfoVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询车辆信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 车辆信息分页列表
|
||||
*/
|
||||
TableDataInfo<VehVehicleInfoVo> queryPageList(VehVehicleInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的车辆信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 车辆信息列表
|
||||
*/
|
||||
List<VehVehicleInfoVo> queryList(VehVehicleInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增车辆信息
|
||||
*
|
||||
* @param bo 车辆信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(VehVehicleInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改车辆信息
|
||||
*
|
||||
* @param bo 车辆信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(VehVehicleInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除车辆信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
package org.dromara.vehicle.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.vehicle.domain.VehVehicleInfo;
|
||||
import org.dromara.vehicle.domain.bo.VehVehicleInfoBo;
|
||||
import org.dromara.vehicle.domain.vo.VehVehicleInfoVo;
|
||||
import org.dromara.vehicle.mapper.VehVehicleInfoMapper;
|
||||
import org.dromara.vehicle.service.IVehVehicleInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 车辆信息Service业务层处理
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-10-25
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper, VehVehicleInfo>
|
||||
implements IVehVehicleInfoService {
|
||||
|
||||
/**
|
||||
* 查询车辆信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 车辆信息
|
||||
*/
|
||||
@Override
|
||||
public VehVehicleInfoVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询车辆信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 车辆信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<VehVehicleInfoVo> queryPageList(VehVehicleInfoBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<VehVehicleInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<VehVehicleInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的车辆信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 车辆信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<VehVehicleInfoVo> queryList(VehVehicleInfoBo bo) {
|
||||
LambdaQueryWrapper<VehVehicleInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<VehVehicleInfo> buildQueryWrapper(VehVehicleInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<VehVehicleInfo> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(VehVehicleInfo::getId);
|
||||
lqw.eq(bo.getProjectId() != null, VehVehicleInfo::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlateNumber()), VehVehicleInfo::getPlateNumber, bo.getPlateNumber());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVehicleBrand()), VehVehicleInfo::getVehicleBrand, bo.getVehicleBrand());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVehicleType()), VehVehicleInfo::getVehicleType, bo.getVehicleType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVehicleColor()), VehVehicleInfo::getVehicleColor, bo.getVehicleColor());
|
||||
lqw.eq(bo.getSeatCount() != null, VehVehicleInfo::getSeatCount, bo.getSeatCount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFuelType()), VehVehicleInfo::getFuelType, bo.getFuelType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVehicleStatus()), VehVehicleInfo::getVehicleStatus, bo.getVehicleStatus());
|
||||
lqw.eq(bo.getVehicleLength() != null, VehVehicleInfo::getVehicleLength, bo.getVehicleLength());
|
||||
lqw.eq(bo.getVehicleWidth() != null, VehVehicleInfo::getVehicleWidth, bo.getVehicleWidth());
|
||||
lqw.eq(bo.getVehicleHeight() != null, VehVehicleInfo::getVehicleHeight, bo.getVehicleHeight());
|
||||
lqw.eq(bo.getWheelBase() != null, VehVehicleInfo::getWheelBase, bo.getWheelBase());
|
||||
lqw.eq(bo.getWheelTrack() != null, VehVehicleInfo::getWheelTrack, bo.getWheelTrack());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOwnerType()), VehVehicleInfo::getOwnerType, bo.getOwnerType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRentalCompany()), VehVehicleInfo::getRentalCompany, bo.getRentalCompany());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRegistrationCertNo()), VehVehicleInfo::getRegistrationCertNo, bo.getRegistrationCertNo());
|
||||
lqw.eq(bo.getRegisterDate() != null, VehVehicleInfo::getRegisterDate, bo.getRegisterDate());
|
||||
lqw.eq(bo.getPurchaseDate() != null, VehVehicleInfo::getPurchaseDate, bo.getPurchaseDate());
|
||||
lqw.eq(bo.getPurchasePrice() != null, VehVehicleInfo::getPurchasePrice, bo.getPurchasePrice());
|
||||
lqw.eq(bo.getInsuranceExpiry() != null, VehVehicleInfo::getInsuranceExpiry, bo.getInsuranceExpiry());
|
||||
lqw.eq(bo.getInspectionExpiry() != null, VehVehicleInfo::getInspectionExpiry, bo.getInspectionExpiry());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileIds()), VehVehicleInfo::getFileIds, bo.getFileIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆信息
|
||||
*
|
||||
* @param bo 车辆信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(VehVehicleInfoBo bo) {
|
||||
VehVehicleInfo add = MapstructUtils.convert(bo, VehVehicleInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆信息
|
||||
*
|
||||
* @param bo 车辆信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(VehVehicleInfoBo bo) {
|
||||
VehVehicleInfo update = MapstructUtils.convert(bo, VehVehicleInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(VehVehicleInfo entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除车辆信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.vehicle.mapper.VehVehicleInfoMapper">
|
||||
|
||||
</mapper>
|
||||
114
xinnengyuan/script/sql/vehicle.sql
Normal file
114
xinnengyuan/script/sql/vehicle.sql
Normal file
@ -0,0 +1,114 @@
|
||||
CREATE TABLE veh_vehicle_info
|
||||
(
|
||||
`id` BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||
`project_id` BIGINT NOT NULL COMMENT '项目ID',
|
||||
`plate_number` VARCHAR(32) NOT NULL COMMENT '车牌号',
|
||||
`vehicle_brand` VARCHAR(128) NOT NULL COMMENT '车辆品牌',
|
||||
`vehicle_type` VARCHAR(128) NOT NULL COMMENT '车辆类型',
|
||||
`vehicle_color` VARCHAR(32) NOT NULL COMMENT '车辆颜色',
|
||||
`seat_count` INT NOT NULL COMMENT '座位数',
|
||||
`fuel_type` VARCHAR(32) NOT NULL COMMENT '燃料类型',
|
||||
`vehicle_status` VARCHAR(32) NOT NULL COMMENT '车辆状态',
|
||||
`vehicle_length` DECIMAL(10, 2) DEFAULT 0.00 NULL COMMENT '车长(米)',
|
||||
`vehicle_width` DECIMAL(10, 2) DEFAULT 0.00 NULL COMMENT '车宽(米)',
|
||||
`vehicle_height` DECIMAL(10, 2) DEFAULT 0.00 NULL COMMENT '车高(米)',
|
||||
`wheel_base` DECIMAL(10, 2) DEFAULT 0.00 NULL COMMENT '轴距(米)',
|
||||
`wheel_track` DECIMAL(10, 2) DEFAULT 0.00 NULL COMMENT '轮距(米)',
|
||||
`owner_type` VARCHAR(16) NOT NULL COMMENT '车辆性质',
|
||||
`rental_company` VARCHAR(256) NULL COMMENT '租赁方信息',
|
||||
`registration_cert_no` VARCHAR(128) NULL COMMENT '登记证书编号(车管所登记凭证)',
|
||||
`register_date` DATE NULL COMMENT '登记日期',
|
||||
`purchase_date` DATE NULL COMMENT '购置日期',
|
||||
`purchase_price` DECIMAL(12, 2) DEFAULT 0.00 NULL COMMENT '购置价格',
|
||||
`insurance_expiry` DATE NULL COMMENT '保险到期时间',
|
||||
`inspection_expiry` DATE NULL COMMENT '年检到期时间',
|
||||
`file_ids` VARCHAR(512) NULL COMMENT '附件ID',
|
||||
`remark` TEXT NULL COMMENT '备注',
|
||||
`create_by` BIGINT NULL COMMENT '创建者',
|
||||
`update_by` BIGINT NULL COMMENT '更新者',
|
||||
`create_dept` BIGINT NULL COMMENT '创建部门',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL COMMENT '更新时间',
|
||||
index `idx_project_id` (`project_id`)
|
||||
) COMMENT ='车辆信息';
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378114, '车辆信息', '1981982566466318337', '1', 'vehicleInfo', 'vehicle/vehicleInfo/index', 1, 0,
|
||||
'C', '0', '0', 'vehicle:vehicleInfo:list', '#', 103, 1, sysdate(), null, null, '车辆信息菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378115, '车辆信息查询', 1981989139020378114, '1', '#', '', 1, 0, 'F', '0', '0',
|
||||
'vehicle:vehicleInfo:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378116, '车辆信息新增', 1981989139020378114, '2', '#', '', 1, 0, 'F', '0', '0',
|
||||
'vehicle:vehicleInfo:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378117, '车辆信息修改', 1981989139020378114, '3', '#', '', 1, 0, 'F', '0', '0',
|
||||
'vehicle:vehicleInfo:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378118, '车辆信息删除', 1981989139020378114, '4', '#', '', 1, 0, 'F', '0', '0',
|
||||
'vehicle:vehicleInfo:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible,
|
||||
status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values (1981989139020378119, '车辆信息导出', 1981989139020378114, '5', '#', '', 1, 0, 'F', '0', '0',
|
||||
'vehicle:vehicleInfo:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
|
||||
CREATE TABLE veh_vehicle_trip
|
||||
(
|
||||
`id` BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||
`project_id` BIGINT NOT NULL COMMENT '项目ID',
|
||||
`initiator_id` BIGINT NOT NULL COMMENT '发起人',
|
||||
`vehicle_id` BIGINT NULL COMMENT '车辆ID',
|
||||
`trip_reason` VARCHAR(512) NOT NULL COMMENT '出行事由',
|
||||
`start_place` VARCHAR(255) NULL COMMENT '出发地',
|
||||
`end_place` VARCHAR(255) NOT NULL COMMENT '目的地',
|
||||
`start_lat` VARCHAR(32) NULL COMMENT '出发地经度',
|
||||
`start_lng` VARCHAR(32) NULL COMMENT '出发地纬度',
|
||||
`end_lat` VARCHAR(32) NULL COMMENT '目的地经度',
|
||||
`end_lng` VARCHAR(32) NULL COMMENT '目的地纬度',
|
||||
`start_time` DATETIME NOT NULL COMMENT '计划出发时间',
|
||||
`end_time` DATETIME NULL COMMENT '计划到达时间',
|
||||
`left_seat` INT DEFAULT 0 NOT NULL COMMENT '剩余座位数',
|
||||
`is_driver` VARCHAR(2) NOT NULL COMMENT '是否为车主(0不是 1是)',
|
||||
`trip_status` VARCHAR(2) DEFAULT '0' NOT NULL COMMENT '状态',
|
||||
`remark` TEXT NULL COMMENT '备注',
|
||||
`create_by` BIGINT NULL COMMENT '创建者',
|
||||
`update_by` BIGINT NULL COMMENT '更新者',
|
||||
`create_dept` BIGINT NULL COMMENT '创建部门',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL COMMENT '更新时间',
|
||||
index `idx_project_id` (`project_id`)
|
||||
) COMMENT ='车辆出行记录';
|
||||
|
||||
|
||||
CREATE TABLE veh_vehicle_apply
|
||||
(
|
||||
`id` BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||
`project_id` BIGINT NOT NULL COMMENT '项目ID',
|
||||
`trip_id` BIGINT NOT NULL COMMENT '关联行程ID',
|
||||
`passenger_id` BIGINT NOT NULL COMMENT '乘客用户ID',
|
||||
`passenger_phone` VARCHAR(32) NULL COMMENT '联系电话',
|
||||
`status` VARCHAR(2) DEFAULT '0' NOT NULL COMMENT '状态( 0申请中 1已确认 2上车 3到达 4取消)',
|
||||
`boarded` VARCHAR(2) DEFAULT '0' NOT NULL COMMENT '是否确认上车(0否 1是)',
|
||||
`arrived` VARCHAR(2) DEFAULT '0' NOT NULL COMMENT '是否确认到达(0否 1是)',
|
||||
`remark` TEXT NULL COMMENT '备注',
|
||||
`create_by` BIGINT NULL COMMENT '创建者',
|
||||
`update_by` BIGINT NULL COMMENT '更新者',
|
||||
`create_dept` BIGINT NULL COMMENT '创建部门',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL COMMENT '更新时间',
|
||||
index `idx_project_id` (`project_id`)
|
||||
) COMMENT ='乘车申请';
|
||||
|
||||
Reference in New Issue
Block a user