feax:()修改代码规范(注释,swagger文档)
parent
2c3197fac9
commit
40d0dde1f9
|
@ -1,106 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-fault</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.carrotsearch.thirdparty</groupId>
|
||||
<artifactId>simple-xml-safe</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.attoparser</groupId>
|
||||
<artifactId>attoparser</artifactId>
|
||||
<version>2.0.7.RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,16 +0,0 @@
|
|||
package com.muyu;
|
||||
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class CloudFaultApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CloudFaultApplication.class,args);
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_log",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FaultLog extends BaseEntity {
|
||||
/**
|
||||
* 日志ID
|
||||
*/
|
||||
@TableId(value = "fault_log_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "日志ID",type = "Long",description = "日志ID")
|
||||
private Long faultLogId;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
@Schema(defaultValue = "故障码",type = "String",description = "故障码")
|
||||
private String faultLogCodes;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Schema(defaultValue = "车辆VIN",type = "String",description = "车辆VIN")
|
||||
private String faultLogVin;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@Schema(defaultValue = "开始报警时间",type = "Date",description = "开始报警时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date faultLogStartTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@Schema(defaultValue = "结束报警时间",type = "Date",description = "结束报警时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date faultLogEndTime;
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_message",autoResultMap = true)
|
||||
public class FaultMessage {
|
||||
/**
|
||||
* 站内信ID
|
||||
*/
|
||||
@TableId(value = "fault_message_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "站内信ID",type = "Long",description = "站内信ID")
|
||||
private Long faultMessageId;
|
||||
/**
|
||||
* 消息发送人
|
||||
*/
|
||||
@Schema(defaultValue = "消息发送人",type = "String",description = "消息发送人")
|
||||
private String faultMessageSendName;
|
||||
/**
|
||||
* 消息接收人
|
||||
*/
|
||||
@Schema(defaultValue = "消息接收人",type = "String",description = "消息发送人")
|
||||
private String faultMessageRemoveName;
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@Schema(defaultValue = "消息内容",type = "String",description = "消息内容")
|
||||
private String faultMessageContent;
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@Schema(defaultValue = "发送时间",type = "Date",description = "发送时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date faultMessageSendTime;
|
||||
/**
|
||||
* 消息状态(1:未读,2:已读)
|
||||
*/
|
||||
@Schema(defaultValue = "消息状态",type = "Integer",description = "消息状态(1:未读,2:已读)")
|
||||
private Integer faultMessageState;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_notify",autoResultMap = true)
|
||||
public class FaultNotify {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "fault_notify_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "ID",type = "Long",description = "ID")
|
||||
private Long faultNotifyId;
|
||||
/**
|
||||
* 通知方
|
||||
*/
|
||||
@Schema(defaultValue = "通知方",type = "String",description = "通知方")
|
||||
private String faultNotifyParty;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@Schema(defaultValue = "联系方式",type = "String",description = "联系方式")
|
||||
private String faultNotifyManner;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_severity",autoResultMap = true)
|
||||
public class FaultSeverity extends BaseEntity {
|
||||
/**
|
||||
* 等级ID
|
||||
*/
|
||||
@TableId(value = "fault_severity_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "等级ID",type = "Long",description = "等级ID")
|
||||
private Long faultSeverityId;
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@Schema(defaultValue = "等级名称",type = "String",description = "等级名称")
|
||||
private String faultSeverityName;
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
@Schema(defaultValue = "优先级",type = "Integer",description = "优先级: 1_(立即) 2_(1小时内) 3_(24小时内)")
|
||||
private Integer faultSeverityPriority;
|
||||
/**
|
||||
* 通知策略
|
||||
*/
|
||||
@Schema(defaultValue = "通知策略",type = "String",description = "通知策略: 提示:邮件通知团队\n" +
|
||||
"警告:邮件通知负责人\n" +
|
||||
"严重:立即通知技术人员")
|
||||
private String faultSeverityNotificationPolicy;
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_type",autoResultMap = true)
|
||||
public class FaultType{
|
||||
/**
|
||||
* 故障类型ID
|
||||
*/
|
||||
@TableId(value = "fault_type_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "故障类型ID",type = "Long",description = "故障类型ID")
|
||||
private Long faultTypeId;
|
||||
/**
|
||||
* 故障类型名称
|
||||
*/
|
||||
@Schema(defaultValue = "故障类型名称",type = "String",description = "故障类型名称")
|
||||
private String faultTypeName;
|
||||
/**
|
||||
* 故障类型描述
|
||||
*/
|
||||
@Schema(defaultValue = "故障类型描述",type = "String",description = "故障类型描述")
|
||||
private String faultTypeDescription;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_rule",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FaultrRule extends BaseEntity {
|
||||
/**
|
||||
* 故障规则ID
|
||||
*/
|
||||
@TableId(value = "fault_rule_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "故障规则ID",type = "Long",description = "故障规则ID")
|
||||
private Long faultRuleId;
|
||||
/**
|
||||
* 故障规则名称
|
||||
*/
|
||||
@Schema(defaultValue = "故障规则名称",type = "String",description = "故障规则名称")
|
||||
private String faultRuleName;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
@Schema(defaultValue = "故障规则参数",type = "String",description = "故障规则参数")
|
||||
private String faultRuleParameter;
|
||||
/**
|
||||
* 故障规则描述
|
||||
*/
|
||||
@Schema(defaultValue = "故障规则描述",type = "String",description = "故障规则描述")
|
||||
private String faultRuleDescription;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.fault.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "sys_car_fault", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysCarFault extends BaseEntity {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@TableId(value = "id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "自增主键",type = "Long",description = "自增主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 车辆故障编码
|
||||
*/
|
||||
@Schema(defaultValue = "车辆故障编码",type = "String",description = "车辆故障编码")
|
||||
private String faultCode;
|
||||
/**
|
||||
* 车辆故障类型ID
|
||||
*/
|
||||
@Schema(defaultValue = "车辆故障类型ID",type = "Integer",description = "车辆故障类型ID")
|
||||
private Integer faultTypeId;
|
||||
/**
|
||||
* 故障VIN编码
|
||||
*/
|
||||
@Schema(defaultValue = "故障VIN编码",type = "String",description = "故障VIN编码")
|
||||
private String carVin;
|
||||
/**
|
||||
* 车辆故障标签
|
||||
*/
|
||||
@Schema(defaultValue = "车辆故障标签",type = "String",description = "车辆故障标签")
|
||||
private String faultLabel;
|
||||
/**
|
||||
* 车辆故障位
|
||||
*/
|
||||
@Schema(defaultValue = "车辆故障位",type = "String",description = "车辆故障位")
|
||||
private String faultBit;
|
||||
/**
|
||||
* 车辆故障值
|
||||
*/
|
||||
@Schema(defaultValue = "车辆故障值",type = "String",description = "车辆故障值")
|
||||
private String faultValue;
|
||||
/**
|
||||
* 故障级别
|
||||
*/
|
||||
@Schema(defaultValue = "故障级别",type = "String",description = "故障级别")
|
||||
private String faultWarn;
|
||||
/**
|
||||
* 报警状态(Y.是,N.否)
|
||||
*/
|
||||
@Schema(defaultValue = "报警状态",type = "String",description = "报警状态")
|
||||
private String warnStatus;
|
||||
/**
|
||||
* 故障描述信息
|
||||
*/
|
||||
@Schema(defaultValue = "故障描述信息",type = "String",description = "故障描述信息")
|
||||
private String faultDesc;
|
||||
/**
|
||||
* 启用状态(1.待处理 2.处理中 3.已处理 4.忽略)
|
||||
*/
|
||||
@Schema(defaultValue = "启用状态",type = "String",description = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
|
||||
private String state;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.common.FaultLog;
|
||||
import com.muyu.fault.service.FaultLogService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/log")
|
||||
@Tag(name = "故障日志",description = "对故障记录日志")
|
||||
public class FaultLogController{
|
||||
@Autowired
|
||||
private FaultLogService faultLogService;
|
||||
|
||||
/**
|
||||
* 查询车辆故障日志列表
|
||||
*/
|
||||
@RequestMapping(value = "/faultLogList", method = RequestMethod.GET)
|
||||
public Result<List<FaultLog>> faultLogList(FaultLog faultLog){
|
||||
List<FaultLog> list = faultLogService.faultLogList(faultLog);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加车辆故障日志
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/insertLog",method = RequestMethod.POST)
|
||||
public Result insertLog(@RequestBody FaultLog faultLog){
|
||||
return Result.success(faultLogService.save(faultLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆故障日志
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateLog",method = RequestMethod.PUT)
|
||||
public Result updateLog(@RequestBody FaultLog faultLog){
|
||||
return Result.success(faultLogService.updateById(faultLog));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 批量删除车辆故障日志
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/remove/{ids}",method = RequestMethod.DELETE)
|
||||
public Result remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
return Result.success(faultLogService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条日志详细信息
|
||||
* @param faultLogId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/byidId/{faultLogId}",method = RequestMethod.GET)
|
||||
public Result byidId(@PathVariable Long faultLogId){
|
||||
FaultLog byid = faultLogService.byidId(faultLogId);
|
||||
return Result.success(byid);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.fault.common.FaultMessage;
|
||||
import com.muyu.fault.service.FaultMessageService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/message")
|
||||
@Tag(name = "站内信的管理",description = "对站内信息的处理与查看")
|
||||
public class FaultMessageController {
|
||||
@Autowired
|
||||
private FaultMessageService faultMessageService;
|
||||
|
||||
/**
|
||||
* 站内信列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/faultMessageList",method = RequestMethod.GET)
|
||||
public Result<List<FaultMessage>> faultMessageList( FaultMessage faultMessage){
|
||||
return Result.success(faultMessageService.faultMessageList(faultMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加消息
|
||||
* @param faultMessage
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/insertMessage",method = RequestMethod.POST)
|
||||
public Result insertMessage(@RequestBody FaultMessage faultMessage){
|
||||
String username = SecurityUtils.getUsername();
|
||||
//消息发送人
|
||||
faultMessage.setFaultMessageSendName(username);
|
||||
return Result.success(faultMessageService.save(faultMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未读状态(faultMessageState==1)信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectOne",method = RequestMethod.POST)
|
||||
public Result<List<FaultMessage>> selectOne(){
|
||||
List<FaultMessage> one = faultMessageService.selectOne();
|
||||
return Result.success(one);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已读状态(faultMessageState==2)信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectTwo",method = RequestMethod.POST)
|
||||
public Result<List<FaultMessage>> selectTwo(){
|
||||
List<FaultMessage> one = faultMessageService.selectTwo();
|
||||
return Result.success(one);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改已读状态
|
||||
* @param faultMessageId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateTwo/{faultMessageId}",method = RequestMethod.POST)
|
||||
public Result updateTwo(@PathVariable(name = "faultMessageId") Long faultMessageId){
|
||||
LambdaUpdateWrapper<FaultMessage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(FaultMessage::getFaultMessageState,2);
|
||||
updateWrapper.eq(FaultMessage::getFaultMessageId,faultMessageId);
|
||||
faultMessageService.update(updateWrapper);
|
||||
return Result.success(faultMessageId,"消息已读");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
* @param faultMessageId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMessageId/{faultMessageId}",method = RequestMethod.POST)
|
||||
public Result deleteMessageId(@PathVariable(name = "faultMessageId") Long faultMessageId){
|
||||
return Result.success(faultMessageService.removeById(faultMessageId),"删除成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.fault.common.FaultType;
|
||||
import com.muyu.fault.service.FaultTypeService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/type")
|
||||
@Tag(name = "故障类型",description = "对故障类型的定义")
|
||||
public class FaultTypeController {
|
||||
@Autowired
|
||||
private FaultTypeService faultTypeService;
|
||||
|
||||
/**
|
||||
* 故障类型表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "faultTypeList",method = RequestMethod.GET)
|
||||
public Result<List<FaultType>> faultTypeList(FaultType faultType){
|
||||
return Result.success(faultTypeService.faultTypeList(faultType));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加故障类型
|
||||
* @param faultType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "insertType",method = RequestMethod.POST)
|
||||
public Result insertType(@RequestBody FaultType faultType){
|
||||
return Result.success(faultTypeService.save(faultType));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改故障类型
|
||||
* @param faultType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "updateType",method = RequestMethod.POST)
|
||||
public Result updateype(@RequestBody FaultType faultType){
|
||||
return Result.success(faultTypeService.updateById(faultType));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除故障类型
|
||||
* @param faultTypeId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "deleteType/{faultTypeId}",method = RequestMethod.DELETE)
|
||||
public Result deleteType(@PathVariable(name = "faultTypeId") Long faultTypeId){
|
||||
return Result.success(faultTypeService.removeById(faultTypeId));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.common.FaultrRule;
|
||||
import com.muyu.fault.service.FaultrRuleService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/rule")
|
||||
@Tag(name = "故障的规则",description = "对故障数据规则的判断")
|
||||
public class FaultrRuleController {
|
||||
@Autowired
|
||||
private FaultrRuleService faultrRuleService;
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*/
|
||||
@RequestMapping(value = "/faultRuleList", method = RequestMethod.GET)
|
||||
public Result<List<FaultrRule>> faultRuleList(FaultrRule faultrRule)
|
||||
{
|
||||
List<FaultrRule> list = faultrRuleService.faultRuleList(faultrRule);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加车辆规则
|
||||
* @param faultrRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/insertRule",method = RequestMethod.POST)
|
||||
public Result insertRule(@RequestBody FaultrRule faultrRule){
|
||||
return Result.success(faultrRuleService.save(faultrRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆规则
|
||||
* @param faultrRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateRule",method = RequestMethod.POST)
|
||||
public Result updateRule(@RequestBody FaultrRule faultrRule){
|
||||
return Result.success(faultrRuleService.updateById(faultrRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条故障规则详细信息
|
||||
* @param faultRuleId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/byidRuleId/{faultRuleId}",method = RequestMethod.GET)
|
||||
public Result byidRuleId(@PathVariable Long faultRuleId){
|
||||
FaultrRule byid = faultrRuleService.byidRuleId(faultRuleId);
|
||||
return Result.success(byid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆故障
|
||||
*/
|
||||
@RequestMapping(value = "/remove/{ids}",method = RequestMethod.DELETE)
|
||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
faultrRuleService.removeBatchByIds(Arrays.asList(ids));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
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.security.utils.SecurityUtils;
|
||||
import com.muyu.fault.common.FaultLog;
|
||||
import com.muyu.fault.common.SysCarFault;
|
||||
import com.muyu.fault.service.FaultLogService;
|
||||
import com.muyu.fault.service.SysCarFaultService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/faultInfo")
|
||||
@Tag(name = "故障管理",description = "故障的管理与查看")
|
||||
public class SysCarFaultController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private SysCarFaultService sysCarFaultService;
|
||||
@Autowired
|
||||
private FaultLogService faultLogService;
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*/
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public Result<List<SysCarFault>> list(SysCarFault sysCarFault)
|
||||
{
|
||||
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆故障列表
|
||||
*/
|
||||
@RequestMapping(value = "export",method = RequestMethod.POST)
|
||||
public void export(HttpServletResponse response, SysCarFault sysCarFault)
|
||||
{
|
||||
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
|
||||
ExcelUtil<SysCarFault> util = new ExcelUtil<SysCarFault>(SysCarFault.class);
|
||||
util.exportExcel(response, list, "车辆故障数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车辆故障详细信息
|
||||
*/
|
||||
@RequestMapping(value = "/getInfo/{id}",method = RequestMethod.GET)
|
||||
public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysCarFaultService.selectSysCarFaultById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆故障
|
||||
*/
|
||||
@RequestMapping(value = "add",method = RequestMethod.POST)
|
||||
public Result<Integer> add(
|
||||
@Validated @RequestBody SysCarFault sysCarFault)
|
||||
{
|
||||
String prefix = "GT"; // 随机码的前缀
|
||||
int minNumber = 1; // 随机数字的最小值
|
||||
int maxNumber = 999; // 随机数字的最大值
|
||||
Random random = new Random(); // 创建一个随机对象
|
||||
// 生成一个随机数字
|
||||
int number = random.nextInt(maxNumber - minNumber + 1) + minNumber;
|
||||
// 将数字格式化为三位字符串,不足三位前面补0
|
||||
String formattedNumber = String.format("%03d", number);
|
||||
// 生成一个随机字母
|
||||
String alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
String randomLetter = alphabets.charAt(random.nextInt(alphabets.length())) + "";
|
||||
// 拼接前缀、随机字母和随机数字
|
||||
String randomCode = prefix + randomLetter + formattedNumber;
|
||||
System.out.println(randomCode); // 输出随机码
|
||||
//赋值
|
||||
sysCarFault.setFaultCode(randomCode);
|
||||
sysCarFault.setCreateBy(SecurityUtils.getUsername());
|
||||
FaultLog faultLog = new FaultLog();
|
||||
faultLog.setFaultLogCodes(sysCarFault.getFaultCode());
|
||||
faultLog.setFaultLogVin(sysCarFault.getCarVin());
|
||||
DateTime startTime = DateTime.now(); // 获取当前时间作为开始时间
|
||||
faultLog.setFaultLogStartTime(startTime);
|
||||
faultLogService.save(faultLog);
|
||||
if (sysCarFaultService.checkIdUnique(sysCarFault)) {
|
||||
return error("新增 车辆故障 '" + sysCarFault + "'失败,车辆故障已存在");
|
||||
}
|
||||
return toAjax(sysCarFaultService.save(sysCarFault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆故障
|
||||
*/
|
||||
@RequestMapping(value = "edit",method = RequestMethod.PUT)
|
||||
public Result<Integer> edit(
|
||||
@Validated @RequestBody SysCarFault sysCarFault)
|
||||
{
|
||||
if (!sysCarFaultService.checkIdUnique(sysCarFault)) {
|
||||
return error("修改 车辆故障 '" + sysCarFault + "'失败,车辆故障不存在");
|
||||
}
|
||||
sysCarFault.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(sysCarFaultService.updateById(sysCarFault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆故障
|
||||
*/
|
||||
@RequestMapping(value = "/remove/{ids}",method = RequestMethod.DELETE)
|
||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.common.FaultLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FaultLogMapper extends BaseMapper<FaultLog> {
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.common.FaultMessage;
|
||||
|
||||
public interface FaultMessageMapper extends BaseMapper<FaultMessage> {
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.common.FaultType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FaultTypeMapper extends BaseMapper<FaultType> {
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.common.FaultrRule;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface FaultrRuleMapper extends BaseMapper<FaultrRule> {
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.common.SysCarFault;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface SysCarFaultMapper extends BaseMapper<SysCarFault>{
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.common.FaultLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaultLogService extends IService<FaultLog> {
|
||||
List<FaultLog> faultLogList(FaultLog faultLog);
|
||||
|
||||
|
||||
FaultLog byidId(Long faultLogId);
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.common.FaultMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaultMessageService extends IService<FaultMessage> {
|
||||
|
||||
List<FaultMessage> selectOne();
|
||||
|
||||
List<FaultMessage> selectTwo();
|
||||
|
||||
List<FaultMessage> faultMessageList(FaultMessage faultMessage);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.common.FaultType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaultTypeService extends IService<FaultType> {
|
||||
List<FaultType> faultTypeList(FaultType faultType);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.common.FaultrRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaultrRuleService extends IService<FaultrRule> {
|
||||
List<FaultrRule> faultRuleList(FaultrRule faultrRule);
|
||||
|
||||
FaultrRule byidRuleId(Long faultRuleId);
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.common.SysCarFault;
|
||||
|
||||
public interface SysCarFaultService extends IService<SysCarFault> {
|
||||
/**
|
||||
* 精确查询车辆故障
|
||||
*
|
||||
* @param id 车辆故障主键
|
||||
* @return 车辆故障
|
||||
*/
|
||||
public SysCarFault selectSysCarFaultById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障集合
|
||||
*/
|
||||
public List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault);
|
||||
|
||||
/**
|
||||
* 判断 车辆故障 id是否唯一
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean checkIdUnique(SysCarFault sysCarFault);
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.fault.common.FaultLog;
|
||||
import com.muyu.fault.mapper.FaultLogMapper;
|
||||
import com.muyu.fault.service.FaultLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> implements FaultLogService {
|
||||
@Override
|
||||
public List<FaultLog> faultLogList(FaultLog faultLog) {
|
||||
LambdaQueryWrapper<FaultLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(faultLog.getFaultLogVin()),
|
||||
FaultLog::getFaultLogVin, faultLog.getFaultLogVin());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(faultLog.getFaultLogCodes()),
|
||||
FaultLog::getFaultLogCodes, faultLog.getFaultLogCodes());
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FaultLog byidId(Long faultLogId) {
|
||||
LambdaQueryWrapper<FaultLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(faultLogId, "日志ID不可为空");
|
||||
queryWrapper.eq(FaultLog::getFaultLogId, faultLogId);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.fault.common.FaultMessage;
|
||||
import com.muyu.fault.mapper.FaultMessageMapper;
|
||||
import com.muyu.fault.service.FaultMessageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FaultMessageServiceImpl extends ServiceImpl<FaultMessageMapper, FaultMessage> implements FaultMessageService {
|
||||
|
||||
@Override
|
||||
public List<FaultMessage> selectOne() {
|
||||
LambdaQueryWrapper<FaultMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//查询消息状态为1的未读数据
|
||||
queryWrapper.eq(FaultMessage::getFaultMessageState, 1);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FaultMessage> selectTwo() {
|
||||
LambdaQueryWrapper<FaultMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//查询消息状态为2的已读数据
|
||||
queryWrapper.eq(FaultMessage::getFaultMessageState, 2);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FaultMessage> faultMessageList(FaultMessage faultMessage) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
LambdaQueryWrapper<FaultMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(faultMessage.getFaultMessageRemoveName())) {
|
||||
queryWrapper.eq(FaultMessage::getFaultMessageSendName,username);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(String.valueOf(faultMessage.getFaultMessageState()))) {
|
||||
queryWrapper.eq(FaultMessage::getFaultMessageState,faultMessage.getFaultMessageState());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(faultMessage.getFaultMessageSendName())) {
|
||||
queryWrapper.like(FaultMessage::getFaultMessageSendName,faultMessage.getFaultMessageSendName());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.fault.common.FaultType;
|
||||
import com.muyu.fault.mapper.FaultTypeMapper;
|
||||
import com.muyu.fault.service.FaultTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FaultTypeServiceImpl extends ServiceImpl<FaultTypeMapper, FaultType> implements FaultTypeService {
|
||||
@Override
|
||||
public List<FaultType> faultTypeList(FaultType faultType) {
|
||||
LambdaQueryWrapper<FaultType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(faultType.getFaultTypeName())) {
|
||||
queryWrapper.like(FaultType::getFaultTypeName,faultType.getFaultTypeName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(faultType.getFaultTypeDescription())) {
|
||||
queryWrapper.like(FaultType::getFaultTypeDescription,faultType.getFaultTypeDescription());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.fault.common.FaultrRule;
|
||||
import com.muyu.fault.mapper.FaultrRuleMapper;
|
||||
import com.muyu.fault.service.FaultrRuleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FaultrRuleServiceImpl extends ServiceImpl<FaultrRuleMapper, FaultrRule> implements FaultrRuleService {
|
||||
|
||||
@Override
|
||||
public List<FaultrRule> faultRuleList(FaultrRule faultrRule) {
|
||||
LambdaQueryWrapper<FaultrRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(faultrRule.getFaultRuleName())) {
|
||||
queryWrapper.eq(FaultrRule::getFaultRuleName,faultrRule.getFaultRuleName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(faultrRule.getFaultRuleParameter())) {
|
||||
queryWrapper.eq(FaultrRule::getFaultRuleParameter,faultrRule.getFaultRuleParameter());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FaultrRule byidRuleId(Long faultRuleId) {
|
||||
LambdaQueryWrapper<FaultrRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(faultRuleId, "规则ID不可为空");
|
||||
queryWrapper.eq(FaultrRule::getFaultRuleId, faultRuleId);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.fault.common.SysCarFault;
|
||||
import com.muyu.fault.service.SysCarFaultService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.fault.mapper.SysCarFaultMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@Service
|
||||
public class SysCarFaultServiceImpl
|
||||
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
||||
implements SysCarFaultService {
|
||||
|
||||
/**
|
||||
* 精确查询车辆故障
|
||||
*
|
||||
* @param id 车辆故障主键
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public SysCarFault selectSysCarFaultById(Long id)
|
||||
{
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(id, "id不可为空");
|
||||
queryWrapper.eq(SysCarFault::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault)
|
||||
{
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(sysCarFault.getFaultTypeId())),
|
||||
SysCarFault::getFaultTypeId, sysCarFault.getFaultTypeId());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(sysCarFault.getState()),
|
||||
SysCarFault::getState, sysCarFault.getState());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(sysCarFault.getCarVin()),
|
||||
SysCarFault::getCarVin, sysCarFault.getCarVin());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(sysCarFault.getFaultWarn()),
|
||||
SysCarFault::getFaultWarn, sysCarFault.getFaultWarn());
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 唯一 判断
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkIdUnique(SysCarFault sysCarFault) {
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysCarFault::getId, sysCarFault.getId());
|
||||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,29 +0,0 @@
|
|||
import org.simpleframework.xml.Text;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Random;
|
||||
|
||||
@Text
|
||||
public class Text01 {
|
||||
public static void main(String[] args) {
|
||||
// String prefix = "GT"; // 随机码的前缀
|
||||
// int minNumber = 1; // 随机数字的最小值
|
||||
// int maxNumber = 999; // 随机数字的最大值
|
||||
// Random random = new Random(); // 创建一个随机对象
|
||||
// // 生成一个随机数字
|
||||
// int number = random.nextInt(maxNumber - minNumber + 1) + minNumber;
|
||||
// // 将数字格式化为三位字符串,不足三位前面补0
|
||||
// String formattedNumber = String.format("%03d", number);
|
||||
// // 生成一个随机字母
|
||||
// String alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
// String randomLetter = alphabets.charAt(random.nextInt(alphabets.length())) + "";
|
||||
// // 拼接前缀、随机字母和随机数字
|
||||
// String randomCode = prefix + randomLetter + formattedNumber;
|
||||
// System.out.println(randomCode); // 输出随机码
|
||||
// LocalDateTime startTime = LocalDateTime.now(); // 开始时间
|
||||
// LocalDateTime endTime = startTime.plusHours(2); // 结束时间设置为开始时间后2小时
|
||||
//
|
||||
// System.out.println("Start Time: " + startTime);
|
||||
// System.out.println("End Time: " + endTime);
|
||||
}
|
||||
}
|
|
@ -112,15 +112,4 @@ public class SysEntController extends BaseController {
|
|||
sysEntService.removeById(entId);
|
||||
return Result.success(null,Constants.SUCCESS_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询状态为待审核的企业
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectOne",method = RequestMethod.POST)
|
||||
@Operation(summary = "查询状态为待审核的企业",description = "根据企业状态查询待审核的企业")
|
||||
public Result<List<SysEnt>> selectOne(){
|
||||
return Result.success(sysEntService.selectOne());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,4 @@ public interface SysEntService extends IService<SysEnt> {
|
|||
* @return 返回结果
|
||||
*/
|
||||
public List<EntResp> selectList(EntListReq entListReq);
|
||||
|
||||
List<SysEnt> selectOne();
|
||||
}
|
||||
|
|
|
@ -64,11 +64,4 @@ public class SysEntServiceImpl extends ServiceImpl<SysEntMapper, SysEnt> impleme
|
|||
.map(EntResp::entBuild)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysEnt> selectOne() {
|
||||
LambdaQueryWrapper<EntResp> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EntResp::getEntStatus,0);
|
||||
return this.list((IPage<SysEnt>) queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue