refactor(重构电子围栏)
commit
e644f5be3a
|
@ -34,16 +34,10 @@
|
|||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>4.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-company-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,23 +1,18 @@
|
|||
package com.muyu.clw.common.many.datasource;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.muyu.clw.common.many.datasource.domain.model.DataSourceInfo;
|
||||
import com.muyu.clw.common.many.remote.RemoteEnterpriseService;
|
||||
import com.muyu.clw.common.saas.domain.model.EntInfo;
|
||||
import com.muyu.clw.common.many.datasource.factory.DruidDataSourceFactory;
|
||||
import com.muyu.clw.common.many.datasource.role.DynamicDataSource;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.SpringUtils;
|
||||
import com.muyu.domain.Enterprise;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
|
@ -33,15 +33,6 @@ public class DruidDataSourceFactory {
|
|||
druidDataSource.setConnectionErrorRetryAttempts(0);
|
||||
druidDataSource.setMaxActive(20); // 设置最大活动连接数为 20
|
||||
|
||||
// try {
|
||||
// Thread.sleep(4000);
|
||||
// druidDataSource.getConnection();
|
||||
// log.info("{}->数据库连接成功", dataSourceInfo.getKey());
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// log.error("数据库连接失败: {}", e.getMessage());
|
||||
// throw new RuntimeException("数据库连接失败", e);
|
||||
// }
|
||||
return druidDataSource;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,84 +1,130 @@
|
|||
package com.muyu.many.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.many.domain.req.FenceEditReq;
|
||||
import com.muyu.many.domain.req.FenceQueryReq;
|
||||
import com.muyu.many.domain.req.FenceSaveReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 fence
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public class Fence extends BaseEntity
|
||||
{
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("fence")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "Fence", description = "电子围栏")
|
||||
public class Fence extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 电子围栏名称 */
|
||||
@Excel(name = "电子围栏名称")
|
||||
private String name;
|
||||
/** 围栏名称 */
|
||||
@Excel(name = "围栏名称")
|
||||
@ApiModelProperty(name = "围栏名称", value = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏类型 */
|
||||
@Excel(name = "围栏类型")
|
||||
private String fenceType;
|
||||
/** 围栏组ID */
|
||||
@Excel(name = "围栏组ID")
|
||||
@ApiModelProperty(name = "围栏组ID", value = "围栏组ID")
|
||||
private Long groupId;
|
||||
|
||||
/** 经纬度信息 */
|
||||
@Excel(name = "经纬度信息")
|
||||
/** 围栏经纬度 */
|
||||
@Excel(name = "围栏经纬度")
|
||||
@ApiModelProperty(name = "围栏经纬度", value = "围栏经纬度")
|
||||
private String longitudeAndLatitude;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
/** 围栏备注 */
|
||||
@Excel(name = "围栏备注")
|
||||
@ApiModelProperty(name = "围栏备注", value = "围栏备注")
|
||||
private String fenceNote;
|
||||
|
||||
/** 半径 */
|
||||
@Excel(name = "半径")
|
||||
@ApiModelProperty(name = "半径", value = "半径")
|
||||
private BigDecimal radius;
|
||||
|
||||
/** 驶入,驶出 */
|
||||
@Excel(name = "驶入,驶出")
|
||||
@ApiModelProperty(name = "驶入,驶出", value = "驶入,驶出")
|
||||
private String driveOutIn;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
@ApiModelProperty(name = "是否删除", value = "是否删除")
|
||||
private Long isDelete;
|
||||
|
||||
/** 围栏状态 */
|
||||
@Excel(name = "围栏状态")
|
||||
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
|
||||
private Long fenceState;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static Fence queryBuild( FenceQueryReq fenceQueryReq){
|
||||
return Fence.builder()
|
||||
.fenceName(fenceQueryReq.getFenceName())
|
||||
.groupId(fenceQueryReq.getGroupId())
|
||||
.longitudeAndLatitude(fenceQueryReq.getLongitudeAndLatitude())
|
||||
.fenceNote(fenceQueryReq.getFenceNote())
|
||||
.radius(fenceQueryReq.getRadius())
|
||||
.driveOutIn(fenceQueryReq.getDriveOutIn())
|
||||
.isDelete(fenceQueryReq.getIsDelete())
|
||||
.fenceState(fenceQueryReq.getFenceState())
|
||||
.build();
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static Fence saveBuild(FenceSaveReq fenceSaveReq){
|
||||
return Fence.builder()
|
||||
.fenceName(fenceSaveReq.getFenceName())
|
||||
.groupId(fenceSaveReq.getGroupId())
|
||||
.longitudeAndLatitude(fenceSaveReq.getLongitudeAndLatitude())
|
||||
.fenceNote(fenceSaveReq.getFenceNote())
|
||||
.radius(fenceSaveReq.getRadius())
|
||||
.driveOutIn(fenceSaveReq.getDriveOutIn())
|
||||
.isDelete(fenceSaveReq.getIsDelete())
|
||||
.fenceState(fenceSaveReq.getFenceState())
|
||||
.build();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setFenceType(String fenceType)
|
||||
{
|
||||
this.fenceType = fenceType;
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static Fence editBuild(Long id, FenceEditReq fenceEditReq){
|
||||
return Fence.builder()
|
||||
.id(id)
|
||||
.fenceName(fenceEditReq.getFenceName())
|
||||
.groupId(fenceEditReq.getGroupId())
|
||||
.longitudeAndLatitude(fenceEditReq.getLongitudeAndLatitude())
|
||||
.fenceNote(fenceEditReq.getFenceNote())
|
||||
.radius(fenceEditReq.getRadius())
|
||||
.driveOutIn(fenceEditReq.getDriveOutIn())
|
||||
.isDelete(fenceEditReq.getIsDelete())
|
||||
.fenceState(fenceEditReq.getFenceState())
|
||||
.build();
|
||||
}
|
||||
|
||||
public String getFenceType()
|
||||
{
|
||||
return fenceType;
|
||||
}
|
||||
public void setLongitudeAndLatitude(String longitudeAndLatitude)
|
||||
{
|
||||
this.longitudeAndLatitude = longitudeAndLatitude;
|
||||
}
|
||||
|
||||
public String getLongitudeAndLatitude()
|
||||
{
|
||||
return longitudeAndLatitude;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("fenceType", getFenceType())
|
||||
.append("longitudeAndLatitude", getLongitudeAndLatitude())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
package com.muyu.many.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.many.domain.req.GroupEditReq;
|
||||
import com.muyu.many.domain.req.GroupQueryReq;
|
||||
import com.muyu.many.domain.req.GroupSaveReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 围栏组对象 group
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("`group`")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "Group", description = "围栏组")
|
||||
public class Group extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 围栏组名称 */
|
||||
@Excel(name = "围栏组名称")
|
||||
@ApiModelProperty(name = "围栏组名称", value = "围栏组名称")
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static Group queryBuild( GroupQueryReq groupQueryReq){
|
||||
return Group.builder()
|
||||
.groupName(groupQueryReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static Group saveBuild(GroupSaveReq groupSaveReq){
|
||||
return Group.builder()
|
||||
.groupName(groupSaveReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static Group editBuild(Long id, GroupEditReq groupEditReq){
|
||||
return Group.builder()
|
||||
.id(id)
|
||||
.groupName(groupEditReq.getGroupName())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,258 +1,190 @@
|
|||
package com.muyu.many.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.many.domain.req.VehicleEditReq;
|
||||
import com.muyu.many.domain.req.VehicleQueryReq;
|
||||
import com.muyu.many.domain.req.VehicleSaveReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车辆对象 vehicle
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public class Vehicle extends BaseEntity
|
||||
{
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("vehicle")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "Vehicle", description = "车辆")
|
||||
public class Vehicle extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆id */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "车辆id", value = "车辆id")
|
||||
private Long id;
|
||||
|
||||
/** 车辆vin */
|
||||
@Excel(name = "车辆vin")
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
@ApiModelProperty(name = "型号", value = "型号")
|
||||
private String model;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "生产日期", value = "生产日期")
|
||||
private Date productionDate;
|
||||
|
||||
/** 车身类型 */
|
||||
@Excel(name = "车身类型")
|
||||
@ApiModelProperty(name = "车身类型", value = "车身类型")
|
||||
private String bodyType;
|
||||
|
||||
/** 车身颜色 */
|
||||
@Excel(name = "车身颜色")
|
||||
@ApiModelProperty(name = "车身颜色", value = "车身颜色")
|
||||
private String color;
|
||||
|
||||
/** 发动机排量 */
|
||||
@Excel(name = "发动机排量")
|
||||
@ApiModelProperty(name = "发动机排量", value = "发动机排量")
|
||||
private BigDecimal engineCapacity;
|
||||
|
||||
/** 燃油类型 */
|
||||
@Excel(name = "燃油类型")
|
||||
@ApiModelProperty(name = "燃油类型", value = "燃油类型")
|
||||
private String fuelType;
|
||||
|
||||
/** 变速器类型 */
|
||||
@Excel(name = "变速器类型")
|
||||
@ApiModelProperty(name = "变速器类型", value = "变速器类型")
|
||||
private String transmission;
|
||||
|
||||
/** 驱动方式 */
|
||||
@Excel(name = "驱动方式")
|
||||
@ApiModelProperty(name = "驱动方式", value = "驱动方式")
|
||||
private String driveType;
|
||||
|
||||
/** 行驶里程 */
|
||||
@Excel(name = "行驶里程")
|
||||
@ApiModelProperty(name = "行驶里程", value = "行驶里程")
|
||||
private BigDecimal mileage;
|
||||
|
||||
/** 注册日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "注册日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "注册日期", value = "注册日期")
|
||||
private Date registrationDate;
|
||||
|
||||
/** 车牌号码 */
|
||||
@Excel(name = "车牌号码")
|
||||
@ApiModelProperty(name = "车牌号码", value = "车牌号码")
|
||||
private String licenseNumber;
|
||||
|
||||
/** 持有者 */
|
||||
@Excel(name = "持有者")
|
||||
private String holder;
|
||||
|
||||
/** 车辆类型 */
|
||||
@Excel(name = "车辆类型")
|
||||
@ApiModelProperty(name = "车辆类型", value = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
/** 电子围栏ID */
|
||||
@Excel(name = "电子围栏ID")
|
||||
@ApiModelProperty(name = "电子围栏ID", value = "电子围栏ID")
|
||||
private Long fenceId;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static Vehicle queryBuild( VehicleQueryReq vehicleQueryReq){
|
||||
return Vehicle.builder()
|
||||
.vin(vehicleQueryReq.getVin())
|
||||
.brand(vehicleQueryReq.getBrand())
|
||||
.model(vehicleQueryReq.getModel())
|
||||
.productionDate(vehicleQueryReq.getProductionDate())
|
||||
.bodyType(vehicleQueryReq.getBodyType())
|
||||
.color(vehicleQueryReq.getColor())
|
||||
.engineCapacity(vehicleQueryReq.getEngineCapacity())
|
||||
.fuelType(vehicleQueryReq.getFuelType())
|
||||
.transmission(vehicleQueryReq.getTransmission())
|
||||
.driveType(vehicleQueryReq.getDriveType())
|
||||
.mileage(vehicleQueryReq.getMileage())
|
||||
.registrationDate(vehicleQueryReq.getRegistrationDate())
|
||||
.licenseNumber(vehicleQueryReq.getLicenseNumber())
|
||||
.vehicleType(vehicleQueryReq.getVehicleType())
|
||||
.fenceId(vehicleQueryReq.getFenceId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setVin(String vin)
|
||||
{
|
||||
this.vin = vin;
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static Vehicle saveBuild(VehicleSaveReq vehicleSaveReq){
|
||||
return Vehicle.builder()
|
||||
.vin(vehicleSaveReq.getVin())
|
||||
.brand(vehicleSaveReq.getBrand())
|
||||
.model(vehicleSaveReq.getModel())
|
||||
.productionDate(vehicleSaveReq.getProductionDate())
|
||||
.bodyType(vehicleSaveReq.getBodyType())
|
||||
.color(vehicleSaveReq.getColor())
|
||||
.engineCapacity(vehicleSaveReq.getEngineCapacity())
|
||||
.fuelType(vehicleSaveReq.getFuelType())
|
||||
.transmission(vehicleSaveReq.getTransmission())
|
||||
.driveType(vehicleSaveReq.getDriveType())
|
||||
.mileage(vehicleSaveReq.getMileage())
|
||||
.registrationDate(vehicleSaveReq.getRegistrationDate())
|
||||
.licenseNumber(vehicleSaveReq.getLicenseNumber())
|
||||
.vehicleType(vehicleSaveReq.getVehicleType())
|
||||
.fenceId(vehicleSaveReq.getFenceId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public String getVin()
|
||||
{
|
||||
return vin;
|
||||
}
|
||||
public void setBrand(String brand)
|
||||
{
|
||||
this.brand = brand;
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static Vehicle editBuild(Long id, VehicleEditReq vehicleEditReq){
|
||||
return Vehicle.builder()
|
||||
.id(id)
|
||||
.vin(vehicleEditReq.getVin())
|
||||
.brand(vehicleEditReq.getBrand())
|
||||
.model(vehicleEditReq.getModel())
|
||||
.productionDate(vehicleEditReq.getProductionDate())
|
||||
.bodyType(vehicleEditReq.getBodyType())
|
||||
.color(vehicleEditReq.getColor())
|
||||
.engineCapacity(vehicleEditReq.getEngineCapacity())
|
||||
.fuelType(vehicleEditReq.getFuelType())
|
||||
.transmission(vehicleEditReq.getTransmission())
|
||||
.driveType(vehicleEditReq.getDriveType())
|
||||
.mileage(vehicleEditReq.getMileage())
|
||||
.registrationDate(vehicleEditReq.getRegistrationDate())
|
||||
.licenseNumber(vehicleEditReq.getLicenseNumber())
|
||||
.vehicleType(vehicleEditReq.getVehicleType())
|
||||
.fenceId(vehicleEditReq.getFenceId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public String getBrand()
|
||||
{
|
||||
return brand;
|
||||
}
|
||||
public void setModel(String model)
|
||||
{
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
public void setProductionDate(Date productionDate)
|
||||
{
|
||||
this.productionDate = productionDate;
|
||||
}
|
||||
|
||||
public Date getProductionDate()
|
||||
{
|
||||
return productionDate;
|
||||
}
|
||||
public void setBodyType(String bodyType)
|
||||
{
|
||||
this.bodyType = bodyType;
|
||||
}
|
||||
|
||||
public String getBodyType()
|
||||
{
|
||||
return bodyType;
|
||||
}
|
||||
public void setColor(String color)
|
||||
{
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
public void setEngineCapacity(BigDecimal engineCapacity)
|
||||
{
|
||||
this.engineCapacity = engineCapacity;
|
||||
}
|
||||
|
||||
public BigDecimal getEngineCapacity()
|
||||
{
|
||||
return engineCapacity;
|
||||
}
|
||||
public void setFuelType(String fuelType)
|
||||
{
|
||||
this.fuelType = fuelType;
|
||||
}
|
||||
|
||||
public String getFuelType()
|
||||
{
|
||||
return fuelType;
|
||||
}
|
||||
public void setTransmission(String transmission)
|
||||
{
|
||||
this.transmission = transmission;
|
||||
}
|
||||
|
||||
public String getTransmission()
|
||||
{
|
||||
return transmission;
|
||||
}
|
||||
public void setDriveType(String driveType)
|
||||
{
|
||||
this.driveType = driveType;
|
||||
}
|
||||
|
||||
public String getDriveType()
|
||||
{
|
||||
return driveType;
|
||||
}
|
||||
public void setMileage(BigDecimal mileage)
|
||||
{
|
||||
this.mileage = mileage;
|
||||
}
|
||||
|
||||
public BigDecimal getMileage()
|
||||
{
|
||||
return mileage;
|
||||
}
|
||||
public void setRegistrationDate(Date registrationDate)
|
||||
{
|
||||
this.registrationDate = registrationDate;
|
||||
}
|
||||
|
||||
public Date getRegistrationDate()
|
||||
{
|
||||
return registrationDate;
|
||||
}
|
||||
public void setLicenseNumber(String licenseNumber)
|
||||
{
|
||||
this.licenseNumber = licenseNumber;
|
||||
}
|
||||
|
||||
public String getLicenseNumber()
|
||||
{
|
||||
return licenseNumber;
|
||||
}
|
||||
public void setHolder(String holder)
|
||||
{
|
||||
this.holder = holder;
|
||||
}
|
||||
|
||||
public String getHolder()
|
||||
{
|
||||
return holder;
|
||||
}
|
||||
public void setVehicleType(String vehicleType)
|
||||
{
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
public String getVehicleType()
|
||||
{
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("vin", getVin())
|
||||
.append("brand", getBrand())
|
||||
.append("model", getModel())
|
||||
.append("productionDate", getProductionDate())
|
||||
.append("bodyType", getBodyType())
|
||||
.append("color", getColor())
|
||||
.append("engineCapacity", getEngineCapacity())
|
||||
.append("fuelType", getFuelType())
|
||||
.append("transmission", getTransmission())
|
||||
.append("driveType", getDriveType())
|
||||
.append("mileage", getMileage())
|
||||
.append("registrationDate", getRegistrationDate())
|
||||
.append("licenseNumber", getLicenseNumber())
|
||||
.append("holder", getHolder())
|
||||
.append("vehicleType", getVehicleType())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 fence
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceEditReq", description = "电子围栏")
|
||||
public class FenceEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏名称 */
|
||||
@ApiModelProperty(name = "围栏名称", value = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏组ID */
|
||||
@ApiModelProperty(name = "围栏组ID", value = "围栏组ID")
|
||||
private Long groupId;
|
||||
|
||||
/** 围栏经纬度 */
|
||||
@ApiModelProperty(name = "围栏经纬度", value = "围栏经纬度")
|
||||
private String longitudeAndLatitude;
|
||||
|
||||
/** 围栏备注 */
|
||||
@ApiModelProperty(name = "围栏备注", value = "围栏备注")
|
||||
private String fenceNote;
|
||||
|
||||
/** 半径 */
|
||||
@ApiModelProperty(name = "半径", value = "半径")
|
||||
private BigDecimal radius;
|
||||
|
||||
/** 驶入,驶出 */
|
||||
@ApiModelProperty(name = "驶入,驶出", value = "驶入,驶出")
|
||||
private String driveOutIn;
|
||||
|
||||
/** 是否删除 */
|
||||
@ApiModelProperty(name = "是否删除", value = "是否删除")
|
||||
private Long isDelete;
|
||||
|
||||
/** 围栏状态 */
|
||||
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
|
||||
private Long fenceState;
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 fence
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceQueryReq", description = "电子围栏")
|
||||
public class FenceQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏名称 */
|
||||
@ApiModelProperty(name = "围栏名称", value = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏组ID */
|
||||
@ApiModelProperty(name = "围栏组ID", value = "围栏组ID")
|
||||
private Long groupId;
|
||||
|
||||
/** 围栏经纬度 */
|
||||
@ApiModelProperty(name = "围栏经纬度", value = "围栏经纬度")
|
||||
private String longitudeAndLatitude;
|
||||
|
||||
/** 围栏备注 */
|
||||
@ApiModelProperty(name = "围栏备注", value = "围栏备注")
|
||||
private String fenceNote;
|
||||
|
||||
/** 半径 */
|
||||
@ApiModelProperty(name = "半径", value = "半径")
|
||||
private BigDecimal radius;
|
||||
|
||||
/** 驶入,驶出 */
|
||||
@ApiModelProperty(name = "驶入,驶出", value = "驶入,驶出")
|
||||
private String driveOutIn;
|
||||
|
||||
/** 是否删除 */
|
||||
@ApiModelProperty(name = "是否删除", value = "是否删除")
|
||||
private Long isDelete;
|
||||
|
||||
/** 围栏状态 */
|
||||
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
|
||||
private Long fenceState;
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 fence
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "FenceSaveReq", description = "电子围栏")
|
||||
public class FenceSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 围栏名称 */
|
||||
|
||||
@ApiModelProperty(name = "围栏名称", value = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏组ID */
|
||||
|
||||
@ApiModelProperty(name = "围栏组ID", value = "围栏组ID")
|
||||
private Long groupId;
|
||||
|
||||
/** 围栏经纬度 */
|
||||
|
||||
@ApiModelProperty(name = "围栏经纬度", value = "围栏经纬度")
|
||||
private String longitudeAndLatitude;
|
||||
|
||||
/** 围栏备注 */
|
||||
|
||||
@ApiModelProperty(name = "围栏备注", value = "围栏备注")
|
||||
private String fenceNote;
|
||||
|
||||
/** 半径 */
|
||||
|
||||
@ApiModelProperty(name = "半径", value = "半径")
|
||||
private BigDecimal radius;
|
||||
|
||||
/** 驶入,驶出 */
|
||||
|
||||
@ApiModelProperty(name = "驶入,驶出", value = "驶入,驶出")
|
||||
private String driveOutIn;
|
||||
|
||||
/** 是否删除 */
|
||||
|
||||
@ApiModelProperty(name = "是否删除", value = "是否删除")
|
||||
private Long isDelete;
|
||||
|
||||
/** 围栏状态 */
|
||||
|
||||
@ApiModelProperty(name = "围栏状态", value = "围栏状态")
|
||||
private Long fenceState;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 围栏组对象 group
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupEditReq", description = "围栏组")
|
||||
public class GroupEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏组名称 */
|
||||
@ApiModelProperty(name = "围栏组名称", value = "围栏组名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 围栏组对象 group
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupQueryReq", description = "围栏组")
|
||||
public class GroupQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏组名称 */
|
||||
@ApiModelProperty(name = "围栏组名称", value = "围栏组名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 围栏组对象 group
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupSaveReq", description = "围栏组")
|
||||
public class GroupSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 围栏组名称 */
|
||||
|
||||
@ApiModelProperty(name = "围栏组名称", value = "围栏组名称")
|
||||
private String groupName;
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车辆对象 vehicle
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "VehicleEditReq", description = "车辆")
|
||||
public class VehicleEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆vin */
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 品牌 */
|
||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 型号 */
|
||||
@ApiModelProperty(name = "型号", value = "型号")
|
||||
private String model;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "生产日期", value = "生产日期")
|
||||
private Date productionDate;
|
||||
|
||||
/** 车身类型 */
|
||||
@ApiModelProperty(name = "车身类型", value = "车身类型")
|
||||
private String bodyType;
|
||||
|
||||
/** 车身颜色 */
|
||||
@ApiModelProperty(name = "车身颜色", value = "车身颜色")
|
||||
private String color;
|
||||
|
||||
/** 发动机排量 */
|
||||
@ApiModelProperty(name = "发动机排量", value = "发动机排量")
|
||||
private BigDecimal engineCapacity;
|
||||
|
||||
/** 燃油类型 */
|
||||
@ApiModelProperty(name = "燃油类型", value = "燃油类型")
|
||||
private String fuelType;
|
||||
|
||||
/** 变速器类型 */
|
||||
@ApiModelProperty(name = "变速器类型", value = "变速器类型")
|
||||
private String transmission;
|
||||
|
||||
/** 驱动方式 */
|
||||
@ApiModelProperty(name = "驱动方式", value = "驱动方式")
|
||||
private String driveType;
|
||||
|
||||
/** 行驶里程 */
|
||||
@ApiModelProperty(name = "行驶里程", value = "行驶里程")
|
||||
private BigDecimal mileage;
|
||||
|
||||
/** 注册日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "注册日期", value = "注册日期")
|
||||
private Date registrationDate;
|
||||
|
||||
/** 车牌号码 */
|
||||
@ApiModelProperty(name = "车牌号码", value = "车牌号码")
|
||||
private String licenseNumber;
|
||||
|
||||
/** 车辆类型 */
|
||||
@ApiModelProperty(name = "车辆类型", value = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
/** 电子围栏ID */
|
||||
@ApiModelProperty(name = "电子围栏ID", value = "电子围栏ID")
|
||||
private Long fenceId;
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车辆对象 vehicle
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "VehicleQueryReq", description = "车辆")
|
||||
public class VehicleQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆vin */
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 品牌 */
|
||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 型号 */
|
||||
@ApiModelProperty(name = "型号", value = "型号")
|
||||
private String model;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "生产日期", value = "生产日期")
|
||||
private Date productionDate;
|
||||
|
||||
/** 车身类型 */
|
||||
@ApiModelProperty(name = "车身类型", value = "车身类型")
|
||||
private String bodyType;
|
||||
|
||||
/** 车身颜色 */
|
||||
@ApiModelProperty(name = "车身颜色", value = "车身颜色")
|
||||
private String color;
|
||||
|
||||
/** 发动机排量 */
|
||||
@ApiModelProperty(name = "发动机排量", value = "发动机排量")
|
||||
private BigDecimal engineCapacity;
|
||||
|
||||
/** 燃油类型 */
|
||||
@ApiModelProperty(name = "燃油类型", value = "燃油类型")
|
||||
private String fuelType;
|
||||
|
||||
/** 变速器类型 */
|
||||
@ApiModelProperty(name = "变速器类型", value = "变速器类型")
|
||||
private String transmission;
|
||||
|
||||
/** 驱动方式 */
|
||||
@ApiModelProperty(name = "驱动方式", value = "驱动方式")
|
||||
private String driveType;
|
||||
|
||||
/** 行驶里程 */
|
||||
@ApiModelProperty(name = "行驶里程", value = "行驶里程")
|
||||
private BigDecimal mileage;
|
||||
|
||||
/** 注册日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "注册日期", value = "注册日期")
|
||||
private Date registrationDate;
|
||||
|
||||
/** 车牌号码 */
|
||||
@ApiModelProperty(name = "车牌号码", value = "车牌号码")
|
||||
private String licenseNumber;
|
||||
|
||||
/** 车辆类型 */
|
||||
@ApiModelProperty(name = "车辆类型", value = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
/** 电子围栏ID */
|
||||
@ApiModelProperty(name = "电子围栏ID", value = "电子围栏ID")
|
||||
private Long fenceId;
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package com.muyu.many.domain.req;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车辆对象 vehicle
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "VehicleSaveReq", description = "车辆")
|
||||
public class VehicleSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车辆id */
|
||||
|
||||
@ApiModelProperty(name = "车辆id", value = "车辆id")
|
||||
private Long id;
|
||||
|
||||
/** 车辆vin */
|
||||
|
||||
@ApiModelProperty(name = "车辆vin", value = "车辆vin")
|
||||
private String vin;
|
||||
|
||||
/** 品牌 */
|
||||
|
||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 型号 */
|
||||
|
||||
@ApiModelProperty(name = "型号", value = "型号")
|
||||
private String model;
|
||||
|
||||
/** 生产日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
||||
@ApiModelProperty(name = "生产日期", value = "生产日期")
|
||||
private Date productionDate;
|
||||
|
||||
/** 车身类型 */
|
||||
|
||||
@ApiModelProperty(name = "车身类型", value = "车身类型")
|
||||
private String bodyType;
|
||||
|
||||
/** 车身颜色 */
|
||||
|
||||
@ApiModelProperty(name = "车身颜色", value = "车身颜色")
|
||||
private String color;
|
||||
|
||||
/** 发动机排量 */
|
||||
|
||||
@ApiModelProperty(name = "发动机排量", value = "发动机排量")
|
||||
private BigDecimal engineCapacity;
|
||||
|
||||
/** 燃油类型 */
|
||||
|
||||
@ApiModelProperty(name = "燃油类型", value = "燃油类型")
|
||||
private String fuelType;
|
||||
|
||||
/** 变速器类型 */
|
||||
|
||||
@ApiModelProperty(name = "变速器类型", value = "变速器类型")
|
||||
private String transmission;
|
||||
|
||||
/** 驱动方式 */
|
||||
|
||||
@ApiModelProperty(name = "驱动方式", value = "驱动方式")
|
||||
private String driveType;
|
||||
|
||||
/** 行驶里程 */
|
||||
|
||||
@ApiModelProperty(name = "行驶里程", value = "行驶里程")
|
||||
private BigDecimal mileage;
|
||||
|
||||
/** 注册日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
||||
@ApiModelProperty(name = "注册日期", value = "注册日期")
|
||||
private Date registrationDate;
|
||||
|
||||
/** 车牌号码 */
|
||||
|
||||
@ApiModelProperty(name = "车牌号码", value = "车牌号码")
|
||||
private String licenseNumber;
|
||||
|
||||
/** 车辆类型 */
|
||||
|
||||
@ApiModelProperty(name = "车辆类型", value = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
/** 电子围栏ID */
|
||||
|
||||
@ApiModelProperty(name = "电子围栏ID", value = "电子围栏ID")
|
||||
private Long fenceId;
|
||||
|
||||
}
|
|
@ -28,5 +28,10 @@
|
|||
<artifactId>muyu-modules-many-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-company-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -23,12 +23,6 @@
|
|||
<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>
|
||||
|
@ -54,35 +48,18 @@
|
|||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.2.20</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
@ -109,18 +86,24 @@
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>4.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.amqp</groupId>
|
||||
<artifactId>spring-rabbit</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules-many-remote</artifactId>
|
||||
<artifactId>muyu-modules-many-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules-many-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,52 +1,59 @@
|
|||
package com.muyu.authentication.controller;
|
||||
|
||||
import com.muyu.authentication.service.IFenceService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.authentication.service.FenceService;
|
||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.many.domain.Fence;
|
||||
import com.muyu.many.domain.req.FenceEditReq;
|
||||
import com.muyu.many.domain.req.FenceQueryReq;
|
||||
import com.muyu.many.domain.req.FenceSaveReq;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏Controller
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Api(tags = "电子围栏")
|
||||
@RestController
|
||||
@RequestMapping("/fence")
|
||||
public class FenceController extends BaseController
|
||||
{
|
||||
public class FenceController extends BaseController {
|
||||
@Autowired
|
||||
private IFenceService fenceService;
|
||||
private FenceService fenceService;
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*/
|
||||
@ApiOperation("获取电子围栏列表")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Fence>> list(Fence fence,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
public Result<TableDataInfo<Fence>> list(FenceQueryReq fenceQueryReq) {
|
||||
startPage();
|
||||
List<Fence> list = fenceService.selectFenceList(fence,headerValue);
|
||||
List<Fence> list = fenceService.list(Fence.queryBuild(fenceQueryReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电子围栏列表
|
||||
*/
|
||||
@ApiOperation("导出电子围栏列表")
|
||||
@Log(title = "电子围栏", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Fence fence,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
List<Fence> list = fenceService.selectFenceList(fence,headerValue);
|
||||
public void export(HttpServletResponse response, Fence fence) {
|
||||
List<Fence> list = fenceService.list(fence);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
ExcelUtil<Fence> util = new ExcelUtil<Fence>(Fence.class);
|
||||
util.exportExcel(response, list, "电子围栏数据");
|
||||
}
|
||||
|
@ -54,10 +61,13 @@ public class FenceController extends BaseController
|
|||
/**
|
||||
* 获取电子围栏详细信息
|
||||
*/
|
||||
@ApiOperation("获取电子围栏详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
return success(fenceService.selectFenceById(id,headerValue));
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<Fence> getInfo(@PathVariable("id") Long id) {
|
||||
Fence byId = fenceService.getById(id);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return Result.success(byId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,19 +75,23 @@ public class FenceController extends BaseController
|
|||
*/
|
||||
@Log(title = "电子围栏", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Fence fence,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
return toAjax(fenceService.insertFence(fence,headerValue));
|
||||
@ApiOperation("新增电子围栏")
|
||||
public Result<String> add(@RequestBody FenceSaveReq fenceSaveReq) {
|
||||
boolean save = fenceService.save(Fence.saveBuild(fenceSaveReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*/
|
||||
@Log(title = "电子围栏", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Fence fence,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
return toAjax(fenceService.updateFence(fence,headerValue));
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改电子围栏")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody FenceEditReq fenceEditReq) {
|
||||
boolean b = fenceService.updateById(Fence.editBuild(id, fenceEditReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,8 +99,11 @@ public class FenceController extends BaseController
|
|||
*/
|
||||
@Log(title = "电子围栏", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids,@RequestHeader("ent_code")String headerValue)
|
||||
{
|
||||
return toAjax(fenceService.deleteFenceByIds(ids,headerValue));
|
||||
@ApiOperation("删除电子围栏")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
boolean b = fenceService.removeBatchByIds(ids);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
package com.muyu.authentication.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.authentication.service.GroupService;
|
||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.many.domain.Group;
|
||||
import com.muyu.many.domain.req.GroupEditReq;
|
||||
import com.muyu.many.domain.req.GroupQueryReq;
|
||||
import com.muyu.many.domain.req.GroupSaveReq;
|
||||
import io.swagger.annotations.*;
|
||||
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.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
|
||||
/**
|
||||
* 围栏组Controller
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Api(tags = "围栏组")
|
||||
@RestController
|
||||
@RequestMapping("/group")
|
||||
public class GroupController extends BaseController {
|
||||
@Autowired
|
||||
private GroupService groupService;
|
||||
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
*/
|
||||
@ApiOperation("获取围栏组列表")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Group>> list(GroupQueryReq groupQueryReq) {
|
||||
startPage();
|
||||
List<Group> list = groupService.list(Group.queryBuild(groupQueryReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出围栏组列表
|
||||
*/
|
||||
@ApiOperation("导出围栏组列表")
|
||||
@Log(title = "围栏组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Group group) {
|
||||
List<Group> list = groupService.list(group);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
ExcelUtil<Group> util = new ExcelUtil<Group>(Group.class);
|
||||
util.exportExcel(response, list, "围栏组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取围栏组详细信息
|
||||
*/
|
||||
@ApiOperation("获取围栏组详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<Group> getInfo(@PathVariable("id") Long id) {
|
||||
Group byId = groupService.getById(id);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return Result.success(byId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增围栏组
|
||||
*/
|
||||
@Log(title = "围栏组", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增围栏组")
|
||||
public Result<String> add(@RequestBody GroupSaveReq groupSaveReq) {
|
||||
boolean save = groupService.save(Group.saveBuild(groupSaveReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改围栏组
|
||||
*/
|
||||
@Log(title = "围栏组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改围栏组")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody GroupEditReq groupEditReq) {
|
||||
boolean b = groupService.updateById(Group.editBuild(id, groupEditReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除围栏组
|
||||
*/
|
||||
@Log(title = "围栏组", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除围栏组")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
boolean b = groupService.removeBatchByIds(ids);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
}
|
|
@ -23,9 +23,9 @@ public class ManyEnterpriseController {
|
|||
private ManyEnterpriseService manyEnterpriseService;
|
||||
|
||||
@PostMapping("/AllList")
|
||||
public Result<List<Enterprise>> AllList(@RequestHeader("ent_code") String headerValue){
|
||||
public Result<List<Enterprise>> AllList(){
|
||||
return Result.success(
|
||||
manyEnterpriseService.AllList(headerValue)
|
||||
manyEnterpriseService.AllList()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,52 +1,67 @@
|
|||
package com.muyu.authentication.controller;
|
||||
|
||||
import com.muyu.authentication.service.IVehicleService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.authentication.service.VehicleService;
|
||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
import com.muyu.many.domain.req.VehicleEditReq;
|
||||
import com.muyu.many.domain.req.VehicleQueryReq;
|
||||
import com.muyu.many.domain.req.VehicleSaveReq;
|
||||
import io.swagger.annotations.*;
|
||||
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.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆Controller
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Api(tags = "车辆")
|
||||
@RestController
|
||||
@RequestMapping("/vehicle")
|
||||
public class VehicleController extends BaseController
|
||||
{
|
||||
public class VehicleController extends BaseController {
|
||||
@Autowired
|
||||
private IVehicleService vehicleService;
|
||||
private VehicleService vehicleService;
|
||||
|
||||
/**
|
||||
* 查询车辆列表
|
||||
*/
|
||||
@ApiOperation("获取车辆列表")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Vehicle>> list(Vehicle vehicle,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
public Result<TableDataInfo<Vehicle>> list(VehicleQueryReq vehicleQueryReq) {
|
||||
startPage();
|
||||
List<Vehicle> list = vehicleService.selectVehicleList(vehicle, entCode);
|
||||
List<Vehicle> list = vehicleService.list(Vehicle.queryBuild(vehicleQueryReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆列表
|
||||
*/
|
||||
@ApiOperation("导出车辆列表")
|
||||
@Log(title = "车辆", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Vehicle vehicle,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
List<Vehicle> list = vehicleService.selectVehicleList(vehicle, entCode);
|
||||
public void export(HttpServletResponse response, Vehicle vehicle) {
|
||||
List<Vehicle> list = vehicleService.list(vehicle);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
ExcelUtil<Vehicle> util = new ExcelUtil<Vehicle>(Vehicle.class);
|
||||
util.exportExcel(response, list, "车辆数据");
|
||||
}
|
||||
|
@ -54,10 +69,13 @@ public class VehicleController extends BaseController
|
|||
/**
|
||||
* 获取车辆详细信息
|
||||
*/
|
||||
@ApiOperation("获取车辆详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
return success(vehicleService.selectVehicleById(id,entCode));
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<Vehicle> getInfo(@PathVariable("id") Long id) {
|
||||
Vehicle byId = vehicleService.getById(id);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return Result.success(byId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,19 +83,23 @@ public class VehicleController extends BaseController
|
|||
*/
|
||||
@Log(title = "车辆", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Vehicle vehicle,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
return toAjax(vehicleService.insertVehicle(vehicle,entCode));
|
||||
@ApiOperation("新增车辆")
|
||||
public Result<String> add(@RequestBody VehicleSaveReq vehicleSaveReq) {
|
||||
boolean save = vehicleService.save(Vehicle.saveBuild(vehicleSaveReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(save);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆
|
||||
*/
|
||||
@Log(title = "车辆", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Vehicle vehicle,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
return toAjax(vehicleService.updateVehicle(vehicle,entCode));
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改车辆")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody VehicleEditReq vehicleEditReq) {
|
||||
boolean b = vehicleService.updateById(Vehicle.editBuild(id, vehicleEditReq));
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,8 +107,11 @@ public class VehicleController extends BaseController
|
|||
*/
|
||||
@Log(title = "车辆", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids,@RequestHeader("ent_code") String entCode)
|
||||
{
|
||||
return toAjax(vehicleService.deleteVehicleByIds(ids,entCode));
|
||||
@ApiOperation("删除车辆")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
boolean b = vehicleService.removeBatchByIds(ids);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return toAjax(b);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,64 +1,15 @@
|
|||
package com.muyu.authentication.mapper;
|
||||
|
||||
|
||||
|
||||
import com.muyu.many.domain.Fence;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.many.domain.Fence;
|
||||
|
||||
/**
|
||||
* 电子围栏Mapper接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface FenceMapper
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
public Fence selectFenceById(Long id);
|
||||
public interface FenceMapper extends BaseMapper<Fence> {
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<Fence> selectFenceList(Fence fence);
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFence(Fence fence);
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFence(Fence fence);
|
||||
|
||||
/**
|
||||
* 删除电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFenceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFenceByIds(Long[] ids);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.authentication.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.many.domain.Group;
|
||||
|
||||
/**
|
||||
* 围栏组Mapper接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface GroupMapper extends BaseMapper<Group> {
|
||||
|
||||
}
|
|
@ -1,64 +1,15 @@
|
|||
package com.muyu.authentication.mapper;
|
||||
|
||||
|
||||
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
|
||||
/**
|
||||
* 车辆Mapper接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface VehicleMapper
|
||||
{
|
||||
/**
|
||||
* 查询车辆
|
||||
*
|
||||
* @param id 车辆主键
|
||||
* @return 车辆
|
||||
*/
|
||||
public Vehicle selectVehicleById(Long id);
|
||||
public interface VehicleMapper extends BaseMapper<Vehicle> {
|
||||
|
||||
/**
|
||||
* 查询车辆列表
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 车辆集合
|
||||
*/
|
||||
public List<Vehicle> selectVehicleList(Vehicle vehicle);
|
||||
|
||||
/**
|
||||
* 新增车辆
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertVehicle(Vehicle vehicle);
|
||||
|
||||
/**
|
||||
* 修改车辆
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateVehicle(Vehicle vehicle);
|
||||
|
||||
/**
|
||||
* 删除车辆
|
||||
*
|
||||
* @param id 车辆主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVehicleById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除车辆
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteVehicleByIds(Long[] ids);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.authentication.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.many.domain.Fence;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface FenceService extends IService<Fence> {
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<Fence> list(Fence fence);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.authentication.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.many.domain.Group;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 围栏组Service接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface GroupService extends IService<Group> {
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
*
|
||||
* @param group 围栏组
|
||||
* @return 围栏组集合
|
||||
*/
|
||||
public List<Group> list(Group group);
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package com.muyu.authentication.service;
|
||||
|
||||
|
||||
|
||||
import com.muyu.many.domain.Fence;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
*/
|
||||
public interface IFenceService
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
public Fence selectFenceById(Long id,String headerValue);
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<Fence> selectFenceList(Fence fence,String headerValue);
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFence(Fence fence,String headerValue);
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFence(Fence fence,String headerValue);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的电子围栏主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFenceByIds(Long[] ids,String headerValue);
|
||||
|
||||
/**
|
||||
* 删除电子围栏信息
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFenceById(Long id,String headerValue);
|
||||
}
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
public interface ManyEnterpriseService extends IService<Enterprise> {
|
||||
List<Enterprise> AllList(String headerValue);
|
||||
List<Enterprise> AllList();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.authentication.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆Service接口
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
public interface VehicleService extends IService<Vehicle> {
|
||||
/**
|
||||
* 查询车辆列表
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 车辆集合
|
||||
*/
|
||||
public List<Vehicle> list(Vehicle vehicle);
|
||||
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package com.muyu.authentication.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.authentication.mapper.FenceMapper;
|
||||
import com.muyu.authentication.service.IFenceService;
|
||||
import com.muyu.authentication.service.FenceService;
|
||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.many.domain.Fence;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -14,28 +17,11 @@ import java.util.List;
|
|||
* 电子围栏Service业务层处理
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class FenceServiceImpl implements IFenceService
|
||||
{
|
||||
@Autowired
|
||||
private FenceMapper fenceMapper;
|
||||
|
||||
/**
|
||||
* 查询电子围栏
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public Fence selectFenceById(Long id,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
Fence fence = fenceMapper.selectFenceById(id);
|
||||
getManyDelete();
|
||||
return fence;
|
||||
}
|
||||
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
|
@ -44,86 +30,44 @@ public class FenceServiceImpl implements IFenceService
|
|||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public List<Fence> selectFenceList(Fence fence,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
List<Fence> fences = fenceMapper.selectFenceList(fence);
|
||||
getManyDelete();
|
||||
return fences;
|
||||
public List<Fence> list(Fence fence) {
|
||||
|
||||
}
|
||||
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFence(Fence fence,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
fence.setCreateTime(DateUtils.getNowDate());
|
||||
int i = fenceMapper.insertFence(fence);
|
||||
getManyDelete();
|
||||
return i;
|
||||
|
||||
}
|
||||
if (ObjUtils.notNull(fence.getFenceName())){
|
||||
queryWrapper.like(Fence::getFenceName, fence.getFenceName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*
|
||||
* @param fence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFence(Fence fence,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
fence.setUpdateTime(DateUtils.getNowDate());
|
||||
int i = fenceMapper.updateFence(fence);
|
||||
getManyDelete();
|
||||
return i;
|
||||
if (ObjUtils.notNull(fence.getGroupId())){
|
||||
queryWrapper.eq(Fence::getGroupId, fence.getGroupId());
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjUtils.notNull(fence.getLongitudeAndLatitude())){
|
||||
queryWrapper.eq(Fence::getLongitudeAndLatitude, fence.getLongitudeAndLatitude());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏
|
||||
*
|
||||
* @param ids 需要删除的电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFenceByIds(Long[] ids,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
int i = fenceMapper.deleteFenceByIds(ids);
|
||||
getManyDelete();
|
||||
return i;
|
||||
if (ObjUtils.notNull(fence.getFenceNote())){
|
||||
queryWrapper.eq(Fence::getFenceNote, fence.getFenceNote());
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjUtils.notNull(fence.getRadius())){
|
||||
queryWrapper.eq(Fence::getRadius, fence.getRadius());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电子围栏信息
|
||||
*
|
||||
* @param id 电子围栏主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFenceById(Long id,String headerValue)
|
||||
{
|
||||
getMany(headerValue);
|
||||
int i = fenceMapper.deleteFenceById(id);
|
||||
getManyDelete();
|
||||
return i;
|
||||
}
|
||||
if (ObjUtils.notNull(fence.getDriveOutIn())){
|
||||
queryWrapper.eq(Fence::getDriveOutIn, fence.getDriveOutIn());
|
||||
}
|
||||
|
||||
public void getMany(String entCode){
|
||||
//切换数据库 切换到从数据库
|
||||
DynamicDataSourceHolder.setDynamicDataSourceKey(entCode);
|
||||
}
|
||||
public void getManyDelete (){
|
||||
//切换数据库 切换到从数据库
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
if (ObjUtils.notNull(fence.getIsDelete())){
|
||||
queryWrapper.eq(Fence::getIsDelete, fence.getIsDelete());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(fence.getFenceState())){
|
||||
queryWrapper.eq(Fence::getFenceState, fence.getFenceState());
|
||||
}
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.authentication.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.authentication.mapper.GroupMapper;
|
||||
import com.muyu.authentication.service.GroupService;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.many.domain.Group;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 围栏组Service业务层处理
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements GroupService {
|
||||
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
*
|
||||
* @param group 围栏组
|
||||
* @return 围栏组
|
||||
*/
|
||||
@Override
|
||||
public List<Group> list(Group group) {
|
||||
LambdaQueryWrapper<Group> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(group.getGroupName())){
|
||||
queryWrapper.like(Group::getGroupName, group.getGroupName());
|
||||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -27,9 +27,8 @@ public class ManyEnterpriseServiceImpl extends ServiceImpl<ManyEnterpriseMapper,
|
|||
private ManyEnterpriseMapper manyEnterpriseMapper;
|
||||
|
||||
@Override
|
||||
public List<Enterprise> AllList(String headerValue) {
|
||||
//切换数据库 切换到从数据库
|
||||
DynamicDataSourceHolder.setDynamicDataSourceKey(headerValue);
|
||||
public List<Enterprise> AllList() {
|
||||
|
||||
List<Enterprise> enterprises = manyEnterpriseMapper.selectList(null);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return enterprises;
|
||||
|
|
|
@ -1,127 +1,101 @@
|
|||
package com.muyu.authentication.service.impl;
|
||||
|
||||
import com.muyu.authentication.mapper.VehicleMapper;
|
||||
import com.muyu.authentication.service.IVehicleService;
|
||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.authentication.mapper.VehicleMapper;
|
||||
import com.muyu.authentication.service.VehicleService;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.many.domain.Vehicle;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
/**
|
||||
* 车辆Service业务层处理
|
||||
*
|
||||
* @author wan
|
||||
* @date 2024-05-31
|
||||
* @date 2024-06-17
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class VehicleServiceImpl implements IVehicleService
|
||||
{
|
||||
@Autowired
|
||||
private VehicleMapper vehicleMapper;
|
||||
|
||||
/**
|
||||
* 查询车辆
|
||||
*
|
||||
* @param id 车辆主键
|
||||
* @return 车辆
|
||||
*/
|
||||
@Override
|
||||
public Vehicle selectVehicleById(Long id, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
Vehicle vehicle = vehicleMapper.selectVehicleById(id);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return vehicle;
|
||||
}
|
||||
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements VehicleService {
|
||||
|
||||
/**
|
||||
* 查询车辆列表
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @param entCode
|
||||
* @return 车辆
|
||||
*/
|
||||
@Override
|
||||
public List<Vehicle> selectVehicleList(Vehicle vehicle, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
List<Vehicle> vehicles = vehicleMapper.selectVehicleList(vehicle);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return vehicles;
|
||||
}
|
||||
public List<Vehicle> list(Vehicle vehicle) {
|
||||
LambdaQueryWrapper<Vehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
/**
|
||||
* 新增车辆
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertVehicle(Vehicle vehicle, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
vehicle.setCreateTime(DateUtils.getNowDate());
|
||||
String userKey = UUID.randomUUID().toString();
|
||||
vehicle.setVin(userKey);
|
||||
int i = vehicleMapper.insertVehicle(vehicle);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆
|
||||
*
|
||||
* @param vehicle 车辆
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateVehicle(Vehicle vehicle, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
vehicle.setUpdateTime(DateUtils.getNowDate());
|
||||
int i = vehicleMapper.updateVehicle(vehicle);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return i;
|
||||
}
|
||||
if (ObjUtils.notNull(vehicle.getVin())){
|
||||
queryWrapper.eq(Vehicle::getVin, vehicle.getVin());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车辆
|
||||
*
|
||||
* @param ids 需要删除的车辆主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVehicleByIds(Long[] ids, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
int i = vehicleMapper.deleteVehicleByIds(ids);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return i;
|
||||
if (ObjUtils.notNull(vehicle.getBrand())){
|
||||
queryWrapper.eq(Vehicle::getBrand, vehicle.getBrand());
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjUtils.notNull(vehicle.getModel())){
|
||||
queryWrapper.eq(Vehicle::getModel, vehicle.getModel());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆信息
|
||||
*
|
||||
* @param id 车辆主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteVehicleById(Long id, String entCode)
|
||||
{
|
||||
getMany(entCode);
|
||||
int i = vehicleMapper.deleteVehicleById(id);
|
||||
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||
return i;
|
||||
if (ObjUtils.notNull(vehicle.getProductionDate())){
|
||||
queryWrapper.eq(Vehicle::getProductionDate, vehicle.getProductionDate());
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjUtils.notNull(vehicle.getBodyType())){
|
||||
queryWrapper.eq(Vehicle::getBodyType, vehicle.getBodyType());
|
||||
}
|
||||
|
||||
public void getMany(String entCode){
|
||||
//切换数据库 切换到从数据库
|
||||
DynamicDataSourceHolder.setDynamicDataSourceKey(entCode);
|
||||
if (ObjUtils.notNull(vehicle.getColor())){
|
||||
queryWrapper.eq(Vehicle::getColor, vehicle.getColor());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getEngineCapacity())){
|
||||
queryWrapper.eq(Vehicle::getEngineCapacity, vehicle.getEngineCapacity());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getFuelType())){
|
||||
queryWrapper.eq(Vehicle::getFuelType, vehicle.getFuelType());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getTransmission())){
|
||||
queryWrapper.eq(Vehicle::getTransmission, vehicle.getTransmission());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getDriveType())){
|
||||
queryWrapper.eq(Vehicle::getDriveType, vehicle.getDriveType());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getMileage())){
|
||||
queryWrapper.eq(Vehicle::getMileage, vehicle.getMileage());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getRegistrationDate())){
|
||||
queryWrapper.eq(Vehicle::getRegistrationDate, vehicle.getRegistrationDate());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getLicenseNumber())){
|
||||
queryWrapper.eq(Vehicle::getLicenseNumber, vehicle.getLicenseNumber());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getVehicleType())){
|
||||
queryWrapper.eq(Vehicle::getVehicleType, vehicle.getVehicleType());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(vehicle.getFenceId())){
|
||||
queryWrapper.eq(Vehicle::getFenceId, vehicle.getFenceId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,18 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.authentication.mapper.FenceMapper">
|
||||
<mapper namespace="com.muyu.fence.mapper.FenceMapper">
|
||||
|
||||
<resultMap type="com.muyu.many.domain.Fence" id="FenceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="fenceType" column="fence_type" />
|
||||
<result property="fenceName" column="fence_name" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="longitudeAndLatitude" column="longitude_and_latitude" />
|
||||
<result property="fenceNote" column="fence_note" />
|
||||
<result property="radius" column="radius" />
|
||||
<result property="driveOutIn" column="drive_out_in" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="fenceState" column="fence_state" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -17,70 +22,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectFenceVo">
|
||||
select id, name, fence_type, longitude_and_latitude, create_by, create_time, update_by, update_time, remark from fence
|
||||
select id, fence_name, group_id, longitude_and_latitude, fence_note, radius, drive_out_in, is_delete, fence_state, create_by, create_time, update_by, update_time, remark from fence
|
||||
</sql>
|
||||
|
||||
<select id="selectFenceList" parameterType="com.muyu.many.domain.Fence" resultMap="FenceResult">
|
||||
<include refid="selectFenceVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="fenceType != null and fenceType != ''"> and fence_type = #{fenceType}</if>
|
||||
<if test="longitudeAndLatitude != null and longitudeAndLatitude != ''"> and longitude_and_latitude = #{longitudeAndLatitude}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFenceById" parameterType="Long" resultMap="FenceResult">
|
||||
<include refid="selectFenceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFence" parameterType="com.muyu.many.domain.Fence" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fence
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="fenceType != null">fence_type,</if>
|
||||
<if test="longitudeAndLatitude != null">longitude_and_latitude,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="fenceType != null">#{fenceType},</if>
|
||||
<if test="longitudeAndLatitude != null">#{longitudeAndLatitude},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFence" parameterType="com.muyu.many.domain.Fence">
|
||||
update fence
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="fenceType != null">fence_type = #{fenceType},</if>
|
||||
<if test="longitudeAndLatitude != null">longitude_and_latitude = #{longitudeAndLatitude},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFenceById" parameterType="Long">
|
||||
delete from fence where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFenceByIds" parameterType="String">
|
||||
delete from fence where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<?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.group.mapper.GroupMapper">
|
||||
|
||||
<resultMap type="com.muyu.many.domain.Group" id="GroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGroupVo">
|
||||
select id, group_name, create_by, create_time, update_by, update_time, remark from `group`
|
||||
</sql>
|
||||
</mapper>
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.authentication.mapper.VehicleMapper">
|
||||
<mapper namespace="com.muyu.vehicle.mapper.VehicleMapper">
|
||||
|
||||
<resultMap type="com.muyu.many.domain.Vehicle" id="VehicleResult">
|
||||
<result property="id" column="id" />
|
||||
|
@ -19,8 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="mileage" column="mileage" />
|
||||
<result property="registrationDate" column="registration_date" />
|
||||
<result property="licenseNumber" column="license_number" />
|
||||
<result property="holder" column="holder" />
|
||||
<result property="vehicleType" column="vehicle_type" />
|
||||
<result property="fenceId" column="fence_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -29,118 +29,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectVehicleVo">
|
||||
select id, vin, brand, model, production_date, body_type, color, engine_capacity, fuel_type, transmission, drive_type, mileage, registration_date, license_number, holder, vehicle_type, create_by, create_time, update_by, update_time, remark from vehicle
|
||||
select id, vin, brand, model, production_date, body_type, color, engine_capacity, fuel_type, transmission, drive_type, mileage, registration_date, license_number, vehicle_type, fence_id, create_by, create_time, update_by, update_time, remark from vehicle
|
||||
</sql>
|
||||
|
||||
<select id="selectVehicleList" parameterType="com.muyu.many.domain.Vehicle" resultMap="VehicleResult">
|
||||
<include refid="selectVehicleVo"/>
|
||||
<where>
|
||||
<if test="vin != null and vin != ''"> and vin = #{vin}</if>
|
||||
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
|
||||
<if test="model != null and model != ''"> and model = #{model}</if>
|
||||
<if test="productionDate != null "> and production_date = #{productionDate}</if>
|
||||
<if test="bodyType != null and bodyType != ''"> and body_type = #{bodyType}</if>
|
||||
<if test="color != null and color != ''"> and color = #{color}</if>
|
||||
<if test="engineCapacity != null "> and engine_capacity = #{engineCapacity}</if>
|
||||
<if test="fuelType != null and fuelType != ''"> and fuel_type = #{fuelType}</if>
|
||||
<if test="transmission != null and transmission != ''"> and transmission = #{transmission}</if>
|
||||
<if test="driveType != null and driveType != ''"> and drive_type = #{driveType}</if>
|
||||
<if test="mileage != null "> and mileage = #{mileage}</if>
|
||||
<if test="registrationDate != null "> and registration_date = #{registrationDate}</if>
|
||||
<if test="licenseNumber != null and licenseNumber != ''"> and license_number = #{licenseNumber}</if>
|
||||
<if test="holder != null and holder != ''"> and holder = #{holder}</if>
|
||||
<if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVehicleById" parameterType="Long" resultMap="VehicleResult">
|
||||
<include refid="selectVehicleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertVehicle" parameterType="com.muyu.many.domain.Vehicle" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into vehicle
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="vin != null">vin,</if>
|
||||
<if test="brand != null">brand,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="bodyType != null">body_type,</if>
|
||||
<if test="color != null">color,</if>
|
||||
<if test="engineCapacity != null">engine_capacity,</if>
|
||||
<if test="fuelType != null">fuel_type,</if>
|
||||
<if test="transmission != null">transmission,</if>
|
||||
<if test="driveType != null">drive_type,</if>
|
||||
<if test="mileage != null">mileage,</if>
|
||||
<if test="registrationDate != null">registration_date,</if>
|
||||
<if test="licenseNumber != null">license_number,</if>
|
||||
<if test="holder != null">holder,</if>
|
||||
<if test="vehicleType != null">vehicle_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="vin != null">#{vin},</if>
|
||||
<if test="brand != null">#{brand},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="bodyType != null">#{bodyType},</if>
|
||||
<if test="color != null">#{color},</if>
|
||||
<if test="engineCapacity != null">#{engineCapacity},</if>
|
||||
<if test="fuelType != null">#{fuelType},</if>
|
||||
<if test="transmission != null">#{transmission},</if>
|
||||
<if test="driveType != null">#{driveType},</if>
|
||||
<if test="mileage != null">#{mileage},</if>
|
||||
<if test="registrationDate != null">#{registrationDate},</if>
|
||||
<if test="licenseNumber != null">#{licenseNumber},</if>
|
||||
<if test="holder != null">#{holder},</if>
|
||||
<if test="vehicleType != null">#{vehicleType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateVehicle" parameterType="com.muyu.many.domain.Vehicle">
|
||||
update vehicle
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="vin != null">vin = #{vin},</if>
|
||||
<if test="brand != null">brand = #{brand},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="bodyType != null">body_type = #{bodyType},</if>
|
||||
<if test="color != null">color = #{color},</if>
|
||||
<if test="engineCapacity != null">engine_capacity = #{engineCapacity},</if>
|
||||
<if test="fuelType != null">fuel_type = #{fuelType},</if>
|
||||
<if test="transmission != null">transmission = #{transmission},</if>
|
||||
<if test="driveType != null">drive_type = #{driveType},</if>
|
||||
<if test="mileage != null">mileage = #{mileage},</if>
|
||||
<if test="registrationDate != null">registration_date = #{registrationDate},</if>
|
||||
<if test="licenseNumber != null">license_number = #{licenseNumber},</if>
|
||||
<if test="holder != null">holder = #{holder},</if>
|
||||
<if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteVehicleById" parameterType="Long">
|
||||
delete from vehicle where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteVehicleByIds" parameterType="String">
|
||||
delete from vehicle where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue