From 40d0dde1f9dbc21bfb7ad7ae7679e026fd4e9387 Mon Sep 17 00:00:00 2001 From: chenruijia <1518542096@qq.com> Date: Sat, 28 Sep 2024 14:58:20 +0800 Subject: [PATCH] =?UTF-8?q?feax:()=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83(=E6=B3=A8=E9=87=8A,swagger=E6=96=87=E6=A1=A3?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloud-modules/cloud-modules-fault/pom.xml | 106 --------------- .../java/com/muyu/CloudFaultApplication.java | 16 --- .../java/com/muyu/fault/common/FaultLog.java | 51 -------- .../com/muyu/fault/common/FaultMessage.java | 54 -------- .../com/muyu/fault/common/FaultNotify.java | 34 ----- .../com/muyu/fault/common/FaultSeverity.java | 43 ------ .../java/com/muyu/fault/common/FaultType.java | 35 ----- .../com/muyu/fault/common/FaultrRule.java | 39 ------ .../com/muyu/fault/common/SysCarFault.java | 74 ----------- .../fault/controller/FaultLogController.java | 74 ----------- .../controller/FaultMessageController.java | 87 ------------- .../fault/controller/FaultTypeController.java | 63 --------- .../controller/FaultrRuleController.java | 74 ----------- .../controller/SysCarFaultController.java | 122 ------------------ .../com/muyu/fault/mapper/FaultLogMapper.java | 10 -- .../muyu/fault/mapper/FaultMessageMapper.java | 7 - .../muyu/fault/mapper/FaultTypeMapper.java | 9 -- .../muyu/fault/mapper/FaultrRuleMapper.java | 10 -- .../muyu/fault/mapper/SysCarFaultMapper.java | 8 -- .../muyu/fault/service/FaultLogService.java | 14 -- .../fault/service/FaultMessageService.java | 15 --- .../muyu/fault/service/FaultTypeService.java | 10 -- .../muyu/fault/service/FaultrRuleService.java | 12 -- .../fault/service/SysCarFaultService.java | 31 ----- .../service/impl/FaultLogServiceImpl.java | 33 ----- .../service/impl/FaultMessageServiceImpl.java | 48 ------- .../service/impl/FaultTypeServiceImpl.java | 26 ---- .../service/impl/FaultrRuleServiceImpl.java | 36 ------ .../service/impl/SysCarFaultServiceImpl.java | 68 ---------- .../src/main/resources/logback/dev.xml | 74 ----------- .../src/main/resources/logback/prod.xml | 81 ------------ .../src/main/resources/logback/test.xml | 81 ------------ .../src/test/java/Text01.java | 29 ----- .../system/controller/SysEntController.java | 11 -- .../muyu/system/service/SysEntService.java | 2 - .../service/impl/SysEntServiceImpl.java | 7 - 36 files changed, 1494 deletions(-) delete mode 100644 cloud-modules/cloud-modules-fault/pom.xml delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/CloudFaultApplication.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultLog.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultMessage.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultNotify.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultSeverity.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultType.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultrRule.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/SysCarFault.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultLogController.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultMessageController.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultTypeController.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultrRuleController.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/SysCarFaultController.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultLogMapper.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultMessageMapper.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultTypeMapper.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultrRuleMapper.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/SysCarFaultMapper.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultLogService.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultMessageService.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultTypeService.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultrRuleService.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/SysCarFaultService.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultLogServiceImpl.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultMessageServiceImpl.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultTypeServiceImpl.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultrRuleServiceImpl.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/SysCarFaultServiceImpl.java delete mode 100644 cloud-modules/cloud-modules-fault/src/main/resources/logback/dev.xml delete mode 100644 cloud-modules/cloud-modules-fault/src/main/resources/logback/prod.xml delete mode 100644 cloud-modules/cloud-modules-fault/src/main/resources/logback/test.xml delete mode 100644 cloud-modules/cloud-modules-fault/src/test/java/Text01.java diff --git a/cloud-modules/cloud-modules-fault/pom.xml b/cloud-modules/cloud-modules-fault/pom.xml deleted file mode 100644 index ee6f8a2..0000000 --- a/cloud-modules/cloud-modules-fault/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - 4.0.0 - - com.muyu - cloud-modules - 3.6.3 - - - cloud-modules-fault - - - 17 - 17 - UTF-8 - - - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - com.mysql - mysql-connector-j - - - - - com.muyu - cloud-common-datasource - - - - - com.muyu - cloud-common-datascope - - - - - com.muyu - cloud-common-log - - - - - com.muyu - cloud-common-api-doc - - - com.carrotsearch.thirdparty - simple-xml-safe - 2.7.1 - test - - - org.attoparser - attoparser - 2.0.7.RELEASE - test - - - - - ${project.artifactId} - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - - - diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/CloudFaultApplication.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/CloudFaultApplication.java deleted file mode 100644 index 1017e81..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/CloudFaultApplication.java +++ /dev/null @@ -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); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultLog.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultLog.java deleted file mode 100644 index 9953029..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultLog.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultMessage.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultMessage.java deleted file mode 100644 index b264b28..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultMessage.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultNotify.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultNotify.java deleted file mode 100644 index 5ccb6bb..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultNotify.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultSeverity.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultSeverity.java deleted file mode 100644 index 63fa98b..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultSeverity.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultType.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultType.java deleted file mode 100644 index 7bae718..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultType.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultrRule.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultrRule.java deleted file mode 100644 index 6e649d5..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/FaultrRule.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/SysCarFault.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/SysCarFault.java deleted file mode 100644 index 690c07e..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/common/SysCarFault.java +++ /dev/null @@ -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; -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultLogController.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultLogController.java deleted file mode 100644 index 79e79a4..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultLogController.java +++ /dev/null @@ -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> faultLogList(FaultLog faultLog){ - List 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); - } - - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultMessageController.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultMessageController.java deleted file mode 100644 index 35bb9fa..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultMessageController.java +++ /dev/null @@ -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> 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> selectOne(){ - List one = faultMessageService.selectOne(); - return Result.success(one); - } - - /** - * 查询已读状态(faultMessageState==2)信息 - * @return - */ - @RequestMapping(value = "/selectTwo",method = RequestMethod.POST) - public Result> selectTwo(){ - List 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 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),"删除成功"); - } - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultTypeController.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultTypeController.java deleted file mode 100644 index 342e984..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultTypeController.java +++ /dev/null @@ -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> 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)); - } - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultrRuleController.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultrRuleController.java deleted file mode 100644 index 176d8c1..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/FaultrRuleController.java +++ /dev/null @@ -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> faultRuleList(FaultrRule faultrRule) - { - List 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 remove(@PathVariable("ids") Long[] ids) - { - faultrRuleService.removeBatchByIds(Arrays.asList(ids)); - return Result.success(); - } - - - - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/SysCarFaultController.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/SysCarFaultController.java deleted file mode 100644 index a7ee151..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/controller/SysCarFaultController.java +++ /dev/null @@ -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 sysCarFault) - { - List list = sysCarFaultService.selectSysCarFaultList(sysCarFault); - return success(list); - } - - /** - * 导出车辆故障列表 - */ - @RequestMapping(value = "export",method = RequestMethod.POST) - public void export(HttpServletResponse response, SysCarFault sysCarFault) - { - List list = sysCarFaultService.selectSysCarFaultList(sysCarFault); - ExcelUtil util = new ExcelUtil(SysCarFault.class); - util.exportExcel(response, list, "车辆故障数据"); - } - - /** - * 获取车辆故障详细信息 - */ - @RequestMapping(value = "/getInfo/{id}",method = RequestMethod.GET) - public Result> getInfo(@PathVariable("id") Long id) - { - return success(sysCarFaultService.selectSysCarFaultById(id)); - } - - /** - * 新增车辆故障 - */ - @RequestMapping(value = "add",method = RequestMethod.POST) - public Result 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 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 remove(@PathVariable("ids") Long[] ids) - { - sysCarFaultService.removeBatchByIds(Arrays.asList(ids)); - return success(); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultLogMapper.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultLogMapper.java deleted file mode 100644 index 5e9fc19..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultLogMapper.java +++ /dev/null @@ -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 { -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultMessageMapper.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultMessageMapper.java deleted file mode 100644 index 73a3930..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultMessageMapper.java +++ /dev/null @@ -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 { -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultTypeMapper.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultTypeMapper.java deleted file mode 100644 index 5265201..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultTypeMapper.java +++ /dev/null @@ -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 { -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultrRuleMapper.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultrRuleMapper.java deleted file mode 100644 index 3fd2169..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/FaultrRuleMapper.java +++ /dev/null @@ -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 { -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/SysCarFaultMapper.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/SysCarFaultMapper.java deleted file mode 100644 index 92ece6a..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/mapper/SysCarFaultMapper.java +++ /dev/null @@ -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{ -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultLogService.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultLogService.java deleted file mode 100644 index 2af9a14..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultLogService.java +++ /dev/null @@ -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 { - List faultLogList(FaultLog faultLog); - - - FaultLog byidId(Long faultLogId); - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultMessageService.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultMessageService.java deleted file mode 100644 index 89f6b81..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultMessageService.java +++ /dev/null @@ -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 { - - List selectOne(); - - List selectTwo(); - - List faultMessageList(FaultMessage faultMessage); -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultTypeService.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultTypeService.java deleted file mode 100644 index e4e6037..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultTypeService.java +++ /dev/null @@ -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 { - List faultTypeList(FaultType faultType); -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultrRuleService.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultrRuleService.java deleted file mode 100644 index 3899aa7..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/FaultrRuleService.java +++ /dev/null @@ -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 { - List faultRuleList(FaultrRule faultrRule); - - FaultrRule byidRuleId(Long faultRuleId); -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/SysCarFaultService.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/SysCarFaultService.java deleted file mode 100644 index 9afe833..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/SysCarFaultService.java +++ /dev/null @@ -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 { - /** - * 精确查询车辆故障 - * - * @param id 车辆故障主键 - * @return 车辆故障 - */ - public SysCarFault selectSysCarFaultById(Long id); - - /** - * 查询车辆故障列表 - * - * @param sysCarFault 车辆故障 - * @return 车辆故障集合 - */ - public List selectSysCarFaultList(SysCarFault sysCarFault); - - /** - * 判断 车辆故障 id是否唯一 - * @param sysCarFault 车辆故障 - * @return 结果 - */ - Boolean checkIdUnique(SysCarFault sysCarFault); - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultLogServiceImpl.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultLogServiceImpl.java deleted file mode 100644 index 3387ba9..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultLogServiceImpl.java +++ /dev/null @@ -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 implements FaultLogService { - @Override - public List faultLogList(FaultLog faultLog) { - LambdaQueryWrapper 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 queryWrapper = new LambdaQueryWrapper<>(); - Assert.notNull(faultLogId, "日志ID不可为空"); - queryWrapper.eq(FaultLog::getFaultLogId, faultLogId); - return this.getOne(queryWrapper); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultMessageServiceImpl.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultMessageServiceImpl.java deleted file mode 100644 index bf697a5..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultMessageServiceImpl.java +++ /dev/null @@ -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 implements FaultMessageService { - - @Override - public List selectOne() { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - //查询消息状态为1的未读数据 - queryWrapper.eq(FaultMessage::getFaultMessageState, 1); - return this.list(queryWrapper); - } - - @Override - public List selectTwo() { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - //查询消息状态为2的已读数据 - queryWrapper.eq(FaultMessage::getFaultMessageState, 2); - return this.list(queryWrapper); - } - - @Override - public List faultMessageList(FaultMessage faultMessage) { - String username = SecurityUtils.getUsername(); - LambdaQueryWrapper 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); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultTypeServiceImpl.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultTypeServiceImpl.java deleted file mode 100644 index d316e3c..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultTypeServiceImpl.java +++ /dev/null @@ -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 implements FaultTypeService { - @Override - public List faultTypeList(FaultType faultType) { - LambdaQueryWrapper 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); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultrRuleServiceImpl.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultrRuleServiceImpl.java deleted file mode 100644 index 5f55d1a..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/FaultrRuleServiceImpl.java +++ /dev/null @@ -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 implements FaultrRuleService { - - @Override - public List faultRuleList(FaultrRule faultrRule) { - LambdaQueryWrapper 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 queryWrapper = new LambdaQueryWrapper<>(); - Assert.notNull(faultRuleId, "规则ID不可为空"); - queryWrapper.eq(FaultrRule::getFaultRuleId, faultRuleId); - return this.getOne(queryWrapper); - } -} diff --git a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/SysCarFaultServiceImpl.java b/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/SysCarFaultServiceImpl.java deleted file mode 100644 index a3ba13f..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/java/com/muyu/fault/service/impl/SysCarFaultServiceImpl.java +++ /dev/null @@ -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 - implements SysCarFaultService { - - /** - * 精确查询车辆故障 - * - * @param id 车辆故障主键 - * @return 车辆故障 - */ - @Override - public SysCarFault selectSysCarFaultById(Long id) - { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - Assert.notNull(id, "id不可为空"); - queryWrapper.eq(SysCarFault::getId, id); - return this.getOne(queryWrapper); - } - - - /** - * 查询车辆故障列表 - * - * @param sysCarFault 车辆故障 - * @return 车辆故障 - */ - @Override - public List selectSysCarFaultList(SysCarFault sysCarFault) - { - LambdaQueryWrapper 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 queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(SysCarFault::getId, sysCarFault.getId()); - return this.count(queryWrapper) > 0; - } - -} diff --git a/cloud-modules/cloud-modules-fault/src/main/resources/logback/dev.xml b/cloud-modules/cloud-modules-fault/src/main/resources/logback/dev.xml deleted file mode 100644 index d1b5629..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/resources/logback/dev.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - ${log.pattern} - - - - - - ${log.path}/info.log - - - - ${log.path}/info.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/error.log - - - - ${log.path}/error.%d{yyyy-MM-dd}.log - - 60 - - - ${log.pattern} - - - - ERROR - - ACCEPT - - DENY - - - - - - - - - - - - - - - - - - diff --git a/cloud-modules/cloud-modules-fault/src/main/resources/logback/prod.xml b/cloud-modules/cloud-modules-fault/src/main/resources/logback/prod.xml deleted file mode 100644 index 76a0d8f..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/resources/logback/prod.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - ${log.sky.pattern} - - - - - - ${log.path}/info.log - - - - ${log.path}/info.%d{yyyy-MM-dd}.log - - 60 - - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/error.log - - - - ${log.path}/error.%d{yyyy-MM-dd}.log - - 60 - - - - - ERROR - - ACCEPT - - DENY - - - - - - - - ${log.sky.pattern} - - - - - - - - - - - - - - - - - - - - diff --git a/cloud-modules/cloud-modules-fault/src/main/resources/logback/test.xml b/cloud-modules/cloud-modules-fault/src/main/resources/logback/test.xml deleted file mode 100644 index 2cd69e4..0000000 --- a/cloud-modules/cloud-modules-fault/src/main/resources/logback/test.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - ${log.sky.pattern} - - - - - - ${log.path}/info.log - - - - ${log.path}/info.%d{yyyy-MM-dd}.log - - 60 - - - - - INFO - - ACCEPT - - DENY - - - - - ${log.path}/error.log - - - - ${log.path}/error.%d{yyyy-MM-dd}.log - - 60 - - - - - ERROR - - ACCEPT - - DENY - - - - - - - - ${log.sky.pattern} - - - - - - - - - - - - - - - - - - - - diff --git a/cloud-modules/cloud-modules-fault/src/test/java/Text01.java b/cloud-modules/cloud-modules-fault/src/test/java/Text01.java deleted file mode 100644 index 921a9e8..0000000 --- a/cloud-modules/cloud-modules-fault/src/test/java/Text01.java +++ /dev/null @@ -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); - } -} diff --git a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/controller/SysEntController.java b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/controller/SysEntController.java index f04083d..5fc4492 100644 --- a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/controller/SysEntController.java +++ b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/controller/SysEntController.java @@ -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> selectOne(){ - return Result.success(sysEntService.selectOne()); - } } diff --git a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/SysEntService.java b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/SysEntService.java index f305258..321b6b8 100644 --- a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/SysEntService.java +++ b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/SysEntService.java @@ -20,6 +20,4 @@ public interface SysEntService extends IService { * @return 返回结果 */ public List selectList(EntListReq entListReq); - - List selectOne(); } diff --git a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/impl/SysEntServiceImpl.java b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/impl/SysEntServiceImpl.java index 98c5a93..a014b52 100644 --- a/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/impl/SysEntServiceImpl.java +++ b/cloud-modules/cloud-modules-system/src/main/java/com/muyu/system/service/impl/SysEntServiceImpl.java @@ -64,11 +64,4 @@ public class SysEntServiceImpl extends ServiceImpl impleme .map(EntResp::entBuild) .toList(); } - - @Override - public List selectOne() { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(EntResp::getEntStatus,0); - return this.list((IPage) queryWrapper); - } }