代码初始化
parent
caa1ed9c43
commit
973f1953cc
|
@ -0,0 +1,8 @@
|
||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-common/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-common/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-remote/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-remote/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-server/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/fate-fault-server/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,111 @@
|
||||||
|
package com.fate.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池信息
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-19:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Battery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池ID 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池编号 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryCoding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池类型
|
||||||
|
*/
|
||||||
|
public String batteryType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池容量
|
||||||
|
*/
|
||||||
|
public Integer batteryCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池电压
|
||||||
|
*/
|
||||||
|
public Double batteryActualVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池质量
|
||||||
|
*/
|
||||||
|
public Integer batteryActualMass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*出厂时间
|
||||||
|
*/
|
||||||
|
public Date batteryDeliveryTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池加热状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryHeatingFlag ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池当前状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池保温状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryPreservationFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*DCDC(电力交换系统)状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer batteryExchangeFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*车辆状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*充电状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carLaterFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*运行状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carRunningFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*SOC状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carSocFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*可充电储能装置工作状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carStorageFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驱动电机状态 1 2
|
||||||
|
*/
|
||||||
|
public Integer carDriveFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位是否有效 1 2
|
||||||
|
*/
|
||||||
|
public Integer carPositioningFlag;
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.fate.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零件信息
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-20:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
|
||||||
|
public class Drive {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驱动零件ID
|
||||||
|
*/
|
||||||
|
private Integer driveId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置型号
|
||||||
|
*/
|
||||||
|
private String driveName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂商名称
|
||||||
|
*/
|
||||||
|
private String drivePartNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAS(汽车防盗系统)状态
|
||||||
|
*/
|
||||||
|
private Integer driveTheftFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PTC(电动加热器)状态
|
||||||
|
*/
|
||||||
|
private Integer drivePowerFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EPS(电动助力系统)状态
|
||||||
|
*/
|
||||||
|
private Integer driveAssistFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*ABS(防抱死)状态
|
||||||
|
*/
|
||||||
|
private Integer driveBrakingFlag;
|
||||||
|
}
|
|
@ -29,14 +29,6 @@ public class FaultCode {
|
||||||
private Integer faultId;
|
private Integer faultId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:shixuchao
|
|
||||||
* @Date:
|
|
||||||
* @Description 故障内容
|
|
||||||
*/
|
|
||||||
@NotEmpty(message = "故障内容不能为空")
|
|
||||||
private String faultContent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* @Author:shixuchao
|
||||||
* @Date:
|
* @Date:
|
||||||
|
@ -63,28 +55,10 @@ public class FaultCode {
|
||||||
private Integer faultTypeId;
|
private Integer faultTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* 报警ID
|
||||||
* @Date:
|
|
||||||
* @Description 故障异常指标
|
|
||||||
*/
|
*/
|
||||||
@NotEmpty(message = "故障异常指标不能为空")
|
@NotEmpty(message = "报警ID不能为空")
|
||||||
private Integer faultErrorInformation;
|
private Integer policeId;
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:shixuchao
|
|
||||||
* @Date:
|
|
||||||
* @Description 故障正常指标
|
|
||||||
*/
|
|
||||||
@NotEmpty(message = "故障正常指标不能为空")
|
|
||||||
private Integer faultSucceedInformation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:shixuchao
|
|
||||||
* @Date:
|
|
||||||
* @Description 故障状态
|
|
||||||
*/
|
|
||||||
@NotEmpty(message = "故障状态不能为空")
|
|
||||||
private Integer faultFlag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* @Author:shixuchao
|
||||||
|
@ -93,4 +67,5 @@ public class FaultCode {
|
||||||
*/
|
*/
|
||||||
@NotEmpty(message = "车辆ID不能为空")
|
@NotEmpty(message = "车辆ID不能为空")
|
||||||
private Integer carId;
|
private Integer carId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.fate.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警信息
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-16:31
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Police {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警ID
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "报警ID不能为空")
|
||||||
|
private Integer policeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警信息
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "报警信息不能为空")
|
||||||
|
private String policeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常状态
|
||||||
|
*/
|
||||||
|
private String policeNum;
|
||||||
|
}
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.fate.domain.request;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池信息
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-20:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BatteryRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池编号
|
||||||
|
*/
|
||||||
|
public Integer batteryCoding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池类型
|
||||||
|
*/
|
||||||
|
public String batteryType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池容量
|
||||||
|
*/
|
||||||
|
public Integer batteryCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池电压
|
||||||
|
*/
|
||||||
|
public Double batteryActualVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*电池质量
|
||||||
|
*/
|
||||||
|
public Integer batteryActualMass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*出厂时间
|
||||||
|
*/
|
||||||
|
public Date batteryDeliveryTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池加热状态
|
||||||
|
*/
|
||||||
|
public Integer batteryHeatingFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池当前状态
|
||||||
|
*/
|
||||||
|
public Integer batteryFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*动力电池保温状态
|
||||||
|
*/
|
||||||
|
public Integer batteryPreservationFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*DCDC(电力交换系统)状态
|
||||||
|
*/
|
||||||
|
public Integer batteryExchangeFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*车辆状态
|
||||||
|
*/
|
||||||
|
public Integer carFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*充电状态
|
||||||
|
*/
|
||||||
|
public Integer carLaterFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*运行状态
|
||||||
|
*/
|
||||||
|
public Integer carRunningFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*SOC状态
|
||||||
|
*/
|
||||||
|
public Integer carSocFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*可充电储能装置工作状态
|
||||||
|
*/
|
||||||
|
public Integer carStorageFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驱动电机状态
|
||||||
|
*/
|
||||||
|
public Integer carDriveFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位是否有效
|
||||||
|
*/
|
||||||
|
public Integer carPositioningFlag;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.fate.domain.request;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Negative;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零件信息
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-20:07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DriveRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置型号
|
||||||
|
*/
|
||||||
|
private String driveName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂商名称
|
||||||
|
*/
|
||||||
|
private String drivePartNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAS(汽车防盗系统)状态
|
||||||
|
*/
|
||||||
|
private Integer driveTheftFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PTC(电动加热器)状态
|
||||||
|
*/
|
||||||
|
private Integer drivePowerFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EPS(电动助力系统)状态
|
||||||
|
*/
|
||||||
|
private Integer driveAssistFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*ABS(防抱死)状态
|
||||||
|
*/
|
||||||
|
private Integer driveBrakingFlag;
|
||||||
|
}
|
|
@ -21,15 +21,6 @@ import java.util.Date;
|
||||||
|
|
||||||
public class FaultCodeRequest {
|
public class FaultCodeRequest {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:shixuchao
|
|
||||||
* @Date:
|
|
||||||
* @Description 故障内容
|
|
||||||
*/
|
|
||||||
@NotEmpty(message = "内容不能为空")
|
|
||||||
private String faultContent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* @Author:shixuchao
|
||||||
* @Date:
|
* @Date:
|
||||||
|
@ -55,21 +46,11 @@ public class FaultCodeRequest {
|
||||||
private Integer faultTypeId;
|
private Integer faultTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* 报警ID
|
||||||
* @Date:
|
|
||||||
* @Description 故障异常指标
|
|
||||||
*/
|
*/
|
||||||
@NotEmpty(message = "故障异常指标不能为空")
|
@NotEmpty(message = "报警ID不能为空")
|
||||||
private Integer faultErrorInformation;
|
private Integer policeId;
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:shixuchao
|
|
||||||
* @Date:
|
|
||||||
* @Description 故障正常指标
|
|
||||||
*/
|
|
||||||
|
|
||||||
@NotEmpty(message = "故障正常指标不能为空")
|
|
||||||
private Integer faultSucceedInformation;
|
|
||||||
/**
|
/**
|
||||||
* @Author:shixuchao
|
* @Author:shixuchao
|
||||||
* @Date:
|
* @Date:
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.fate.domain.request;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警类型
|
||||||
|
*
|
||||||
|
* @author ShiXuChao
|
||||||
|
* @version 2023/12/1-16:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PoliceRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警信息
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "报警信息不能为空")
|
||||||
|
private String policeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警类型
|
||||||
|
*/
|
||||||
|
private String policeNum;
|
||||||
|
}
|
|
@ -83,4 +83,28 @@ public class FaultController {
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/policeList")
|
||||||
|
public Result policeList(){
|
||||||
|
Result result=faultService.policeList();
|
||||||
|
log.info("功能:报警信息列表 URI:{} 方法:{} 参数:{}",request.getRequestURI(),request.getMethod()
|
||||||
|
,result.getData());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/driveList")
|
||||||
|
public Result driveList(){
|
||||||
|
Result result=faultService.driveList();
|
||||||
|
log.info("功能:零件信息列表展示 URI:{} 方法:{} 参数:{}",request.getRequestURI(),request.getMethod()
|
||||||
|
,result.getData());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/batteryList")
|
||||||
|
public Result batteryList(){
|
||||||
|
Result result=faultService.batteryList();
|
||||||
|
log.info("功能:电池信息列表展示 URI:{} 方法:{} 参数:{}",request.getRequestURI(),request.getMethod()
|
||||||
|
,result.getData());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class RabbitMq {
|
||||||
MsgUtils.sendCode("你看不起我?草", "13120856998");
|
MsgUtils.sendCode("你看不起我?草", "13120856998");
|
||||||
count++;
|
count++;
|
||||||
if (count == 3) {
|
if (count == 3) {
|
||||||
faultService.rabbitUpdate(item.getFaultId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.getPriorityId() == 4) {
|
if (item.getPriorityId() == 4) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.fate.fault.mapper;
|
package com.fate.fault.mapper;
|
||||||
|
|
||||||
import com.fate.domain.FaultCode;
|
import com.fate.domain.*;
|
||||||
import com.fate.domain.FaultType;
|
|
||||||
import com.fate.domain.request.FaultCodeRequest;
|
import com.fate.domain.request.FaultCodeRequest;
|
||||||
import com.fate.modle.Vo;
|
import com.fate.modle.Vo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -66,5 +65,13 @@ public interface FaultMapper {
|
||||||
|
|
||||||
List<FaultCode> timeList();
|
List<FaultCode> timeList();
|
||||||
|
|
||||||
Integer rabbitUpdate(@Param("faultId") Integer faultId);
|
List<Police> policeList();
|
||||||
|
|
||||||
|
List<Drive> driveList();
|
||||||
|
|
||||||
|
List<Battery> batteryList();
|
||||||
|
|
||||||
|
void driveInsert(@Param("i") int i, Drive item);
|
||||||
|
|
||||||
|
void batteryInsert(@Param("num") int num, Battery item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,5 +61,9 @@ public interface FaultService {
|
||||||
|
|
||||||
Result<List<FaultCode>> timeList();
|
Result<List<FaultCode>> timeList();
|
||||||
|
|
||||||
void rabbitUpdate(Integer faultId);
|
Result policeList();
|
||||||
|
|
||||||
|
Result driveList();
|
||||||
|
|
||||||
|
Result batteryList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.fate.fault.service.impl;
|
package com.fate.fault.service.impl;
|
||||||
|
|
||||||
import com.fate.common.core.domain.Result;
|
import com.fate.common.core.domain.Result;
|
||||||
import com.fate.domain.FaultCode;
|
import com.fate.domain.*;
|
||||||
import com.fate.domain.FaultType;
|
|
||||||
import com.fate.domain.request.FaultCodeRequest;
|
import com.fate.domain.request.FaultCodeRequest;
|
||||||
import com.fate.fault.mapper.FaultMapper;
|
import com.fate.fault.mapper.FaultMapper;
|
||||||
import com.fate.fault.service.FaultService;
|
import com.fate.fault.service.FaultService;
|
||||||
|
@ -78,8 +77,78 @@ public class FaultServiceImpl implements FaultService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rabbitUpdate(Integer faultId) {
|
public Result policeList() {
|
||||||
Integer rabbitUpdate=faultMapper.rabbitUpdate(faultId);
|
List<Police> policeList=faultMapper.policeList();
|
||||||
|
return Result.success(policeList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result driveList() {
|
||||||
|
List<Drive> driveList=faultMapper.driveList();
|
||||||
|
driveList.forEach(item->{
|
||||||
|
if (item.getDriveAssistFlag()==2){
|
||||||
|
faultMapper.driveInsert(4,item);
|
||||||
|
}
|
||||||
|
if (item.getDriveBrakingFlag()==2){
|
||||||
|
faultMapper.driveInsert(10,item);
|
||||||
|
}
|
||||||
|
if (item.getDriveTheftFlag() == 2) {
|
||||||
|
faultMapper.driveInsert(5,item);
|
||||||
|
}
|
||||||
|
if (item.getDrivePowerFlag()==2){
|
||||||
|
faultMapper.driveInsert(6,item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Result.success(driveList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result batteryList() {
|
||||||
|
List<Battery> batteryList=faultMapper.batteryList();
|
||||||
|
|
||||||
|
List<Police> result = (List<Police>) this.policeList().getData();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
batteryList.forEach(item->{
|
||||||
|
boolean batteryHeatingFlag = batteryList.stream().allMatch(item1 -> item1.getBatteryHeatingFlag()==2);
|
||||||
|
if (batteryHeatingFlag){
|
||||||
|
faultMapper.batteryInsert(1,item);
|
||||||
|
}
|
||||||
|
if (item.getBatteryFlag()==2){
|
||||||
|
faultMapper.batteryInsert(2,item);
|
||||||
|
}
|
||||||
|
if (item.getBatteryPreservationFlag()==2){
|
||||||
|
faultMapper.batteryInsert(3,item);
|
||||||
|
}
|
||||||
|
if (item.getBatteryExchangeFlag()==2){
|
||||||
|
faultMapper.batteryInsert(7,item);
|
||||||
|
}
|
||||||
|
if (item.getCarFlag()==2){
|
||||||
|
faultMapper.batteryInsert(12,item);
|
||||||
|
}
|
||||||
|
if (item.getCarLaterFlag()==2){
|
||||||
|
faultMapper.batteryInsert(13,item);
|
||||||
|
}
|
||||||
|
if (item.getCarRunningFlag()==2){
|
||||||
|
faultMapper.batteryInsert(14,item);
|
||||||
|
}
|
||||||
|
if (item.getCarSocFlag()==2){
|
||||||
|
faultMapper.batteryInsert(15,item);
|
||||||
|
}
|
||||||
|
if (item.getCarStorageFlag()==2){
|
||||||
|
faultMapper.batteryInsert(16,item);
|
||||||
|
}
|
||||||
|
if (item.getCarDriveFlag()==2){
|
||||||
|
faultMapper.batteryInsert(17,item);
|
||||||
|
}
|
||||||
|
if (item.getCarPositioningFlag()==2){
|
||||||
|
faultMapper.batteryInsert(18,item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Result.success(batteryList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,67 +4,101 @@
|
||||||
|
|
||||||
<resultMap id="faultCode" type="com.fate.domain.FaultCode">
|
<resultMap id="faultCode" type="com.fate.domain.FaultCode">
|
||||||
<id column="fault_id" property="faultId"></id>
|
<id column="fault_id" property="faultId"></id>
|
||||||
<result column="fault_content" property="faultContent"></result>
|
|
||||||
<result column="priority_id" property="priorityId"></result>
|
<result column="priority_id" property="priorityId"></result>
|
||||||
<result column="fault_time" property="faultTime"></result>
|
<result column="fault_time" property="faultTime"></result>
|
||||||
<result column="fault_type_id" property="faultTypeId"></result>
|
<result column="fault_type_id" property="faultTypeId"></result>
|
||||||
<result column="fault_error_information" property="faultErrorInformation"></result>
|
<result column="police_id" property="policeId"></result>
|
||||||
<result column="fault_succeed_information" property="faultSucceedInformation"></result>
|
|
||||||
<result column="fault_flag" property="faultFlag"></result>
|
|
||||||
<result column="car_id" property="carId"></result>
|
<result column="car_id" property="carId"></result>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="faultInsert">
|
<insert id="faultInsert">
|
||||||
INSERT INTO `t_fault_code`
|
INSERT INTO `t_fault_code`
|
||||||
(`fault_content`,
|
(
|
||||||
`priority_id`,
|
`priority_id`,
|
||||||
`fault_time`,
|
`fault_time`,
|
||||||
`fault_type_id`,
|
`fault_type_id`,
|
||||||
`fault_error_information`,
|
`police_id`,
|
||||||
`fault_succeed_information`,
|
|
||||||
`fault_flag`,
|
|
||||||
`car_id`)
|
`car_id`)
|
||||||
VALUES (#{faultContent},
|
VALUES (
|
||||||
#{priorityId},
|
#{priorityId},
|
||||||
#{faultTime},
|
#{faultTime},
|
||||||
#{faultTypeId},
|
#{faultTypeId},
|
||||||
#{faultErrorInformation},
|
#{policeId},
|
||||||
#{faultSucceedInformation},
|
|
||||||
#{faultFlag},
|
|
||||||
#{carId});
|
#{carId});
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="driveInsert">
|
||||||
|
INSERT INTO `t_fault_code`
|
||||||
|
(`priority_id`,
|
||||||
|
`fault_time`,
|
||||||
|
`fault_type_id`,
|
||||||
|
`police_id`,
|
||||||
|
`car_id`)
|
||||||
|
VALUES (#{},
|
||||||
|
now(),
|
||||||
|
#{},
|
||||||
|
#{i},
|
||||||
|
#{carId});
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<insert id="batteryInsert">
|
||||||
|
INSERT INTO `t_fault_code`
|
||||||
|
(`priority_id`,
|
||||||
|
`fault_time`,
|
||||||
|
`fault_type_id`,
|
||||||
|
`police_id`,
|
||||||
|
`car_id`)
|
||||||
|
VALUES (#{},
|
||||||
|
now(),
|
||||||
|
#{},
|
||||||
|
#{num},
|
||||||
|
#{carId});
|
||||||
|
</insert>
|
||||||
<update id="faultUpdate">
|
<update id="faultUpdate">
|
||||||
UPDATE `t_fault_code`
|
UPDATE `t_fault_code`
|
||||||
SET `fault_content` = #{faultContent},
|
SET `priority_id` = #{priorityId},
|
||||||
`priority_id` = #{priorityId},
|
|
||||||
`fault_time` = now(),
|
`fault_time` = now(),
|
||||||
`fault_type_id` = #{faultTypeId},
|
`fault_type_id` = #{faultTypeId},
|
||||||
`fault_error_information` = #{faultErrorInformation},
|
`police_id`=#{policeId},
|
||||||
`fault_succeed_information` = #{faultSucceedInformation},
|
|
||||||
`fault_flag`=#{faultFlag},
|
|
||||||
`car_id` = #{carId}
|
`car_id` = #{carId}
|
||||||
WHERE `fault_id` = #{faultId};
|
WHERE `fault_id` = #{faultId};
|
||||||
</update>
|
</update>
|
||||||
<update id="rabbitUpdate">
|
|
||||||
update `t_fault_code` set `fault_flag`=3 where `fault_id`=#{faultId}
|
|
||||||
</update>
|
|
||||||
<delete id="faultDelete">
|
<delete id="faultDelete">
|
||||||
delete from t_fault_code where fault_oid=#{faultId}
|
delete from t_fault_code where fault_oid=#{faultId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="faultList" resultMap="faultCode">
|
<select id="faultList" resultMap="faultCode">
|
||||||
select * from t_fault_code where car_id=#{carId}
|
select * from t_fault_code c
|
||||||
|
left join t_fault_type t on c.fault_type_id=t.fault_type_id
|
||||||
|
LEFT JOIN t_police p on c.police_id=p.police_id
|
||||||
|
LEFT JOIN t_priority o on c.priority_id=o.priority_id
|
||||||
|
where car_id=#{carId}
|
||||||
</select>
|
</select>
|
||||||
<select id="faultFind" resultMap="faultCode">
|
<select id="faultFind" resultMap="faultCode">
|
||||||
select * from t_fault_code where fault_id=#{faultId}
|
select * from t_fault_code c
|
||||||
|
left join t_fault_type t on c.fault_type_id=t.fault_type_id
|
||||||
|
LEFT JOIN t_police p on c.police_id=p.police_id
|
||||||
|
LEFT JOIN t_priority o on c.priority_id=o.priority_id
|
||||||
|
where fault_id=#{faultId}
|
||||||
</select>
|
</select>
|
||||||
<select id="faultTypeList" resultType="com.fate.domain.FaultType">
|
<select id="faultTypeList" resultType="com.fate.domain.FaultType">
|
||||||
select * from t_fault_type
|
select * from t_fault_type
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="timeList" resultType="com.fate.domain.FaultCode">
|
<select id="timeList" resultType="com.fate.domain.FaultCode">
|
||||||
select * from t_fault_code
|
select * from t_fault_code c
|
||||||
|
left join t_fault_type t on c.fault_type_id=t.fault_type_id
|
||||||
|
LEFT JOIN t_police p on c.police_id=p.police_id
|
||||||
|
LEFT JOIN t_priority o on c.priority_id=o.priority_id
|
||||||
|
</select>
|
||||||
|
<select id="policeList" resultType="com.fate.domain.Police">
|
||||||
|
select * from t_police
|
||||||
|
</select>
|
||||||
|
<select id="driveList" resultType="com.fate.domain.Drive">
|
||||||
|
select * from t_drive d left join t_car c on d.car_id=c.car_id
|
||||||
|
</select>
|
||||||
|
<select id="batteryList" resultType="com.fate.domain.Battery">
|
||||||
|
select * from t_battery b left join t_car c on b.car_id=c.car_id
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue