Merge remote-tracking branch 'origin/dev.entBusiness' into dev
# Conflicts: # cloud-common/cloud-common-cache/src/main/java/com/muyu/common/cache/config/PrimaryKeyBasic.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/enterprise/controller/CarManageController.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/enterprise/controller/CarMessageController.java # cloud-modules/cloud-modules-event-process/src/main/java/com/muyu/event/process/consumer/GoOnlineConsumer.javadev
commit
7f257959ca
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.common.cache.config;
|
package com.muyu.common.cache.config;
|
||||||
|
|
||||||
|
import com.muyu.common.core.text.StrFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键基础
|
* 主键基础
|
||||||
* @ClassName PrimaryKeyBasic
|
* @ClassName PrimaryKeyBasic
|
||||||
|
@ -14,13 +16,18 @@ public interface PrimaryKeyBasic <K>{
|
||||||
*/
|
*/
|
||||||
public String keyPre();
|
public String keyPre();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key 后缀
|
||||||
|
*/
|
||||||
|
public String keyPost();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键编码
|
* 主键编码
|
||||||
* @param key 缓存建
|
* @param key 缓存建
|
||||||
* @return 装修建
|
* @return 装修建
|
||||||
*/
|
*/
|
||||||
public default String encode(K key){
|
public default String encode(K key){
|
||||||
return keyPre() + key.toString();
|
return StrFormatter.format("{}:vin{}:{}", keyPre(), key.toString(), keyPost());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,9 +35,8 @@ public interface PrimaryKeyBasic <K>{
|
||||||
* @param key 缓存建
|
* @param key 缓存建
|
||||||
* @return 装修建
|
* @return 装修建
|
||||||
*/
|
*/
|
||||||
public default K decode(String key) {
|
public K decode(String key);
|
||||||
return (K) key.substring(keyPre().length());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,12 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-security</artifactId>
|
<artifactId>cloud-common-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 公共核心依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -30,7 +30,9 @@ public interface RemoteEntService {
|
||||||
* @param entId 企业ID
|
* @param entId 企业ID
|
||||||
* @return 响应结果
|
* @return 响应结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/{entId}")
|
@GetMapping(value = "/getById/{entId}")
|
||||||
public Result<SysEnt> getById(@PathVariable(value = "entId") Long entId);
|
Result<SysEnt> getById(@PathVariable(value = "entId") Long entId);
|
||||||
|
// @GetMapping(value = "/{entId}")
|
||||||
|
// Result<EntResp> getById(@PathVariable(value = "entId") Long entId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package com.muyu.enterprise.cache;
|
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* redis企业业务层
|
|
||||||
* @ClassName CarCompanyCacheService
|
|
||||||
* @Description CarCompanyCacheService:类的描述
|
|
||||||
* @Date 2024/10/3 15:22
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class CarCompanyCacheService extends CacheAbsBasic<String, CarCompany> {
|
|
||||||
@Override
|
|
||||||
public String keyPre() {
|
|
||||||
return "CarCompany:info:";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String decode(String key) {
|
|
||||||
return key.replace("CarCompany:info:","");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +1,6 @@
|
||||||
package com.muyu.enterprise.cache;
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.FaultType;
|
|
||||||
import com.muyu.enterprise.domain.SysCarFault;
|
import com.muyu.enterprise.domain.SysCarFault;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,13 +14,18 @@ import com.muyu.enterprise.domain.SysCarFault;
|
||||||
public class CarFaultCacheService extends CacheAbsBasic<String, SysCarFault> {
|
public class CarFaultCacheService extends CacheAbsBasic<String, SysCarFault> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "sysCarFault:info:";
|
return "vehicleDeterminationStandard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "fault";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("faultType:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,33 @@
|
||||||
package com.muyu.enterprise.cache;
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
import com.muyu.enterprise.domain.vo.CarVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis报文业务层
|
* redis车辆业务层
|
||||||
* @ClassName CarManageCacheService
|
* @ClassName CarManageCacheService
|
||||||
* @Description CarManageCacheService:类的描述
|
* @Description CarManageCacheService:类的描述
|
||||||
* @Date 2024/10/3 15:22
|
* @Date 2024/10/3 15:22
|
||||||
* @author MingWei.Zong(微醺)
|
* @author MingWei.Zong(微醺)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CarManageCacheService extends CacheAbsBasic<String, List<CarManage>> {
|
public class CarManageCacheService extends CacheAbsBasic<String, List<CarVO>> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "carManage:info:";
|
return "vehicleDeterminationStandard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "carManage";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("carManage:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.enterprise.cache;
|
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
|
||||||
import com.muyu.enterprise.domain.CarMessage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* redis车辆管理业务层
|
|
||||||
* @ClassName CarMessageCacheService
|
|
||||||
* @Description CarMessageCacheService:类的描述
|
|
||||||
* @Date 2024/9/30 11:42
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
*/
|
|
||||||
public class CarMessageCacheService extends CacheAbsBasic<String, CarMessage> {
|
|
||||||
@Override
|
|
||||||
public String keyPre() {
|
|
||||||
return "carMessage:info:";
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String encode(String key) {
|
|
||||||
// return super.encode(key);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String decode(String key) {
|
|
||||||
return key.replace("carMessage:info:","");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.muyu.enterprise.cache;
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
import com.muyu.enterprise.domain.vo.CarTemplateVO;
|
||||||
import com.muyu.enterprise.domain.CarTemplate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis报文模版业务层
|
* redis报文模版业务层
|
||||||
|
@ -12,17 +11,21 @@ import com.muyu.enterprise.domain.CarTemplate;
|
||||||
* @author MingWei.Zong(微醺)
|
* @author MingWei.Zong(微醺)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CarTemplateCacheService extends CacheAbsBasic<String, CarTemplate> {
|
public class CarTemplateCacheService extends CacheAbsBasic<String, CarTemplateVO> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "carTemplate:info:";
|
return "vehicleDeterminationStandard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "messageTemplate";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("carTemplate:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,18 @@ import com.muyu.enterprise.domain.vo.WarnVo;
|
||||||
public class CarWarnCacheService extends CacheAbsBasic<String, WarnVo> {
|
public class CarWarnCacheService extends CacheAbsBasic<String, WarnVo> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "warnStrategy:info:";
|
return "vehicleDeterminationStandard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "warn";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("warnStrategy:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.enterprise.cache;
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,20 +8,24 @@ import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
||||||
* @ClassName ElectronicFenceCacheService
|
* @ClassName ElectronicFenceCacheService
|
||||||
* @Description ElectronicFenceCacheService:类的描述
|
* @Description ElectronicFenceCacheService:类的描述
|
||||||
* @Date 2024/10/3 15:22
|
* @Date 2024/10/3 15:22
|
||||||
* @author MingWei.Zong
|
* @author MingWei.Zong(微醺)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ElectronicFenceCacheService extends CacheAbsBasic<String, ElectronicFence> {
|
public class ElectronicFenceCacheService extends CacheAbsBasic<String, ElectronicFence> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "electronicFence:info:";
|
return "vehicleDeterminationStandard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "electronicFence";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("electronicFence:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
com.muyu.enterprise.cache.CarCompanyCacheService
|
|
||||||
com.muyu.enterprise.cache.CarFaultCacheService
|
com.muyu.enterprise.cache.CarFaultCacheService
|
||||||
com.muyu.enterprise.cache.CarVehicleTypeCacheService
|
com.muyu.enterprise.cache.CarVehicleTypeCacheService
|
||||||
com.muyu.enterprise.cache.CarVehicleCacheService
|
com.muyu.enterprise.cache.CarVehicleCacheService
|
||||||
com.muyu.enterprise.cache.CarMessageValueCacheService
|
com.muyu.enterprise.cache.CarMessageValueCacheService
|
||||||
|
com.muyu.enterprise.cache.CarTemplateCacheService
|
||||||
com.muyu.enterprise.cache.CarWarnCacheService
|
com.muyu.enterprise.cache.CarWarnCacheService
|
||||||
com.muyu.enterprise.cache.ElectronicFenceCacheService
|
com.muyu.enterprise.cache.ElectronicFenceCacheService
|
||||||
com.muyu.enterprise.cache.CarManageCacheService
|
com.muyu.enterprise.cache.CarManageCacheService
|
||||||
|
|
||||||
|
com.muyu.enterprise.cache.CarManageCacheService
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
package com.muyu.enterprise.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
/**
|
|
||||||
* 企业表--实体类
|
|
||||||
* @ClassName CarCompany
|
|
||||||
* @Description 企业表
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
@TableName(value = "car_company")
|
|
||||||
@Tag(name = "企业表")
|
|
||||||
public class CarCompany {
|
|
||||||
/**
|
|
||||||
* 企业表
|
|
||||||
*/
|
|
||||||
@TableId(value = "enterprise_id",type = IdType.AUTO)
|
|
||||||
private Long enterpriseId;
|
|
||||||
/**
|
|
||||||
* 企业名称
|
|
||||||
*/
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
}
|
|
|
@ -28,7 +28,7 @@ public class CarType {
|
||||||
* 车辆类型id
|
* 车辆类型id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "car_type_id",type = IdType.AUTO)
|
@TableId(value = "car_type_id",type = IdType.AUTO)
|
||||||
private Integer carTypeId;
|
private long carTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆类型名称
|
* 车辆类型名称
|
||||||
|
@ -38,7 +38,7 @@ public class CarType {
|
||||||
/**
|
/**
|
||||||
* 模板id
|
* 模板id
|
||||||
*/
|
*/
|
||||||
private Integer templateId;
|
private long templateId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.enterprise.domain.dateBase;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组_车辆_中间表
|
||||||
|
* @ClassName CarGroupCentre
|
||||||
|
* @PATH com.muyu.enterprise.domain:类的路径
|
||||||
|
* @Date 2024/10/10 19:27
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "车辆表")
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "car_manage",autoResultMap = true)
|
||||||
|
public class CarGroupCentre {
|
||||||
|
/**
|
||||||
|
* 围栏组_车辆_中间表ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "car_group_id",type = IdType.AUTO)
|
||||||
|
private Integer carGroupId;
|
||||||
|
/**
|
||||||
|
* 围栏组表id
|
||||||
|
*/
|
||||||
|
private Integer electronicFenceId;
|
||||||
|
/**
|
||||||
|
* 车辆id
|
||||||
|
*/
|
||||||
|
private Integer carId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.muyu.enterprise.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义报文模块表
|
||||||
|
* @ClassName CarTemplateVO
|
||||||
|
* @PATH com.muyu.enterprise.domain.vo:类的路径
|
||||||
|
* @Date 2024/10/9 20:42
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CarTemplateVO {
|
||||||
|
/**
|
||||||
|
* 报文模版表
|
||||||
|
*/
|
||||||
|
@TableId(value = "template_id",type = IdType.AUTO)
|
||||||
|
private Long templateId;
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String templateName;
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String templateDescribe;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文表
|
||||||
|
*/
|
||||||
|
private Long messageId;
|
||||||
|
/**
|
||||||
|
* 车辆报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
/**
|
||||||
|
* 开始位下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
/**
|
||||||
|
* 结束位下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -12,17 +12,20 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* 自定义车辆表--实体类
|
||||||
|
* @ClassName CarVO
|
||||||
|
* @Description 自定义车辆表
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
* @Date 2024/9/28 16:52
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
|
||||||
@TableName(value = "t_car",autoResultMap = true)
|
|
||||||
public class CarVO {
|
public class CarVO {
|
||||||
/**
|
/**
|
||||||
* 车辆表
|
* 车辆表
|
||||||
*/
|
*/
|
||||||
@TableId(value = "car_id",type = IdType.AUTO)
|
|
||||||
private Integer carId;
|
private Integer carId;
|
||||||
/**
|
/**
|
||||||
* 车架号
|
* 车架号
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muyu.enterprise.domain.vo;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义电子围栏表
|
||||||
|
* @ClassName ElectronicFenceVO
|
||||||
|
* @PATH com.muyu.enterprise.domain.vo:类的路径
|
||||||
|
* @Date 2024/10/10 19:59
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectronicFenceVO {
|
||||||
|
/**
|
||||||
|
* 围栏组id
|
||||||
|
*/
|
||||||
|
private Long groupId;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定的电子围栏
|
||||||
|
*/
|
||||||
|
List<ElectronicFenceResp> electronicFenceRespList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,23 +1,26 @@
|
||||||
package com.muyu.enterprise.domain.vo;
|
package com.muyu.enterprise.domain.vo;
|
||||||
/**
|
|
||||||
* 控制层
|
|
||||||
* 业务实现层
|
|
||||||
* @ClassName WarnVo
|
|
||||||
* @PATH com.muyu.enterprise.domain.vo:类的路径
|
|
||||||
* @Date 2024/10/8 14:05
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
*/
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.enterprise.domain.WarnRule;
|
import com.muyu.enterprise.domain.WarnRule;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 自定义预警策略表
|
||||||
|
* @ClassName WarnVo
|
||||||
|
* @PATH com.muyu.enterprise.domain.vo:类的路径
|
||||||
|
* @Date 2024/10/8 14:05
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class WarnVo {
|
public class WarnVo {
|
||||||
/** 策略id */
|
/** 策略id */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
|
@ -18,26 +18,6 @@ import org.springframework.web.client.RestTemplate;
|
||||||
public class CloudEnterpriseApplication {
|
public class CloudEnterpriseApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudEnterpriseApplication.class, args);
|
SpringApplication.run(CloudEnterpriseApplication.class, args);
|
||||||
System.out.println(" _ooOoo_\n" +
|
|
||||||
" o8888888o\n" +
|
|
||||||
" 88\" . \"88\n" +
|
|
||||||
" (| -_- |)\n" +
|
|
||||||
" O\\ = /O\n" +
|
|
||||||
" ____/`---'\\____\n" +
|
|
||||||
" .' \\\\| |// `.\n" +
|
|
||||||
" / \\\\||| : |||// \\\n" +
|
|
||||||
" / _||||| -:- |||||- \\\n" +
|
|
||||||
" | | \\\\\\ - /// | |\n" +
|
|
||||||
" | \\_| ''\\---/'' | |\n" +
|
|
||||||
" \\ .-\\__ `-` ___/-. /\n" +
|
|
||||||
" ___`. .' /--.--\\ `. . __\n" +
|
|
||||||
" .\"\" '< `.___\\_<|>_/___.' >'\"\".\n" +
|
|
||||||
" | | : `- \\`.;`\\ _ /`;.`/ - ` : | |\n" +
|
|
||||||
" \\ \\ `-. \\_ __\\ /__ _/ .-` / /\n" +
|
|
||||||
" ======`-.____`-.___\\_____/___.-`____.-'======\n" +
|
|
||||||
" `=---='\n" +
|
|
||||||
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
|
|
||||||
" // 佛祖保佑 永不宕机 永无BUG //");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//实现远程调用
|
//实现远程调用
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
package com.muyu.enterprise.controller;
|
|
||||||
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆企业--控制层
|
|
||||||
* @ClassName CarCompanyController
|
|
||||||
* @Description 车辆企业 Controller 层
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/carCompany")
|
|
||||||
/** 构造必备注解 只有用 final 修饰 才会被构造注入 */
|
|
||||||
@RequiredArgsConstructor //制动构造注入 默认无参 Lombook包下
|
|
||||||
@Tag(name = "CarCompanyController", description = "企业表")
|
|
||||||
public class CarCompanyController extends BaseController {
|
|
||||||
|
|
||||||
private final CarCompanyService sysCarCompanyService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询企业表
|
|
||||||
*/
|
|
||||||
@PostMapping("selectCompany")
|
|
||||||
public Result<List<CarCompany>> selectCompany(){
|
|
||||||
startPage();
|
|
||||||
List<CarCompany> list = sysCarCompanyService.list();
|
|
||||||
list.forEach(carCompany -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
return Result.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询企业
|
|
||||||
*/
|
|
||||||
@PostMapping("selectCompanyByCompanyId")
|
|
||||||
public Result<CarCompany> selectCompanyByCompanyId(@RequestParam("enterpriseId") Long enterpriseId){
|
|
||||||
return Result.success(sysCarCompanyService.selectCompanyByCompanyId(enterpriseId));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -2,19 +2,14 @@ package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.enterprise.service.CarConfigService;
|
import com.muyu.enterprise.service.CarConfigService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆配置--控制层
|
* 车辆配置--控制层
|
||||||
* @ClassName CarCompanyController
|
* @ClassName CarCompanyController
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.enterprise.controller;
|
package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
import com.muyu.enterprise.domain.CarManage;
|
||||||
|
@ -9,13 +9,10 @@ import com.muyu.enterprise.domain.CarMessage;
|
||||||
import com.muyu.enterprise.domain.car.Vehicle;
|
import com.muyu.enterprise.domain.car.Vehicle;
|
||||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
import com.muyu.enterprise.domain.vo.CarVO;
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.enterprise.service.CarManageService;
|
import com.muyu.enterprise.service.CarManageService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
@ -38,8 +35,7 @@ import java.util.List;
|
||||||
@Tag(name = "CarManageController", description = "车辆管理")
|
@Tag(name = "CarManageController", description = "车辆管理")
|
||||||
public class CarManageController extends BaseController {
|
public class CarManageController extends BaseController {
|
||||||
|
|
||||||
|
private final CarManageCacheService carManageCacheService;
|
||||||
private final CarCompanyService sysCarCompanyService;
|
|
||||||
|
|
||||||
private final CarManageService carManageService;
|
private final CarManageService carManageService;
|
||||||
|
|
||||||
|
@ -101,6 +97,7 @@ public class CarManageController extends BaseController {
|
||||||
// 随机生成VIN码
|
// 随机生成VIN码
|
||||||
String key2 = RandomUtil.randomNumbers(17);
|
String key2 = RandomUtil.randomNumbers(17);
|
||||||
carVO.setCarVin(key2);
|
carVO.setCarVin(key2);
|
||||||
|
// carVO
|
||||||
carManageService.insertCar(carVO);
|
carManageService.insertCar(carVO);
|
||||||
return Result.success("添加成功");
|
return Result.success("添加成功");
|
||||||
}
|
}
|
||||||
|
@ -145,7 +142,6 @@ public class CarManageController extends BaseController {
|
||||||
* @return 返回结果
|
* @return 返回结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/findByCarManageVin/{carManageVin}")
|
@GetMapping("/findByCarManageVin/{carManageVin}")
|
||||||
@Operation(description = "通过车辆vin码查询模板id")
|
|
||||||
public Result<Long> findByCarManageVin(@PathVariable("vehicleVin") String carManageVin) {
|
public Result<Long> findByCarManageVin(@PathVariable("vehicleVin") String carManageVin) {
|
||||||
Long byCarManageVin = carManageService.findByCarManageVin(carManageVin);
|
Long byCarManageVin = carManageService.findByCarManageVin(carManageVin);
|
||||||
return Result.success(byCarManageVin);
|
return Result.success(byCarManageVin);
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
@Tag(name = "报文",description = "报文模块")
|
@Tag(name = "报文",description = "报文模块")
|
||||||
public class CarMessageController extends BaseController {
|
public class CarMessageController extends BaseController {
|
||||||
|
|
||||||
private final CarVehicleCacheService carMessageCacheService;
|
// private final CarMessageCacheService carMessageCacheService;
|
||||||
private final CarMessageService sysCarMessageService;
|
private final CarMessageService sysCarMessageService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CarMessageService carMessageService;
|
private CarMessageService carMessageService;
|
||||||
|
@ -71,7 +71,7 @@ public class CarMessageController extends BaseController {
|
||||||
public Result insertMessage(@RequestBody CarMessage carMessage){
|
public Result insertMessage(@RequestBody CarMessage carMessage){
|
||||||
sysCarMessageService.save(carMessage);
|
sysCarMessageService.save(carMessage);
|
||||||
//报文 redis
|
//报文 redis
|
||||||
carMessageCacheService.put(carMessage.getMessageType(),new Vehicle());
|
// carMessageCacheService.put(carMessage.getMessageType(),new CarMessage());
|
||||||
return Result.success("添加成功");
|
return Result.success("添加成功");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,10 +45,21 @@ public class CarTypeController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/catTypeId")
|
@PostMapping("/catTypeId")
|
||||||
private Result<CarType> catTypeId(@RequestParam("catTypeId") Integer catTypeId) {
|
private Result<CarType> catTypeId(@RequestParam("catTypeId") Long catTypeId) {
|
||||||
CarType carType = carTypeService.findById(catTypeId);
|
CarType carType = carTypeService.findById(catTypeId);
|
||||||
return Result.success(carType);
|
return Result.success(carType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过报文模版id查询车辆类型表
|
||||||
|
* @param templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectCarTemplateByTemplateId")
|
||||||
|
private Result<CarType> selectCarTemplateByTemplateId(@RequestParam("templateId") Long templateId) {
|
||||||
|
CarType carType = carTypeService.SelectCarTemplateByTemplateId(templateId);
|
||||||
|
return Result.success(carType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.muyu.enterprise.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆企业--持久层
|
|
||||||
* @ClassName CarCompanyMapper
|
|
||||||
* @Description 车辆企业 Mapper 层
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
public interface CarCompanyMapper extends BaseMapper<CarCompany> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -13,6 +13,6 @@ import org.apache.ibatis.annotations.Param;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CarTypeMapper extends BaseMapper<CarType> {
|
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||||
CarType findById(@Param("catTypeId") Integer catTypeId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package com.muyu.enterprise.service;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆企业--业务层
|
|
||||||
* @ClassName CarCompanyService
|
|
||||||
* @Description 车辆企业 Service 层
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
public interface CarCompanyService extends IService<CarCompany> {
|
|
||||||
/**
|
|
||||||
* @param enterpriseId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
CarCompany selectCompanyByCompanyId(Long enterpriseId);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -10,6 +10,12 @@ import com.muyu.enterprise.domain.CarType;
|
||||||
* @Date 2024/9/28 16:52
|
* @Date 2024/9/28 16:52
|
||||||
*/
|
*/
|
||||||
public interface CarTypeService extends IService<CarType> {
|
public interface CarTypeService extends IService<CarType> {
|
||||||
CarType findById(Integer catTypeId);
|
CarType findById(long catTypeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过报文模版id查询车辆类型表
|
||||||
|
* @param templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CarType SelectCarTemplateByTemplateId(Long templateId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
package com.muyu.enterprise.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.mapper.CarCompanyMapper;
|
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.common.redis.service.RedisService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆企业--业务实现层
|
|
||||||
* @ClassName CarCompanyServiceImpl
|
|
||||||
* @Description 车辆企业 ServiceImpl 层
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 车辆企业--业务层
|
|
||||||
* @ClassName CarCompanyService
|
|
||||||
* @Description 车辆企业 Service 层
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
* @Date 2024/9/28 16:52
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CarCompanyServiceImpl extends ServiceImpl<CarCompanyMapper, CarCompany>
|
|
||||||
implements CarCompanyService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
@Autowired
|
|
||||||
private CarCompanyMapper carCompanyMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param enterpriseId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public CarCompany selectCompanyByCompanyId(Long enterpriseId) {
|
|
||||||
return carCompanyMapper.selectById(enterpriseId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,24 +1,12 @@
|
||||||
package com.muyu.enterprise.service.impl;
|
package com.muyu.enterprise.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.CarConfig;
|
import com.muyu.enterprise.domain.CarConfig;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
|
||||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
|
||||||
import com.muyu.enterprise.mapper.CarConfigMapper;
|
import com.muyu.enterprise.mapper.CarConfigMapper;
|
||||||
import com.muyu.enterprise.mapper.CarManageMapper;
|
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.enterprise.service.CarConfigService;
|
import com.muyu.enterprise.service.CarConfigService;
|
||||||
import com.muyu.enterprise.service.CarManageService;
|
|
||||||
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.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆配置--业务实现层
|
* 车辆配置--业务实现层
|
||||||
* @ClassName CarConfigServiceImpl
|
* @ClassName CarConfigServiceImpl
|
||||||
|
|
|
@ -3,17 +3,14 @@ package com.muyu.enterprise.service.impl;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.muyu.common.system.domain.SysEnt;
|
|
||||||
import com.muyu.common.system.remote.RemoteEntService;
|
import com.muyu.common.system.remote.RemoteEntService;
|
||||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.CarConfig;
|
import com.muyu.enterprise.domain.CarConfig;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
import com.muyu.enterprise.domain.CarManage;
|
||||||
import com.muyu.enterprise.domain.car.Vehicle;
|
import com.muyu.enterprise.domain.car.Vehicle;
|
||||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
import com.muyu.enterprise.domain.vo.CarVO;
|
||||||
import com.muyu.enterprise.mapper.CarManageMapper;
|
import com.muyu.enterprise.mapper.CarManageMapper;
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
|
||||||
import com.muyu.enterprise.service.CarConfigService;
|
import com.muyu.enterprise.service.CarConfigService;
|
||||||
import com.muyu.enterprise.service.CarManageService;
|
import com.muyu.enterprise.service.CarManageService;
|
||||||
|
|
||||||
|
@ -35,8 +32,6 @@ import java.util.List;
|
||||||
public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage>
|
public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage>
|
||||||
implements CarManageService {
|
implements CarManageService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CarCompanyService carCompanyService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CarConfigService carConfigService;
|
private CarConfigService carConfigService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -75,10 +70,10 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
||||||
carVO.setEnergyType(carConfig.getEnergyType());
|
carVO.setEnergyType(carConfig.getEnergyType());
|
||||||
carVO.setGearType(carConfig.getGearType());
|
carVO.setGearType(carConfig.getGearType());
|
||||||
// 查询出对象,用于赋值 ----------远调企业
|
// 查询出对象,用于赋值 ----------远调企业
|
||||||
SysEnt data = remoteEntService.getById(carVO.getEnterpriseId()).getData();
|
// SysEnt data = remoteEntService.getById(carVO.getEnterpriseId()).getData();
|
||||||
carVO.setName(data.getName());
|
// carVO.setName(data.getName());
|
||||||
// 存到 redis
|
// 存到 redis
|
||||||
carManageCacheService.put(carVO.getCarVin(),list);
|
carManageCacheService.put(carVO.getCarVin(),carVOS);
|
||||||
});
|
});
|
||||||
return carVOS;
|
return carVOS;
|
||||||
}
|
}
|
||||||
|
@ -88,12 +83,10 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
||||||
CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class);
|
CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class);
|
||||||
return carManageMapper.selectJoinList(CarVO.class, new MPJLambdaWrapper<CarManage>()
|
return carManageMapper.selectJoinList(CarVO.class, new MPJLambdaWrapper<CarManage>()
|
||||||
.selectAll(CarManage.class) // 查询所有车辆表
|
.selectAll(CarManage.class) // 查询所有车辆表
|
||||||
.select(CarCompany::getCompanyName)
|
|
||||||
.select(CarConfig::getConfigName)
|
.select(CarConfig::getConfigName)
|
||||||
.select(CarConfig::getGearType)
|
.select(CarConfig::getGearType)
|
||||||
.select(CarConfig::getEnergyType)
|
.select(CarConfig::getEnergyType)
|
||||||
.leftJoin(CarConfig.class, CarConfig::getConfigId, CarManage::getConfigId)
|
.leftJoin(CarConfig.class, CarConfig::getConfigId, CarManage::getConfigId)
|
||||||
.leftJoin(CarCompany.class, CarCompany::getEnterpriseId, CarManage::getEnterpriseId)
|
|
||||||
.eq(carManage.getCarVin() != null && carManage.getCarVin() != "", CarManage::getCarVin, carManage.getCarVin())
|
.eq(carManage.getCarVin() != null && carManage.getCarVin() != "", CarManage::getCarVin, carManage.getCarVin())
|
||||||
.eq(carManage.getCarModel() != null && carManage.getCarModel() != "", CarManage::getCarModel, carManage.getCarModel())
|
.eq(carManage.getCarModel() != null && carManage.getCarModel() != "", CarManage::getCarModel, carManage.getCarModel())
|
||||||
.eq(carManage.getCarBrand() != null && carManage.getCarBrand() != "", CarManage::getCarBrand, carManage.getCarBrand())
|
.eq(carManage.getCarBrand() != null && carManage.getCarBrand() != "", CarManage::getCarBrand, carManage.getCarBrand())
|
||||||
|
@ -106,8 +99,9 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertCar(CarManage carVO) {
|
public void insertCar(CarManage carVO) {
|
||||||
ArrayList<CarManage> carVOS = new ArrayList<>();
|
CarVO carVO1 = BeanUtil.copyProperties(carVO, CarVO.class);
|
||||||
carVOS.add(carVO);
|
List<CarVO> carVOS = new ArrayList<>();
|
||||||
|
carVOS.add(carVO1);
|
||||||
save(carVO);
|
save(carVO);
|
||||||
// 存到缓存中去
|
// 存到缓存中去
|
||||||
carManageCacheService.put(carVO.getCarVin(),carVOS);
|
carManageCacheService.put(carVO.getCarVin(),carVOS);
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
package com.muyu.enterprise.service.impl;
|
package com.muyu.enterprise.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.enterprise.cache.CarTemplateCacheService;
|
||||||
|
import com.muyu.enterprise.domain.CarManage;
|
||||||
import com.muyu.enterprise.domain.CarTemplate;
|
import com.muyu.enterprise.domain.CarTemplate;
|
||||||
|
import com.muyu.enterprise.domain.CarType;
|
||||||
|
import com.muyu.enterprise.mapper.CarManageMapper;
|
||||||
import com.muyu.enterprise.mapper.CarTemplateMapper;
|
import com.muyu.enterprise.mapper.CarTemplateMapper;
|
||||||
|
import com.muyu.enterprise.service.CarManageService;
|
||||||
import com.muyu.enterprise.service.CarTemplateService;
|
import com.muyu.enterprise.service.CarTemplateService;
|
||||||
|
import com.muyu.enterprise.service.CarTypeService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -16,8 +23,15 @@ import java.util.List;
|
||||||
* @Date 2024/9/28 16:52
|
* @Date 2024/9/28 16:52
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Log4j2
|
||||||
public class CarTemplateServiceImpl extends ServiceImpl<CarTemplateMapper, CarTemplate> implements CarTemplateService {
|
public class CarTemplateServiceImpl extends ServiceImpl<CarTemplateMapper, CarTemplate> implements CarTemplateService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CarTemplateCacheService carTemplateCacheService;
|
||||||
|
@Autowired
|
||||||
|
private CarManageService carManageService;
|
||||||
|
@Autowired
|
||||||
|
private CarTypeService carTypeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CarTemplateMapper sysCarTemplateMapper;
|
private CarTemplateMapper sysCarTemplateMapper;
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +50,14 @@ public class CarTemplateServiceImpl extends ServiceImpl<CarTemplateMapper, CarTe
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CarTemplate selectTemplateByTemplateId(Long templateId) {
|
public CarTemplate selectTemplateByTemplateId(Long templateId) {
|
||||||
return sysCarTemplateMapper.selectById(templateId);
|
// 通过id查询报文信息
|
||||||
|
CarTemplate carTemplate = sysCarTemplateMapper.selectById(templateId);
|
||||||
|
// 获取到车辆的 vin 用于存储 redis 1.通过报文模版id 获取车辆类型 id
|
||||||
|
CarType carType = carTypeService.SelectCarTemplateByTemplateId(templateId);
|
||||||
|
// 通过 车辆类型ID 获取 车辆信息
|
||||||
|
CarManage carManage = carManageService.carManageShowByCarTypeId(carType.getCarTypeId());
|
||||||
|
// 将报文信息存储到 redis
|
||||||
|
// carTemplateCacheService.put(carManage.getCarVin(),carTemplate);
|
||||||
|
return carTemplate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,17 @@ public class CarTypeTypeServiceImpl
|
||||||
private CarTypeMapper carTypeMapper;
|
private CarTypeMapper carTypeMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CarType findById(Integer catTypeId) {
|
public CarType findById(long catTypeId) {
|
||||||
CarType carType= carTypeMapper.findById(catTypeId);
|
return getById(catTypeId);
|
||||||
return carType;
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通过报文模版id查询车辆类型表
|
||||||
|
* @param templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CarType SelectCarTemplateByTemplateId(Long templateId) {
|
||||||
|
return getById(templateId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@ package com.muyu.enterprise.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.muyu.enterprise.cache.CarFaultCacheService;
|
||||||
import com.muyu.enterprise.domain.SysCarFault;
|
import com.muyu.enterprise.domain.SysCarFault;
|
||||||
import com.muyu.enterprise.service.SysCarFaultService;
|
import com.muyu.enterprise.service.SysCarFaultService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.muyu.enterprise.mapper.SysCarFaultMapper;
|
import com.muyu.enterprise.mapper.SysCarFaultMapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
@ -23,6 +25,9 @@ public class SysCarFaultServiceImpl
|
||||||
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
||||||
implements SysCarFaultService {
|
implements SysCarFaultService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CarFaultCacheService carFaultCacheService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精确查询车辆故障
|
* 精确查询车辆故障
|
||||||
*
|
*
|
||||||
|
@ -58,7 +63,7 @@ public class SysCarFaultServiceImpl
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(sysCarFault.getFaultWarn()),
|
queryWrapper.eq(StringUtils.isNotEmpty(sysCarFault.getFaultWarn()),
|
||||||
SysCarFault::getFaultWarn, sysCarFault.getFaultWarn());
|
SysCarFault::getFaultWarn, sysCarFault.getFaultWarn());
|
||||||
|
|
||||||
|
// carFaultCacheService.put();
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package com.muyu.enterprise.service.impl;
|
package com.muyu.enterprise.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
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.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
|
||||||
import com.muyu.enterprise.cache.CarWarnCacheService;
|
import com.muyu.enterprise.cache.CarWarnCacheService;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
import com.muyu.enterprise.domain.CarManage;
|
||||||
import com.muyu.enterprise.domain.WarnRule;
|
import com.muyu.enterprise.domain.WarnRule;
|
||||||
|
|
|
@ -3,7 +3,5 @@
|
||||||
|
|
||||||
<mapper namespace="com.muyu.enterprise.mapper.CarTypeMapper">
|
<mapper namespace="com.muyu.enterprise.mapper.CarTypeMapper">
|
||||||
|
|
||||||
<select id="findById" resultType="com.muyu.enterprise.domain.CarType">
|
|
||||||
select * from t_car_type where t_car_type.car_type_id = #{catTypeId}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ public class GoOnlineConsumer {
|
||||||
/**
|
/**
|
||||||
* 车辆管理缓存服务
|
* 车辆管理缓存服务
|
||||||
*/
|
*/
|
||||||
private final CarVehicleTypeCacheService carManageCacheService;
|
// private final CarManageCacheService carManageCacheService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆故障缓存服务
|
* 车辆故障缓存服务
|
||||||
|
@ -66,7 +65,7 @@ public class GoOnlineConsumer {
|
||||||
public void online(String vin) {
|
public void online(String vin) {
|
||||||
log.info("车辆vin码:{},该车辆已上线", vin);
|
log.info("车辆vin码:{},该车辆已上线", vin);
|
||||||
cacheUtil.put(vin, new HashMap<String, Object>() {{
|
cacheUtil.put(vin, new HashMap<String, Object>() {{
|
||||||
put(CacheHandlerConstants.CAR_MANAGE_KEY, carManageCacheService.get(vin));
|
// put(CacheHandlerConstants.CAR_MANAGE_KEY, carManageCacheService.get(vin));
|
||||||
put(CacheHandlerConstants.FAULT_RULE_KEY, carFaultCacheService.get(vin));
|
put(CacheHandlerConstants.FAULT_RULE_KEY, carFaultCacheService.get(vin));
|
||||||
put(CacheHandlerConstants.ELECTRONIC_FENCE_KEY, electronicFenceCacheService.get(vin));
|
put(CacheHandlerConstants.ELECTRONIC_FENCE_KEY, electronicFenceCacheService.get(vin));
|
||||||
put(CacheHandlerConstants.WARN_RULE_KEY, carWarnCacheService.get(vin));
|
put(CacheHandlerConstants.WARN_RULE_KEY, carWarnCacheService.get(vin));
|
||||||
|
|
Loading…
Reference in New Issue