Merge branch 'dev.entBusiness' into dev
# Conflicts: # cloud-common/cloud-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-cache/src/main/java/com/muyu/enterprise/cache/CarFaultCacheService.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-cache/src/main/java/com/muyu/enterprise/cache/CarWarnCacheService.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/enterprise/domain/CarTemplate.java # cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/enterprise/CloudEnterpriseApplication.java # pom.xmldev.entBusiness
commit
0534db9f37
|
@ -4,7 +4,7 @@ package com.muyu.common.cache.config;
|
|||
* @ClassName CacheAbsBasic
|
||||
* @Description CacheAbsBasic:类的描述
|
||||
* @Date 2024/9/30 1:39
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.awt.image.Kernel;
|
|||
* @ClassName CacheBasic
|
||||
* @Description CacheBasic:类的描述
|
||||
* @Date 2024/9/30 1:36
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
public interface CacheBasic<K,V> extends PrimaryKeyBasic<K>{
|
||||
|
|
|
@ -5,7 +5,7 @@ package com.muyu.common.cache.config;
|
|||
* @ClassName PrimaryKeyBasic
|
||||
* @Description PrimaryKeyBasic:类的描述
|
||||
* @Date 2024/9/30 0:15
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
public interface PrimaryKeyBasic <K>{
|
||||
/**
|
||||
|
|
|
@ -24,4 +24,5 @@ public class ServiceNameConstants {
|
|||
* 企业平台服务的serviceid
|
||||
*/
|
||||
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.lang.annotation.*;
|
|||
* @ClassName EnableCustomSwagger2
|
||||
* @Description EnableCustomSwagger2:类的描述
|
||||
* @Date 2024/10/6 22:16
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.function.Predicate;
|
|||
* @ClassName SwaggerAutoConfiguration
|
||||
* @Description SwaggerAutoConfiguration:类的描述
|
||||
* @Date 2024/10/6 22:16
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.stream.Collectors;
|
|||
* @ClassName SwaggerBeanPostProcessor
|
||||
* @Description SwaggerBeanPostProcessor:类的描述
|
||||
* @Date 2024/10/6 22:16
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
public class SwaggerBeanPostProcessor implements BeanPostProcessor {
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||
* @ClassName SwaggerProperties
|
||||
* @Description SwaggerProperties:类的描述
|
||||
* @Date 2024/10/6 22:16
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
@ConfigurationProperties("swagger")
|
||||
public class SwaggerProperties {
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||
* @ClassName SwaggerWebConfiguration
|
||||
* @Description SwaggerWebConfiguration:类的描述
|
||||
* @Date 2024/10/6 22:16
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
public class SwaggerWebConfiguration implements WebMvcConfigurer {
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
package com.muyu.common.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.skywalking.apm.toolkit.trace.Tag;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆表--实体类
|
||||
* @ClassName CarManage
|
||||
* @Description 车辆表
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@TableName(value = "car_manage",autoResultMap = true)
|
||||
public class CarManage {
|
||||
/**
|
||||
* 车辆表
|
||||
*/
|
||||
@TableId(value = "car_id",type = IdType.AUTO)
|
||||
private Long carId;
|
||||
/**
|
||||
* 车架号
|
||||
*/
|
||||
private String carFrame;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carCode;
|
||||
/**
|
||||
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
||||
*/
|
||||
private Integer carColor;
|
||||
/**
|
||||
* VIN码
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 驾驶员
|
||||
*/
|
||||
private long userId;
|
||||
/**
|
||||
* 车辆配置
|
||||
*/
|
||||
private long configId;
|
||||
/**
|
||||
* 年审日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date audditTime;
|
||||
/**
|
||||
* 行驶证到期日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date licenseTime;
|
||||
/**
|
||||
* 保险到期日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date insuranceTime;
|
||||
/**
|
||||
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||
*/
|
||||
private Integer carStatus;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 当前档位
|
||||
*/
|
||||
private Integer carGears;
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carModel;
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
private String carBrand;
|
||||
|
||||
/** 最后一次连线时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date carLastJoinTime;
|
||||
|
||||
/** 最后一次离线时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date carLastOfflineTime;
|
||||
|
||||
/**
|
||||
* 汽车所属企业id
|
||||
*/
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 汽车类型id
|
||||
*/
|
||||
private Long CarTypeId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.common.system.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.SysEnt;
|
||||
import com.muyu.common.system.remote.factory.RemoteEntFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
/**
|
||||
* 企业服务
|
||||
* @ClassName RemoteEntService
|
||||
* @PATH com.muyu.common.system.remote:类的路径
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/10/8 10:59
|
||||
*/
|
||||
@FeignClient(
|
||||
path = "/ent",
|
||||
contextId = "remoteEntService",
|
||||
value = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallbackFactory = RemoteEntFallbackFactory.class
|
||||
)
|
||||
public interface RemoteEntService {
|
||||
/**
|
||||
* 根据ID获取企业信息
|
||||
* @param entId 企业ID
|
||||
* @return 响应结果
|
||||
*/
|
||||
@GetMapping(value = "/{entId}")
|
||||
public Result<SysEnt> getById(@PathVariable(value = "entId") Long entId);
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.common.system.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.CarManage;
|
||||
import com.muyu.common.system.domain.SysEnt;
|
||||
import com.muyu.common.system.remote.factory.RemoteEntFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 预警服务
|
||||
* @ClassName RemoteWarnService
|
||||
* @PATH com.muyu.common.system.remote:类的路径
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/10/8 10:59
|
||||
*/
|
||||
@FeignClient(
|
||||
path = "/strategy",
|
||||
contextId = "remoteWarnService",
|
||||
value = ServiceNameConstants.ENTERPRISE_SERVICE,
|
||||
fallbackFactory = RemoteEntFallbackFactory.class
|
||||
)
|
||||
public interface RemoteWarnService {
|
||||
/**
|
||||
* 通过 carTypeId 查询车辆信息
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("carManageShowByCarTypeId")
|
||||
public Result<CarManage> carManageShowByCarTypeId(@RequestParam("carTypeId") Long carTypeId);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.remote.RemoteEntService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 企业服务降级处理
|
||||
* @ClassName RemoteEntFallbackFactory
|
||||
* @PATH com.muyu.common.system.remote.factory:类的路径
|
||||
* @Date 2024/10/8 10:59
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
@Component
|
||||
public class RemoteEntFallbackFactory implements FallbackFactory<RemoteEntService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteEntFallbackFactory.class);
|
||||
@Override
|
||||
public RemoteEntService create(Throwable throwable) {
|
||||
log.error("企业服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteEntService() {
|
||||
@Override
|
||||
public Result getById(Long entId) {
|
||||
return Result.error("查询企业失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.remote.RemoteEntService;
|
||||
import com.muyu.common.system.remote.RemoteWarnService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 预警服务降级处理--通过预警中车辆类型ID查询车辆信息
|
||||
* @ClassName RemoteWarnFallbackFactory
|
||||
* @PATH com.muyu.common.system.remote.factory:类的路径
|
||||
* @Date 2024/10/8 10:59
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
@Component
|
||||
public class RemoteWarnFallbackFactory implements FallbackFactory<RemoteWarnService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteWarnFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteWarnService create(Throwable throwable) {
|
||||
log.error("通过预警中车辆类型ID查询车辆信息服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteWarnService() {
|
||||
@Override
|
||||
public Result carManageShowByCarTypeId(Long carTypeId) {
|
||||
return Result.error("通过预警中车辆类型ID查询车辆信息失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteEntFallbackFactory
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.muyu.enterprise.domain.CarManage;
|
|||
* @ClassName CarCompanyCacheService
|
||||
* @Description CarCompanyCacheService:类的描述
|
||||
* @Date 2024/10/3 15:22
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
public class CarCompanyCacheService extends CacheAbsBasic<String, CarCompany> {
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
package com.muyu.enterprise.cache;
|
||||
|
||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||
import com.muyu.enterprise.domain.FaultRule;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.muyu.enterprise.domain.CarCompany;
|
||||
import com.muyu.enterprise.domain.FaultType;
|
||||
import com.muyu.enterprise.domain.SysCarFault;
|
||||
|
||||
/**
|
||||
* redis故障业务层
|
||||
* @ClassName CarFaultCacheService
|
||||
* @Description CarFaultCacheService:类的描述
|
||||
* @Date 2024/10/3 15:22
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
public class CarFaultCacheService extends CacheAbsBasic<String, FaultRule> {
|
||||
|
||||
public class CarFaultCacheService extends CacheAbsBasic<String, SysCarFault> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "faultRule:info:";
|
||||
return "sysCarFault:info:";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("faultRule:info:","");
|
||||
return key.replace("faultType:info:","");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,16 +2,19 @@ package com.muyu.enterprise.cache;
|
|||
|
||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
import com.muyu.enterprise.domain.vo.CarVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* redis报文业务层
|
||||
* @ClassName CarManageCacheService
|
||||
* @Description CarManageCacheService:类的描述
|
||||
* @Date 2024/10/3 15:22
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
public class CarManageCacheService extends CacheAbsBasic<String, CarManage> {
|
||||
public class CarManageCacheService extends CacheAbsBasic<String, List<CarManage>> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "carManage:info:";
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.enterprise.domain.CarMessage;
|
|||
* @ClassName CarMessageCacheService
|
||||
* @Description CarMessageCacheService:类的描述
|
||||
* @Date 2024/9/30 11:42
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
public class CarMessageCacheService extends CacheAbsBasic<String, CarMessage> {
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.muyu.enterprise.domain.CarTemplate;
|
|||
* @ClassName CarTemplateCacheService
|
||||
* @Description CarTemplateCacheService:类的描述
|
||||
* @Date 2024/10/3 15:22
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
public class CarTemplateCacheService extends CacheAbsBasic<String, CarTemplate> {
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
package com.muyu.enterprise.cache;
|
||||
|
||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||
import com.muyu.enterprise.domain.WarnRule;
|
||||
import com.muyu.enterprise.domain.WarnStrategy;
|
||||
import com.muyu.enterprise.domain.vo.WarnVo;
|
||||
|
||||
/**
|
||||
* redis车辆预警业务层
|
||||
* @ClassName CarWarnCacheService
|
||||
* @Description CarWarnCacheService:类的描述
|
||||
* @Date 2024/10/3 15:22
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
public class CarWarnCacheService extends CacheAbsBasic<String, WarnRule> {
|
||||
public class CarWarnCacheService extends CacheAbsBasic<String, WarnVo> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "warnRule:info:";
|
||||
return "warnStrategy:info:";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("warnRule:info:","");
|
||||
return key.replace("warnStrategy:info:","");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
* 企业表--实体类
|
||||
* @ClassName CarCompany
|
||||
* @Description 企业表
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
* 车辆配置表--实体类
|
||||
* @ClassName CarConfig
|
||||
* @Description 车辆配置表
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.Date;
|
|||
* 车辆表--实体类
|
||||
* @ClassName CarManage
|
||||
* @Description 车辆表
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
|
@ -107,5 +107,10 @@ public class CarManage {
|
|||
*/
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 汽车类型id
|
||||
*/
|
||||
private Long CarTypeId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
* 报文表--实体类
|
||||
* @ClassName CarMessage
|
||||
* @Description 报文表
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
* 报文类型表--实体类
|
||||
* @ClassName CarMessageType
|
||||
* @Description 报文类型表
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -8,12 +8,12 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultRule:故障规则
|
||||
* 报文模版表--实体类
|
||||
* @ClassName CarTemplate
|
||||
* @Description 报文模版表
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -96,6 +96,11 @@ public class CarVO {
|
|||
/** 所属企业 */
|
||||
private Long enterpriseId;
|
||||
|
||||
/**
|
||||
* 汽车类型id
|
||||
*/
|
||||
private Long CarTypeId;
|
||||
|
||||
|
||||
|
||||
// /** 车辆车型(如客车,卡车,公交车等) */
|
||||
|
@ -122,6 +127,6 @@ public class CarVO {
|
|||
* 企业名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
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.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.enterprise.domain.WarnRule;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WarnVo {
|
||||
/** 策略id */
|
||||
private Long id;
|
||||
|
||||
/** 车辆类型id */
|
||||
private Long carTypeId;
|
||||
|
||||
/** 策略名称 */
|
||||
private String strategyName;
|
||||
|
||||
/** 报文模版id */
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 预警规则
|
||||
*/
|
||||
List<WarnRule> warnRuleList;
|
||||
}
|
|
@ -105,8 +105,8 @@
|
|||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
<version>1.4.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.muyu.common.security.annotation.EnableCustomConfig;
|
|||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* 企业平台微服务启动类
|
||||
|
@ -38,4 +40,12 @@ public class CloudEnterpriseApplication {
|
|||
" // 佛祖保佑 永不宕机 永无BUG //");
|
||||
}
|
||||
|
||||
//实现远程调用
|
||||
@Bean
|
||||
public RestTemplate restTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.enterprise.OpenFen;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 企业远调
|
||||
* @ClassName SysEntOpenFen
|
||||
* @Description SysEntOpenFen:类的描述
|
||||
* @Date 2024/10/7 11:52
|
||||
* @author MingWei.Zong(微醺)
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class SysEntFallbackFactory {
|
||||
|
||||
}
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
* 车辆企业--控制层
|
||||
* @ClassName CarCompanyController
|
||||
* @Description 车辆企业 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
* 车辆配置--控制层
|
||||
* @ClassName CarCompanyController
|
||||
* @Description 车辆配置 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
@ -32,7 +32,7 @@ public class CarConfigController extends BaseController {
|
|||
private final CarConfigService carConfigService;
|
||||
|
||||
/**
|
||||
* 通过 configId 查询企业
|
||||
* 通过 configId
|
||||
* @param configId
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.RandomUtil;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
import com.muyu.enterprise.domain.CarMessage;
|
||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||
import com.muyu.enterprise.domain.vo.CarVO;
|
||||
import com.muyu.enterprise.service.CarCompanyService;
|
||||
|
@ -25,7 +26,7 @@ import java.util.List;
|
|||
* 车辆管理--控制层
|
||||
* @ClassName CarManageController
|
||||
* @Description 车辆管理 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
@ -39,7 +40,7 @@ public class CarManageController extends BaseController {
|
|||
|
||||
private final CarCompanyService sysCarCompanyService;
|
||||
|
||||
private final CarManageService sysCarService;
|
||||
private final CarManageService carManageService;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -51,7 +52,7 @@ public class CarManageController extends BaseController {
|
|||
public Result<List<CarVO>> carListShow2(@RequestBody CarDTO carDTO){
|
||||
startPage();
|
||||
// 存到缓存中去
|
||||
return Result.success(sysCarService.carListShow2(carDTO));
|
||||
return Result.success(carManageService.carListShow2(carDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,7 +62,7 @@ public class CarManageController extends BaseController {
|
|||
*/
|
||||
@PostMapping("/carListShow")
|
||||
public Result<List<CarVO>> carListShow(@RequestBody CarDTO carDTO){
|
||||
return Result.success(sysCarService.CarListShow(carDTO));
|
||||
return Result.success(carManageService.CarListShow(carDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,7 +72,18 @@ public class CarManageController extends BaseController {
|
|||
*/
|
||||
@PostMapping("carManageShowByCarId")
|
||||
public Result carManageShowByCarId(@RequestParam("carId") Long carId){
|
||||
return Result.success(sysCarService.getById(carId));
|
||||
return Result.success(carManageService.carManageShowByCarId(carId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 carTypeId 查询车辆信息
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("carManageShowByCarTypeId")
|
||||
public Result<CarManage> carManageShowByCarTypeId(@RequestParam("carTypeId") Long carTypeId){
|
||||
CarManage carManage = carManageService.carManageShowByCarTypeId(carTypeId);
|
||||
return Result.success(carManage);
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,7 +100,7 @@ public class CarManageController extends BaseController {
|
|||
// 随机生成VIN码
|
||||
String key2 = RandomUtil.randomNumbers(17);
|
||||
carVO.setCarVin(key2);
|
||||
sysCarService.insertCar(carVO);
|
||||
carManageService.insertCar(carVO);
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
|
||||
|
@ -102,7 +114,7 @@ public class CarManageController extends BaseController {
|
|||
public Result updataCar(@RequestBody CarManage carVO){
|
||||
//
|
||||
carVO.setUserId(SecurityUtils.getUserId());
|
||||
sysCarService.updateById(carVO);
|
||||
carManageService.updateById(carVO);
|
||||
return Result.success("车辆修改成功");
|
||||
}
|
||||
|
||||
|
@ -113,7 +125,7 @@ public class CarManageController extends BaseController {
|
|||
*/
|
||||
@PostMapping("deleteCar")
|
||||
public Result deleteCar(@RequestParam("ids") List<Long> ids){
|
||||
sysCarService.removeBatchByIds(ids);
|
||||
carManageService.removeBatchByIds(ids);
|
||||
return Result.success("车辆删除成功");
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
* 车辆报文--控制层
|
||||
* @ClassName carMessageController
|
||||
* @Description 车辆类型 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
* 报文类型--控制层
|
||||
* @ClassName CarMessageTypeController
|
||||
* @Description 报文类型 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* 报文模版--控制层
|
||||
* @ClassName CarTemplateController
|
||||
* @Description 报文模版 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
|
|
|
@ -113,8 +113,6 @@ public class WarnRuleController extends BaseController
|
|||
@GetMapping("/selectByStrategyId")
|
||||
public Result<List<WarnRule>> selectByStrategyId
|
||||
(@RequestParam("strategyId") Long strategyId){
|
||||
List<WarnRule> list = warnRuleService.list
|
||||
(new LambdaQueryWrapper<WarnRule>().eq(WarnRule::getStrategyId, strategyId));
|
||||
return success(list);
|
||||
return success(warnRuleService.selectByStrategyId(strategyId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import com.muyu.common.core.utils.poi.ExcelUtil;
|
|||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.enterprise.domain.resp.WarnStrategy;
|
||||
import com.muyu.enterprise.service.IWarnStrategyService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
@ -27,6 +26,7 @@ import java.util.List;
|
|||
@Tag(name = "故障策略",description = "故障策略对应车辆类型用来客户选择")
|
||||
public class WarnStrategyController extends BaseController
|
||||
{
|
||||
|
||||
@Resource
|
||||
private IWarnStrategyService warnStrategyService;
|
||||
|
||||
|
@ -109,8 +109,8 @@ public class WarnStrategyController extends BaseController
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/strategyRuleList")
|
||||
public Result<List<WarnStrategy>> StrategyRuleList(@RequestBody com.muyu.enterprise.domain.WarnStrategy warnStrategy){
|
||||
List<WarnStrategy> list = warnStrategyService.strategyList(warnStrategy);
|
||||
public Result<List<com.muyu.enterprise.domain.WarnStrategy>> StrategyRuleList(@RequestBody com.muyu.enterprise.domain.WarnStrategy warnStrategy){
|
||||
List<com.muyu.enterprise.domain.WarnStrategy> list = warnStrategyService.strategyList(warnStrategy);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.enterprise.domain.CarCompany;
|
|||
* 车辆企业--持久层
|
||||
* @ClassName CarCompanyMapper
|
||||
* @Description 车辆企业 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarCompanyMapper extends BaseMapper<CarCompany> {
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
* 车辆配置--持久层
|
||||
* @ClassName CarManageMapper
|
||||
* @Description 车辆配置 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
|||
* 车辆管理--持久层
|
||||
* @ClassName CarManageMapper
|
||||
* @Description 车辆管理 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||
* 车辆报文--持久层
|
||||
* @ClassName CarMessageMapper
|
||||
* @Description 车辆类型 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* 报文类型--持久层
|
||||
* @ClassName CarMessageTypeMapper
|
||||
* @Description 报文类型 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||
* 报文模版--持久层
|
||||
* @ClassName CarTemplateMapper
|
||||
* @Description 报文模版 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
|||
* 车辆类型--持久层
|
||||
* @ClassName CarTypeMapper
|
||||
* @Description 车辆类型 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -15,5 +15,5 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface WarnStrategyMapper extends BaseMapper<com.muyu.enterprise.domain.WarnStrategy>{
|
||||
|
||||
List<WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy);
|
||||
List<com.muyu.enterprise.domain.WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.muyu.enterprise.domain.CarCompany;
|
|||
* 车辆企业--业务层
|
||||
* @ClassName CarCompanyService
|
||||
* @Description 车辆企业 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarCompanyService extends IService<CarCompany> {
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
* 车辆配置--业务层
|
||||
* @ClassName CarConfigService
|
||||
* @Description 车辆配置 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarConfigService extends IService<CarConfig> {
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||
* 车辆管理--业务层
|
||||
* @ClassName CarManageService
|
||||
* @Description 车辆管理 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarManageService extends IService<CarManage> {
|
||||
|
@ -34,4 +34,18 @@ public interface CarManageService extends IService<CarManage> {
|
|||
* @return
|
||||
*/
|
||||
void insertCar(CarManage carVO);
|
||||
|
||||
/**
|
||||
* 通过 carTypeId 查询车辆信息
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
CarManage carManageShowByCarTypeId(Long carTypeId);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
CarManage carManageShowByCarId(Long carId);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
* 车辆报文--业务层
|
||||
* @ClassName CarMessageService
|
||||
* @Description 车辆类型 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarMessageService extends IService<CarMessage> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
* 报文类型--业务层
|
||||
* @ClassName CarMessageTypeService
|
||||
* @Description 报文类型 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarMessageTypeService extends IService<CarMessageType> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
* 报文模版--业务层
|
||||
* @ClassName CarTemplateService
|
||||
* @Description 报文模版 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarTemplateService extends IService<CarTemplate> {
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.muyu.enterprise.domain.CarType;
|
|||
* 车辆类型--业务层
|
||||
* @ClassName CarTypeService
|
||||
* @Description 车辆类型 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarTypeService extends IService<CarType> {
|
||||
|
|
|
@ -35,6 +35,10 @@ public interface IWarnRuleService extends IService<WarnRule> {
|
|||
*/
|
||||
Boolean checkIdUnique(WarnRule warnRule);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据策略id查询规则
|
||||
* @param strategyId
|
||||
* @return
|
||||
*/
|
||||
List<WarnRule> selectByStrategyId(Long strategyId);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,6 @@ public interface IWarnStrategyService extends IService<com.muyu.enterprise.domai
|
|||
Boolean checkIdUnique(com.muyu.enterprise.domain.WarnStrategy warnStrategy);
|
||||
|
||||
|
||||
List<WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy);
|
||||
List<com.muyu.enterprise.domain.WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy);
|
||||
|
||||
}
|
||||
|
|
|
@ -12,14 +12,14 @@ import org.springframework.stereotype.Service;
|
|||
* 车辆企业--业务实现层
|
||||
* @ClassName CarCompanyServiceImpl
|
||||
* @Description 车辆企业 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
/**
|
||||
* 车辆企业--业务层
|
||||
* @ClassName CarCompanyService
|
||||
* @Description 车辆企业 Service 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* 车辆配置--业务实现层
|
||||
* @ClassName CarConfigServiceImpl
|
||||
* @Description 车辆配置 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -3,10 +3,9 @@ package com.muyu.enterprise.service.impl;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.system.domain.SysEnt;
|
||||
import com.muyu.common.system.remote.RemoteEntService;
|
||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||
import com.muyu.enterprise.controller.CarCompanyController;
|
||||
import com.muyu.enterprise.domain.CarCompany;
|
||||
import com.muyu.enterprise.domain.CarConfig;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
|
@ -16,8 +15,6 @@ import com.muyu.enterprise.mapper.CarManageMapper;
|
|||
import com.muyu.enterprise.service.CarCompanyService;
|
||||
import com.muyu.enterprise.service.CarConfigService;
|
||||
import com.muyu.enterprise.service.CarManageService;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -28,7 +25,7 @@ import java.util.List;
|
|||
* 车辆管理--业务实现层
|
||||
* @ClassName CarManageServiceImpl
|
||||
* @Description 车辆管理 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
@ -42,8 +39,9 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
|||
@Autowired
|
||||
private CarManageCacheService carManageCacheService;
|
||||
@Autowired
|
||||
private RemoteEntService remoteEntService;
|
||||
@Autowired
|
||||
private CarManageMapper carManageMapper;
|
||||
|
||||
/**
|
||||
* 车辆列表2
|
||||
* @param carDTO
|
||||
|
@ -53,6 +51,7 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
|||
public List<CarVO> carListShow2(CarDTO carDTO) {
|
||||
// 获取 企业
|
||||
CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class);
|
||||
|
||||
List<CarManage> list = lambdaQuery()
|
||||
.eq(carManage.getCarVin() != null && carManage.getCarVin() != "", CarManage::getCarVin, carManage.getCarVin())
|
||||
.eq(carManage.getCarModel() != null && carManage.getCarModel() != "", CarManage::getCarModel, carManage.getCarModel())
|
||||
|
@ -71,14 +70,12 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
|||
carVO.setConfigName(carConfig.getConfigName());
|
||||
carVO.setEnergyType(carConfig.getEnergyType());
|
||||
carVO.setGearType(carConfig.getGearType());
|
||||
// 查询出对象,用于赋值
|
||||
CarCompany carCompany = carCompanyService.selectCompanyByCompanyId(carVO.getEnterpriseId());
|
||||
carVO.setCompanyName(carCompany.getCompanyName());
|
||||
// 查询出对象,用于赋值 ----------远调企业
|
||||
SysEnt data = remoteEntService.getById(carVO.getEnterpriseId()).getData();
|
||||
carVO.setName(data.getName());
|
||||
// 存到 redis
|
||||
carManageCacheService.put(carVO.getCarVin(),new CarManage());
|
||||
carManageCacheService.put(carVO.getCarVin(),list);
|
||||
});
|
||||
|
||||
|
||||
return carVOS;
|
||||
}
|
||||
@Override
|
||||
|
@ -105,9 +102,31 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
|
|||
|
||||
@Override
|
||||
public void insertCar(CarManage carVO) {
|
||||
ArrayList<CarManage> carVOS = new ArrayList<>();
|
||||
carVOS.add(carVO);
|
||||
save(carVO);
|
||||
// 存到缓存中去
|
||||
carManageCacheService.put(carVO.getCarVin(),new CarManage());
|
||||
carManageCacheService.put(carVO.getCarVin(),carVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 carTypeId 查询车辆信息
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CarManage carManageShowByCarTypeId(Long carTypeId) {
|
||||
return getById(carTypeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CarManage carManageShowByCarId(Long carId) {
|
||||
return getById(carId);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* 车辆报文--业务实现层
|
||||
* @ClassName CarMessageServiceImpl
|
||||
* @Description 车辆类型 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
* 报文类型--业务实现层
|
||||
* @ClassName CarMessageTypeServiceImpl
|
||||
* @Description 报文类型 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
* 报文模版--业务实现层
|
||||
* @ClassName CarTemplateServiceImpl
|
||||
* @Description 报文模版 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
|||
* 车辆类型--业务实现层
|
||||
* @ClassName CarTypeTypeServiceImpl
|
||||
* @Description 车辆类型 ServiceImpl 层
|
||||
* @author MingWei.Zong
|
||||
* @author MingWei.Zong(微醺)
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Service
|
||||
|
|
|
@ -57,6 +57,8 @@ public class SysCarFaultServiceImpl
|
|||
SysCarFault::getCarVin, sysCarFault.getCarVin());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(sysCarFault.getFaultWarn()),
|
||||
SysCarFault::getFaultWarn, sysCarFault.getFaultWarn());
|
||||
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.enterprise.domain.WarnRule;
|
||||
import com.muyu.enterprise.mapper.WarnRuleMapper;
|
||||
import com.muyu.enterprise.service.CarManageService;
|
||||
import com.muyu.enterprise.service.IWarnRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
@ -21,7 +23,6 @@ import java.util.List;
|
|||
public class WarnRuleServiceImpl
|
||||
extends ServiceImpl<WarnRuleMapper, WarnRule>
|
||||
implements IWarnRuleService {
|
||||
|
||||
/**
|
||||
* 精确查询预警规则
|
||||
*
|
||||
|
@ -84,6 +85,15 @@ public class WarnRuleServiceImpl
|
|||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据策略id查询规则
|
||||
* @param strategyId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<WarnRule> selectByStrategyId(Long strategyId) {
|
||||
return list(new LambdaQueryWrapper<WarnRule>().eq(WarnRule::getStrategyId, strategyId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
package com.muyu.enterprise.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.enterprise.domain.resp.WarnStrategy;
|
||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||
import com.muyu.enterprise.cache.CarWarnCacheService;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
import com.muyu.enterprise.domain.WarnRule;
|
||||
import com.muyu.enterprise.domain.WarnStrategy;
|
||||
import com.muyu.enterprise.domain.vo.WarnVo;
|
||||
import com.muyu.enterprise.mapper.WarnStrategyMapper;
|
||||
import com.muyu.enterprise.service.CarManageService;
|
||||
import com.muyu.enterprise.service.IWarnRuleService;
|
||||
import com.muyu.enterprise.service.IWarnStrategyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -23,6 +32,12 @@ public class WarnStrategyServiceImpl
|
|||
extends ServiceImpl<WarnStrategyMapper, com.muyu.enterprise.domain.WarnStrategy>
|
||||
implements IWarnStrategyService {
|
||||
|
||||
@Autowired
|
||||
private CarManageService carManageService;
|
||||
@Resource
|
||||
private IWarnRuleService warnRuleService;
|
||||
@Autowired
|
||||
private CarWarnCacheService carWarnCacheService;
|
||||
@Autowired
|
||||
private WarnStrategyMapper warnStrategyMapper;
|
||||
|
||||
|
@ -61,7 +76,27 @@ public class WarnStrategyServiceImpl
|
|||
if (StringUtils.isNotNull(warnStrategy.getTemplateId())){
|
||||
queryWrapper.eq(com.muyu.enterprise.domain.WarnStrategy::getTemplateId, warnStrategy.getTemplateId());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
// 1.获取 车辆 vin 码
|
||||
CarManage carManage = carManageService.carManageShowByCarTypeId(warnStrategy.getCarTypeId());
|
||||
List<WarnStrategy> list = list(queryWrapper);
|
||||
WarnVo warnVo = new WarnVo();
|
||||
// 遍历 赋值
|
||||
list.forEach(warnStrategy1 -> {
|
||||
// 2.查询 对应的策略有没有规则
|
||||
List<WarnRule> warnRules = warnRuleService.selectByStrategyId(warnStrategy1.getId());
|
||||
// 3.判断有没有对应的规则
|
||||
if(warnRules.size()!=0){// 有规则
|
||||
// 把查询出来的预警规则放入自定义的实体类
|
||||
warnVo.setWarnRuleList(warnRules);
|
||||
}
|
||||
warnVo.setId(warnStrategy1.getId());
|
||||
warnVo.setCarTypeId(warnStrategy1.getCarTypeId());
|
||||
warnVo.setStrategyName(warnStrategy1.getStrategyName());
|
||||
warnVo.setTemplateId(warnStrategy1.getTemplateId());
|
||||
});
|
||||
// 存储到 redis 中去
|
||||
carWarnCacheService.put(carManage.getCarVin(),warnVo);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,7 +112,7 @@ public class WarnStrategyServiceImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy) {
|
||||
public List<com.muyu.enterprise.domain.WarnStrategy> strategyList(com.muyu.enterprise.domain.WarnStrategy warnStrategy) {
|
||||
return warnStrategyMapper.strategyList(warnStrategy);
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class EntResp {
|
|||
* 手机号码
|
||||
*/
|
||||
@Schema(title = "手机号码", type = "String", defaultValue = "18321974313", description = "手机号码")
|
||||
private String phoneNumber;
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
|
@ -71,7 +71,7 @@ public class EntResp {
|
|||
.entId(sysEnt.getId())
|
||||
.entName(sysEnt.getName())
|
||||
.leader(sysEnt.getLeader())
|
||||
.phoneNumber(sysEnt.getPhone())
|
||||
.phone(sysEnt.getPhone())
|
||||
.email(sysEnt.getEmail())
|
||||
.entCode(sysEnt.getEntCode())
|
||||
.entStatus(sysEnt.getEntStatus())
|
||||
|
|
15
pom.xml
15
pom.xml
|
@ -53,6 +53,7 @@
|
|||
<mybatis.plus.join.version>1.4.13</mybatis.plus.join.version>
|
||||
<org.eclipse.paho.client.mqttv3.version>1.2.5</org.eclipse.paho.client.mqttv3.version>
|
||||
<caffeine.version>3.1.8</caffeine.version>
|
||||
<mybatis.plus.join.version>1.4.13</mybatis.plus.join.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
|
@ -270,6 +271,20 @@
|
|||
<version>${caffeine.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MyBatisPlus - 依赖包 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
<version>${mybatis.plus.join.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
|
Loading…
Reference in New Issue