feat(新增滑窗配置)

master
031026 2024-06-27 20:55:38 +08:00
commit 1ca5930f76
74 changed files with 3092 additions and 324 deletions

View File

@ -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<List<MessageData>> enterpriseAllList();
}

View File

@ -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<RemoteMessageDataService> {
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<List<MessageData>> enterpriseAllList() {
return Result.error("报文配置获取失败:{}"+cause.getMessage());
}
};
}
}

View File

@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import com.muyu.authentication.service.IEnterpriseService; import com.muyu.authentication.service.IEnterpriseService;
import com.muyu.domain.vo.EnterpriseReq; 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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;
@ -128,7 +128,7 @@ public class EnterpriseController extends BaseController
} }
@GetMapping("/redisList/{vin}") @GetMapping("/redisList/{vin}")
public Result<MessageData> redisList(@PathVariable String vin){ public Result<MessageDataArgument> redisList(@PathVariable String vin){
return Result.success( return Result.success(
enterpriseService.redisList(vin) enterpriseService.redisList(vin)
); );

View File

@ -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<MessageData>> list(){
return Result.success(
messageDataService.messageList()
);
}
}

View File

@ -5,7 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.Enterprise; import com.muyu.domain.Enterprise;
import com.muyu.domain.vo.EnterpriseReq; import com.muyu.domain.vo.EnterpriseReq;
import com.muyu.many.domain.Message.MessageData; import com.muyu.many.domain.Message.MessageDataArgument;
/** /**
* Service * Service
@ -69,5 +69,5 @@ public interface IEnterpriseService extends IService<Enterprise>
String enterpriseUpdateId(Long id); String enterpriseUpdateId(Long id);
MessageData redisList(String vin); MessageDataArgument redisList(String vin);
} }

View File

@ -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<MessageData> {
List<MessageData> messageList();
}

View File

@ -18,8 +18,7 @@ import com.muyu.common.core.utils.DateUtils;
import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.RemoteUserService; import com.muyu.common.system.remote.RemoteUserService;
import com.muyu.domain.vo.EnterpriseReq; import com.muyu.domain.vo.EnterpriseReq;
import com.muyu.many.domain.Message.MessageData; import com.muyu.many.domain.Message.MessageDataArgument;
import com.muyu.many.forewarning.EarlyWarning;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -246,8 +245,8 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper,Enterpri
private StringRedisTemplate redisTemplate; private StringRedisTemplate redisTemplate;
@Override @Override
public MessageData redisList(String vin) { public MessageDataArgument redisList(String vin) {
String index = redisTemplate.opsForValue().get(vin); String index = redisTemplate.opsForValue().get(vin);
return JSON.parseObject(index, MessageData.class); return JSON.parseObject(index, MessageDataArgument.class);
} }
} }

View File

@ -1,31 +0,0 @@
package com.muyu.authentication.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.authentication.mapper.MessageDataMapper;
import com.muyu.authentication.service.MessageDataService;
import com.muyu.domain.MessageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*
* @ClassName MessageDataServiceImpl
* @Author AnNan.Wang
* @Date 2024/6/27 10:31
*/
@Service
public class MessageDataServiceImpl extends ServiceImpl<MessageDataMapper, MessageData>
implements MessageDataService {
@Autowired
private MessageDataMapper messageDataMapper;
@Override
public List<MessageData> messageList() {
return messageDataMapper.selectList(null);
}
}

View File

@ -6,7 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
/** /**
* MessageData * MessageDataArgument
* *
* @author Yangle * @author Yangle
* Date 2024/6/7 17:15 * Date 2024/6/7 17:15
@ -15,7 +15,7 @@ import lombok.experimental.SuperBuilder;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder @SuperBuilder
public class MessageData { public class MessageDataArgument {
/** /**
*vin *vin
*/ */

View File

@ -1,57 +1,110 @@
package com.muyu.many.domain; package com.muyu.many.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; 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.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder; 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 wan
* @Author AnNan.Wang * @date 2024-06-28
* @Date 2024/6/26 18:38
*/ */
@Data @Data
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("message_analysis") @TableName("message_analysis")
@ApiModel(value = "MessageAnalysis", description = "报文解析")
public class MessageAnalysis{ public class MessageAnalysis{
/**
*
*/ /** 主键 */
@TableId(value = "id",type = IdType.AUTO) @TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "主键", value = "主键")
private Long id; private Long id;
/**
* ID @Excel(name = "车辆ID")
*/ @ApiModelProperty(name = "车辆ID", value = "车辆ID")
private Long vehicleId; private Long vehicleId;
/**
* key /** 指标项key */
*/ @Excel(name = "指标项key")
@ApiModelProperty(name = "指标项key", value = "指标项key")
private String analyzeKey; private String analyzeKey;
/**
* /** 起始位 */
*/ @Excel(name = "起始位")
private Integer analyzeStart; @ApiModelProperty(name = "起始位", value = "起始位")
/** private Long analyzeStart;
*
*/ /** 终止位 */
private Integer ent; @Excel(name = "终止位")
/** @ApiModelProperty(name = "终止位", value = "终止位")
* private Long ent;
*/
/** 指标项标签 */
@Excel(name = "指标项标签")
@ApiModelProperty(name = "指标项标签", value = "指标项标签")
private String lable; private String lable;
/**
* /** 类型 */
*/ @Excel(name = "类型")
@ApiModelProperty(name = "类型", value = "类型")
private String type; 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();
}
} }

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity; import com.muyu.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
/** /**
* * message_data
* *
* @ClassName MessageData * @author wan
* @Author AnNan.Wang * @date 2024-06-28
* @Date 2024/6/27 9:56
*/ */
@Data @Data
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("message_data")
public class MessageData extends BaseEntity{ public class MessageData extends BaseEntity{
/**
*
*/
@TableId(value = "id",type = IdType.AUTO)
private Long id; private Long id;
/**
*
*/
private String messageLabel; private String messageLabel;
/**
* Key
*/
private String analyzeKey; private String analyzeKey;
/**
*
*/
private String initiationPosition; private String initiationPosition;
/**
*
*/
private String terminatePosition; private String terminatePosition;
/**
*
*/
private String typeIdentification; private String typeIdentification;
} }

View File

@ -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<MessageData> messageDataList;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Long> ids;
}

View File

@ -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<MessageData> messageDataList;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -95,12 +95,6 @@
<artifactId>muyu-modules-many-common</artifactId> <artifactId>muyu-modules-many-common</artifactId>
<version>3.6.3</version> <version>3.6.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-modules-many-common</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.muyu</groupId> <groupId>com.muyu</groupId>
<artifactId>muyu-common-log</artifactId> <artifactId>muyu-common-log</artifactId>

View File

@ -1,10 +1,12 @@
package com.muyu.authentication; package com.muyu.authentication;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.authentication.mapper.MessageAnalysisMapper; import com.muyu.authentication.mapper.MessageAnalysisMapper;
import com.muyu.authentication.mapper.VehicleMapper; import com.muyu.authentication.mapper.VehicleMapper;
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder; import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
import com.muyu.clw.common.many.remote.RemoteEnterpriseService; 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.core.domain.Result;
import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients; 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.domain.Enterprise;
import com.muyu.many.domain.MessageAnalysis; import com.muyu.many.domain.MessageAnalysis;
import com.muyu.many.domain.Vehicle; import com.muyu.many.domain.Vehicle;
import org.apache.commons.collections4.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate; 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.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
@ -59,11 +62,24 @@ public class MuYuManyApplication implements ApplicationRunner {
String ent = "ent_" + enterprise1.getContactPhone().substring(enterprise1.getContactPhone().length() - 4); String ent = "ent_" + enterprise1.getContactPhone().substring(enterprise1.getContactPhone().length() - 4);
DynamicDataSourceHolder.setDynamicDataSourceKey(ent); DynamicDataSourceHolder.setDynamicDataSourceKey(ent);
List<Vehicle> vehicles = vehicleMapper.selectList(null); List<Vehicle> vehicles = vehicleMapper.selectList(null);
List<MessageAnalysis> messageAnalyses = messageAnalysisMapper.selectList(null);
for (Vehicle vehicle : vehicles) {
redisTemplate.opsForValue().set(vehicle.getVin(), JSON.toJSONString(messageAnalyses),4,TimeUnit.HOURS); vehicles.forEach(vehicle -> {
} List<MessageAnalysis> messageAnalyses = messageAnalysisMapper.selectList(
new LambdaQueryWrapper<>() {{
eq(MessageAnalysis::getVehicleId, vehicle.getId());
;
}}
);
List<MessageAnalysis> 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);
});
} }
} }
} }

View File

@ -1,34 +1,123 @@
package com.muyu.authentication.controller; package com.muyu.authentication.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.muyu.authentication.service.MessageAnalysisService; 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.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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import java.util.List; 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 wan
* @Author AnNan.Wang * @date 2024-06-28
* @Date 2024/6/26 18:40
*/ */
@Api(tags = "报文解析")
@RestController @RestController
@RequestMapping("/messageAnalysis") @RequestMapping("/analysis")
public class MessageAnalysisController { public class MessageAnalysisController extends BaseController {
@Autowired @Autowired
private MessageAnalysisService messageAnalysisService; private MessageAnalysisService messageAnalysisService;
@PostMapping("/messageAnalysisAdd") /**
public Result<String> messageAnalysisAdd(@RequestBody List<MessageAnalysis> messageAnalysisList){ *
return messageAnalysisService.messageAnalysisAdd(messageAnalysisList); */
@ApiOperation("获取报文解析列表")
@GetMapping("/list")
public Result<TableDataInfo<MessageAnalysis>> list(MessageAnalysisQueryReq messageAnalysisQueryReq) {
startPage();
List<MessageAnalysis> 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<MessageAnalysis> list = messageAnalysisService.list(messageAnalysis);
ExcelUtil<MessageAnalysis> util = new ExcelUtil<MessageAnalysis>(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<MessageAnalysis> 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<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = messageAnalysisService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
@GetMapping("/messageAnalysisList")
public Result<List<MessageAnalysis>>messageAnalysisList(){
List<MessageAnalysis> messageAnalyses = messageAnalysisService.messageAnalysisList();
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(messageAnalyses);
}
} }

View File

@ -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<TableDataInfo<MessageConfigurationType>> list(MessageConfigurationTypeQueryReq messageConfigurationTypeQueryReq) {
startPage();
List<MessageConfigurationType> 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<MessageConfigurationType> list = messageConfigurationTypeService.list(messageConfigurationType);
ExcelUtil<MessageConfigurationType> util = new ExcelUtil<MessageConfigurationType>(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<MessageConfigurationType> 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<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = messageConfigurationTypeService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
}

View File

@ -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<TableDataInfo<MessageData>> list(MessageDataQueryReq messageDataQueryReq) {
startPage();
List<MessageData> 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<MessageData> list = messageDataService.list(messageData);
ExcelUtil<MessageData> util = new ExcelUtil<MessageData>(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<MessageData> 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<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = messageDataService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
@GetMapping("/messageList")
public Result<List<MessageData>> messageList(){
List<MessageData> list = messageDataService.list();
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(list);
}
@PostMapping("/messageDataEnterpriseAdd")
public void messageDataEnterpriseAdd(@RequestBody MessageDataEnterprise messageDataEnterprise){
messageDataService.messageDataEnterpriseAdd(messageDataEnterprise);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
}
}

View File

@ -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<TableDataInfo<SlideLength>> list(SlideLengthQueryReq slideLengthQueryReq) {
startPage();
List<SlideLength> 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<SlideLength> list = slideLengthService.list(slideLength);
ExcelUtil<SlideLength> util = new ExcelUtil<SlideLength>(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<SlideLength> getInfo(@PathVariable("id") Long id) {
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(slideLengthService.getById(id));
}
/**
*
*/
@Log(title = "滑动长度", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation("新增滑动长度")
public Result<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = slideLengthService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
@GetMapping("/slideLengthList")
public Result<List<SlideLength>> windowList(){
List<SlideLength> slideLengthList = slideLengthService.slideLengthList();
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(slideLengthList);
}
}

View File

@ -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<TableDataInfo<SlidingInfo>> list(SlidingInfoQueryReq slidingInfoQueryReq) {
startPage();
List<SlidingInfo> 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<SlidingInfo> list = slidingInfoService.list(slidingInfo);
ExcelUtil<SlidingInfo> util = new ExcelUtil<SlidingInfo>(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<SlidingInfo> 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<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = slidingInfoService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
}

View File

@ -114,4 +114,13 @@ public class VehicleController extends BaseController {
DynamicDataSourceHolder.removeDynamicDataSourceKey(); DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b); return toAjax(b);
} }
@GetMapping("/vehicleList")
public Result<List<Vehicle>> vehicleList(){
List<Vehicle> vehicles = vehicleService.vehicleList();
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(vehicles);
}
} }

View File

@ -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<TableDataInfo<Window>> list(WindowQueryReq windowQueryReq) {
startPage();
List<Window> 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<Window> list = windowService.list(window);
ExcelUtil<Window> util = new ExcelUtil<Window>(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<Window> 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<String> 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<String> 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<String> remove(@PathVariable List<Long> ids) {
boolean b = windowService.removeBatchByIds(ids);
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return toAjax(b);
}
@GetMapping("/windowList")
public Result<List<Window>> windowList(){
List<Window> windows = windowService.windowList();
DynamicDataSourceHolder.removeDynamicDataSourceKey();
return Result.success(windows);
}
}

View File

@ -1,15 +1,16 @@
package com.muyu.authentication.mapper; package com.muyu.authentication.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.many.domain.MessageAnalysis; 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<MessageAnalysis> { public interface MessageAnalysisMapper extends BaseMapper<MessageAnalysis> {
} }

View File

@ -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<MessageConfigurationType> {
}

View File

@ -1,15 +1,14 @@
package com.muyu.authentication.mapper; package com.muyu.authentication.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.domain.MessageData; import com.muyu.many.domain.MessageData;
/** /**
* Mapper * Mapper
* *
* @author AnNan.Wang * @author wan
* @ClassName: MessageDataMapper * @date 2024-06-28
* @createTime: 2024/6/27 10:33
*/ */
public interface MessageDataMapper extends BaseMapper<MessageData> { public interface MessageDataMapper extends BaseMapper<MessageData> {
} }

View File

@ -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<SlideLength> {
}

View File

@ -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<SlidingInfo> {
}

View File

@ -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<Window> {
}

View File

@ -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("开始消费");
}
}

View File

@ -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);
//
//
// }
//}

View File

@ -59,39 +59,39 @@ public class BreakdownAbnormalMq {
String[] split = faultInfo.getVin().split("-"); String[] split = faultInfo.getVin().split("-");
log.info("split:{}",split[0]); log.info("split:{}",split[0]);
FaultInfo build = FaultInfo.builder() // FaultInfo build = FaultInfo.builder()
.faultCode(split[1]) // .faultCode(split[1])
.vin(split[0]) // .vin(split[0])
.endTime(faultInfo.getEndTime()) // .endTime(faultInfo.getEndTime())
.build(); // .build();
String key=build.getVin()+"123"; // String key=build.getVin()+"123";
String ent = redisTemplate.opsForValue().get(key); // String ent = redisTemplate.opsForValue().get(key);
DynamicDataSourceHolder.setDynamicDataSourceKey(ent); // DynamicDataSourceHolder.setDynamicDataSourceKey(ent);
//
//获取最新一天数据 // //获取最新一天数据
List<FaultInfo> faultInfos = faultInfoMapper.selectList( // List<FaultInfo> faultInfos = faultInfoMapper.selectList(
new QueryWrapper<FaultInfo>() // new QueryWrapper<FaultInfo>()
.eq("fault_code", build.getFaultCode()) // 替换 yourFaultCode 为实际的故障代码值 // .eq("fault_code", build.getFaultCode()) // 替换 yourFaultCode 为实际的故障代码值
.orderByDesc("start_time") // .orderByDesc("start_time")
.last("LIMIT 1") // .last("LIMIT 1")
); // );
//判断非空 //判断非空
if (!faultInfos.isEmpty()) { // if (!faultInfos.isEmpty()) {
//获取第一条数据 // //获取第一条数据
FaultInfo latestFaultInfo = faultInfos.get(0); // FaultInfo latestFaultInfo = faultInfos.get(0);
// 这里可以对 latestFaultInfo 进行进一步操作或者返回 // // 这里可以对 latestFaultInfo 进行进一步操作或者返回
log.info("Latest FaultInfo: {}", latestFaultInfo); // log.info("Latest FaultInfo: {}", latestFaultInfo);
//
//修改数据 // //修改数据
faultInfoMapper.updateById( // faultInfoMapper.updateById(
FaultInfo.builder() // FaultInfo.builder()
.id(latestFaultInfo.getId()) // .id(latestFaultInfo.getId())
.endTime(new Date()) // .endTime(new Date())
.build() // .build()
); // );
DynamicDataSourceHolder.removeDynamicDataSourceKey(); // DynamicDataSourceHolder.removeDynamicDataSourceKey();
log.info("消费结束"); // log.info("消费结束");
} // }
log.info("消费结束"); log.info("消费结束");
} }
} }

View File

@ -1,19 +1,26 @@
package com.muyu.authentication.service; package com.muyu.authentication.service;
import java.util.List;
import com.muyu.many.domain.MessageAnalysis;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.core.domain.Result;
import com.muyu.many.domain.MessageAnalysis; import com.muyu.many.domain.MessageAnalysis;
import java.util.List;
/** /**
* Service * Service
* *
* @author AnNan.Wang * @author wan
* @ClassName: MessageAnalysisService * @date 2024-06-28
* @createTime: 2024/6/26 18:41
*/ */
public interface MessageAnalysisService extends IService<MessageAnalysis> { public interface MessageAnalysisService extends IService<MessageAnalysis> {
Result<String> messageAnalysisAdd(List<MessageAnalysis> messageAnalysisList); /**
*
*
* @param messageAnalysis
* @return
*/
public List<MessageAnalysis> list(MessageAnalysis messageAnalysis);
List<MessageAnalysis> messageAnalysisList();
} }

View File

@ -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<MessageConfigurationType> {
/**
*
*
* @param messageConfigurationType
* @return
*/
public List<MessageConfigurationType> list(MessageConfigurationType messageConfigurationType);
}

View File

@ -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<MessageData> {
/**
*
*
* @param messageData
* @return
*/
public List<MessageData> list(MessageData messageData);
void messageDataEnterpriseAdd(MessageDataEnterprise messageDataEnterprise);
}

View File

@ -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<SlideLength> {
/**
*
*
* @param slideLength
* @return
*/
public List<SlideLength> list(SlideLength slideLength);
List<SlideLength> slideLengthList();
}

View File

@ -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<SlidingInfo> {
/**
*
*
* @param slidingInfo
* @return
*/
public List<SlidingInfo> list(SlidingInfo slidingInfo);
boolean add(SlidingInfo slidingInfo);
boolean updateId(SlidingInfo slidingInfo);
}

View File

@ -20,4 +20,6 @@ public interface VehicleService extends IService<Vehicle> {
*/ */
public List<Vehicle> list(Vehicle vehicle); public List<Vehicle> list(Vehicle vehicle);
List<Vehicle> vehicleList();
} }

View File

@ -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<Window> {
/**
*
*
* @param window
* @return
*/
public List<Window> list(Window window);
List<Window> windowList();
}

View File

@ -1,42 +1,70 @@
package com.muyu.authentication.service.impl; 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; import java.util.List;
/** import com.muyu.authentication.service.MessageAnalysisService;
* import com.muyu.common.core.utils.ObjUtils;
* import com.muyu.many.domain.MessageAnalysis;
* @ClassName MessageAnalysisServiceImpl import com.muyu.authentication.mapper.MessageAnalysisMapper;
* @Author AnNan.Wang
* @Date 2024/6/26 18:43
*/
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 @Service
public class MessageAnalysisServiceImpl extends ServiceImpl<MessageAnalysisMapper, MessageAnalysis> public class MessageAnalysisServiceImpl extends ServiceImpl<MessageAnalysisMapper, MessageAnalysis> implements MessageAnalysisService {
implements MessageAnalysisService {
/**
*
*
* @param messageAnalysis
* @return
*/
@Override
public List<MessageAnalysis> list(MessageAnalysis messageAnalysis) {
LambdaQueryWrapper<MessageAnalysis> 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 @Autowired
private MessageAnalysisMapper messageAnalysisMapper; private MessageAnalysisMapper messageAnalysis;
@Override @Override
public Result<String> messageAnalysisAdd(List<MessageAnalysis> messageAnalysisList) { public List<MessageAnalysis> messageAnalysisList() {
for (MessageAnalysis messageAnalysis : messageAnalysisList) { return messageAnalysis.selectList(null);
messageAnalysisMapper.insert(
MessageAnalysis.builder()
.analyzeKey(messageAnalysis.getAnalyzeKey())
.analyzeStart(messageAnalysis.getAnalyzeStart())
.ent(messageAnalysis.getEnt())
.lable(messageAnalysis.getLable())
.type(messageAnalysis.getType())
.build()
);
}
return Result.success();
} }
} }

View File

@ -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<MessageConfigurationTypeMapper, MessageConfigurationType> implements MessageConfigurationTypeService {
/**
*
*
* @param messageConfigurationType
* @return
*/
@Override
public List<MessageConfigurationType> list(MessageConfigurationType messageConfigurationType) {
LambdaQueryWrapper<MessageConfigurationType> 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);
}
}

View File

@ -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<MessageDataMapper, MessageData> implements MessageDataService {
/**
*
*
* @param messageData
* @return
*/
@Override
public List<MessageData> list(MessageData messageData) {
LambdaQueryWrapper<MessageData> 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> 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<Vehicle> vehicles = vehicleMapper.selectList(null);
vehicles.forEach(vehicl -> {
List<MessageAnalysis> messageAnalyses = messageAnalysisMapper.selectList(
new LambdaQueryWrapper<>() {{
eq(MessageAnalysis::getVehicleId, vehicl.getId());
;
}}
);
List<MessageAnalysis> 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<MessageData> messageDataList(List<Long> ids){
List<MessageData> arrayList = new ArrayList<>();
for (Long id : ids) {
MessageData messageData = messageDataMapper.selectOne(
new LambdaQueryWrapper<>() {{
eq(MessageData::getId, id);
}}
);
arrayList.add(messageData);
}
return arrayList;
}
}

View File

@ -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<SlideLengthMapper, SlideLength> implements SlideLengthService {
@Autowired
private SlideLengthMapper slideLengthMapper;
/**
*
*
* @param slideLength
* @return
*/
@Override
public List<SlideLength> list(SlideLength slideLength) {
LambdaQueryWrapper<SlideLength> 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<SlideLength> slideLengthList() {
return slideLengthMapper.selectList(null);
}
}

View File

@ -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<SlidingInfoMapper, SlidingInfo> implements SlidingInfoService {
@Autowired
private SlidingInfoMapper slidingInfoMapper;
/**
*
*
* @param slidingInfo
* @return
*/
@Override
public List<SlidingInfo> list(SlidingInfo slidingInfo) {
LambdaQueryWrapper<SlidingInfo> 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;
}
}

View File

@ -1,13 +1,19 @@
package com.muyu.authentication.service.impl; package com.muyu.authentication.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.authentication.mapper.MessageAnalysisMapper;
import com.muyu.authentication.mapper.VehicleMapper; import com.muyu.authentication.mapper.VehicleMapper;
import com.muyu.authentication.service.VehicleService; import com.muyu.authentication.service.VehicleService;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import com.muyu.many.domain.MessageAnalysis;
import com.muyu.many.domain.Vehicle; import com.muyu.many.domain.Vehicle;
import lombok.extern.slf4j.Slf4j; 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 org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -98,4 +104,19 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
return list(queryWrapper); return list(queryWrapper);
} }
@Autowired
private VehicleMapper vehicleMapper;
@Autowired
private MessageAnalysisMapper messageAnalysisMapper;
@Override
public List<Vehicle> vehicleList() {
return vehicleMapper.selectList(null);
}
@Autowired
private StringRedisTemplate redisTemplate;
} }

View File

@ -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<WindowMapper, Window> implements WindowService {
@Autowired
private WindowMapper mapper;
/**
*
*
* @param window
* @return
*/
@Override
public List<Window> list(Window window) {
LambdaQueryWrapper<Window> 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<Window> windowList() {
return mapper.selectList(null);
}
}

View File

@ -1,2 +1,3 @@
com.muyu.authentication.rabbitmq.MessageConsumer com.muyu.authentication.rabbitmq.MessageConsumer
com.muyu.authentication.rabbitmq.vo.BreakdownAbnormalMq com.muyu.authentication.rabbitmq.vo.BreakdownAbnormalMq
com.muyu.authentication.rabbitmq.enterprise.EnterpriseMq

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.SlideLength.mapper.SlideLengthMapper">
<resultMap type="com.muyu.many.domain.SlideLength" id="SlideLengthResult">
<result property="id" column="id" />
<result property="slideLengthName" column="slide_length_name" />
<result property="slideLengthProportion" column="slide_length_proportion" />
</resultMap>
<sql id="selectSlideLengthVo">
select id, slide_length_name, slide_length_proportion from slide_length
</sql>
</mapper>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.SlidingInfo.mapper.SlidingInfoMapper">
<resultMap type="com.muyu.many.domain.SlidingInfo" id="SlidingInfoResult">
<result property="id" column="id" />
<result property="vehicleVin" column="vehicle_vin" />
<result property="messageKye" column="message_kye" />
<result property="analyzeKey" column="analyze_key" />
<result property="messageLabel" column="message_label" />
<result property="standard" column="standard" />
<result property="windowRadiusId" column="window_radius_id" />
<result property="slideLengthId" column="slide_length_id" />
</resultMap>
</mapper>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.Window.mapper.WindowMapper">
<resultMap type="com.muyu.many.domain.Window" id="WindowResult">
<result property="id" column="id" />
<result property="windowRadiusName" column="window_radius_name" />
<result property="windowRadiusLength" column="window_radius_length" />
</resultMap>
<sql id="selectWindowVo">
select id, window_radius_name, window_radius_length from window
</sql>
</mapper>