feat(新增故障管理)
commit
eaf96768bc
|
@ -9,7 +9,6 @@ import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.domain.AddService;
|
import com.muyu.domain.AddService;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
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.*;
|
||||||
|
|
||||||
|
|
|
@ -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.MessageData;
|
import com.muyu.many.domain.Message.MessageData;
|
||||||
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;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.authentication.service;
|
package com.muyu.authentication.service;
|
||||||
|
|
||||||
import com.muyu.domain.AddService;
|
import com.muyu.domain.AddService;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -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.MessageData;
|
import com.muyu.many.domain.Message.MessageData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业Service接口
|
* 企业Service接口
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package com.muyu.authentication.service.impl;
|
package com.muyu.authentication.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.muyu.authentication.mapper.AddServiceMapper;
|
import com.muyu.authentication.mapper.AddServiceMapper;
|
||||||
import com.muyu.authentication.service.IAddServiceService;
|
import com.muyu.authentication.service.IAddServiceService;
|
||||||
import com.muyu.common.core.utils.DateUtils;
|
import com.muyu.common.core.utils.DateUtils;
|
||||||
import com.muyu.domain.AddService;
|
import com.muyu.domain.AddService;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -18,11 +18,10 @@ 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.MessageData;
|
import com.muyu.many.domain.Message.MessageData;
|
||||||
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;
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.muyu.domain.Enterprise;
|
import com.muyu.domain.Enterprise;
|
||||||
|
@ -244,7 +243,7 @@ public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper,Enterpri
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MessageData redisList(String vin) {
|
public MessageData redisList(String vin) {
|
||||||
String index = redisTemplate.opsForList().index(vin, -1);
|
String index = redisTemplate.opsForValue().get(vin);
|
||||||
return JSON.parseObject(index, MessageData.class);
|
return JSON.parseObject(index, MessageData.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.muyu.many.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
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.many.domain.req.DefectInfoQueryReq;
|
||||||
|
import com.muyu.many.domain.req.DefectInfoSaveReq;
|
||||||
|
import com.muyu.many.domain.req.DefectInfoEditReq;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码对象 defect_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("defect_info")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "DefectInfo", description = "故障码")
|
||||||
|
public class DefectInfo 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 defectCode;
|
||||||
|
|
||||||
|
/** 故障标签 */
|
||||||
|
@Excel(name = "故障标签")
|
||||||
|
@ApiModelProperty(name = "故障标签", value = "故障标签")
|
||||||
|
private String abortSituation;
|
||||||
|
|
||||||
|
/** 故障位 */
|
||||||
|
@Excel(name = "故障位")
|
||||||
|
@ApiModelProperty(name = "故障位", value = "故障位")
|
||||||
|
private Long defectBit;
|
||||||
|
|
||||||
|
/** 故障值 */
|
||||||
|
@Excel(name = "故障值")
|
||||||
|
@ApiModelProperty(name = "故障值", value = "故障值")
|
||||||
|
private Long defectValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询构造器
|
||||||
|
*/
|
||||||
|
public static DefectInfo queryBuild( DefectInfoQueryReq defectInfoQueryReq){
|
||||||
|
return DefectInfo.builder()
|
||||||
|
.defectCode(defectInfoQueryReq.getDefectCode())
|
||||||
|
.abortSituation(defectInfoQueryReq.getAbortSituation())
|
||||||
|
.defectBit(defectInfoQueryReq.getDefectBit())
|
||||||
|
.defectValue(defectInfoQueryReq.getDefectValue())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static DefectInfo saveBuild(DefectInfoSaveReq defectInfoSaveReq){
|
||||||
|
return DefectInfo.builder()
|
||||||
|
.defectCode(defectInfoSaveReq.getDefectCode())
|
||||||
|
.abortSituation(defectInfoSaveReq.getAbortSituation())
|
||||||
|
.defectBit(defectInfoSaveReq.getDefectBit())
|
||||||
|
.defectValue(defectInfoSaveReq.getDefectValue())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static DefectInfo editBuild(Long id, DefectInfoEditReq defectInfoEditReq){
|
||||||
|
return DefectInfo.builder()
|
||||||
|
.id(id)
|
||||||
|
.defectCode(defectInfoEditReq.getDefectCode())
|
||||||
|
.abortSituation(defectInfoEditReq.getAbortSituation())
|
||||||
|
.defectBit(defectInfoEditReq.getDefectBit())
|
||||||
|
.defectValue(defectInfoEditReq.getDefectValue())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
package com.muyu.many.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoEditReq;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoQueryReq;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoSaveReq;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录对象 fault_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("fault_info")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "FaultInfo", description = "故障记录")
|
||||||
|
public class FaultInfo 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 faultCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
@ApiModelProperty(name = "车辆VIN", value = "车辆VIN")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 故障等级 */
|
||||||
|
@Excel(name = "故障等级")
|
||||||
|
@ApiModelProperty(name = "故障等级", value = "故障等级")
|
||||||
|
private String failureLevel;
|
||||||
|
|
||||||
|
/** 故障开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "故障开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障开始时间", value = "故障开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 故障结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "故障结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障结束时间", value = "故障结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询构造器
|
||||||
|
*/
|
||||||
|
public static FaultInfo queryBuild( FaultInfoQueryReq faultInfoQueryReq){
|
||||||
|
return FaultInfo.builder()
|
||||||
|
.faultCode(faultInfoQueryReq.getFaultCode())
|
||||||
|
.vin(faultInfoQueryReq.getVin())
|
||||||
|
.failureLevel(faultInfoQueryReq.getFailureLevel())
|
||||||
|
.startTime(faultInfoQueryReq.getStartTime())
|
||||||
|
.endTime(faultInfoQueryReq.getEndTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static FaultInfo saveBuild(FaultInfoSaveReq faultInfoSaveReq){
|
||||||
|
return FaultInfo.builder()
|
||||||
|
.faultCode(faultInfoSaveReq.getFaultCode())
|
||||||
|
.vin(faultInfoSaveReq.getVin())
|
||||||
|
.failureLevel(faultInfoSaveReq.getFailureLevel())
|
||||||
|
.startTime(faultInfoSaveReq.getStartTime())
|
||||||
|
.endTime(faultInfoSaveReq.getEndTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static FaultInfo editBuild(Long id, FaultInfoEditReq faultInfoEditReq){
|
||||||
|
return FaultInfo.builder()
|
||||||
|
.id(id)
|
||||||
|
.faultCode(faultInfoEditReq.getFaultCode())
|
||||||
|
.vin(faultInfoEditReq.getVin())
|
||||||
|
.failureLevel(faultInfoEditReq.getFailureLevel())
|
||||||
|
.startTime(faultInfoEditReq.getStartTime())
|
||||||
|
.endTime(faultInfoEditReq.getEndTime())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.many.domain;
|
package com.muyu.many.domain.Message;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -0,0 +1,42 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码对象 defect_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "DefectInfoEditReq", description = "故障码")
|
||||||
|
public class DefectInfoEditReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String defectCode;
|
||||||
|
|
||||||
|
/** 故障标签 */
|
||||||
|
@ApiModelProperty(name = "故障标签", value = "故障标签")
|
||||||
|
private String abortSituation;
|
||||||
|
|
||||||
|
/** 故障位 */
|
||||||
|
@ApiModelProperty(name = "故障位", value = "故障位")
|
||||||
|
private Long defectBit;
|
||||||
|
|
||||||
|
/** 故障值 */
|
||||||
|
@ApiModelProperty(name = "故障值", value = "故障值")
|
||||||
|
private Long defectValue;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码对象 defect_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "DefectInfoQueryReq", description = "故障码")
|
||||||
|
public class DefectInfoQueryReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String defectCode;
|
||||||
|
|
||||||
|
/** 故障标签 */
|
||||||
|
@ApiModelProperty(name = "故障标签", value = "故障标签")
|
||||||
|
private String abortSituation;
|
||||||
|
|
||||||
|
/** 故障位 */
|
||||||
|
@ApiModelProperty(name = "故障位", value = "故障位")
|
||||||
|
private Long defectBit;
|
||||||
|
|
||||||
|
/** 故障值 */
|
||||||
|
@ApiModelProperty(name = "故障值", value = "故障值")
|
||||||
|
private Long defectValue;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码对象 defect_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "DefectInfoSaveReq", description = "故障码")
|
||||||
|
public class DefectInfoSaveReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "主键", value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String defectCode;
|
||||||
|
|
||||||
|
/** 故障标签 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障标签", value = "故障标签")
|
||||||
|
private String abortSituation;
|
||||||
|
|
||||||
|
/** 故障位 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障位", value = "故障位")
|
||||||
|
private Long defectBit;
|
||||||
|
|
||||||
|
/** 故障值 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障值", value = "故障值")
|
||||||
|
private Long defectValue;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.muyu.many.domain.req;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录对象 fault_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "FaultInfoEditReq", description = "故障记录")
|
||||||
|
public class FaultInfoEditReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String faultCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@ApiModelProperty(name = "车辆VIN", value = "车辆VIN")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 故障等级 */
|
||||||
|
@ApiModelProperty(name = "故障等级", value = "故障等级")
|
||||||
|
private String failureLevel;
|
||||||
|
|
||||||
|
/** 故障开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障开始时间", value = "故障开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 故障结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障结束时间", value = "故障结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.muyu.many.domain.req;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录对象 fault_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "FaultInfoQueryReq", description = "故障记录")
|
||||||
|
public class FaultInfoQueryReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String faultCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@ApiModelProperty(name = "车辆VIN", value = "车辆VIN")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 故障等级 */
|
||||||
|
@ApiModelProperty(name = "故障等级", value = "故障等级")
|
||||||
|
private String failureLevel;
|
||||||
|
|
||||||
|
/** 故障开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障开始时间", value = "故障开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 故障结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(name = "故障结束时间", value = "故障结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.muyu.many.domain.req;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录对象 fault_info
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "FaultInfoSaveReq", description = "故障记录")
|
||||||
|
public class FaultInfoSaveReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "主键", value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障码", value = "故障码")
|
||||||
|
private String faultCode;
|
||||||
|
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "车辆VIN", value = "车辆VIN")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/** 故障等级 */
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障等级", value = "故障等级")
|
||||||
|
private String failureLevel;
|
||||||
|
|
||||||
|
/** 故障开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障开始时间", value = "故障开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 故障结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "故障结束时间", value = "故障结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
|
@ -9,12 +9,14 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator;
|
import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业模块
|
* 企业模块
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
|
@EnableScheduling
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.muyu.authentication.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.muyu.authentication.service.DefectInfoService;
|
||||||
|
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||||
|
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.many.domain.DefectInfo;
|
||||||
|
import com.muyu.many.domain.req.DefectInfoQueryReq;
|
||||||
|
import com.muyu.many.domain.req.DefectInfoSaveReq;
|
||||||
|
import com.muyu.many.domain.req.DefectInfoEditReq;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码Controller
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Api(tags = "故障码")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/defect")
|
||||||
|
public class DefectInfoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private DefectInfoService defectInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障码列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取故障码列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<DefectInfo>> list(DefectInfoQueryReq defectInfoQueryReq) {
|
||||||
|
startPage();
|
||||||
|
List<DefectInfo> list = defectInfoService.list(DefectInfo.queryBuild(defectInfoQueryReq));
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出故障码列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出故障码列表")
|
||||||
|
@Log(title = "故障码", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, DefectInfo defectInfo) {
|
||||||
|
List<DefectInfo> list = defectInfoService.list(defectInfo);
|
||||||
|
ExcelUtil<DefectInfo> util = new ExcelUtil<DefectInfo>(DefectInfo.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<DefectInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
|
DefectInfo byId = defectInfoService.getById(id);
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return Result.success(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障码
|
||||||
|
*/
|
||||||
|
@Log(title = "故障码", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("新增故障码")
|
||||||
|
public Result<String> add(@RequestBody DefectInfoSaveReq defectInfoSaveReq) {
|
||||||
|
boolean save = defectInfoService.save(DefectInfo.saveBuild(defectInfoSaveReq));
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return toAjax(save);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障码
|
||||||
|
*/
|
||||||
|
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/{id}")
|
||||||
|
@ApiOperation("修改故障码")
|
||||||
|
public Result<String> edit(@PathVariable Long id, @RequestBody DefectInfoEditReq defectInfoEditReq) {
|
||||||
|
boolean b = defectInfoService.updateById(DefectInfo.editBuild(id, defectInfoEditReq));
|
||||||
|
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 = defectInfoService.removeBatchByIds(ids);
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return toAjax(b);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.muyu.authentication.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.muyu.authentication.service.FaultInfoService;
|
||||||
|
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.many.domain.FaultInfo;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoEditReq;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoQueryReq;
|
||||||
|
import com.muyu.many.domain.req.FaultInfoSaveReq;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录Controller
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Api(tags = "故障记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fault")
|
||||||
|
public class FaultInfoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private FaultInfoService faultInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障记录列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取故障记录列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<FaultInfo>> list(FaultInfoQueryReq faultInfoQueryReq) {
|
||||||
|
startPage();
|
||||||
|
List<FaultInfo> list = faultInfoService.list(FaultInfo.queryBuild(faultInfoQueryReq));
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出故障记录列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出故障记录列表")
|
||||||
|
@Log(title = "故障记录", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, FaultInfo faultInfo) {
|
||||||
|
List<FaultInfo> list = faultInfoService.list(faultInfo);
|
||||||
|
ExcelUtil<FaultInfo> util = new ExcelUtil<FaultInfo>(FaultInfo.class);
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
util.exportExcel(response, list, "故障记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取故障记录详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取故障记录详细信息")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
|
public Result<FaultInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
|
FaultInfo byId = faultInfoService.getById(id);
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return Result.success(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障记录
|
||||||
|
*/
|
||||||
|
@Log(title = "故障记录", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("新增故障记录")
|
||||||
|
public Result<String> add(@RequestBody FaultInfoSaveReq faultInfoSaveReq) {
|
||||||
|
boolean save = faultInfoService.save(FaultInfo.saveBuild(faultInfoSaveReq));
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return toAjax(save);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障记录
|
||||||
|
*/
|
||||||
|
@Log(title = "故障记录", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/{id}")
|
||||||
|
@ApiOperation("修改故障记录")
|
||||||
|
public Result<String> edit(@PathVariable Long id, @RequestBody FaultInfoEditReq faultInfoEditReq) {
|
||||||
|
boolean b = faultInfoService.updateById(FaultInfo.editBuild(id, faultInfoEditReq));
|
||||||
|
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 = faultInfoService.removeBatchByIds(ids);
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
return toAjax(b);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,12 +8,10 @@ import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.many.domain.Fence;
|
import com.muyu.many.domain.Fence;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
import com.muyu.many.domain.req.FenceEditReq;
|
import com.muyu.many.domain.req.FenceEditReq;
|
||||||
import com.muyu.many.domain.req.FenceQueryReq;
|
import com.muyu.many.domain.req.FenceQueryReq;
|
||||||
import com.muyu.many.domain.req.FenceSaveReq;
|
import com.muyu.many.domain.req.FenceSaveReq;
|
||||||
import com.muyu.many.domain.vo.FenceReq;
|
import com.muyu.many.domain.vo.FenceReq;
|
||||||
import com.muyu.many.domain.vo.Locations;
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.authentication.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.many.domain.DefectInfo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码Mapper接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
public interface DefectInfoMapper extends BaseMapper<DefectInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -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.FaultInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
public interface FaultInfoMapper extends BaseMapper<FaultInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.authentication.rabbitmq.vo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.muyu.many.domain.Enterprise;
|
||||||
|
import com.muyu.many.domain.FaultInfo;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收故障信息
|
||||||
|
*
|
||||||
|
* @ClassName BreakdownAbnormalMq
|
||||||
|
* @Author AnNan.Wang
|
||||||
|
* @Date 2024/6/20 16:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
|
@Component
|
||||||
|
public class BreakdownAbnormalMq {
|
||||||
|
|
||||||
|
|
||||||
|
@RabbitListener(queues = "discover_time")
|
||||||
|
public void discoverTime(String message){
|
||||||
|
log.info("开始消费");
|
||||||
|
//转换
|
||||||
|
FaultInfo faultInfo = JSON.parseObject(message, FaultInfo.class);
|
||||||
|
|
||||||
|
// redis
|
||||||
|
// VIN
|
||||||
|
// ent_????
|
||||||
|
|
||||||
|
log.info("消费结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RabbitListener(queues = "resolve_time")
|
||||||
|
public void resolveTime(String message){
|
||||||
|
log.info("开始消费");
|
||||||
|
FaultInfo parse = JSON.parseObject(message, FaultInfo.class);
|
||||||
|
|
||||||
|
log.info("消费结束");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.muyu.authentication.redisCache;
|
||||||
|
|
||||||
|
import com.muyu.authentication.mapper.VehicleMapper;
|
||||||
|
import com.muyu.authentication.redisCache.vo.CacheList;
|
||||||
|
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
||||||
|
import com.muyu.clw.common.many.remote.RemoteEnterpriseService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.domain.Enterprise;
|
||||||
|
import com.muyu.many.domain.Vehicle;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每个企业的车辆
|
||||||
|
*
|
||||||
|
* @ClassName RedisCache
|
||||||
|
* @Author AnNan.Wang
|
||||||
|
* @Date 2024/6/20 16:52
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Log4j2
|
||||||
|
@Component
|
||||||
|
public class RedisCache {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RemoteEnterpriseService remoteEnterpriseService;
|
||||||
|
@Autowired
|
||||||
|
private VehicleMapper vehicleMapper;
|
||||||
|
@Autowired
|
||||||
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0/10 * * * * ?")
|
||||||
|
public void initialize(){
|
||||||
|
Result<List<Enterprise>> enterprised = remoteEnterpriseService.enterpriseAllList();
|
||||||
|
List<Enterprise> data = enterprised.getData();
|
||||||
|
|
||||||
|
for (Enterprise datum : data) {
|
||||||
|
String many="ent_"+datum.getContactPhone().substring(datum.getContactPhone().length()-4);
|
||||||
|
DynamicDataSourceHolder.setDynamicDataSourceKey(many);
|
||||||
|
List<Vehicle> vehicles = vehicleMapper.selectList(null);
|
||||||
|
for (Vehicle vehicle : vehicles) {
|
||||||
|
String key = vehicle.getVin()+"123";
|
||||||
|
log.info("存入reids里,key:{},many:{}",key,many);
|
||||||
|
redisTemplate.opsForValue().set(key,many);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DynamicDataSourceHolder.removeDynamicDataSourceKey();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.muyu.authentication.redisCache.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存
|
||||||
|
*
|
||||||
|
* @ClassName CacheList
|
||||||
|
* @Author AnNan.Wang
|
||||||
|
* @Date 2024/6/20 17:02
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CacheList {
|
||||||
|
private String key;
|
||||||
|
private String entList;
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.authentication.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.muyu.many.domain.DefectInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码Service接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
public interface DefectInfoService extends IService<DefectInfo> {
|
||||||
|
/**
|
||||||
|
* 查询故障码列表
|
||||||
|
*
|
||||||
|
* @param defectInfo 故障码
|
||||||
|
* @return 故障码集合
|
||||||
|
*/
|
||||||
|
public List<DefectInfo> list(DefectInfo defectInfo);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.authentication.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.many.domain.FaultInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录Service接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
public interface FaultInfoService extends IService<FaultInfo> {
|
||||||
|
/**
|
||||||
|
* 查询故障记录列表
|
||||||
|
*
|
||||||
|
* @param faultInfo 故障记录
|
||||||
|
* @return 故障记录集合
|
||||||
|
*/
|
||||||
|
public List<FaultInfo> list(FaultInfo faultInfo);
|
||||||
|
|
||||||
|
}
|
|
@ -3,9 +3,7 @@ package com.muyu.authentication.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.many.domain.Fence;
|
import com.muyu.many.domain.Fence;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
import com.muyu.many.domain.vo.FenceReq;
|
import com.muyu.many.domain.vo.FenceReq;
|
||||||
import com.muyu.many.domain.vo.Locations;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.authentication.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.muyu.authentication.mapper.DefectInfoMapper;
|
||||||
|
import com.muyu.authentication.service.DefectInfoService;
|
||||||
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
|
import com.muyu.many.domain.DefectInfo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
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-20
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DefectInfoServiceImpl extends ServiceImpl<DefectInfoMapper, DefectInfo> implements DefectInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障码列表
|
||||||
|
*
|
||||||
|
* @param defectInfo 故障码
|
||||||
|
* @return 故障码
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DefectInfo> list(DefectInfo defectInfo) {
|
||||||
|
LambdaQueryWrapper<DefectInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(defectInfo.getDefectCode())){
|
||||||
|
queryWrapper.eq(DefectInfo::getDefectCode, defectInfo.getDefectCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(defectInfo.getAbortSituation())){
|
||||||
|
queryWrapper.eq(DefectInfo::getAbortSituation, defectInfo.getAbortSituation());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(defectInfo.getDefectBit())){
|
||||||
|
queryWrapper.eq(DefectInfo::getDefectBit, defectInfo.getDefectBit());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(defectInfo.getDefectValue())){
|
||||||
|
queryWrapper.eq(DefectInfo::getDefectValue, defectInfo.getDefectValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.muyu.authentication.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.authentication.mapper.FaultInfoMapper;
|
||||||
|
import com.muyu.authentication.service.FaultInfoService;
|
||||||
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
|
import com.muyu.many.domain.FaultInfo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-06-20
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class FaultInfoServiceImpl extends ServiceImpl<FaultInfoMapper, FaultInfo> implements FaultInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障记录列表
|
||||||
|
*
|
||||||
|
* @param faultInfo 故障记录
|
||||||
|
* @return 故障记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FaultInfo> list(FaultInfo faultInfo) {
|
||||||
|
LambdaQueryWrapper<FaultInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(faultInfo.getFaultCode())){
|
||||||
|
queryWrapper.eq(FaultInfo::getFaultCode, faultInfo.getFaultCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(faultInfo.getVin())){
|
||||||
|
queryWrapper.eq(FaultInfo::getVin, faultInfo.getVin());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(faultInfo.getFailureLevel())){
|
||||||
|
queryWrapper.eq(FaultInfo::getFailureLevel, faultInfo.getFailureLevel());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(faultInfo.getStartTime())){
|
||||||
|
queryWrapper.eq(FaultInfo::getStartTime, faultInfo.getStartTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjUtils.notNull(faultInfo.getEndTime())){
|
||||||
|
queryWrapper.eq(FaultInfo::getEndTime, faultInfo.getEndTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,22 +1,14 @@
|
||||||
package com.muyu.authentication.service.impl;
|
package com.muyu.authentication.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.authentication.mapper.FenceMapper;
|
import com.muyu.authentication.mapper.FenceMapper;
|
||||||
import com.muyu.authentication.service.FenceService;
|
import com.muyu.authentication.service.FenceService;
|
||||||
import com.muyu.clw.common.many.datasource.holder.DynamicDataSourceHolder;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.ObjUtils;
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
import com.muyu.many.domain.Fence;
|
import com.muyu.many.domain.Fence;
|
||||||
import com.muyu.many.domain.MessageData;
|
|
||||||
import com.muyu.many.domain.vo.FenceReq;
|
import com.muyu.many.domain.vo.FenceReq;
|
||||||
import com.muyu.many.domain.vo.Locations;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.ListOperations;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{ "properties": [ ] }
|
|
@ -3,6 +3,9 @@ server:
|
||||||
port: 9403
|
port: 9403
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
redis:
|
||||||
|
host: 101.34.243.166
|
||||||
|
port: 6379
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
username: guest
|
username: guest
|
||||||
password: guest
|
password: guest
|
||||||
|
@ -12,8 +15,6 @@ spring:
|
||||||
listener:
|
listener:
|
||||||
simple:
|
simple:
|
||||||
prefetch: 1 # 每次只能获取一条,处理完成才能获取下一条
|
prefetch: 1 # 每次只能获取一条,处理完成才能获取下一条
|
||||||
publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange)
|
|
||||||
publisher-returns: true #确
|
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: ruoyi-many
|
name: ruoyi-many
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?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.defect.mapper.DefectInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.many.domain.DefectInfo" id="DefectInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="defectCode" column="defect_code" />
|
||||||
|
<result property="abortSituation" column="abort_situation" />
|
||||||
|
<result property="defectBit" column="defect_bit" />
|
||||||
|
<result property="defectValue" column="defect_value" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDefectInfoVo">
|
||||||
|
select id, defect_code, abort_situation, defect_bit, defect_value, remark, create_by, create_time, update_by, update_time from defect_info
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?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.fault.mapper.FaultInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.many.domain.FaultInfo" id="FaultInfoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="faultCode" column="fault_code" />
|
||||||
|
<result property="vin" column="vin" />
|
||||||
|
<result property="failureLevel" column="failure_level" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="endTime" column="end_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectFaultInfoVo">
|
||||||
|
select id, fault_code, vin, failure_level, start_time, end_time, remark, create_by, create_time, update_by, update_time from fault_info
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue