test:故障记录展示数据修改

dev
袁子龙 2024-09-23 20:56:10 +08:00
parent 2b4111fccd
commit c13bf9528c
4 changed files with 75 additions and 16 deletions

View File

@ -23,23 +23,33 @@ public class sysCarFaultLogController extends BaseController {
private SysCarFaultLogService service;
@GetMapping("/list")
public Result<TableDataInfo<SysCarFaultLog>> list(){
public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.list();
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
return getDataTable(list);
}
@GetMapping("/listIsReadAlready")
public Result<TableDataInfo<SysCarFaultLog>>listIsReadAlready(){
@GetMapping("/listStatusIgnore")
public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listIsReadAlready();
List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog);
return getDataTable(list);
}
@GetMapping("/listIsReadNoAlready")
public Result<TableDataInfo<SysCarFaultLog>>listIsReadNoAlready(){
@GetMapping("/listStatusSolve")
public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listIsReadNoAlready();
List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog);
return getDataTable(list);
}
@GetMapping("/listStatusProcess")
public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog);
return getDataTable(list);
}

View File

@ -36,11 +36,12 @@ public class SysCarFaultLog extends BaseEntity {
/** 结束时间*/
private Date updateTime;
/** 是否已读 */
private Integer isRead;
/** VIN码 */
private String vin;
/** 处理状态 1-解决 2-处理中 3-忽略 */
private Integer status;
}

View File

@ -15,6 +15,10 @@ import java.util.List;
*/
public interface SysCarFaultLogService extends IService<SysCarFaultLog> {
public List<SysCarFaultLog> listIsReadAlready( );
public List<SysCarFaultLog>listIsReadNoAlready( );
public List<SysCarFaultLog>selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog);
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog);
public List<SysCarFaultLog>listStatusProcess(SysCarFaultLog sysCarFaultLog );
public List<SysCarFaultLog>listStatusSolve(SysCarFaultLog sysCarFaultLog);
}

View File

@ -1,5 +1,6 @@
package com.muyu.breakdown.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.breakdown.domain.SysCarFaultLog;
@ -8,6 +9,8 @@ import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
import com.muyu.breakdown.mapper.SysCarFaultMapper;
import com.muyu.breakdown.service.SysCarFaultLogService;
import com.muyu.breakdown.service.SysCarFaultLogService;
import com.muyu.common.core.utils.StringUtils;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,13 +27,54 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
@Autowired
private SysCarFaultLogMapper mapper;
@Override
public List<SysCarFaultLog> listIsReadAlready() {
return mapper.listIsReadAlready();
public List<SysCarFaultLog> selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog) {
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
}
if (sysCarFaultLog.getStatus()!=null){
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
}
return this.list(wrapper);
}
@Override
public List<SysCarFaultLog> listIsReadNoAlready() {
return mapper.listIsReadAlready();
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog) {
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
}
if (sysCarFaultLog.getStatus()==3){
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
}
return this.list(wrapper);
}
@Override
public List<SysCarFaultLog> listStatusProcess(SysCarFaultLog sysCarFaultLog) {
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
}
if (sysCarFaultLog.getStatus()==2){
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
}
return this.list(wrapper);
}
@Override
public List<SysCarFaultLog> listStatusSolve(SysCarFaultLog sysCarFaultLog) {
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
}
if (sysCarFaultLog.getStatus()==1){
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
}
return this.list(wrapper);
}
}