故障日志
parent
96ce17cb1d
commit
deebcff5bb
|
@ -0,0 +1,140 @@
|
|||
package com.muyu.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.muyu.business.domain.req.*;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.*;
|
||||
import lombok.experimental.*;
|
||||
import org.springframework.format.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障日志对象
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("故障日志对象")
|
||||
@TableName("fault_logs")
|
||||
public class FaultLogs implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 故障日志主键*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("故障日志主键")
|
||||
private Long logId;
|
||||
|
||||
/** 车辆VIN*/
|
||||
@ApiModelProperty("车辆VIN")
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
@ApiModelProperty("故障码")
|
||||
private String faultCode;
|
||||
|
||||
/**故障名称*/
|
||||
@ApiModelProperty("故障名称")
|
||||
private String faultName;
|
||||
|
||||
/** 是否产生报警:Y正常 N报警 */
|
||||
@ApiModelProperty("是否产生报警")
|
||||
private String alarmFlag;
|
||||
|
||||
/** 报警开始时间*/
|
||||
@ApiModelProperty("报警开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startAlarmTime;
|
||||
|
||||
/** 报警结束时间*/
|
||||
@ApiModelProperty("报警结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endAlarmTime;
|
||||
|
||||
/** 最近报警时间*/
|
||||
@ApiModelProperty("最近报警时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recentlyAlarmTime;
|
||||
|
||||
/** 处理时间*/
|
||||
@ApiModelProperty("处理时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date disposeTime;
|
||||
|
||||
/** 处理人*/
|
||||
private String disposeBy;
|
||||
|
||||
/** 处理状态(0正常 1故障 2维护中)*/
|
||||
private String disposeStatus;
|
||||
|
||||
|
||||
/** 创建者*/
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者*/
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间*/
|
||||
@ApiModelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
public static FaultLogs addFaultLogsReq(FaultLogsAddReq faultLogsAddReq){
|
||||
return FaultLogs.builder()
|
||||
.carVin(faultLogsAddReq.getCarVin())
|
||||
.faultCode(faultLogsAddReq.getFaultCode())
|
||||
.faultName(faultLogsAddReq.getFaultName())
|
||||
.alarmFlag(faultLogsAddReq.getAlarmFlag())
|
||||
.startAlarmTime(faultLogsAddReq.getStartAlarmTime())
|
||||
.endAlarmTime(faultLogsAddReq.getEndAlarmTime())
|
||||
.recentlyAlarmTime(faultLogsAddReq.getRecentlyAlarmTime())
|
||||
.disposeTime(faultLogsAddReq.getDisposeTime())
|
||||
.disposeBy(faultLogsAddReq.getDisposeBy())
|
||||
.disposeStatus(faultLogsAddReq.getDisposeStatus())
|
||||
.createBy(faultLogsAddReq.getCreateBy())
|
||||
.createTime(faultLogsAddReq.getCreateTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultLogs updFaultLogsReq(FaultLogsUpdReq faultLogsUpdReq){
|
||||
return FaultLogs.builder()
|
||||
.logId(faultLogsUpdReq.getLogId())
|
||||
.carVin(faultLogsUpdReq.getCarVin())
|
||||
.faultCode(faultLogsUpdReq.getFaultCode())
|
||||
.faultName(faultLogsUpdReq.getFaultName())
|
||||
.alarmFlag(faultLogsUpdReq.getAlarmFlag())
|
||||
.startAlarmTime(faultLogsUpdReq.getStartAlarmTime())
|
||||
.endAlarmTime(faultLogsUpdReq.getEndAlarmTime())
|
||||
.recentlyAlarmTime(faultLogsUpdReq.getRecentlyAlarmTime())
|
||||
.disposeTime(faultLogsUpdReq.getDisposeTime())
|
||||
.disposeBy(faultLogsUpdReq.getDisposeBy())
|
||||
.disposeStatus(faultLogsUpdReq.getDisposeStatus())
|
||||
.updateBy(faultLogsUpdReq.getUpdateBy())
|
||||
.updateTime(faultLogsUpdReq.getUpdateTime())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.muyu.business.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 新增故障日志对象
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FaultLogsAddReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultCode;
|
||||
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String faultName;
|
||||
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private String alarmFlag;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date startAlarmTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date endAlarmTime;
|
||||
|
||||
/**
|
||||
* 最近报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date recentlyAlarmTime;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date disposeTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String disposeBy;
|
||||
|
||||
/**
|
||||
* 处理状态(0正常 1故障 2维护中)
|
||||
*/
|
||||
private String disposeStatus;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.business.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障日志查询对象
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FaultLogsReq implements Serializable {
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultCode;
|
||||
|
||||
/**故障名称*/
|
||||
private String faultName;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date startAlarmTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date endAlarmTime;
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.muyu.business.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 编辑故障日志对象
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FaultLogsUpdReq implements Serializable {
|
||||
/**
|
||||
* 故障日志主键
|
||||
*/
|
||||
private Long logId;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultCode;
|
||||
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String faultName;
|
||||
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private String alarmFlag;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date startAlarmTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date endAlarmTime;
|
||||
|
||||
/**
|
||||
* 最近报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date recentlyAlarmTime;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date disposeTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String disposeBy;
|
||||
|
||||
/**
|
||||
* 处理状态(0正常 1故障 2维护中)
|
||||
*/
|
||||
private String disposeStatus;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.business.domain.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import lombok.*;
|
||||
import lombok.experimental.*;
|
||||
import org.springframework.format.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障日志响应对象
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class FaultLogsResponse implements Serializable {
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private Long faultId;
|
||||
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private String alarmFlag;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date startAlarmTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date endAlarmTime;
|
||||
|
||||
/**
|
||||
* 最近报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date recentlyAlarmTime;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||
private Date disposeTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String disposeBy;
|
||||
|
||||
/**
|
||||
* 处理状态(0正常 1故障 2维护中)
|
||||
*/
|
||||
private String disposeStatus;
|
||||
}
|
|
@ -11,6 +11,7 @@ import com.muyu.system.common.domain.FaultCodeInfo;
|
|||
import com.muyu.system.common.domain.req.FaultCodeReq;
|
||||
import com.muyu.system.common.domain.req.FaultCodesAddReq;
|
||||
import com.muyu.system.common.domain.req.FaultCodesUpdReq;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.*;
|
||||
import org.springframework.validation.annotation.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -23,6 +24,8 @@ import java.util.*;
|
|||
* @author Li YongJie
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@Api(tags = "故障码管理")
|
||||
@ApiModel(description = "故障码Controller")
|
||||
@RestController
|
||||
@RequestMapping("/faultCodes")
|
||||
public class FaultCodesController extends BaseController {
|
||||
|
@ -36,6 +39,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 查询故障码列表
|
||||
*/
|
||||
@ApiOperation("故障码列表")
|
||||
@RequiresPermissions("business:faultCodes:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(FaultCodeReq faultCodes) {
|
||||
|
@ -47,6 +51,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 新增故障码
|
||||
*/
|
||||
@ApiOperation("新增故障码")
|
||||
@RequiresPermissions("business:faultCodes:add")
|
||||
@Log(title = "故障码", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
|
@ -57,6 +62,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 获取故障码详细信息
|
||||
*/
|
||||
@ApiOperation("获取故障码详细信息")
|
||||
@RequiresPermissions("business:faultCodes:query")
|
||||
@GetMapping(value = "/{faultId}")
|
||||
public Result getInfo(@PathVariable("faultId") Long faultId) {
|
||||
|
@ -66,6 +72,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 修改故障码
|
||||
*/
|
||||
@ApiOperation("修改故障码")
|
||||
@RequiresPermissions("business:faultCodes:edit")
|
||||
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
|
@ -76,6 +83,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 修改故障码状态
|
||||
*/
|
||||
@ApiOperation("修改故障码状态")
|
||||
@RequiresPermissions("business:faultCodes:edit")
|
||||
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
|
@ -86,6 +94,7 @@ public class FaultCodesController extends BaseController {
|
|||
/**
|
||||
* 删除故障码
|
||||
*/
|
||||
@ApiOperation("删除故障码")
|
||||
@RequiresPermissions("business:faultCodes:remove")
|
||||
@Log(title = "故障码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{faultIds}")
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
package com.muyu.business.controller;
|
||||
|
||||
import com.muyu.business.domain.*;
|
||||
import com.muyu.business.domain.req.*;
|
||||
import com.muyu.business.service.*;
|
||||
import com.muyu.common.core.domain.*;
|
||||
import com.muyu.common.core.web.controller.*;
|
||||
import com.muyu.common.core.web.page.*;
|
||||
import com.muyu.common.log.annotation.*;
|
||||
import com.muyu.common.log.enums.*;
|
||||
import com.muyu.common.security.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.*;
|
||||
import org.springframework.validation.annotation.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障码日志Controller
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Api(tags = "故障日志管理")
|
||||
@ApiModel(description = "故障日志Controller")
|
||||
@RestController
|
||||
@RequestMapping("/faultLogs")
|
||||
public class FaultLogsController extends BaseController {
|
||||
|
||||
/**
|
||||
* 注入故障日志Service
|
||||
*/
|
||||
@Autowired
|
||||
private FaultLogsService faultLogsService;
|
||||
|
||||
@ApiOperation("故障日志列表")
|
||||
@RequiresPermissions("business:faultLogs:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(FaultLogsReq faultLogsReq) {
|
||||
startPage();
|
||||
List<FaultLogs> list = faultLogsService.selectFaultLogsList(faultLogsReq);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障日志
|
||||
*/
|
||||
@ApiOperation("新增故障日志")
|
||||
@RequiresPermissions("business:faultLogs:add")
|
||||
@Log(title = "故障日志", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody @Validated FaultLogsAddReq faultLogsAddReq) {
|
||||
return toAjax(faultLogsService.insertFaultLogs(FaultLogs.addFaultLogsReq(faultLogsAddReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障日志详情
|
||||
*/
|
||||
@ApiOperation(value = "故障日志详情",hidden = true)
|
||||
@RequiresPermissions("business:faultLogs:query")
|
||||
@GetMapping("/{logId}")
|
||||
public Result detail(@ApiParam(value = "故障日志主键") @PathVariable("logId") Long logId) {
|
||||
return Result.success(faultLogsService.selectFaultLogsById(logId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障日志
|
||||
*/
|
||||
@ApiOperation(value = "修改故障日志",hidden = true)
|
||||
@RequiresPermissions("business:faultLogs:edit")
|
||||
@Log(title = "故障日志", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody @Validated FaultLogsUpdReq faultLogsUpdReq) {
|
||||
return toAjax(faultLogsService.updateFaultLogs(FaultLogs.updFaultLogsReq(faultLogsUpdReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障日志
|
||||
*/
|
||||
@ApiOperation(value = "删除故障日志",hidden = true)
|
||||
@RequiresPermissions("business:faultLogs:remove")
|
||||
@Log(title = "故障日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{logIds}")
|
||||
public Result remove(@ApiParam(value = "故障日志Id", required = true) @PathVariable("logIds") Long[] logIds) {
|
||||
return toAjax(faultLogsService.deleteFaultLogsByIds(logIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.*;
|
||||
import com.muyu.business.domain.*;
|
||||
|
||||
/**
|
||||
* 故障日志Mapper接口
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
public interface FaultLogsMapper extends BaseMapper<FaultLogs> {
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.*;
|
||||
import com.muyu.business.domain.*;
|
||||
import com.muyu.business.domain.req.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障日志Service接口
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
public interface FaultLogsService extends IService<FaultLogs> {
|
||||
/**
|
||||
* 故障日志列表
|
||||
*
|
||||
* @param faultLogsReq
|
||||
* @return
|
||||
*/
|
||||
List<FaultLogs> selectFaultLogsList(FaultLogsReq faultLogsReq);
|
||||
|
||||
/**
|
||||
* 新增故障日志
|
||||
*
|
||||
* @param faultLogs
|
||||
* @return
|
||||
*/
|
||||
int insertFaultLogs(FaultLogs faultLogs);
|
||||
|
||||
/**
|
||||
* 故障日志详情
|
||||
*
|
||||
* @param logId
|
||||
* @return
|
||||
*/
|
||||
FaultLogs selectFaultLogsById(Long logId);
|
||||
|
||||
/**
|
||||
* 编辑故障日志
|
||||
*
|
||||
* @param faultLogs
|
||||
* @return
|
||||
*/
|
||||
int updateFaultLogs(FaultLogs faultLogs);
|
||||
|
||||
/**
|
||||
* 删除故障日志
|
||||
*
|
||||
* @param logId
|
||||
* @return
|
||||
*/
|
||||
int deleteFaultLogsById(Long logId);
|
||||
|
||||
/**
|
||||
* 批量删除故障日志
|
||||
*
|
||||
* @param logIds
|
||||
* @return
|
||||
*/
|
||||
int deleteFaultLogsByIds(Long[] logIds);
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.muyu.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.*;
|
||||
import com.muyu.business.domain.*;
|
||||
import com.muyu.business.domain.req.*;
|
||||
import com.muyu.business.mapper.*;
|
||||
import com.muyu.business.service.*;
|
||||
import com.muyu.common.core.utils.*;
|
||||
import com.muyu.common.security.utils.*;
|
||||
import lombok.extern.slf4j.*;
|
||||
import org.springframework.beans.factory.annotation.*;
|
||||
import org.springframework.stereotype.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 故障日志Service业务层处理
|
||||
*
|
||||
* @Author LiYonJie
|
||||
* @Date 2024/3/30
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FaultLogsServiceImpl extends ServiceImpl<FaultLogsMapper, FaultLogs>
|
||||
implements FaultLogsService {
|
||||
|
||||
/**
|
||||
* 注入故障日志mapper
|
||||
*/
|
||||
@Autowired
|
||||
private FaultLogsMapper faultLogsMapper;
|
||||
|
||||
@Override
|
||||
public List<FaultLogs> selectFaultLogsList(FaultLogsReq faultLogsReq) {
|
||||
LambdaQueryWrapper<FaultLogs> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotEmpty(faultLogsReq.getCarVin()), FaultLogs::getCarVin, faultLogsReq.getCarVin());
|
||||
wrapper.eq(StringUtils.isNotNull(faultLogsReq.getFaultCode()), FaultLogs::getFaultCode, faultLogsReq.getFaultCode());
|
||||
wrapper.like(StringUtils.isNotEmpty(faultLogsReq.getFaultName()), FaultLogs::getFaultName, faultLogsReq.getFaultName());
|
||||
Date startAlarmTime = DateUtils.parseDate(faultLogsReq.getStartAlarmTime());
|
||||
Date endAlarmTime = DateUtils.parseDate(faultLogsReq.getEndAlarmTime());
|
||||
// wrapper.gt(StringUtils.isNotNull(faultLogsReq.getStartAlarmTime()), FaultLogs::getStartAlarmTime, startAlarmTime);
|
||||
// wrapper.lt(StringUtils.isNotNull(faultLogsReq.getEndAlarmTime()), FaultLogs::getEndAlarmTime, endAlarmTime);
|
||||
log.info("----------------------",startAlarmTime, ";-------------" + endAlarmTime);
|
||||
wrapper.apply(StringUtils.isNotNull(startAlarmTime),"UNIX_TIMESTAMP(start_alarm_time) >= UNIX_TIMESTAMP('" + startAlarmTime + "')");
|
||||
wrapper.apply(StringUtils.isNotNull(endAlarmTime),"UNIX_TIMESTAMP(end_alarm_time) <= UNIX_TIMESTAMP('" + endAlarmTime + "')");
|
||||
return faultLogsMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertFaultLogs(FaultLogs faultLogs) {
|
||||
faultLogs.setEndAlarmTime(null);
|
||||
faultLogs.setRecentlyAlarmTime(null);
|
||||
faultLogs.setDisposeTime(null);
|
||||
faultLogs.setDisposeBy(null);
|
||||
faultLogs.setDisposeStatus("1");
|
||||
faultLogs.setAlarmFlag("N");
|
||||
faultLogs.setCreateBy(SecurityUtils.getUsername());
|
||||
faultLogs.setCreateTime(DateUtils.getNowDate());
|
||||
return faultLogsMapper.insert(faultLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FaultLogs selectFaultLogsById(Long logId) {
|
||||
return faultLogsMapper.selectById(logId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFaultLogs(FaultLogs faultLogs) {
|
||||
faultLogs.setUpdateBy(SecurityUtils.getUsername());
|
||||
faultLogs.setUpdateTime(DateUtils.getNowDate());
|
||||
return faultLogsMapper.updateById(faultLogs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFaultLogsById(Long logId) {
|
||||
return faultLogsMapper.deleteById(logId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFaultLogsByIds(Long[] logIds) {
|
||||
return faultLogsMapper.deleteBatchIds(Arrays.asList(logIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!-- mybatis数据层 namespace命名空间-->
|
||||
<mapper namespace="com.muyu.business.mapper.FaultLogsMapper">
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue