parent
5505c3c45f
commit
02f71d7baf
|
@ -0,0 +1,43 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Break
|
||||||
|
* @Description 故障实体类
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Break {
|
||||||
|
/**
|
||||||
|
* 故障id
|
||||||
|
**/
|
||||||
|
private Integer breakId;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
**/
|
||||||
|
private String breakCode;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
**/
|
||||||
|
private String breakVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
**/
|
||||||
|
private Date breakDate;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
**/
|
||||||
|
private Date breakTime;
|
||||||
|
/**
|
||||||
|
* 故障类型
|
||||||
|
**/
|
||||||
|
private String breakType;
|
||||||
|
/**
|
||||||
|
* 故障状态 是否警告
|
||||||
|
**/
|
||||||
|
private Integer breakState;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLog
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 15:07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BreakLog {
|
||||||
|
|
||||||
|
/** 故障日志id */
|
||||||
|
private Integer breakLogId;
|
||||||
|
/** 故障码 */
|
||||||
|
private String breakCode;
|
||||||
|
/** 车辆VIN */
|
||||||
|
private String breakVin;
|
||||||
|
/** 故障类型 */
|
||||||
|
private String breakType;
|
||||||
|
/** 结束报警时间 */
|
||||||
|
private String breakTime;
|
||||||
|
/** 开始报警时间 */
|
||||||
|
private String breakDate;
|
||||||
|
/** 是否报警 */
|
||||||
|
private String breakState;
|
||||||
|
}
|
|
@ -0,0 +1,113 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障对象 business_break
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BusinessBreak extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long breakId;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@Excel(name = "故障码")
|
||||||
|
private String breakCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String breakVin;
|
||||||
|
|
||||||
|
/** 结束报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结束报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date breakTime;
|
||||||
|
|
||||||
|
/** 故障类型 */
|
||||||
|
@Excel(name = "故障类型")
|
||||||
|
private String breakType;
|
||||||
|
|
||||||
|
/** 开始报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "开始报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date breakDate;
|
||||||
|
|
||||||
|
/** 是否警告 */
|
||||||
|
@Excel(name = "是否警告")
|
||||||
|
private String breakState;
|
||||||
|
|
||||||
|
public void setBreakId(Long breakId)
|
||||||
|
{
|
||||||
|
this.breakId = breakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBreakId()
|
||||||
|
{
|
||||||
|
return breakId;
|
||||||
|
}
|
||||||
|
public void setBreakCode(String breakCode)
|
||||||
|
{
|
||||||
|
this.breakCode = breakCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakCode()
|
||||||
|
{
|
||||||
|
return breakCode;
|
||||||
|
}
|
||||||
|
public void setBreakVin(String breakVin)
|
||||||
|
{
|
||||||
|
this.breakVin = breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakVin()
|
||||||
|
{
|
||||||
|
return breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setBreakType(String breakType)
|
||||||
|
{
|
||||||
|
this.breakType = breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakType()
|
||||||
|
{
|
||||||
|
return breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBreakState(String breakState)
|
||||||
|
{
|
||||||
|
this.breakState = breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakState()
|
||||||
|
{
|
||||||
|
return breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("breakId", getBreakId())
|
||||||
|
.append("breakCode", getBreakCode())
|
||||||
|
.append("breakVin", getBreakVin())
|
||||||
|
.append("breakTime", getBreakTime())
|
||||||
|
.append("breakType", getBreakType())
|
||||||
|
.append("breakDate", getBreakDate())
|
||||||
|
.append("breakState", getBreakState())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.zhilian.business.remote;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.remote.factory.RemoteBreakFallbackFactory;
|
||||||
|
import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import lombok.extern.java.Log;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteBreakService", value = ServiceNameConstants.BUSINESS_SERVICE, fallbackFactory = RemoteBreakFallbackFactory.class)
|
||||||
|
public interface RemoteBreakService {
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public Result add(@RequestBody BusinessBreak businessBreak);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.common.business.remote;
|
package com.zhilian.business.remote;
|
||||||
|
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.common.business.remote.factory.RemoteVehicleFallbackFactory;
|
import com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory;
|
||||||
import com.zhilian.common.core.constant.ServiceNameConstants;
|
import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.zhilian.business.remote.factory;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.remote.RemoteBreakService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class RemoteBreakFallbackFactory implements FallbackFactory<RemoteBreakService> {
|
||||||
|
@Override
|
||||||
|
public RemoteBreakService create(Throwable cause) {
|
||||||
|
return new RemoteBreakService() {
|
||||||
|
@Override
|
||||||
|
public Result add(BusinessBreak businessBreak) {
|
||||||
|
log.error("故障日志服务调用失败");
|
||||||
|
return Result.error("故障日志服务调用失败");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
package com.zhilian.common.business.remote.factory;
|
package com.zhilian.business.remote.factory;
|
||||||
|
|
||||||
|
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.common.business.remote.RemoteVehicleService;
|
import com.zhilian.business.remote.RemoteVehicleService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
|
@ -1,64 +0,0 @@
|
||||||
package com.zhilian.common.business.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.zhilian.common.core.annotation.Excel;
|
|
||||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Fence
|
|
||||||
* @Description 电子围栏实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:28 2024/4/8
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("business_fence")
|
|
||||||
public class Fence extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**
|
|
||||||
* 电子围栏编号
|
|
||||||
*/
|
|
||||||
@Excel(name = "参数主键", cellType = Excel.ColumnType.NUMERIC)
|
|
||||||
@TableId(value = "fence_id", type = IdType.AUTO)
|
|
||||||
private Long fenceId;
|
|
||||||
/**
|
|
||||||
* 电子围栏名称
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏名称")
|
|
||||||
@TableField("fence_name")
|
|
||||||
private String fenceName;
|
|
||||||
/**
|
|
||||||
* 电子围栏类型编号
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏类型编号")
|
|
||||||
@TableField("fence_type_id")
|
|
||||||
private Long fenceTypeId;
|
|
||||||
/**
|
|
||||||
* 电子围栏状态
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏状态")
|
|
||||||
@TableField("fence_state")
|
|
||||||
private Long fenceState;
|
|
||||||
/**
|
|
||||||
* 电子围栏经纬度信息
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏经纬度信息")
|
|
||||||
@TableField("fence_message")
|
|
||||||
private String fenceMessage;
|
|
||||||
@TableField(exist = false)
|
|
||||||
List<Markers> markersList;
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.zhilian.common.business.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.zhilian.common.core.annotation.Excel;
|
|
||||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
/**
|
|
||||||
* @ClassName Markers
|
|
||||||
* @Description 车辆标识实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:29 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("business_markers")
|
|
||||||
public class Markers extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆标识编号
|
|
||||||
*/
|
|
||||||
@TableId(value = "markers_id", type = IdType.AUTO)
|
|
||||||
private Long markersId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆标识名称
|
|
||||||
*/
|
|
||||||
@TableField("markers_name")
|
|
||||||
private String markersName;
|
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
List<Long> fenceIds;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
package com.zhilian.common.business.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.zhilian.common.core.annotation.Excel;
|
|
||||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Vehicle
|
|
||||||
* @Description 车辆信息实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:27 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("business_vehicle")
|
|
||||||
public class Vehicle extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆ID
|
|
||||||
*/
|
|
||||||
@Excel(name = "车辆ID",cellType = Excel.ColumnType.NUMERIC)
|
|
||||||
@TableId(value = "vehicle_id",type = IdType.AUTO)
|
|
||||||
private Long vehicleId;
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
@TableField("vehicle_vin")
|
|
||||||
private String vehicleVIN;
|
|
||||||
/**
|
|
||||||
* 车辆类型编号
|
|
||||||
*/
|
|
||||||
private Long vehicleTypeId;
|
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Long vehicleTypeName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机厂商
|
|
||||||
*/
|
|
||||||
private String vehicleMotor;
|
|
||||||
/**
|
|
||||||
* 电池厂商
|
|
||||||
*/
|
|
||||||
private String vehicleBattery;
|
|
||||||
/**
|
|
||||||
* 电机ID
|
|
||||||
*/
|
|
||||||
private String motorId;
|
|
||||||
/**
|
|
||||||
* 电池ID
|
|
||||||
*/
|
|
||||||
private String batteryId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆状态
|
|
||||||
*/
|
|
||||||
private Long vehicleState;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<Long> markersIds;
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.zhilian.common.business.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.zhilian.common.core.annotation.Excel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
/**
|
|
||||||
* @ClassName VehicleType
|
|
||||||
* @Description 车辆类型实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:30 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ToString
|
|
||||||
@TableName(value = "business_vehicle_type")
|
|
||||||
public class VehicleType {
|
|
||||||
|
|
||||||
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
|
|
||||||
@Excel(name = "车型ID")
|
|
||||||
private Long vehicleTypeId;
|
|
||||||
|
|
||||||
@Excel(name = "车型名称")
|
|
||||||
@TableField(value = "vehicle_type_name")
|
|
||||||
private String vehicleTypeName;
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
package com.zhilian.common.business.domain.middle;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
/**
|
|
||||||
* @ClassName MarkersFence
|
|
||||||
* @Description 车辆标识与电子围栏中间表
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:30 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@TableName("business_markers_fence")
|
|
||||||
public class MarkersFence {
|
|
||||||
/**
|
|
||||||
* 车辆标识编号
|
|
||||||
*/
|
|
||||||
@TableId(value = "markers_id",type = IdType.INPUT)
|
|
||||||
private Long markerId;
|
|
||||||
/**
|
|
||||||
* 电子围栏编号
|
|
||||||
*/
|
|
||||||
@TableField(value = "fence_id",insertStrategy = FieldStrategy.IGNORED)
|
|
||||||
private Long fenceId;
|
|
||||||
|
|
||||||
public Long getMarkerId() {
|
|
||||||
return markerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMarkerId(Long markerId) {
|
|
||||||
this.markerId = markerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getFenceId() {
|
|
||||||
return fenceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFenceId(Long fenceId) {
|
|
||||||
this.fenceId = fenceId;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
package com.zhilian.common.business.domain.middle;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
/**
|
|
||||||
* @ClassName VehicleMarkers
|
|
||||||
* @Description 车辆管理与车辆标识 中间表
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:27 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@TableName("business_vehicle_markers")
|
|
||||||
public class VehicleMarkers {
|
|
||||||
/**
|
|
||||||
* 车辆编号
|
|
||||||
*/
|
|
||||||
@TableId(value = "vehicle_id",type = IdType.INPUT)
|
|
||||||
private Long vehicleId;
|
|
||||||
/**
|
|
||||||
* 车辆标识编号
|
|
||||||
*/
|
|
||||||
@TableField(value = "markers_id",insertStrategy = FieldStrategy.IGNORED)
|
|
||||||
private Long markersId;
|
|
||||||
|
|
||||||
public Long getVehicleId() {
|
|
||||||
return vehicleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVehicleId(Long vehicleId) {
|
|
||||||
this.vehicleId = vehicleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getMarkersId() {
|
|
||||||
return markersId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMarkersId(Long markersId) {
|
|
||||||
this.markersId = markersId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
|
|
||||||
package com.zhilian.common.business.domain.vo;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
/**
|
|
||||||
* @ClassName FenceVo
|
|
||||||
* @Description 电子围栏查询信息实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:27 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@ToString
|
|
||||||
public class FenceVo {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏名称
|
|
||||||
*/
|
|
||||||
private String fenceName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏类型
|
|
||||||
*/
|
|
||||||
private Long fenceTypeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏状态
|
|
||||||
*/
|
|
||||||
private Long fenceState;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package com.zhilian.common.business.domain.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
/**
|
|
||||||
* @ClassName VehicleVo
|
|
||||||
* @Description 车辆管理查询信息实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:28 2024/4/8
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class VehicleVo {
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String vehicleVIN;
|
|
||||||
/**
|
|
||||||
* 车辆类型编号
|
|
||||||
*/
|
|
||||||
private Long vehicleTypeId;
|
|
||||||
/**
|
|
||||||
* 电子围栏编号
|
|
||||||
*/
|
|
||||||
private Long fenceId;
|
|
||||||
/**
|
|
||||||
* 电机厂商
|
|
||||||
*/
|
|
||||||
private String motorBusiness;
|
|
||||||
/**
|
|
||||||
* 电池厂商
|
|
||||||
*/
|
|
||||||
private String batteryBusiness;
|
|
||||||
/**
|
|
||||||
* 电机ID
|
|
||||||
*/
|
|
||||||
private String motorID;
|
|
||||||
/**
|
|
||||||
* 电池ID
|
|
||||||
*/
|
|
||||||
private String batteryID;
|
|
||||||
}
|
|
|
@ -1 +1,3 @@
|
||||||
com.zhilian.common.business.remote.factory.RemoteVehicleFallbackFactory
|
com.zhilian.business.remote.factory.RemoteBreakFallbackFactory
|
||||||
|
com.zhilian.business.remote.factory.RemoteFenceFallbackFactory
|
||||||
|
com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory
|
||||||
|
|
|
@ -20,6 +20,11 @@ public class ServiceNameConstants {
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "zhilian-file";
|
public static final String FILE_SERVICE = "zhilian-file";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务服务的serviceid
|
||||||
|
*/
|
||||||
|
public static final String BUSINESS_SERVICE = "zhilian-business";
|
||||||
/**
|
/**
|
||||||
* 车辆服务的serviceid
|
* 车辆服务的serviceid
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
import com.zhilian.common.business.domain.Fence;
|
|
||||||
import com.zhilian.business.service.FenceService;
|
import com.zhilian.business.service.FenceService;
|
||||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||||
import com.zhilian.common.security.utils.SecurityUtils;
|
import com.zhilian.common.security.utils.SecurityUtils;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
import com.zhilian.common.business.domain.middle.MarkersFence;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
import com.zhilian.business.service.MarkersFenceService;
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
import com.zhilian.business.service.MarkersService;
|
import com.zhilian.business.service.MarkersService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
import com.zhilian.common.business.domain.middle.MarkersFence;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
import com.zhilian.business.service.MarkersFenceService;
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.common.business.domain.middle.VehicleMarkers;
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
import com.zhilian.business.service.MarkersService;
|
import com.zhilian.business.service.MarkersService;
|
||||||
import com.zhilian.business.service.VehicleMarkersService;
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
import com.zhilian.business.service.VehicleService;
|
import com.zhilian.business.service.VehicleService;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
import com.zhilian.common.business.domain.middle.VehicleMarkers;
|
|
||||||
import com.zhilian.business.service.VehicleMarkersService;
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
import com.zhilian.business.domain.VehicleType;
|
||||||
import com.zhilian.common.business.domain.VehicleType;
|
|
||||||
import com.zhilian.business.service.VehicleTypeService;
|
import com.zhilian.business.service.VehicleTypeService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.middle.MarkersFence;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.middle.VehicleMarkers;
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.common.business.domain.VehicleType;
|
import com.zhilian.business.domain.VehicleType;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
import com.zhilian.common.business.domain.middle.MarkersFence;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
|
||||||
public interface MarkersFenceService extends IService<MarkersFence> {
|
public interface MarkersFenceService extends IService<MarkersFence> {
|
||||||
boolean insert(Markers markers);
|
boolean insert(Markers markers);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.common.business.domain.middle.VehicleMarkers;
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhilian.common.business.domain.VehicleType;
|
import com.zhilian.business.domain.VehicleType;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.business.mapper.FenceMapper;
|
import com.zhilian.business.mapper.FenceMapper;
|
||||||
import com.zhilian.business.service.FenceService;
|
import com.zhilian.business.service.FenceService;
|
||||||
import com.zhilian.common.core.utils.StringUtils;
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package com.zhilian.business.service.impl;
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
import com.zhilian.common.business.domain.middle.MarkersFence;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
import com.zhilian.business.mapper.MarkersFenceMapper;
|
import com.zhilian.business.mapper.MarkersFenceMapper;
|
||||||
import com.zhilian.business.service.MarkersFenceService;
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.Markers;
|
import com.zhilian.business.domain.Markers;
|
||||||
import com.zhilian.business.mapper.MarkersMapper;
|
import com.zhilian.business.mapper.MarkersMapper;
|
||||||
import com.zhilian.business.service.MarkersService;
|
import com.zhilian.business.service.MarkersService;
|
||||||
import com.zhilian.common.core.utils.StringUtils;
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package com.zhilian.business.service.impl;
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.common.business.domain.middle.VehicleMarkers;
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
import com.zhilian.business.mapper.VehicleMarkersMapper;
|
import com.zhilian.business.mapper.VehicleMarkersMapper;
|
||||||
import com.zhilian.business.service.VehicleMarkersService;
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.Vehicle;
|
import com.zhilian.business.domain.Vehicle;
|
||||||
import com.zhilian.business.mapper.VehicleMapper;
|
import com.zhilian.business.mapper.VehicleMapper;
|
||||||
import com.zhilian.business.service.VehicleService;
|
import com.zhilian.business.service.VehicleService;
|
||||||
import com.zhilian.common.core.utils.StringUtils;
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.zhilian.business.service.impl;
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhilian.common.business.domain.VehicleType;
|
import com.zhilian.business.domain.VehicleType;
|
||||||
import com.zhilian.business.mapper.VehicleTypeMapper;
|
import com.zhilian.business.mapper.VehicleTypeMapper;
|
||||||
import com.zhilian.business.service.VehicleTypeService;
|
import com.zhilian.business.service.VehicleTypeService;
|
||||||
import com.zhilian.common.redis.service.RedisService;
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
<artifactId>spring-kafka</artifactId>
|
<artifactId>spring-kafka</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,9 +19,12 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients(basePackages = {"com.zhilian.business.remote","com.zhilian.common.system.remote"})
|
||||||
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
//com.zhilian.business.remote.factory.RemoteBreakFallbackFactory
|
||||||
|
//com.zhilian.business.remote.factory.RemoteFenceFallbackFactory
|
||||||
|
//com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory
|
||||||
public class ZhiLianResolverApplication {
|
public class ZhiLianResolverApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(ZhiLianResolverApplication.class,args);
|
SpringApplication.run(ZhiLianResolverApplication.class,args);
|
||||||
|
|
|
@ -1,97 +1,97 @@
|
||||||
package com.zhilian.resolver.model;
|
//package com.zhilian.resolver.model;
|
||||||
import com.zhilian.common.core.utils.SpringUtils;
|
//import com.zhilian.common.core.utils.SpringUtils;
|
||||||
import com.zhilian.common.redis.service.RedisService;
|
//import com.zhilian.common.redis.service.RedisService;
|
||||||
import com.zhilian.common.resolver.domain.ResolverReportData;
|
//import com.zhilian.common.resolver.domain.ResolverReportData;
|
||||||
import com.zhilian.resolver.service.ResolverEventService;
|
//import com.zhilian.resolver.service.ResolverEventService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.kafka.clients.consumer.ConsumerConfig;
|
//import org.apache.kafka.clients.consumer.ConsumerConfig;
|
||||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
//import org.apache.kafka.clients.consumer.ConsumerRecords;
|
||||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
//import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
//import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
import javax.annotation.PostConstruct;
|
//import javax.annotation.PostConstruct;
|
||||||
import java.time.Duration;
|
//import java.time.Duration;
|
||||||
import java.util.*;
|
//import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
//import java.util.stream.Collectors;
|
||||||
|
//
|
||||||
import static com.zhilian.resolver.utils.ConvertUtils.hexStringToString;
|
//import static com.zhilian.resolver.utils.ConvertUtils.hexStringToString;
|
||||||
import static com.zhilian.resolver.utils.ConvertUtils.parseVehicleData;
|
//import static com.zhilian.resolver.utils.ConvertUtils.parseVehicleData;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @ClassName ModelsKafkaMessage
|
// * @ClassName ModelsKafkaMessage
|
||||||
* @Description 描述
|
// * @Description 描述
|
||||||
* @Author Can.J
|
// * @Author Can.J
|
||||||
* @Date 2024/4/8
|
// * @Date 2024/4/8
|
||||||
*/
|
// */
|
||||||
@Component
|
//@Component
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
public class ModelsKafkaMessage {
|
//public class ModelsKafkaMessage {
|
||||||
@Autowired
|
// @Autowired
|
||||||
private RedisService redisService;
|
// private RedisService redisService;
|
||||||
private static final String TOPIC_NAME = "vehicle-topic";
|
// private static final String TOPIC_NAME = "vehicle-topic";
|
||||||
private static final String BOOTSTRAP_SERVERS = "10.10.25.5:9092";
|
// private static final String BOOTSTRAP_SERVERS = "10.10.25.5:9092";
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 消费者配置
|
// * 消费者配置
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@PostConstruct
|
// @PostConstruct
|
||||||
private void consumerMessages() {
|
// private void consumerMessages() {
|
||||||
Thread kafkaConsumerThread = new Thread(() -> {
|
// Thread kafkaConsumerThread = new Thread(() -> {
|
||||||
log.info("启动线程");
|
// log.info("启动线程");
|
||||||
Properties props = new Properties();
|
// Properties props = new Properties();
|
||||||
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS);
|
// props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS);
|
||||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group");
|
// props.put(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group");
|
||||||
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
// props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
||||||
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
// props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
||||||
|
//
|
||||||
//创建消费者
|
// //创建消费者
|
||||||
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
|
// KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
|
//
|
||||||
//订阅主题
|
// //订阅主题
|
||||||
consumer.subscribe(Collections.singletonList(TOPIC_NAME));
|
// consumer.subscribe(Collections.singletonList(TOPIC_NAME));
|
||||||
|
//
|
||||||
//持续消费消息
|
// //持续消费消息
|
||||||
while (true) {
|
// while (true) {
|
||||||
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));
|
// ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));
|
||||||
records.forEach(record -> {
|
// records.forEach(record -> {
|
||||||
System.out.println("接收到的数据:" + record.value());
|
// System.out.println("接收到的数据:" + record.value());
|
||||||
String str = hexStringToString(record.value());
|
// String str = hexStringToString(record.value());
|
||||||
List<ResolverReportData> resolverReportDataList = parseVehicleData(str);
|
// List<ResolverReportData> resolverReportDataList = parseVehicleData(str);
|
||||||
for (ResolverReportData vehicleData : resolverReportDataList) {
|
// for (ResolverReportData vehicleData : resolverReportDataList) {
|
||||||
log.info("解析到车辆数据:{}", vehicleData);
|
// log.info("解析到车辆数据:{}", vehicleData);
|
||||||
|
//
|
||||||
//获取vin
|
// //获取vin
|
||||||
String vin = vehicleData.getVin();
|
// String vin = vehicleData.getVin();
|
||||||
//获取事件集
|
// //获取事件集
|
||||||
Set<Object> cacheSet = redisService.getCacheSet("vehicle-event:" + vin);
|
// Set<Object> cacheSet = redisService.getCacheSet("vehicle-event:" + vin);
|
||||||
List<String> events = cacheSet.stream().map(item -> {
|
// List<String> events = cacheSet.stream().map(item -> {
|
||||||
return String.valueOf(item);
|
// return String.valueOf(item);
|
||||||
}).collect(Collectors.toList());
|
// }).collect(Collectors.toList());
|
||||||
log.info("事件集合:{}",events);
|
// log.info("事件集合:{}",events);
|
||||||
|
//
|
||||||
log.info("解析到车辆数据:{}", vehicleData);
|
// log.info("解析到车辆数据:{}", vehicleData);
|
||||||
for (String stringEvent : events) {
|
// for (String stringEvent : events) {
|
||||||
ResolverEventService resolverEventService =SpringUtils.getBean(stringEvent);
|
// ResolverEventService resolverEventService =SpringUtils.getBean(stringEvent);
|
||||||
resolverEventService.execute(vehicleData);
|
// resolverEventService.execute(vehicleData);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
log.error("Error occurred in Kafka consumer thread", e);
|
// log.error("Error occurred in Kafka consumer thread", e);
|
||||||
} finally {
|
// } finally {
|
||||||
consumer.close();
|
// consumer.close();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
kafkaConsumerThread.start();
|
// kafkaConsumerThread.start();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,9 @@
|
||||||
package com.zhilian.resolver.service.impl.eventMalfunction;
|
package com.zhilian.resolver.service.impl.eventMalfunction;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.remote.RemoteBreakService;
|
||||||
import com.zhilian.common.redis.service.RedisService;
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
import com.zhilian.common.resolver.domain.ErrorCar;
|
|
||||||
import com.zhilian.common.resolver.domain.ResolverReportData;
|
import com.zhilian.common.resolver.domain.ResolverReportData;
|
||||||
import com.zhilian.resolver.mapper.UserMapper;
|
import com.zhilian.resolver.mapper.UserMapper;
|
||||||
import com.zhilian.resolver.service.ResolverEventService;
|
import com.zhilian.resolver.service.ResolverEventService;
|
||||||
|
@ -11,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,109 +39,179 @@ public class MalfunctionEventServiceImpl implements ResolverEventService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResolverReportInfoService resolverReportInfoService;
|
private ResolverReportInfoService resolverReportInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RemoteBreakService remoteBreakService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(ResolverReportData vehicleData) {
|
public void execute(ResolverReportData vehicleData) {
|
||||||
log.info("故障事件开始执行");
|
log.info("故障事件开始执行");
|
||||||
if(isAnyFieldZero(vehicleData)){
|
if(isAnyFieldZero(vehicleData)){
|
||||||
resolverReportInfoService.saveDataToDatabaseByMalfunction(vehicleData);
|
resolverReportInfoService.saveDataToDatabaseByMalfunction(vehicleData);
|
||||||
|
|
||||||
|
BusinessBreak businessBreak = new BusinessBreak();
|
||||||
ErrorCar errorCar = new ErrorCar();
|
businessBreak.setBreakVin(vehicleData.getVin());
|
||||||
errorCar.setVin(vehicleData.getVin());
|
|
||||||
// * 车辆状态 1:正常 0:故障
|
// * 车辆状态 1:正常 0:故障
|
||||||
if(vehicleData.getVehicleStatus()==0){
|
if(vehicleData.getVehicleStatus()==0){
|
||||||
errorCar.setCode("GZ001");
|
businessBreak.setBreakCode("CL001");
|
||||||
errorCar.setLevel(1);
|
businessBreak.setBreakDate(new Date());
|
||||||
|
businessBreak.setBreakType("车体故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 充电状态 1:正常 0:故障
|
// * 充电状态 1:正常 0:故障
|
||||||
// private int chargingStatus;
|
// private int chargingStatus;
|
||||||
if(vehicleData.getChargingStatus()==0){
|
if(vehicleData.getChargingStatus()==0){
|
||||||
errorCar.setCode("GZ001");
|
businessBreak.setBreakCode("CD001");
|
||||||
errorCar.setLevel(1);
|
businessBreak.setBreakDate(new Date());
|
||||||
|
businessBreak.setBreakType("电池故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 运行状态 1:正常 0:故障
|
// * 运行状态 1:正常 0:故障
|
||||||
if(vehicleData.getOperatingStatus()==0){
|
if(vehicleData.getOperatingStatus()==0){
|
||||||
errorCar.setCode("GZ002");
|
businessBreak.setBreakCode("DW001");
|
||||||
errorCar.setLevel(3);
|
businessBreak.setBreakDate(new Date());
|
||||||
|
businessBreak.setBreakType("行驶故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * SOC 状态 1:正常 0:故障
|
// * SOC 状态 1:正常 0:故障
|
||||||
if(vehicleData.getSocStatus()==0){
|
if(vehicleData.getSocStatus()==0){
|
||||||
errorCar.setCode("GZ003");
|
businessBreak.setBreakCode("SOC001");
|
||||||
errorCar.setLevel(3);
|
businessBreak.setBreakDate(new Date());
|
||||||
|
businessBreak.setBreakType("电池故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// /**
|
// 可充电储能装置工作状态 1:正常 0:故障;
|
||||||
// * 可充电储能装置工作状态 1:正常 0:故障
|
if(vehicleData.getChargingEnergyStorageStatus()==0){
|
||||||
// */
|
businessBreak.setBreakCode("CDC001");
|
||||||
// private int chargingEnergyStorageStatus;
|
businessBreak.setBreakDate(new Date());
|
||||||
//
|
businessBreak.setBreakType("电池故障");
|
||||||
// /**
|
businessBreak.setBreakState("1");
|
||||||
// * 驱动电机状态 1:正常 0:故障
|
remoteBreakService.add(businessBreak);
|
||||||
// */
|
}
|
||||||
// private int driveMotorStatus;
|
|
||||||
//
|
// 驱动电机状态 1:正常 0:故障
|
||||||
// /**
|
if(vehicleData.getDriveMotorStatus()==0){
|
||||||
// * 定位是否有效 1:有效 0:无效
|
businessBreak.setBreakCode("DJ001");
|
||||||
// */
|
businessBreak.setBreakDate(new Date());
|
||||||
// private int positionStatus;
|
businessBreak.setBreakType("电机故障");
|
||||||
//
|
businessBreak.setBreakState("1");
|
||||||
// /**
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定位是否有效 1:有效 0:无效
|
||||||
|
if(vehicleData.getPositionStatus()==0){
|
||||||
|
businessBreak.setBreakCode("SOC001");
|
||||||
|
businessBreak.setBreakDate(new Date());
|
||||||
|
businessBreak.setBreakType("定位故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * EAS(汽车防盗系统)状态 1:正常 0:故障
|
// * EAS(汽车防盗系统)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getEasStatus()==0){
|
||||||
// private int easStatus;
|
businessBreak.setBreakCode("EAS001");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("EAS故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * PTC(电动加热器)状态 1:正常 0:故障
|
// * PTC(电动加热器)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getPtcStatus()==0){
|
||||||
// private int ptcStatus;
|
businessBreak.setBreakCode("PTC001");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("加热故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * EPS(电动助力系统)状态 1:正常 0:故障
|
// * EPS(电动助力系统)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getEpsStatus()==0){
|
||||||
// private int epsStatus;
|
businessBreak.setBreakCode("EPS001");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("电动助力故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * ABS(防抱死)状态 1:正常 0:故障
|
// * ABS(防抱死)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getAbsStatus()==0){
|
||||||
// private int absStatus;
|
businessBreak.setBreakCode("ABS001");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("ABS故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * MCU(电机/逆变器)状态 1:正常 0:故障
|
// * MCU(电机/逆变器)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getMcuStatus()==0){
|
||||||
// private int mcuStatus;
|
businessBreak.setBreakCode("MCU001");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("MCU故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * 动力电池加热状态 1:正常 0:故障
|
// * 动力电池加热状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getHeatingStatus()==0){
|
||||||
// private int heatingStatus;
|
businessBreak.setBreakCode("DC002");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("电池故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * 动力电池当前状态 1:正常 0:故障
|
// * 动力电池当前状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getBatteryStatus()==0){
|
||||||
// private int batteryStatus;
|
businessBreak.setBreakCode("DC003");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("电池故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * 动力电池保温状态 1:正常 0:故障
|
// * 动力电池保温状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getBatteryInsulationStatus()==0){
|
||||||
// private int batteryInsulationStatus;
|
businessBreak.setBreakCode("DC004");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("电池故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * DCDC(电力交换系统) 状态 1:正常 0:故障
|
// * DCDC(电力交换系统) 状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getDcdcStatus()==0){
|
||||||
// private int dcdcStatus;
|
businessBreak.setBreakCode("DCDC005");
|
||||||
//
|
businessBreak.setBreakDate(new Date());
|
||||||
// /**
|
businessBreak.setBreakType("电力故障");
|
||||||
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
// * CHG(充电机)状态 1:正常 0:故障
|
// * CHG(充电机)状态 1:正常 0:故障
|
||||||
// */
|
if(vehicleData.getChgStatus()==0){
|
||||||
// private int chgStatus;
|
businessBreak.setBreakCode("CDJ005");
|
||||||
String key = "breakdown";
|
businessBreak.setBreakDate(new Date());
|
||||||
String value = JSON.toJSONString(errorCar);
|
businessBreak.setBreakType("电力故障");
|
||||||
redisService.setCacheObject(key,value);
|
businessBreak.setBreakState("1");
|
||||||
|
remoteBreakService.add(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// String key = "breakdown";
|
||||||
|
String value = JSON.toJSONString(businessBreak);
|
||||||
|
redisService.setCacheObject("breakdown:gz:"+vehicleData.getVin(),value);
|
||||||
long expireTime = 30;
|
long expireTime = 30;
|
||||||
redisService.expire(key, expireTime, TimeUnit.MINUTES);
|
redisService.expire("breakdown:gz:"+vehicleData.getVin(), expireTime, TimeUnit.MINUTES);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue