diff --git a/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/RemoteMessageDataService.java b/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/RemoteMessageDataService.java deleted file mode 100644 index 35908dc..0000000 --- a/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/RemoteMessageDataService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.muyu.clw.common.many.remote; - -import com.muyu.clw.common.many.remote.factory.RemoteEnterpriseFallbackFactory; -import com.muyu.clw.common.many.remote.factory.RemoteMessageDataFallbackFactory; -import com.muyu.common.core.constant.ServiceNameConstants; -import com.muyu.common.core.domain.Result; -import com.muyu.domain.Enterprise; -import com.muyu.domain.MessageData; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; - -import java.util.List; - -/** - * 用户服务 - * - * @author muyu - */ -@FeignClient( - contextId = "remoteMessageDataService", - value = ServiceNameConstants.COMPANY_ENTERPRISE, - fallbackFactory = RemoteMessageDataFallbackFactory.class -) -public interface RemoteMessageDataService { - - @GetMapping("/messageData/list") - public Result> enterpriseAllList(); -} diff --git a/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/factory/RemoteMessageDataFallbackFactory.java b/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/factory/RemoteMessageDataFallbackFactory.java deleted file mode 100644 index ac896b8..0000000 --- a/muyu-common/muyu-common-saas/src/main/java/com/muyu/clw/common/many/remote/factory/RemoteMessageDataFallbackFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.muyu.clw.common.many.remote.factory; - -import com.muyu.clw.common.many.remote.RemoteEnterpriseService; -import com.muyu.clw.common.many.remote.RemoteMessageDataService; -import com.muyu.common.core.domain.Result; -import com.muyu.domain.Enterprise; -import com.muyu.domain.MessageData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cloud.openfeign.FallbackFactory; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @ClassName RemoteEnterpriseFallbackFactory - * @Author AnNan.Wang - * @Date 2024/6/7 21:55 - */ - -@Component -public class RemoteMessageDataFallbackFactory implements FallbackFactory { - private static final Logger log = LoggerFactory.getLogger(RemoteMessageDataFallbackFactory.class); - - @Override - public RemoteMessageDataService create(Throwable cause) { - log.error("日志服务调用失败:{}", cause.getMessage()); - return new RemoteMessageDataService() { - @Override - public Result> enterpriseAllList() { - return Result.error("报文配置获取失败:{}"+cause.getMessage()); - } - }; - } -} diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/EnterpriseController.java b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/EnterpriseController.java index fb48b4f..3b20aae 100644 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/EnterpriseController.java +++ b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/EnterpriseController.java @@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletResponse; import com.muyu.authentication.service.IEnterpriseService; import com.muyu.domain.vo.EnterpriseReq; -import com.muyu.many.domain.Message.MessageData; +import com.muyu.many.domain.Message.MessageDataArgument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.muyu.common.log.annotation.Log; @@ -128,7 +128,7 @@ public class EnterpriseController extends BaseController } @GetMapping("/redisList/{vin}") - public Result redisList(@PathVariable String vin){ + public Result redisList(@PathVariable String vin){ return Result.success( enterpriseService.redisList(vin) ); diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java deleted file mode 100644 index 8d0045a..0000000 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.muyu.authentication.controller; - -import com.muyu.authentication.service.MessageDataService; -import com.muyu.common.core.domain.Result; -import com.muyu.domain.MessageData; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * 报文解析配置Controller层 - * - * @ClassName MessageDataController - * @Author AnNan.Wang - * @Date 2024/6/27 10:27 - */ - -@RestController -@RequestMapping("/messageData") -public class MessageDataController { - @Autowired - private MessageDataService messageDataService; - - @GetMapping("/list") - public Result> list(){ - return Result.success( - messageDataService.messageList() - ); - } -} diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/IEnterpriseService.java b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/IEnterpriseService.java index bcb44d6..a261b55 100644 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/IEnterpriseService.java +++ b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/IEnterpriseService.java @@ -5,7 +5,7 @@ import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.domain.Enterprise; import com.muyu.domain.vo.EnterpriseReq; -import com.muyu.many.domain.Message.MessageData; +import com.muyu.many.domain.Message.MessageDataArgument; /** * 企业Service接口 @@ -69,5 +69,5 @@ public interface IEnterpriseService extends IService String enterpriseUpdateId(Long id); - MessageData redisList(String vin); + MessageDataArgument redisList(String vin); } diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/MessageDataService.java b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/MessageDataService.java deleted file mode 100644 index 20e7f90..0000000 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/MessageDataService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.muyu.authentication.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.muyu.domain.MessageData; - -import java.util.List; - -/** - * 报文解析配置Service层 - * - * @author AnNan.Wang - * @ClassName: MessageDataService - * @createTime: 2024/6/27 10:30 - */ -public interface MessageDataService extends IService { - List messageList(); - - -} diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/impl/EnterpriseServiceImpl.java b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/impl/EnterpriseServiceImpl.java index 6d51ab2..a682c92 100644 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/impl/EnterpriseServiceImpl.java +++ b/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/service/impl/EnterpriseServiceImpl.java @@ -18,8 +18,7 @@ import com.muyu.common.core.utils.DateUtils; import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.remote.RemoteUserService; import com.muyu.domain.vo.EnterpriseReq; -import com.muyu.many.domain.Message.MessageData; -import com.muyu.many.forewarning.EarlyWarning; +import com.muyu.many.domain.Message.MessageDataArgument; import lombok.extern.log4j.Log4j2; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; @@ -246,8 +245,8 @@ public class EnterpriseServiceImpl extends ServiceImpl - implements MessageDataService { - - @Autowired - private MessageDataMapper messageDataMapper; - - @Override - public List messageList() { - return messageDataMapper.selectList(null); - } -} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageData.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageDataArgument.java similarity index 98% rename from muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageData.java rename to muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageDataArgument.java index c94c798..d52a7b0 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageData.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Message/MessageDataArgument.java @@ -6,7 +6,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; /** - * 报文对象 MessageData + * 报文对象 MessageDataArgument * * @author Yangle * Date 2024/6/7 17:15 @@ -15,7 +15,7 @@ import lombok.experimental.SuperBuilder; @AllArgsConstructor @NoArgsConstructor @SuperBuilder -public class MessageData { +public class MessageDataArgument { /** *vin */ diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageAnalysis.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageAnalysis.java index ab95d86..9984fd1 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageAnalysis.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageAnalysis.java @@ -1,57 +1,110 @@ package com.muyu.many.domain; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.AllArgsConstructor; +import com.muyu.many.domain.req.MessageAnalysisEditReq; +import com.muyu.many.domain.req.MessageAnalysisQueryReq; +import com.muyu.many.domain.req.MessageAnalysisSaveReq; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; /** - * 报文解析配置 + * 报文解析对象 message_analysis * - * @ClassName MessageAnalysis - * @Author AnNan.Wang - * @Date 2024/6/26 18:38 + * @author wan + * @date 2024-06-28 */ - @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @TableName("message_analysis") -public class MessageAnalysis { - /** - * 主键 - */ +@ApiModel(value = "MessageAnalysis", description = "报文解析") +public class MessageAnalysis{ + + + /** 主键 */ @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") private Long id; - /** - * 车辆ID - */ + + @Excel(name = "车辆ID") + @ApiModelProperty(name = "车辆ID", value = "车辆ID") private Long vehicleId; - /** - * 指标项key - */ + + /** 指标项key */ + @Excel(name = "指标项key") + @ApiModelProperty(name = "指标项key", value = "指标项key") private String analyzeKey; - /** - * 起始位 - */ - private Integer analyzeStart; - /** - * 终止位 - */ - private Integer ent; - /** - * 指标项标签 - */ + + /** 起始位 */ + @Excel(name = "起始位") + @ApiModelProperty(name = "起始位", value = "起始位") + private Long analyzeStart; + + /** 终止位 */ + @Excel(name = "终止位") + @ApiModelProperty(name = "终止位", value = "终止位") + private Long ent; + + /** 指标项标签 */ + @Excel(name = "指标项标签") + @ApiModelProperty(name = "指标项标签", value = "指标项标签") private String lable; - /** - * 类型 - */ + + /** 类型 */ + @Excel(name = "类型") + @ApiModelProperty(name = "类型", value = "类型") private String type; + /** + * 查询构造器 + */ + public static MessageAnalysis queryBuild(MessageAnalysisQueryReq messageAnalysisQueryReq){ + return MessageAnalysis.builder() + .vehicleId(messageAnalysisQueryReq.getVehicleId()) + .analyzeKey(messageAnalysisQueryReq.getAnalyzeKey()) + .analyzeStart(messageAnalysisQueryReq.getAnalyzeStart()) + .ent(messageAnalysisQueryReq.getEnt()) + .lable(messageAnalysisQueryReq.getLable()) + .type(messageAnalysisQueryReq.getType()) + .build(); + } + + /** + * 添加构造器 + */ + public static MessageAnalysis saveBuild(MessageAnalysisSaveReq messageAnalysisSaveReq){ + return MessageAnalysis.builder() + .vehicleId(messageAnalysisSaveReq.getVehicleId()) + .analyzeKey(messageAnalysisSaveReq.getAnalyzeKey()) + .analyzeStart(messageAnalysisSaveReq.getAnalyzeStart()) + .ent(messageAnalysisSaveReq.getEnt()) + .lable(messageAnalysisSaveReq.getLable()) + .type(messageAnalysisSaveReq.getType()) + .build(); + } + + /** + * 修改构造器 + */ + public static MessageAnalysis editBuild(Long id, MessageAnalysisEditReq messageAnalysisEditReq){ + return MessageAnalysis.builder() + .id(id) + .vehicleId(messageAnalysisEditReq.getVehicleId()) + .analyzeKey(messageAnalysisEditReq.getAnalyzeKey()) + .analyzeStart(messageAnalysisEditReq.getAnalyzeStart()) + .ent(messageAnalysisEditReq.getEnt()) + .lable(messageAnalysisEditReq.getLable()) + .type(messageAnalysisEditReq.getType()) + .build(); + } } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageConfigurationType.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageConfigurationType.java new file mode 100644 index 0000000..6d498d7 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageConfigurationType.java @@ -0,0 +1,81 @@ +package com.muyu.many.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.many.domain.req.MessageConfigurationTypeEditReq; +import com.muyu.many.domain.req.MessageConfigurationTypeQueryReq; +import com.muyu.many.domain.req.MessageConfigurationTypeSaveReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文配置类型对象 message_configuration_type + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("message_configuration_type") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "MessageConfigurationType", description = "报文配置类型") +public class MessageConfigurationType extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 类型名称 */ + @Excel(name = "类型名称") + @ApiModelProperty(name = "类型名称", value = "类型名称") + private String typeName; + + /** 类型标识 */ + @Excel(name = "类型标识") + @ApiModelProperty(name = "类型标识", value = "类型标识") + private String typeIdentification; + + /** + * 查询构造器 + */ + public static MessageConfigurationType queryBuild( MessageConfigurationTypeQueryReq messageConfigurationTypeQueryReq){ + return MessageConfigurationType.builder() + .typeName(messageConfigurationTypeQueryReq.getTypeName()) + .typeIdentification(messageConfigurationTypeQueryReq.getTypeIdentification()) + .build(); + } + + /** + * 添加构造器 + */ + public static MessageConfigurationType saveBuild(MessageConfigurationTypeSaveReq messageConfigurationTypeSaveReq){ + return MessageConfigurationType.builder() + .typeName(messageConfigurationTypeSaveReq.getTypeName()) + .typeIdentification(messageConfigurationTypeSaveReq.getTypeIdentification()) + .build(); + } + + /** + * 修改构造器 + */ + public static MessageConfigurationType editBuild(Long id, MessageConfigurationTypeEditReq messageConfigurationTypeEditReq){ + return MessageConfigurationType.builder() + .id(id) + .typeName(messageConfigurationTypeEditReq.getTypeName()) + .typeIdentification(messageConfigurationTypeEditReq.getTypeIdentification()) + .build(); + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageData.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageData.java new file mode 100644 index 0000000..7461e64 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/MessageData.java @@ -0,0 +1,105 @@ +package com.muyu.many.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.many.domain.req.MessageDataEditReq; +import com.muyu.many.domain.req.MessageDataQueryReq; +import com.muyu.many.domain.req.MessageDataSaveReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文类型数据对象 message_data + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("message_data") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "MessageDataArgument", description = "报文类型数据") +public class MessageData extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 报文标签 */ + @Excel(name = "报文标签") + @ApiModelProperty(name = "报文标签", value = "报文标签") + private String messageLabel; + + /** 指标Key */ + @Excel(name = "指标Key") + @ApiModelProperty(name = "指标Key", value = "指标Key") + private String analyzeKey; + + /** 起始位 */ + @Excel(name = "起始位") + @ApiModelProperty(name = "起始位", value = "起始位") + private String initiationPosition; + + /** 终止位 */ + @Excel(name = "终止位") + @ApiModelProperty(name = "终止位", value = "终止位") + private String terminatePosition; + + /** 报文类型 */ + @Excel(name = "报文类型") + @ApiModelProperty(name = "报文类型", value = "报文类型") + private String typeIdentification; + + /** + * 查询构造器 + */ + public static MessageData queryBuild(MessageDataQueryReq messageDataQueryReq){ + return MessageData.builder() + .messageLabel(messageDataQueryReq.getMessageLabel()) + .analyzeKey(messageDataQueryReq.getAnalyzeKey()) + .initiationPosition(messageDataQueryReq.getInitiationPosition()) + .terminatePosition(messageDataQueryReq.getTerminatePosition()) + .typeIdentification(messageDataQueryReq.getTypeIdentification()) + .build(); + } + + /** + * 添加构造器 + */ + public static MessageData saveBuild(MessageDataSaveReq messageDataSaveReq){ + return MessageData.builder() + .messageLabel(messageDataSaveReq.getMessageLabel()) + .analyzeKey(messageDataSaveReq.getAnalyzeKey()) + .initiationPosition(messageDataSaveReq.getInitiationPosition()) + .terminatePosition(messageDataSaveReq.getTerminatePosition()) + .typeIdentification(messageDataSaveReq.getTypeIdentification()) + .build(); + } + + /** + * 修改构造器 + */ + public static MessageData editBuild(Long id, MessageDataEditReq messageDataEditReq){ + return MessageData.builder() + .id(id) + .messageLabel(messageDataEditReq.getMessageLabel()) + .analyzeKey(messageDataEditReq.getAnalyzeKey()) + .initiationPosition(messageDataEditReq.getInitiationPosition()) + .terminatePosition(messageDataEditReq.getTerminatePosition()) + .typeIdentification(messageDataEditReq.getTypeIdentification()) + .build(); + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlideLength.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlideLength.java new file mode 100644 index 0000000..9f8e248 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlideLength.java @@ -0,0 +1,80 @@ +package com.muyu.many.domain; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.many.domain.req.SlideLengthEditReq; +import com.muyu.many.domain.req.SlideLengthQueryReq; +import com.muyu.many.domain.req.SlideLengthSaveReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑动长度对象 slide_length + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("slide_length") +@ApiModel(value = "SlideLength", description = "滑动长度") +public class SlideLength { + + + /** id */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "id", value = "id") + private Long id; + + /** 滑动长度名称 */ + @Excel(name = "滑动长度名称") + @ApiModelProperty(name = "滑动长度名称", value = "滑动长度名称") + private String slideLengthName; + + /** 占比 */ + @Excel(name = "占比") + @ApiModelProperty(name = "占比", value = "占比") + private BigDecimal slideLengthProportion; + + /** + * 查询构造器 + */ + public static SlideLength queryBuild( SlideLengthQueryReq slideLengthQueryReq){ + return SlideLength.builder() + .slideLengthName(slideLengthQueryReq.getSlideLengthName()) + .slideLengthProportion(slideLengthQueryReq.getSlideLengthProportion()) + .build(); + } + + /** + * 添加构造器 + */ + public static SlideLength saveBuild(SlideLengthSaveReq slideLengthSaveReq){ + return SlideLength.builder() + .slideLengthName(slideLengthSaveReq.getSlideLengthName()) + .slideLengthProportion(slideLengthSaveReq.getSlideLengthProportion()) + .build(); + } + + /** + * 修改构造器 + */ + public static SlideLength editBuild(Long id, SlideLengthEditReq slideLengthEditReq){ + return SlideLength.builder() + .id(id) + .slideLengthName(slideLengthEditReq.getSlideLengthName()) + .slideLengthProportion(slideLengthEditReq.getSlideLengthProportion()) + .build(); + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlidingInfo.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlidingInfo.java new file mode 100644 index 0000000..54e97d6 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/SlidingInfo.java @@ -0,0 +1,113 @@ +package com.muyu.many.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.many.domain.req.SlidingInfoEditReq; +import com.muyu.many.domain.req.SlidingInfoQueryReq; +import com.muyu.many.domain.req.SlidingInfoSaveReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗对象 sliding_info + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("sliding_info") +@ApiModel(value = "SlidingInfo", description = "滑窗") +public class SlidingInfo { + + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** VIN */ + @Excel(name = "VIN") + @ApiModelProperty(name = "VIN", value = "VIN") + private String vehicleVin; + + /** 报文解析ID */ + @Excel(name = "报文解析ID") + @ApiModelProperty(name = "报文解析ID", value = "报文解析ID") + private Long messageKye; + + /** 指标项Key */ + @Excel(name = "指标项Key") + @ApiModelProperty(name = "指标项Key", value = "指标项Key") + private String analyzeKey; + + /** 指标项标签 */ + @Excel(name = "指标项标签") + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String messageLabel; + + /** 标准 */ + @Excel(name = "标准") + @ApiModelProperty(name = "标准", value = "标准") + private Long standard; + + /** 滑窗范围 */ + @Excel(name = "滑窗范围") + @ApiModelProperty(name = "滑窗范围", value = "滑窗范围") + private Long windowRadiusId; + + /** 滑动长度 */ + @Excel(name = "滑动长度") + @ApiModelProperty(name = "滑动长度", value = "滑动长度") + private Long slideLengthId; + + /** + * 查询构造器 + */ + public static SlidingInfo queryBuild( SlidingInfoQueryReq slidingInfoQueryReq){ + return SlidingInfo.builder() + .vehicleVin(slidingInfoQueryReq.getVehicleVin()) + .build(); + } + + /** + * 添加构造器 + */ + public static SlidingInfo saveBuild(SlidingInfoSaveReq slidingInfoSaveReq){ + return SlidingInfo.builder() + .vehicleVin(slidingInfoSaveReq.getVehicleVin()) + .messageKye(slidingInfoSaveReq.getMessageKye()) + .analyzeKey(slidingInfoSaveReq.getAnalyzeKey()) + .messageLabel(slidingInfoSaveReq.getMessageLabel()) + .standard(slidingInfoSaveReq.getStandard()) + .windowRadiusId(slidingInfoSaveReq.getWindowRadiusId()) + .slideLengthId(slidingInfoSaveReq.getSlideLengthId()) + .build(); + } + + /** + * 修改构造器 + */ + public static SlidingInfo editBuild(Long id, SlidingInfoEditReq slidingInfoEditReq){ + return SlidingInfo.builder() + .id(id) + .vehicleVin(slidingInfoEditReq.getVehicleVin()) + .messageKye(slidingInfoEditReq.getMessageKye()) + .analyzeKey(slidingInfoEditReq.getAnalyzeKey()) + .messageLabel(slidingInfoEditReq.getMessageLabel()) + .standard(slidingInfoEditReq.getStandard()) + .windowRadiusId(slidingInfoEditReq.getWindowRadiusId()) + .slideLengthId(slidingInfoEditReq.getSlideLengthId()) + .build(); + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Window.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Window.java new file mode 100644 index 0000000..0ee92d1 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/Window.java @@ -0,0 +1,79 @@ +package com.muyu.many.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.many.domain.req.WindowEditReq; +import com.muyu.many.domain.req.WindowQueryReq; +import com.muyu.many.domain.req.WindowSaveReq; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗范围对象 window + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("window") +@ApiModel(value = "Window", description = "滑窗范围") +public class Window{ + + + /** 主键 */ + @TableId(value = "id",type = IdType.AUTO) + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 滑窗范围名称 */ + @Excel(name = "滑窗范围名称") + @ApiModelProperty(name = "滑窗范围名称", value = "滑窗范围名称") + private String windowRadiusName; + + /** 滑窗长度 */ + @Excel(name = "滑窗长度") + @ApiModelProperty(name = "滑窗长度", value = "滑窗长度") + private Long windowRadiusLength; + + /** + * 查询构造器 + */ + public static Window queryBuild( WindowQueryReq windowQueryReq){ + return Window.builder() + .windowRadiusName(windowQueryReq.getWindowRadiusName()) + .windowRadiusLength(windowQueryReq.getWindowRadiusLength()) + .build(); + } + + /** + * 添加构造器 + */ + public static Window saveBuild(WindowSaveReq windowSaveReq){ + return Window.builder() + .windowRadiusName(windowSaveReq.getWindowRadiusName()) + .windowRadiusLength(windowSaveReq.getWindowRadiusLength()) + .build(); + } + + /** + * 修改构造器 + */ + public static Window editBuild(Long id, WindowEditReq windowEditReq){ + return Window.builder() + .id(id) + .windowRadiusName(windowEditReq.getWindowRadiusName()) + .windowRadiusLength(windowEditReq.getWindowRadiusLength()) + .build(); + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageAnalysisMq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageAnalysisMq.java new file mode 100644 index 0000000..83dca30 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageAnalysisMq.java @@ -0,0 +1,45 @@ +package com.muyu.many.domain.mq; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.math.BigDecimal; + +/** + * @ClassName MessageAnalysisMq + * @Author AnNan.Wang + * @Date 2024/6/29 12:51 + */ + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class MessageAnalysisMq { + /** + * VIN + */ + private String vehicleVin; + /** + * 指标项Key + */ + private String analyzeKey; + /** + * 指标项标签 + */ + private String messageLabel; + /** + * 标准 + */ + private Long standard; + /** + * 滑窗范围 + */ + private Long windowRadiusId; + /** + * 滑动长度 + */ + private BigDecimal slideLengthId; +} diff --git a/muyu-modules/muyu-company/muyu-company-common/src/main/java/com/muyu/domain/MessageData.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageData.java similarity index 58% rename from muyu-modules/muyu-company/muyu-company-common/src/main/java/com/muyu/domain/MessageData.java rename to muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageData.java index 3aa4e41..1778feb 100644 --- a/muyu-modules/muyu-company/muyu-company-common/src/main/java/com/muyu/domain/MessageData.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageData.java @@ -1,50 +1,44 @@ -package com.muyu.domain; +package com.muyu.many.domain.mq; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.common.core.annotation.Excel; import com.muyu.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; /** - * 报文表 + * 报文类型数据对象 message_data * - * @ClassName MessageData - * @Author AnNan.Wang - * @Date 2024/6/27 9:56 + * @author wan + * @date 2024-06-28 */ @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor -@TableName("message_data") -public class MessageData extends BaseEntity { - /** - * 主键 - */ - @TableId(value = "id",type = IdType.AUTO) +public class MessageData extends BaseEntity{ + private Long id; - /** - * 报文标签 - */ + private String messageLabel; - /** - * 指标Key - */ + + private String analyzeKey; - /** - * 起始位 - */ + + private String initiationPosition; - /** - * 终止位 - */ + + private String terminatePosition; - /** - * 报文类型 - */ + + private String typeIdentification; + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageDataEnterpriseMq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageDataEnterpriseMq.java new file mode 100644 index 0000000..65f0c64 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/mq/MessageDataEnterpriseMq.java @@ -0,0 +1,27 @@ +package com.muyu.many.domain.mq; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +/** + * 企业报文传输 + * + * @ClassName MessageDataEnterprise + * @Author AnNan.Wang + * @Date 2024/6/28 18:35 + */ + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class MessageDataEnterpriseMq { + + private String ent; + + private List messageDataList; +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisEditReq.java new file mode 100644 index 0000000..15008d0 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisEditReq.java @@ -0,0 +1,49 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文解析对象 message_analysis + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageAnalysisEditReq", description = "报文解析") +public class MessageAnalysisEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 车辆ID */ + @ApiModelProperty(name = "车辆ID", value = "车辆ID") + private Long vehicleId; + + /** 指标项key */ + @ApiModelProperty(name = "指标项key", value = "指标项key") + private String analyzeKey; + + /** 起始位 */ + @ApiModelProperty(name = "起始位", value = "起始位") + private Long analyzeStart; + + /** 终止位 */ + @ApiModelProperty(name = "终止位", value = "终止位") + private Long ent; + + /** 指标项标签 */ + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String lable; + + /** 类型 */ + @ApiModelProperty(name = "类型", value = "类型") + private String type; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisQueryReq.java new file mode 100644 index 0000000..7a7baea --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisQueryReq.java @@ -0,0 +1,49 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文解析对象 message_analysis + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageAnalysisQueryReq", description = "报文解析") +public class MessageAnalysisQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 车辆ID */ + @ApiModelProperty(name = "车辆ID", value = "车辆ID") + private Long vehicleId; + + /** 指标项key */ + @ApiModelProperty(name = "指标项key", value = "指标项key") + private String analyzeKey; + + /** 起始位 */ + @ApiModelProperty(name = "起始位", value = "起始位") + private Long analyzeStart; + + /** 终止位 */ + @ApiModelProperty(name = "终止位", value = "终止位") + private Long ent; + + /** 指标项标签 */ + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String lable; + + /** 类型 */ + @ApiModelProperty(name = "类型", value = "类型") + private String type; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisSaveReq.java new file mode 100644 index 0000000..750a0a7 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageAnalysisSaveReq.java @@ -0,0 +1,60 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文解析对象 message_analysis + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageAnalysisSaveReq", description = "报文解析") +public class MessageAnalysisSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 车辆ID */ + + @ApiModelProperty(name = "车辆ID", value = "车辆ID") + private Long vehicleId; + + /** 指标项key */ + + @ApiModelProperty(name = "指标项key", value = "指标项key") + private String analyzeKey; + + /** 起始位 */ + + @ApiModelProperty(name = "起始位", value = "起始位") + private Long analyzeStart; + + /** 终止位 */ + + @ApiModelProperty(name = "终止位", value = "终止位") + private Long ent; + + /** 指标项标签 */ + + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String lable; + + /** 类型 */ + + @ApiModelProperty(name = "类型", value = "类型") + private String type; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeEditReq.java new file mode 100644 index 0000000..9d74f96 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeEditReq.java @@ -0,0 +1,33 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文配置类型对象 message_configuration_type + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageConfigurationTypeEditReq", description = "报文配置类型") +public class MessageConfigurationTypeEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 类型名称 */ + @ApiModelProperty(name = "类型名称", value = "类型名称") + private String typeName; + + /** 类型标识 */ + @ApiModelProperty(name = "类型标识", value = "类型标识") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeQueryReq.java new file mode 100644 index 0000000..be321cf --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeQueryReq.java @@ -0,0 +1,33 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文配置类型对象 message_configuration_type + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageConfigurationTypeQueryReq", description = "报文配置类型") +public class MessageConfigurationTypeQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 类型名称 */ + @ApiModelProperty(name = "类型名称", value = "类型名称") + private String typeName; + + /** 类型标识 */ + @ApiModelProperty(name = "类型标识", value = "类型标识") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeSaveReq.java new file mode 100644 index 0000000..1474acd --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageConfigurationTypeSaveReq.java @@ -0,0 +1,40 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文配置类型对象 message_configuration_type + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageConfigurationTypeSaveReq", description = "报文配置类型") +public class MessageConfigurationTypeSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 类型名称 */ + + @ApiModelProperty(name = "类型名称", value = "类型名称") + private String typeName; + + /** 类型标识 */ + + @ApiModelProperty(name = "类型标识", value = "类型标识") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEditReq.java new file mode 100644 index 0000000..6e15787 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEditReq.java @@ -0,0 +1,45 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文类型数据对象 message_data + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageDataEditReq", description = "报文类型数据") +public class MessageDataEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 报文标签 */ + @ApiModelProperty(name = "报文标签", value = "报文标签") + private String messageLabel; + + /** 指标Key */ + @ApiModelProperty(name = "指标Key", value = "指标Key") + private String analyzeKey; + + /** 起始位 */ + @ApiModelProperty(name = "起始位", value = "起始位") + private String initiationPosition; + + /** 终止位 */ + @ApiModelProperty(name = "终止位", value = "终止位") + private String terminatePosition; + + /** 报文类型 */ + @ApiModelProperty(name = "报文类型", value = "报文类型") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterprise.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterprise.java new file mode 100644 index 0000000..32b0a80 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterprise.java @@ -0,0 +1,29 @@ +package com.muyu.many.domain.req; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +/** + * 企业报文 + * + * @ClassName MessageDataEnterprise + * @Author AnNan.Wang + * @Date 2024/6/28 18:35 + */ + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class MessageDataEnterprise { + /** + * 车辆ID + */ + private Long id; + + private List ids; +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterpriseMq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterpriseMq.java new file mode 100644 index 0000000..634ac3a --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataEnterpriseMq.java @@ -0,0 +1,28 @@ +package com.muyu.many.domain.req; + +import com.muyu.many.domain.MessageData; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +/** + * 企业报文传输 + * + * @ClassName MessageDataEnterprise + * @Author AnNan.Wang + * @Date 2024/6/28 18:35 + */ + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class MessageDataEnterpriseMq { + + private Long id; + + private List messageDataList; +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataQueryReq.java new file mode 100644 index 0000000..83176d9 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataQueryReq.java @@ -0,0 +1,45 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文类型数据对象 message_data + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageDataQueryReq", description = "报文类型数据") +public class MessageDataQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 报文标签 */ + @ApiModelProperty(name = "报文标签", value = "报文标签") + private String messageLabel; + + /** 指标Key */ + @ApiModelProperty(name = "指标Key", value = "指标Key") + private String analyzeKey; + + /** 起始位 */ + @ApiModelProperty(name = "起始位", value = "起始位") + private String initiationPosition; + + /** 终止位 */ + @ApiModelProperty(name = "终止位", value = "终止位") + private String terminatePosition; + + /** 报文类型 */ + @ApiModelProperty(name = "报文类型", value = "报文类型") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataSaveReq.java new file mode 100644 index 0000000..e221ed2 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/MessageDataSaveReq.java @@ -0,0 +1,55 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 报文类型数据对象 message_data + * + * @author wan + * @date 2024-06-28 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "MessageDataSaveReq", description = "报文类型数据") +public class MessageDataSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 报文标签 */ + + @ApiModelProperty(name = "报文标签", value = "报文标签") + private String messageLabel; + + /** 指标Key */ + + @ApiModelProperty(name = "指标Key", value = "指标Key") + private String analyzeKey; + + /** 起始位 */ + + @ApiModelProperty(name = "起始位", value = "起始位") + private String initiationPosition; + + /** 终止位 */ + + @ApiModelProperty(name = "终止位", value = "终止位") + private String terminatePosition; + + /** 报文类型 */ + + @ApiModelProperty(name = "报文类型", value = "报文类型") + private String typeIdentification; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthEditReq.java new file mode 100644 index 0000000..69b2c72 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthEditReq.java @@ -0,0 +1,35 @@ +package com.muyu.many.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑动长度对象 slide_length + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlideLengthEditReq", description = "滑动长度") +public class SlideLengthEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 滑动长度名称 */ + @ApiModelProperty(name = "滑动长度名称", value = "滑动长度名称") + private String slideLengthName; + + /** 占比 */ + @ApiModelProperty(name = "占比", value = "占比") + private BigDecimal slideLengthProportion; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthQueryReq.java new file mode 100644 index 0000000..fca4456 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthQueryReq.java @@ -0,0 +1,35 @@ +package com.muyu.many.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑动长度对象 slide_length + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlideLengthQueryReq", description = "滑动长度") +public class SlideLengthQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 滑动长度名称 */ + @ApiModelProperty(name = "滑动长度名称", value = "滑动长度名称") + private String slideLengthName; + + /** 占比 */ + @ApiModelProperty(name = "占比", value = "占比") + private BigDecimal slideLengthProportion; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthSaveReq.java new file mode 100644 index 0000000..f6d5341 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlideLengthSaveReq.java @@ -0,0 +1,42 @@ +package com.muyu.many.domain.req; + +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑动长度对象 slide_length + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlideLengthSaveReq", description = "滑动长度") +public class SlideLengthSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** id */ + + @ApiModelProperty(name = "id", value = "id") + private Long id; + + /** 滑动长度名称 */ + + @ApiModelProperty(name = "滑动长度名称", value = "滑动长度名称") + private String slideLengthName; + + /** 占比 */ + + @ApiModelProperty(name = "占比", value = "占比") + private BigDecimal slideLengthProportion; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoEditReq.java new file mode 100644 index 0000000..951cce3 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoEditReq.java @@ -0,0 +1,53 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗对象 sliding_info + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlidingInfoEditReq", description = "滑窗") +public class SlidingInfoEditReq { + + + /** VIN */ + @ApiModelProperty(name = "VIN", value = "VIN") + private String vehicleVin; + + /** 报文解析ID */ + @ApiModelProperty(name = "报文解析ID", value = "报文解析ID") + private Long messageKye; + + /** 指标项Key */ + @ApiModelProperty(name = "指标项Key", value = "指标项Key") + private String analyzeKey; + + /** 指标项标签 */ + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String messageLabel; + + /** 标准 */ + @ApiModelProperty(name = "标准", value = "标准") + private Long standard; + + /** 滑窗范围 */ + @ApiModelProperty(name = "滑窗范围", value = "滑窗范围") + private Long windowRadiusId; + + /** 滑动长度 */ + @ApiModelProperty(name = "滑动长度", value = "滑动长度") + private Long slideLengthId; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoQueryReq.java new file mode 100644 index 0000000..3fcdd32 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoQueryReq.java @@ -0,0 +1,29 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗对象 sliding_info + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlidingInfoQueryReq", description = "滑窗") +public class SlidingInfoQueryReq { + + + /** VIN */ + @ApiModelProperty(name = "VIN", value = "VIN") + private String vehicleVin; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoSaveReq.java new file mode 100644 index 0000000..fc82167 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/SlidingInfoSaveReq.java @@ -0,0 +1,66 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗对象 sliding_info + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SlidingInfoSaveReq", description = "滑窗") +public class SlidingInfoSaveReq { + + + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** VIN */ + + @ApiModelProperty(name = "VIN", value = "VIN") + private String vehicleVin; + + /** 报文解析ID */ + + @ApiModelProperty(name = "报文解析ID", value = "报文解析ID") + private Long messageKye; + + /** 指标项Key */ + + @ApiModelProperty(name = "指标项Key", value = "指标项Key") + private String analyzeKey; + + /** 指标项标签 */ + + @ApiModelProperty(name = "指标项标签", value = "指标项标签") + private String messageLabel; + + /** 标准 */ + + @ApiModelProperty(name = "标准", value = "标准") + private Long standard; + + /** 滑窗范围 */ + + @ApiModelProperty(name = "滑窗范围", value = "滑窗范围") + private Long windowRadiusId; + + /** 滑动长度 */ + + @ApiModelProperty(name = "滑动长度", value = "滑动长度") + private Long slideLengthId; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowEditReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowEditReq.java new file mode 100644 index 0000000..15275a4 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowEditReq.java @@ -0,0 +1,34 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗范围对象 window + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "WindowEditReq", description = "滑窗范围") +public class WindowEditReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 滑窗范围名称 */ + @ApiModelProperty(name = "滑窗范围名称", value = "滑窗范围名称") + private String windowRadiusName; + + /** 滑窗长度 */ + @ApiModelProperty(name = "滑窗长度", value = "滑窗长度") + private Long windowRadiusLength; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowQueryReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowQueryReq.java new file mode 100644 index 0000000..7e28d37 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowQueryReq.java @@ -0,0 +1,34 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗范围对象 window + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "WindowQueryReq", description = "滑窗范围") +public class WindowQueryReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 滑窗范围名称 */ + @ApiModelProperty(name = "滑窗范围名称", value = "滑窗范围名称") + private String windowRadiusName; + + /** 滑窗长度 */ + @ApiModelProperty(name = "滑窗长度", value = "滑窗长度") + private Long windowRadiusLength; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowSaveReq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowSaveReq.java new file mode 100644 index 0000000..5f93473 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-common/src/main/java/com/muyu/many/domain/req/WindowSaveReq.java @@ -0,0 +1,41 @@ +package com.muyu.many.domain.req; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import io.swagger.annotations.*; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 滑窗范围对象 window + * + * @author wan + * @date 2024-06-29 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "WindowSaveReq", description = "滑窗范围") +public class WindowSaveReq extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + + @ApiModelProperty(name = "主键", value = "主键") + private Long id; + + /** 滑窗范围名称 */ + + @ApiModelProperty(name = "滑窗范围名称", value = "滑窗范围名称") + private String windowRadiusName; + + /** 滑窗长度 */ + + @ApiModelProperty(name = "滑窗长度", value = "滑窗长度") + private Long windowRadiusLength; + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/pom.xml b/muyu-modules/muyu-modules-many/muyu-modules-many-server/pom.xml index 9e01625..6fc777b 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/pom.xml +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/pom.xml @@ -95,12 +95,6 @@ muyu-modules-many-common 3.6.3 - - com.muyu - muyu-modules-many-common - 3.6.3 - compile - com.muyu muyu-common-log diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/MuYuManyApplication.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/MuYuManyApplication.java index 1665e8d..58b4a6d 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/MuYuManyApplication.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/MuYuManyApplication.java @@ -1,10 +1,12 @@ package com.muyu.authentication; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.muyu.authentication.mapper.MessageAnalysisMapper; import com.muyu.authentication.mapper.VehicleMapper; import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; import com.muyu.clw.common.many.remote.RemoteEnterpriseService; +import com.muyu.clw.common.saas.domain.model.EntInfo; import com.muyu.common.core.domain.Result; import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableMyFeignClients; @@ -12,17 +14,18 @@ import com.muyu.common.swagger.annotation.EnableCustomSwagger2; import com.muyu.domain.Enterprise; import com.muyu.many.domain.MessageAnalysis; import com.muyu.many.domain.Vehicle; -import org.apache.commons.collections4.map.HashedMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; /** @@ -59,11 +62,24 @@ public class MuYuManyApplication implements ApplicationRunner { String ent = "ent_" + enterprise1.getContactPhone().substring(enterprise1.getContactPhone().length() - 4); DynamicDataSourceHolder.setDynamicDataSourceKey(ent); List vehicles = vehicleMapper.selectList(null); - List messageAnalyses = messageAnalysisMapper.selectList(null); - for (Vehicle vehicle : vehicles) { - redisTemplate.opsForValue().set(vehicle.getVin(), JSON.toJSONString(messageAnalyses),4,TimeUnit.HOURS); - } + + vehicles.forEach(vehicle -> { + List messageAnalyses = messageAnalysisMapper.selectList( + new LambdaQueryWrapper<>() {{ + eq(MessageAnalysis::getVehicleId, vehicle.getId()); + ; + }} + ); + List arrayList = new ArrayList<>(); + messageAnalyses.forEach(messageAnal->{ + arrayList.add(messageAnal); + }); + String jsonString = JSON.toJSONString(arrayList); + System.out.println(jsonString); + redisTemplate.opsForHash().put("VIN",vehicle.getVin(),jsonString); + }); + } } } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageAnalysisController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageAnalysisController.java index 7ec20e3..80dc812 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageAnalysisController.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageAnalysisController.java @@ -1,34 +1,123 @@ package com.muyu.authentication.controller; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + import com.muyu.authentication.service.MessageAnalysisService; -import com.muyu.common.core.domain.Result; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.many.domain.MessageAnalysis; +import com.muyu.many.domain.req.MessageAnalysisEditReq; +import com.muyu.many.domain.req.MessageAnalysisQueryReq; +import com.muyu.many.domain.req.MessageAnalysisSaveReq; +import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; - -import java.util.List; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; /** - * 报文解析配置的Controller层 + * 报文解析Controller * - * @ClassName MessageAnalysisController - * @Author AnNan.Wang - * @Date 2024/6/26 18:40 + * @author wan + * @date 2024-06-28 */ - +@Api(tags = "报文解析") @RestController -@RequestMapping("/messageAnalysis") -public class MessageAnalysisController { +@RequestMapping("/analysis") +public class MessageAnalysisController extends BaseController { @Autowired private MessageAnalysisService messageAnalysisService; - @PostMapping("/messageAnalysisAdd") - public Result messageAnalysisAdd(@RequestBody List messageAnalysisList){ - return messageAnalysisService.messageAnalysisAdd(messageAnalysisList); + /** + * 查询报文解析列表 + */ + @ApiOperation("获取报文解析列表") + @GetMapping("/list") + public Result> list(MessageAnalysisQueryReq messageAnalysisQueryReq) { + startPage(); + List list = messageAnalysisService.list(MessageAnalysis.queryBuild(messageAnalysisQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); } + /** + * 导出报文解析列表 + */ + @ApiOperation("导出报文解析列表") + @Log(title = "报文解析", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MessageAnalysis messageAnalysis) { + List list = messageAnalysisService.list(messageAnalysis); + ExcelUtil util = new ExcelUtil(MessageAnalysis.class); + util.exportExcel(response, list, "报文解析数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + /** + * 获取报文解析详细信息 + */ + @ApiOperation("获取报文解析详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + MessageAnalysis byId = messageAnalysisService.getById(id); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(byId); + } + + /** + * 新增报文解析 + */ + @Log(title = "报文解析", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增报文解析") + public Result add(@RequestBody MessageAnalysisSaveReq messageAnalysisSaveReq) { + boolean save = messageAnalysisService.save(MessageAnalysis.saveBuild(messageAnalysisSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(save); + } + + /** + * 修改报文解析 + */ + @Log(title = "报文解析", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改报文解析") + public Result edit(@PathVariable Long id, @RequestBody MessageAnalysisEditReq messageAnalysisEditReq) { + boolean b = messageAnalysisService.updateById(MessageAnalysis.editBuild(id, messageAnalysisEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除报文解析 + */ + @Log(title = "报文解析", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除报文解析") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = messageAnalysisService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + @GetMapping("/messageAnalysisList") + public Result>messageAnalysisList(){ + List messageAnalyses = messageAnalysisService.messageAnalysisList(); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(messageAnalyses); + } } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageConfigurationTypeController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageConfigurationTypeController.java new file mode 100644 index 0000000..e3d407f --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageConfigurationTypeController.java @@ -0,0 +1,115 @@ +package com.muyu.authentication.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.authentication.service.MessageConfigurationTypeService; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.many.domain.MessageConfigurationType; +import com.muyu.many.domain.req.MessageConfigurationTypeEditReq; +import com.muyu.many.domain.req.MessageConfigurationTypeQueryReq; +import com.muyu.many.domain.req.MessageConfigurationTypeSaveReq; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; + +/** + * 报文配置类型Controller + * + * @author wan + * @date 2024-06-28 + */ +@Api(tags = "报文配置类型") +@RestController +@RequestMapping("/configuration") +public class MessageConfigurationTypeController extends BaseController { + @Autowired + private MessageConfigurationTypeService messageConfigurationTypeService; + + /** + * 查询报文配置类型列表 + */ + @ApiOperation("获取报文配置类型列表") + @GetMapping("/list") + public Result> list(MessageConfigurationTypeQueryReq messageConfigurationTypeQueryReq) { + startPage(); + List list = messageConfigurationTypeService.list(MessageConfigurationType.queryBuild(messageConfigurationTypeQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); + } + + /** + * 导出报文配置类型列表 + */ + @ApiOperation("导出报文配置类型列表") + @Log(title = "报文配置类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MessageConfigurationType messageConfigurationType) { + List list = messageConfigurationTypeService.list(messageConfigurationType); + ExcelUtil util = new ExcelUtil(MessageConfigurationType.class); + util.exportExcel(response, list, "报文配置类型数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + /** + * 获取报文配置类型详细信息 + */ + @ApiOperation("获取报文配置类型详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + MessageConfigurationType byId = messageConfigurationTypeService.getById(id); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(byId); + } + + /** + * 新增报文配置类型 + */ + @Log(title = "报文配置类型", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增报文配置类型") + public Result add(@RequestBody MessageConfigurationTypeSaveReq messageConfigurationTypeSaveReq) { + boolean save = messageConfigurationTypeService.save(MessageConfigurationType.saveBuild(messageConfigurationTypeSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(save); + } + + /** + * 修改报文配置类型 + */ + @Log(title = "报文配置类型", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改报文配置类型") + public Result edit(@PathVariable Long id, @RequestBody MessageConfigurationTypeEditReq messageConfigurationTypeEditReq) { + boolean b = messageConfigurationTypeService.updateById(MessageConfigurationType.editBuild(id, messageConfigurationTypeEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除报文配置类型 + */ + @Log(title = "报文配置类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除报文配置类型") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = messageConfigurationTypeService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java new file mode 100644 index 0000000..225248a --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/MessageDataController.java @@ -0,0 +1,132 @@ +package com.muyu.authentication.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.authentication.service.MessageDataService; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.many.domain.MessageAnalysis; +import com.muyu.many.domain.MessageData; +import com.muyu.many.domain.req.MessageDataEditReq; +import com.muyu.many.domain.req.MessageDataEnterprise; +import com.muyu.many.domain.req.MessageDataQueryReq; +import com.muyu.many.domain.req.MessageDataSaveReq; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; + +/** + * 报文类型数据Controller + * + * @author wan + * @date 2024-06-28 + */ +@Api(tags = "报文类型数据") +@RestController +@RequestMapping("/message") +public class MessageDataController extends BaseController { + @Autowired + private MessageDataService messageDataService; + + /** + * 查询报文类型数据列表 + */ + @ApiOperation("获取报文类型数据列表") + @GetMapping("/list") + public Result> list(MessageDataQueryReq messageDataQueryReq) { + startPage(); + List list = messageDataService.list(MessageData.queryBuild(messageDataQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); + } + + /** + * 导出报文类型数据列表 + */ + @ApiOperation("导出报文类型数据列表") + @Log(title = "报文类型数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MessageData messageData) { + List list = messageDataService.list(messageData); + ExcelUtil util = new ExcelUtil(MessageData.class); + util.exportExcel(response, list, "报文类型数据数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + /** + * 获取报文类型数据详细信息 + */ + @ApiOperation("获取报文类型数据详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + MessageData byId = messageDataService.getById(id); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(byId); + } + + /** + * 新增报文类型数据 + */ + @Log(title = "报文类型数据", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增报文类型数据") + public Result add(@RequestBody MessageDataSaveReq messageDataSaveReq) { + boolean save = messageDataService.save(MessageData.saveBuild(messageDataSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(save); + } + + /** + * 修改报文类型数据 + */ + @Log(title = "报文类型数据", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改报文类型数据") + public Result edit(@PathVariable Long id, @RequestBody MessageDataEditReq messageDataEditReq) { + boolean b = messageDataService.updateById(MessageData.editBuild(id, messageDataEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除报文类型数据 + */ + @Log(title = "报文类型数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除报文类型数据") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = messageDataService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + @GetMapping("/messageList") + public Result> messageList(){ + List list = messageDataService.list(); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(list); + } + + @PostMapping("/messageDataEnterpriseAdd") + public void messageDataEnterpriseAdd(@RequestBody MessageDataEnterprise messageDataEnterprise){ + messageDataService.messageDataEnterpriseAdd(messageDataEnterprise); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlideLengthController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlideLengthController.java new file mode 100644 index 0000000..751007a --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlideLengthController.java @@ -0,0 +1,124 @@ +package com.muyu.authentication.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.authentication.service.SlideLengthService; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.many.domain.SlideLength; +import com.muyu.many.domain.Window; +import com.muyu.many.domain.req.SlideLengthEditReq; +import com.muyu.many.domain.req.SlideLengthQueryReq; +import com.muyu.many.domain.req.SlideLengthSaveReq; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.common.core.web.page.TableDataInfo; + +/** + * 滑动长度Controller + * + * @author wan + * @date 2024-06-29 + */ +@Api(tags = "滑动长度") +@RestController +@RequestMapping("/SlideLength") +public class SlideLengthController extends BaseController { + @Autowired + private SlideLengthService slideLengthService; + + /** + * 查询滑动长度列表 + */ + @ApiOperation("获取滑动长度列表") + @GetMapping("/list") + public Result> list(SlideLengthQueryReq slideLengthQueryReq) { + startPage(); + List list = slideLengthService.list(SlideLength.queryBuild(slideLengthQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); + } + + /** + * 导出滑动长度列表 + */ + @ApiOperation("导出滑动长度列表") + @Log(title = "滑动长度", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SlideLength slideLength) { + List list = slideLengthService.list(slideLength); + ExcelUtil util = new ExcelUtil(SlideLength.class); + util.exportExcel(response, list, "滑动长度数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + /** + * 获取滑动长度详细信息 + */ + @ApiOperation("获取滑动长度详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(slideLengthService.getById(id)); + } + + /** + * 新增滑动长度 + */ + @Log(title = "滑动长度", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增滑动长度") + public Result add(@RequestBody SlideLengthSaveReq slideLengthSaveReq) { + boolean save = slideLengthService.save(SlideLength.saveBuild(slideLengthSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(save); + } + + /** + * 修改滑动长度 + */ + @Log(title = "滑动长度", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改滑动长度") + public Result edit(@PathVariable Long id, @RequestBody SlideLengthEditReq slideLengthEditReq) { + boolean b = slideLengthService.updateById(SlideLength.editBuild(id, slideLengthEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除滑动长度 + */ + @Log(title = "滑动长度", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除滑动长度") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = slideLengthService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + @GetMapping("/slideLengthList") + public Result> windowList(){ + List slideLengthList = slideLengthService.slideLengthList(); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(slideLengthList); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlidingInfoController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlidingInfoController.java new file mode 100644 index 0000000..1efee32 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/SlidingInfoController.java @@ -0,0 +1,116 @@ +package com.muyu.authentication.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.authentication.service.SlidingInfoService; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.many.domain.SlidingInfo; +import com.muyu.many.domain.req.SlidingInfoEditReq; +import com.muyu.many.domain.req.SlidingInfoQueryReq; +import com.muyu.many.domain.req.SlidingInfoSaveReq; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.common.core.web.page.TableDataInfo; + +/** + * 滑窗Controller + * + * @author wan + * @date 2024-06-29 + */ +@Api(tags = "滑窗") +@RestController +@RequestMapping("/SlidingInfo") +public class SlidingInfoController extends BaseController { + @Autowired + private SlidingInfoService slidingInfoService; + + /** + * 查询滑窗列表 + */ + @ApiOperation("获取滑窗列表") + @GetMapping("/list") + public Result> list(SlidingInfoQueryReq slidingInfoQueryReq) { + startPage(); + List list = slidingInfoService.list(SlidingInfo.queryBuild(slidingInfoQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); + } + + /** + * 导出滑窗列表 + */ + @ApiOperation("导出滑窗列表") + @Log(title = "滑窗", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SlidingInfo slidingInfo) { + List list = slidingInfoService.list(slidingInfo); + ExcelUtil util = new ExcelUtil(SlidingInfo.class); + util.exportExcel(response, list, "滑窗数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + /** + * 获取滑窗详细信息 + */ + @ApiOperation("获取滑窗详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + SlidingInfo byId = slidingInfoService.getById(id); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(byId); + } + + /** + * 新增滑窗 + */ + @Log(title = "滑窗", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增滑窗") + public Result add(@RequestBody SlidingInfoSaveReq slidingInfoSaveReq) { + boolean add = slidingInfoService.add(SlidingInfo.saveBuild(slidingInfoSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(add); + } + + /** + * 修改滑窗 + */ + @Log(title = "滑窗", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改滑窗") + public Result edit(@PathVariable Long id, @RequestBody SlidingInfoEditReq slidingInfoEditReq) { + boolean b = slidingInfoService.updateId(SlidingInfo.editBuild(id, slidingInfoEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除滑窗 + */ + @Log(title = "滑窗", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除滑窗") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = slidingInfoService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/VehicleController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/VehicleController.java index 71c1b65..e58bbf3 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/VehicleController.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/VehicleController.java @@ -114,4 +114,13 @@ public class VehicleController extends BaseController { DynamicDataSourceHolder.removeDynamicDataSourceKey(); return toAjax(b); } + + @GetMapping("/vehicleList") + public Result> vehicleList(){ + List vehicles = vehicleService.vehicleList(); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(vehicles); + } + + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/WindowController.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/WindowController.java new file mode 100644 index 0000000..de71aee --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/controller/WindowController.java @@ -0,0 +1,123 @@ +package com.muyu.authentication.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.authentication.service.WindowService; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.many.domain.Window; +import com.muyu.many.domain.req.WindowEditReq; +import com.muyu.many.domain.req.WindowQueryReq; +import com.muyu.many.domain.req.WindowSaveReq; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.common.core.web.page.TableDataInfo; + +/** + * 滑窗范围Controller + * + * @author wan + * @date 2024-06-29 + */ +@Api(tags = "滑窗范围") +@RestController +@RequestMapping("/Window") +public class WindowController extends BaseController { + @Autowired + private WindowService windowService; + + /** + * 查询滑窗范围列表 + */ + @ApiOperation("获取滑窗范围列表") + @GetMapping("/list") + public Result> list(WindowQueryReq windowQueryReq) { + startPage(); + List list = windowService.list(Window.queryBuild(windowQueryReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return getDataTable(list); + } + + /** + * 导出滑窗范围列表 + */ + @ApiOperation("导出滑窗范围列表") + @Log(title = "滑窗范围", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Window window) { + List list = windowService.list(window); + ExcelUtil util = new ExcelUtil(Window.class); + util.exportExcel(response, list, "滑窗范围数据"); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + } + + /** + * 获取滑窗范围详细信息 + */ + @ApiOperation("获取滑窗范围详细信息") + @GetMapping(value = "/{id}") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) + public Result getInfo(@PathVariable("id") Long id) { + Window byId = windowService.getById(id); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(byId); + } + + /** + * 新增滑窗范围 + */ + @Log(title = "滑窗范围", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增滑窗范围") + public Result add(@RequestBody WindowSaveReq windowSaveReq) { + boolean save = windowService.save(Window.saveBuild(windowSaveReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(save); + } + + /** + * 修改滑窗范围 + */ + @Log(title = "滑窗范围", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + @ApiOperation("修改滑窗范围") + public Result edit(@PathVariable Long id, @RequestBody WindowEditReq windowEditReq) { + boolean b = windowService.updateById(Window.editBuild(id, windowEditReq)); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + /** + * 删除滑窗范围 + */ + @Log(title = "滑窗范围", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除滑窗范围") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4") + public Result remove(@PathVariable List ids) { + boolean b = windowService.removeBatchByIds(ids); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return toAjax(b); + } + + @GetMapping("/windowList") + public Result> windowList(){ + List windows = windowService.windowList(); + DynamicDataSourceHolder.removeDynamicDataSourceKey(); + return Result.success(windows); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageAnalysisMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageAnalysisMapper.java index ae31b1a..3e1d7a9 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageAnalysisMapper.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageAnalysisMapper.java @@ -1,15 +1,16 @@ package com.muyu.authentication.mapper; +import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.many.domain.MessageAnalysis; -/** - * 报文解析配置的Mapper层 - * - * @author AnNan.Wang - * @ClassName: MessageAnalysisMapper - * @createTime: 2024/6/26 18:44 - */ +/** + * 报文解析Mapper接口 + * + * @author wan + * @date 2024-06-28 + */ public interface MessageAnalysisMapper extends BaseMapper { + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageConfigurationTypeMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageConfigurationTypeMapper.java new file mode 100644 index 0000000..d165ee3 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageConfigurationTypeMapper.java @@ -0,0 +1,15 @@ +package com.muyu.authentication.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.many.domain.MessageConfigurationType; + +/** + * 报文配置类型Mapper接口 + * + * @author wan + * @date 2024-06-28 + */ +public interface MessageConfigurationTypeMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java similarity index 55% rename from muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java rename to muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java index 829fa12..7e19836 100644 --- a/muyu-modules/muyu-company/muyu-company-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/MessageDataMapper.java @@ -1,15 +1,14 @@ package com.muyu.authentication.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.muyu.domain.MessageData; +import com.muyu.many.domain.MessageData; /** - * 报文解析Mapper层 + * 报文类型数据Mapper接口 * - * @author AnNan.Wang - * @ClassName: MessageDataMapper - * @createTime: 2024/6/27 10:33 + * @author wan + * @date 2024-06-28 */ - public interface MessageDataMapper extends BaseMapper { + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlideLengthMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlideLengthMapper.java new file mode 100644 index 0000000..2dc7d6b --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlideLengthMapper.java @@ -0,0 +1,15 @@ +package com.muyu.authentication.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.many.domain.SlideLength; + +/** + * 滑动长度Mapper接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface SlideLengthMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlidingInfoMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlidingInfoMapper.java new file mode 100644 index 0000000..fe660bf --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/SlidingInfoMapper.java @@ -0,0 +1,15 @@ +package com.muyu.authentication.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.many.domain.SlidingInfo; + +/** + * 滑窗Mapper接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface SlidingInfoMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/WindowMapper.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/WindowMapper.java new file mode 100644 index 0000000..7227ddf --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/mapper/WindowMapper.java @@ -0,0 +1,15 @@ +package com.muyu.authentication.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.many.domain.Window; + +/** + * 滑窗范围Mapper接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface WindowMapper extends BaseMapper { + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/enterprise/EnterpriseMq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/enterprise/EnterpriseMq.java new file mode 100644 index 0000000..83cef6d --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/enterprise/EnterpriseMq.java @@ -0,0 +1,43 @@ +package com.muyu.authentication.rabbitmq.enterprise; + +import com.alibaba.fastjson.JSON; +import com.muyu.authentication.mapper.MessageAnalysisMapper; +import com.muyu.authentication.mapper.VehicleMapper; +import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; +import com.muyu.many.domain.MessageAnalysis; +import com.muyu.many.domain.Vehicle; +import com.muyu.many.domain.mq.MessageData; +import com.muyu.many.domain.mq.MessageDataEnterpriseMq; +import lombok.extern.log4j.Log4j2; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName EnterpriseMq + * @Author AnNan.Wang + * @Date 2024/6/28 18:51 + */ + +@Log4j2 +@Component +public class EnterpriseMq { + @Autowired + private MessageAnalysisMapper messageAnalysisMapper; + + @Autowired + private StringRedisTemplate redisTemplate; + @Autowired + private VehicleMapper vehicleMapper; + + + @RabbitListener(queues = "1") + public void discoverTime(String message){ + log.info("开始消费"); + + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/record/MessageAnalysisRecord.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/record/MessageAnalysisRecord.java new file mode 100644 index 0000000..e134d9d --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/record/MessageAnalysisRecord.java @@ -0,0 +1,42 @@ +//package com.muyu.authentication.rabbitmq.record; +// +//import com.alibaba.druid.pool.DruidDataSource; +//import com.alibaba.fastjson.JSON; +//import com.muyu.clw.common.many.datasource.domain.model.DataSourceInfo; +//import com.muyu.common.log.annotation.Log; +//import com.muyu.many.domain.Enterprise; +//import lombok.extern.log4j.Log4j2; +//import org.springframework.amqp.rabbit.annotation.RabbitListener; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +///** +// * 返回记录 +// * +// * @ClassName MessageAnalysisRecord +// * @Author AnNan.Wang +// * @Date 2024/6/29 13:50 +// */ +// +//@Log4j2 +//@Component +//public class MessageAnalysisRecord { +// +// @RabbitListener(queues = "5566") +// public void receiveMessage(String message) { +// // 在这里处理接收到的消息,并将其写入MySQL数据库 +// log.info("message:{}",message); +// Enterprise parse = JSON.parseObject(message, Enterprise.class); +// String substring = parse.getContactPhone().substring(parse.getContactPhone().length() - 4); +// String host="123.56.102.11"; +// Integer post= Math.toIntExact(3306 + parse.getId()); +// String key="ent_" + substring; +// log.info("parse:{}",parse); +// +// DataSourceInfo dataSourceInfo = DataSourceInfo.hostAndPortBuild(key, host, post); +// +// log.info("dataSourceInfo:{}",dataSourceInfo); +// +// +// } +//} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/vo/BreakdownAbnormalMq.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/vo/BreakdownAbnormalMq.java index a27b79c..9bd0236 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/vo/BreakdownAbnormalMq.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/rabbitmq/vo/BreakdownAbnormalMq.java @@ -59,39 +59,39 @@ public class BreakdownAbnormalMq { String[] split = faultInfo.getVin().split("-"); log.info("split:{}",split[0]); - FaultInfo build = FaultInfo.builder() - .faultCode(split[1]) - .vin(split[0]) - .endTime(faultInfo.getEndTime()) - .build(); - String key=build.getVin()+"123"; - String ent = redisTemplate.opsForValue().get(key); - DynamicDataSourceHolder.setDynamicDataSourceKey(ent); - - //获取最新一天数据 - List faultInfos = faultInfoMapper.selectList( - new QueryWrapper() - .eq("fault_code", build.getFaultCode()) // 替换 yourFaultCode 为实际的故障代码值 - .orderByDesc("start_time") - .last("LIMIT 1") - ); +// FaultInfo build = FaultInfo.builder() +// .faultCode(split[1]) +// .vin(split[0]) +// .endTime(faultInfo.getEndTime()) +// .build(); +// String key=build.getVin()+"123"; +// String ent = redisTemplate.opsForValue().get(key); +// DynamicDataSourceHolder.setDynamicDataSourceKey(ent); +// +// //获取最新一天数据 +// List faultInfos = faultInfoMapper.selectList( +// new QueryWrapper() +// .eq("fault_code", build.getFaultCode()) // 替换 yourFaultCode 为实际的故障代码值 +// .orderByDesc("start_time") +// .last("LIMIT 1") +// ); //判断非空 - if (!faultInfos.isEmpty()) { - //获取第一条数据 - FaultInfo latestFaultInfo = faultInfos.get(0); - // 这里可以对 latestFaultInfo 进行进一步操作或者返回 - log.info("Latest FaultInfo: {}", latestFaultInfo); - - //修改数据 - faultInfoMapper.updateById( - FaultInfo.builder() - .id(latestFaultInfo.getId()) - .endTime(new Date()) - .build() - ); - DynamicDataSourceHolder.removeDynamicDataSourceKey(); - log.info("消费结束"); - } +// if (!faultInfos.isEmpty()) { +// //获取第一条数据 +// FaultInfo latestFaultInfo = faultInfos.get(0); +// // 这里可以对 latestFaultInfo 进行进一步操作或者返回 +// log.info("Latest FaultInfo: {}", latestFaultInfo); +// +// //修改数据 +// faultInfoMapper.updateById( +// FaultInfo.builder() +// .id(latestFaultInfo.getId()) +// .endTime(new Date()) +// .build() +// ); +// DynamicDataSourceHolder.removeDynamicDataSourceKey(); +// log.info("消费结束"); +// } log.info("消费结束"); } } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageAnalysisService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageAnalysisService.java index 4ab3022..bb2021e 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageAnalysisService.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageAnalysisService.java @@ -1,19 +1,26 @@ package com.muyu.authentication.service; +import java.util.List; +import com.muyu.many.domain.MessageAnalysis; import com.baomidou.mybatisplus.extension.service.IService; -import com.muyu.common.core.domain.Result; import com.muyu.many.domain.MessageAnalysis; -import java.util.List; - /** - * 报文解析配置的Service层 + * 报文解析Service接口 * - * @author AnNan.Wang - * @ClassName: MessageAnalysisService - * @createTime: 2024/6/26 18:41 + * @author wan + * @date 2024-06-28 */ - public interface MessageAnalysisService extends IService { - Result messageAnalysisAdd(List messageAnalysisList); + /** + * 查询报文解析列表 + * + * @param messageAnalysis 报文解析 + * @return 报文解析集合 + */ + public List list(MessageAnalysis messageAnalysis); + + List messageAnalysisList(); + + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageConfigurationTypeService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageConfigurationTypeService.java new file mode 100644 index 0000000..2290543 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageConfigurationTypeService.java @@ -0,0 +1,24 @@ +package com.muyu.authentication.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.many.domain.MessageConfigurationType; + +import java.util.List; + +/** + * 报文配置类型Service接口 + * + * @author wan + * @date 2024-06-28 + */ +public interface MessageConfigurationTypeService extends IService { + /** + * 查询报文配置类型列表 + * + * @param messageConfigurationType 报文配置类型 + * @return 报文配置类型集合 + */ + public List list(MessageConfigurationType messageConfigurationType); + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageDataService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageDataService.java new file mode 100644 index 0000000..6cd603d --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/MessageDataService.java @@ -0,0 +1,31 @@ +package com.muyu.authentication.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.many.domain.MessageAnalysis; +import com.muyu.many.domain.MessageData; +import com.muyu.many.domain.req.MessageDataEnterprise; + +import java.util.List; + +/** + * 报文类型数据Service接口 + * + * @author wan + * @date 2024-06-28 + */ +public interface MessageDataService extends IService { + /** + * 查询报文类型数据列表 + * + * @param messageData 报文类型数据 + * @return 报文类型数据集合 + */ + public List list(MessageData messageData); + + void messageDataEnterpriseAdd(MessageDataEnterprise messageDataEnterprise); + + + + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlideLengthService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlideLengthService.java new file mode 100644 index 0000000..f5ea678 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlideLengthService.java @@ -0,0 +1,24 @@ +package com.muyu.authentication.service; + +import java.util.List; +import com.muyu.many.domain.SlideLength; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 滑动长度Service接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface SlideLengthService extends IService { + /** + * 查询滑动长度列表 + * + * @param slideLength 滑动长度 + * @return 滑动长度集合 + */ + public List list(SlideLength slideLength); + + List slideLengthList(); + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlidingInfoService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlidingInfoService.java new file mode 100644 index 0000000..458ff94 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/SlidingInfoService.java @@ -0,0 +1,25 @@ +package com.muyu.authentication.service; + +import java.util.List; +import com.muyu.many.domain.SlidingInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 滑窗Service接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface SlidingInfoService extends IService { + /** + * 查询滑窗列表 + * + * @param slidingInfo 滑窗 + * @return 滑窗集合 + */ + public List list(SlidingInfo slidingInfo); + + boolean add(SlidingInfo slidingInfo); + + boolean updateId(SlidingInfo slidingInfo); +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/VehicleService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/VehicleService.java index 4c66bfc..0355a33 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/VehicleService.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/VehicleService.java @@ -20,4 +20,6 @@ public interface VehicleService extends IService { */ public List list(Vehicle vehicle); + List vehicleList(); + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/WindowService.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/WindowService.java new file mode 100644 index 0000000..f0aae9a --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/WindowService.java @@ -0,0 +1,25 @@ +package com.muyu.authentication.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.many.domain.Window; + +import java.util.List; + +/** + * 滑窗范围Service接口 + * + * @author wan + * @date 2024-06-29 + */ +public interface WindowService extends IService { + /** + * 查询滑窗范围列表 + * + * @param window 滑窗范围 + * @return 滑窗范围集合 + */ + public List list(Window window); + + List windowList(); +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageAnalysisServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageAnalysisServiceImpl.java index 6b5f926..419b5b1 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageAnalysisServiceImpl.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageAnalysisServiceImpl.java @@ -1,42 +1,70 @@ package com.muyu.authentication.service.impl; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.muyu.authentication.mapper.MessageAnalysisMapper; -import com.muyu.authentication.service.MessageAnalysisService; -import com.muyu.common.core.domain.Result; -import com.muyu.many.domain.MessageAnalysis; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import java.util.List; -/** - * 报文解析配置实现类 - * - * @ClassName MessageAnalysisServiceImpl - * @Author AnNan.Wang - * @Date 2024/6/26 18:43 - */ +import com.muyu.authentication.service.MessageAnalysisService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.MessageAnalysis; +import com.muyu.authentication.mapper.MessageAnalysisMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 报文解析Service业务层处理 + * + * @author wan + * @date 2024-06-28 + */ +@Slf4j @Service -public class MessageAnalysisServiceImpl extends ServiceImpl - implements MessageAnalysisService { +public class MessageAnalysisServiceImpl extends ServiceImpl implements MessageAnalysisService { + + /** + * 查询报文解析列表 + * + * @param messageAnalysis 报文解析 + * @return 报文解析 + */ + @Override + public List list(MessageAnalysis messageAnalysis) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + if (ObjUtils.notNull(messageAnalysis.getVehicleId())){ + queryWrapper.eq(MessageAnalysis::getVehicleId, messageAnalysis.getVehicleId()); + } + + if (ObjUtils.notNull(messageAnalysis.getAnalyzeKey())){ + queryWrapper.eq(MessageAnalysis::getAnalyzeKey, messageAnalysis.getAnalyzeKey()); + } + + if (ObjUtils.notNull(messageAnalysis.getAnalyzeStart())){ + queryWrapper.eq(MessageAnalysis::getAnalyzeStart, messageAnalysis.getAnalyzeStart()); + } + + if (ObjUtils.notNull(messageAnalysis.getEnt())){ + queryWrapper.eq(MessageAnalysis::getEnt, messageAnalysis.getEnt()); + } + + if (ObjUtils.notNull(messageAnalysis.getLable())){ + queryWrapper.eq(MessageAnalysis::getLable, messageAnalysis.getLable()); + } + + if (ObjUtils.notNull(messageAnalysis.getType())){ + queryWrapper.eq(MessageAnalysis::getType, messageAnalysis.getType()); + } + return list(queryWrapper); + } + @Autowired - private MessageAnalysisMapper messageAnalysisMapper; + private MessageAnalysisMapper messageAnalysis; @Override - public Result messageAnalysisAdd(List messageAnalysisList) { - for (MessageAnalysis messageAnalysis : messageAnalysisList) { - messageAnalysisMapper.insert( - MessageAnalysis.builder() - .analyzeKey(messageAnalysis.getAnalyzeKey()) - .analyzeStart(messageAnalysis.getAnalyzeStart()) - .ent(messageAnalysis.getEnt()) - .lable(messageAnalysis.getLable()) - .type(messageAnalysis.getType()) - .build() - ); - } - return Result.success(); + public List messageAnalysisList() { + return messageAnalysis.selectList(null); } } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageConfigurationTypeServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageConfigurationTypeServiceImpl.java new file mode 100644 index 0000000..de7b0c1 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageConfigurationTypeServiceImpl.java @@ -0,0 +1,49 @@ +package com.muyu.authentication.service.impl; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.authentication.mapper.MessageConfigurationTypeMapper; +import com.muyu.authentication.service.MessageConfigurationTypeService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.MessageConfigurationType; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 报文配置类型Service业务层处理 + * + * @author wan + * @date 2024-06-28 + */ +@Slf4j +@Service +public class MessageConfigurationTypeServiceImpl extends ServiceImpl implements MessageConfigurationTypeService { + + /** + * 查询报文配置类型列表 + * + * @param messageConfigurationType 报文配置类型 + * @return 报文配置类型 + */ + @Override + public List list(MessageConfigurationType messageConfigurationType) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(messageConfigurationType.getTypeName())){ + queryWrapper.like(MessageConfigurationType::getTypeName, messageConfigurationType.getTypeName()); + } + + if (ObjUtils.notNull(messageConfigurationType.getTypeIdentification())){ + queryWrapper.eq(MessageConfigurationType::getTypeIdentification, messageConfigurationType.getTypeIdentification()); + } + + + + + + return list(queryWrapper); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageDataServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageDataServiceImpl.java new file mode 100644 index 0000000..9f25a99 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/MessageDataServiceImpl.java @@ -0,0 +1,136 @@ +package com.muyu.authentication.service.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.authentication.mapper.MessageAnalysisMapper; +import com.muyu.authentication.mapper.MessageDataMapper; +import com.muyu.authentication.mapper.VehicleMapper; +import com.muyu.authentication.service.MessageDataService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.domain.Enterprise; +import com.muyu.many.domain.MessageAnalysis; +import com.muyu.many.domain.MessageData; +import com.muyu.many.domain.Vehicle; +import com.muyu.many.domain.req.MessageDataEnterprise; +import com.muyu.many.domain.req.MessageDataEnterpriseMq; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 报文类型数据Service业务层处理 + * + * @author wan + * @date 2024-06-28 + */ +@Slf4j +@Service +public class MessageDataServiceImpl extends ServiceImpl implements MessageDataService { + + /** + * 查询报文类型数据列表 + * + * @param messageData 报文类型数据 + * @return 报文类型数据 + */ + @Override + public List list(MessageData messageData) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(messageData.getMessageLabel())){ + queryWrapper.eq(MessageData::getMessageLabel, messageData.getMessageLabel()); + } + + if (ObjUtils.notNull(messageData.getAnalyzeKey())){ + queryWrapper.eq(MessageData::getAnalyzeKey, messageData.getAnalyzeKey()); + } + + if (ObjUtils.notNull(messageData.getInitiationPosition())){ + queryWrapper.eq(MessageData::getInitiationPosition, messageData.getInitiationPosition()); + } + + if (ObjUtils.notNull(messageData.getTerminatePosition())){ + queryWrapper.eq(MessageData::getTerminatePosition, messageData.getTerminatePosition()); + } + + if (ObjUtils.notNull(messageData.getTypeIdentification())){ + queryWrapper.eq(MessageData::getTypeIdentification, messageData.getTypeIdentification()); + } + + + + + + return list(queryWrapper); + } + + + + + @Autowired + private MessageAnalysisMapper messageAnalysisMapper; + @Autowired + private MessageDataMapper messageDataMapper; + @Autowired + private VehicleMapper vehicleMapper; + @Autowired + private StringRedisTemplate redisTemplate; + + @Override + public void messageDataEnterpriseAdd(MessageDataEnterprise messageDataEnterprise) { + List messageData = messageDataList(messageDataEnterprise.getIds()); + + messageData.forEach(message -> { + messageAnalysisMapper.insert( + MessageAnalysis.builder() + .vehicleId(messageDataEnterprise.getId()) + .analyzeKey(message.getAnalyzeKey()) + .analyzeStart(Long.valueOf(message.getInitiationPosition())) + .ent(Long.valueOf(message.getTerminatePosition())) + .lable(message.getMessageLabel()) + .type(message.getRemark()) + .build() + ); + }); + List vehicles = vehicleMapper.selectList(null); + + + vehicles.forEach(vehicl -> { + List messageAnalyses = messageAnalysisMapper.selectList( + new LambdaQueryWrapper<>() {{ + eq(MessageAnalysis::getVehicleId, vehicl.getId()); + ; + }} + ); + List arrayList = new ArrayList<>(); + messageAnalyses.forEach(messageAnal->{ + arrayList.add(messageAnal); + }); + String jsonString = JSON.toJSONString(arrayList); + System.out.println(jsonString); + redisTemplate.opsForHash().put("VIN",vehicl.getVin(),jsonString); + }); + } + + private List messageDataList(List ids){ + List arrayList = new ArrayList<>(); + for (Long id : ids) { + MessageData messageData = messageDataMapper.selectOne( + new LambdaQueryWrapper<>() {{ + eq(MessageData::getId, id); + }} + ); + arrayList.add(messageData); + } + return arrayList; + } + +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlideLengthServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlideLengthServiceImpl.java new file mode 100644 index 0000000..5556188 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlideLengthServiceImpl.java @@ -0,0 +1,53 @@ +package com.muyu.authentication.service.impl; + +import java.util.List; + +import com.muyu.authentication.mapper.SlideLengthMapper; +import com.muyu.authentication.service.SlideLengthService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.SlideLength; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 滑动长度Service业务层处理 + * + * @author wan + * @date 2024-06-29 + */ +@Slf4j +@Service +public class SlideLengthServiceImpl extends ServiceImpl implements SlideLengthService { + + @Autowired + private SlideLengthMapper slideLengthMapper; + /** + * 查询滑动长度列表 + * + * @param slideLength 滑动长度 + * @return 滑动长度 + */ + @Override + public List list(SlideLength slideLength) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(slideLength.getSlideLengthName())){ + queryWrapper.like(SlideLength::getSlideLengthName, slideLength.getSlideLengthName()); + } + + if (ObjUtils.notNull(slideLength.getSlideLengthProportion())){ + queryWrapper.eq(SlideLength::getSlideLengthProportion, slideLength.getSlideLengthProportion()); + } + return list(queryWrapper); + } + + @Override + public List slideLengthList() { + return slideLengthMapper.selectList(null); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlidingInfoServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlidingInfoServiceImpl.java new file mode 100644 index 0000000..96f9592 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/SlidingInfoServiceImpl.java @@ -0,0 +1,112 @@ +package com.muyu.authentication.service.impl; + +import java.util.List; +import java.util.UUID; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.authentication.mapper.SlideLengthMapper; +import com.muyu.authentication.mapper.SlidingInfoMapper; +import com.muyu.authentication.mapper.WindowMapper; +import com.muyu.authentication.service.SlidingInfoService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.SlideLength; +import com.muyu.many.domain.SlidingInfo; +import com.muyu.many.domain.Window; +import com.muyu.many.domain.mq.MessageAnalysisMq; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 滑窗Service业务层处理 + * + * @author wan + * @date 2024-06-29 + */ +@Slf4j +@Service +public class SlidingInfoServiceImpl extends ServiceImpl implements SlidingInfoService { + + @Autowired + private SlidingInfoMapper slidingInfoMapper; + /** + * 查询滑窗列表 + * + * @param slidingInfo 滑窗 + * @return 滑窗 + */ + @Override + public List list(SlidingInfo slidingInfo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(slidingInfo.getVehicleVin())){ + queryWrapper.eq(SlidingInfo::getVehicleVin, slidingInfo.getVehicleVin()); + } + return list(queryWrapper); + } + + @Autowired + private WindowMapper windowMapper; + @Autowired + private SlideLengthMapper slideLengthMapper; + @Autowired + private RabbitTemplate rabbitTemplate; + @Autowired + private StringRedisTemplate redisTemplate; + + @Override + public boolean add(SlidingInfo slidingInfo) { + int insert = slidingInfoMapper.insert(slidingInfo); + if (insert>0) { + + Window window = windowMapper.selectById(slidingInfo.getWindowRadiusId()); + SlideLength slideLength = slideLengthMapper.selectById(slidingInfo.getSlideLengthId()); + + MessageAnalysisMq build = MessageAnalysisMq.builder() + .vehicleVin(slidingInfo.getVehicleVin()) + .analyzeKey(slidingInfo.getAnalyzeKey()) + .messageLabel(slidingInfo.getMessageLabel()) + .standard(slidingInfo.getStandard()) + .windowRadiusId(window.getWindowRadiusLength()) + .slideLengthId(slideLength.getSlideLengthProportion()) + .build(); + redisTemplate.opsForValue().set(build.getVehicleVin()+"-length",JSON.toJSONString(build)); + return true; + } + return false; + } + + + @Override + public boolean updateId(SlidingInfo slidingInfo) { + int i = slidingInfoMapper.updateById(slidingInfo); + + if (i>0) { + redisTemplate.delete(slidingInfo.getVehicleVin()+"-length"); + Window window = windowMapper.selectById(slidingInfo.getWindowRadiusId()); + SlideLength slideLength = slideLengthMapper.selectById(slidingInfo.getSlideLengthId()); + + MessageAnalysisMq build = MessageAnalysisMq.builder() + .vehicleVin(slidingInfo.getVehicleVin()) + .analyzeKey(slidingInfo.getAnalyzeKey()) + .messageLabel(slidingInfo.getMessageLabel()) + .standard(slidingInfo.getStandard()) + .windowRadiusId(window.getWindowRadiusLength()) + .slideLengthId(slideLength.getSlideLengthProportion()) + .build(); + redisTemplate.opsForValue().set(build.getVehicleVin()+"-length",JSON.toJSONString(build)); + String s = build.getVehicleVin() + "-length"; + rabbitTemplate.convertAndSend("renew",s,message -> { + message.getMessageProperties().setMessageId(UUID.randomUUID().toString()); + return message; + }); + return true; + } + return false; + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/VehicleServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/VehicleServiceImpl.java index 792b188..5727b98 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/VehicleServiceImpl.java +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/VehicleServiceImpl.java @@ -1,13 +1,19 @@ package com.muyu.authentication.service.impl; +import java.util.ArrayList; import java.util.List; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.authentication.mapper.MessageAnalysisMapper; import com.muyu.authentication.mapper.VehicleMapper; import com.muyu.authentication.service.VehicleService; import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.MessageAnalysis; import com.muyu.many.domain.Vehicle; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -98,4 +104,19 @@ public class VehicleServiceImpl extends ServiceImpl impl return list(queryWrapper); } + + @Autowired + private VehicleMapper vehicleMapper; + @Autowired + private MessageAnalysisMapper messageAnalysisMapper; + + @Override + public List vehicleList() { + return vehicleMapper.selectList(null); + } + + @Autowired + private StringRedisTemplate redisTemplate; + + } diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/WindowServiceImpl.java b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/WindowServiceImpl.java new file mode 100644 index 0000000..9e703a4 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/java/com/muyu/authentication/service/impl/WindowServiceImpl.java @@ -0,0 +1,53 @@ +package com.muyu.authentication.service.impl; + +import java.util.List; + +import com.muyu.authentication.mapper.WindowMapper; +import com.muyu.authentication.service.WindowService; +import com.muyu.common.core.utils.ObjUtils; +import com.muyu.many.domain.Window; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; + +/** + * 滑窗范围Service业务层处理 + * + * @author wan + * @date 2024-06-29 + */ +@Slf4j +@Service +public class WindowServiceImpl extends ServiceImpl implements WindowService { + + @Autowired + private WindowMapper mapper; + /** + * 查询滑窗范围列表 + * + * @param window 滑窗范围 + * @return 滑窗范围 + */ + @Override + public List list(Window window) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + + if (ObjUtils.notNull(window.getWindowRadiusName())){ + queryWrapper.like(Window::getWindowRadiusName, window.getWindowRadiusName()); + } + + if (ObjUtils.notNull(window.getWindowRadiusLength())){ + queryWrapper.eq(Window::getWindowRadiusLength, window.getWindowRadiusLength()); + } + return list(queryWrapper); + } + + @Override + public List windowList() { + return mapper.selectList(null); + } +} diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index a44a73c..0ce49c4 100644 --- a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,3 @@ com.muyu.authentication.rabbitmq.MessageConsumer com.muyu.authentication.rabbitmq.vo.BreakdownAbnormalMq +com.muyu.authentication.rabbitmq.enterprise.EnterpriseMq diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlideLengthMapper.xml b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlideLengthMapper.xml new file mode 100644 index 0000000..926c0d9 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlideLengthMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + select id, slide_length_name, slide_length_proportion from slide_length + + diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlidingInfoMapper.xml b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlidingInfoMapper.xml new file mode 100644 index 0000000..4845db1 --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/SlidingInfoMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/WindowMapper.xml b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/WindowMapper.xml new file mode 100644 index 0000000..b0ac86e --- /dev/null +++ b/muyu-modules/muyu-modules-many/muyu-modules-many-server/src/main/resources/mapper/WindowMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + select id, window_radius_name, window_radius_length from window + +