修改bug

master
WeiRan 2024-09-29 16:53:08 +08:00
parent fa3b9b2244
commit 1627aa3dab
14 changed files with 81 additions and 99 deletions

View File

@ -46,7 +46,7 @@ public class CarInformation {
*/ */
// @TableName(value = "car_information_VIN") // @TableName(value = "car_information_VIN")
@TableField(value = "car_information_VIN") @TableField(value = "car_information_VIN")
private String carInformationVin; private String carInformationVIN;
/** /**
* *
*/ */
@ -135,7 +135,7 @@ public class CarInformation {
public static CarInformation carInformationAddBuilder(CarInformationAddReq carInformation) { public static CarInformation carInformationAddBuilder(CarInformationAddReq carInformation) {
return CarInformation.builder() return CarInformation.builder()
.carInformationVin(carInformation.getCarInformationVin()) .carInformationVIN(carInformation.getCarInformationVin())
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate()) .carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
.carInformationBrand(carInformation.getCarInformationBrand()) .carInformationBrand(carInformation.getCarInformationBrand())
.carInformationColor(carInformation.getCarInformationColor()) .carInformationColor(carInformation.getCarInformationColor())

View File

@ -60,7 +60,22 @@ public class FaultCode {
* *
*/ */
private Integer isWarning; private Integer isWarning;
/**
*
*/
private String faulttypeName;
/**
*
*/
private String messageTypeName;
/**
*
*/
private String messageTypeCode;
/**
*
*/
private String messageTypeBelongs;
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){ public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.domain.req.FaultCodeAddReq; import com.muyu.domain.req.FaultCodeAddReq;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
@ -50,6 +51,7 @@ public class FaultLabel {
return FaultLabel.builder() return FaultLabel.builder()
.messageTypeId(0) .messageTypeId(0)
.messageTypeId(faultCodeAddReq.getMessageTypeId()) .messageTypeId(faultCodeAddReq.getMessageTypeId())
.messageTypeCode(faultCodeAddReq.getMessageTypeCode())
.messageTypeName(faultCodeAddReq.getMessageTypeName()) .messageTypeName(faultCodeAddReq.getMessageTypeName())
.messageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs()) .messageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs())
.build(); .build();

View File

@ -55,7 +55,7 @@ public class FaultLog {
/** /**
* VIN * VIN
*/ */
private String carInformationVin; private String carInformationVIN;
/** /**
* *
*/ */

View File

@ -21,6 +21,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
public class FaultCodeListReq { public class FaultCodeListReq {
/** /**
* *
*/ */

View File

@ -1,11 +1,12 @@
package com.muyu.domain.resp; package com.muyu.domain.resp;
import com.muyu.domain.vo.FaultCodeVO; import com.muyu.domain.FaultCode;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* *
@ -19,6 +20,7 @@ import lombok.Data;
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor
@Tag(name="故障码信息响应对象",description = "故障码查询的响应结果") @Tag(name="故障码信息响应对象",description = "故障码查询的响应结果")
public class FaultCodeListResp { public class FaultCodeListResp {
@ -54,14 +56,14 @@ public class FaultCodeListResp {
* *
*/ */
private String faulttypeName; private String faulttypeName;
/**
*
*/
private String messageTypeName;
/** /**
* *
*/ */
private String messageTypeCode; private String messageTypeCode;
/**
*
*/
private String messageTypeName;
/** /**
* *
*/ */
@ -69,22 +71,22 @@ public class FaultCodeListResp {
/** /**
* *
* @param faultCodeVO * @param faultCode
* @return * @return
*/ */
public static FaultCodeListResp faultCodeListResp(FaultCodeVO faultCodeVO){ public static FaultCodeListResp faultCodeListResp(FaultCode faultCode){
return FaultCodeListResp.builder() return FaultCodeListResp.builder()
.faultcodeId(faultCodeVO.getFaultcodeId()) .faultcodeId(faultCode.getFaultcodeId())
.messageTypeId(faultCodeVO.getMessageTypeId()) .messageTypeId(faultCode.getMessageTypeId())
.faultcodeNumber(faultCodeVO.getFaultcodeNumber()) .faultcodeNumber(faultCode.getFaultcodeNumber())
.faultGroup(faultCodeVO.getFaultGroup()) .faultGroup(faultCode.getFaultGroup())
.faultBit(faultCodeVO.getFaultBit()) .faultBit(faultCode.getFaultBit())
.faultValue(faultCodeVO.getFaultValue()) .faultValue(faultCode.getFaultValue())
.isWarning(faultCodeVO.getIsWarning()) .isWarning(faultCode.getIsWarning())
.faulttypeName(faultCodeVO.getFaulttypeName()) .faulttypeName(faultCode.getFaulttypeName())
.messageTypeName(faultCodeVO.getMessageTypeName()) .messageTypeName(faultCode.getMessageTypeName())
.messageTypeCode(faultCodeVO.getMessageTypeCode()) .messageTypeCode(faultCode.getMessageTypeCode())
.messageTypeBelongs(faultCodeVO.getMessageTypeBelongs()) .messageTypeBelongs(faultCode.getMessageTypeBelongs())
.build(); .build();
} }
} }

View File

@ -77,7 +77,7 @@ public class FaultLogListResp {
.startwarningTime(faultLog.getStartwarningTime()) .startwarningTime(faultLog.getStartwarningTime())
.endwarningTime(faultLog.getEndwarningTime()) .endwarningTime(faultLog.getEndwarningTime())
.faultcodeNumber(faultLog.getFaultcodeNumber()) .faultcodeNumber(faultLog.getFaultcodeNumber())
.carInformationVIN(faultLog.getCarInformationVin()) .carInformationVIN(faultLog.getCarInformationVIN())
.build(); .build();
} }
} }

View File

@ -1,44 +0,0 @@
package com.muyu.domain.vo;
import com.muyu.domain.FaultCode;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* ()
* @Authorweiran
* @Packagecom.muyu.cloud.faultmanage.domain.vo
* @Projectcloud-faultmanage
* @nameFaultCodeVO
* @Date2024/9/17 15:14
*/
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Tag(name = "故障码视图")
public class FaultCodeVO extends FaultCode {
/**
*
*/
private String faulttypeName;
/**
*
*/
private String messageTypeName;
/**
*
*/
private String messageTypeCode;
/**
*
*/
private String messageTypeBelongs;
}

View File

@ -1,19 +1,9 @@
package com.muyu.server.mapper; package com.muyu.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.base.MPJBaseMapper;
import com.muyu.domain.FaultCode; import com.muyu.domain.FaultCode;
import com.muyu.domain.FaultLabel;
import com.muyu.domain.req.FaultCodeAddReq;
import com.muyu.domain.req.FaultCodeListReq;
import com.muyu.domain.req.FaultCodeUpdReq;
import com.muyu.domain.resp.FaultCodeListResp;
import com.muyu.domain.vo.FaultCodeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import org.apache.ibatis.annotations.Mapper;
/** /**
* *

View File

@ -6,9 +6,7 @@ import com.muyu.domain.FaultCode;
import com.muyu.domain.req.FaultCodeAddReq; import com.muyu.domain.req.FaultCodeAddReq;
import com.muyu.domain.req.FaultCodeListReq; import com.muyu.domain.req.FaultCodeListReq;
import com.muyu.domain.req.FaultCodeUpdReq; import com.muyu.domain.req.FaultCodeUpdReq;
import com.muyu.domain.resp.FaultCodeListResp;
import com.muyu.domain.resp.FaultCodeTotalListResp; import com.muyu.domain.resp.FaultCodeTotalListResp;
import com.muyu.domain.vo.FaultCodeVO;
/** /**

View File

@ -68,7 +68,7 @@ public class CarInformationServiceImpl
.leftJoin(CarType.class, CarType::getCarTypeId, CarInformation::getCarInformationType) .leftJoin(CarType.class, CarType::getCarTypeId, CarInformation::getCarInformationType)
.leftJoin(CarFence.class, CarFence::getId, CarInformation::getCarInformationFence) .leftJoin(CarFence.class, CarFence::getId, CarInformation::getCarInformationFence)
.eq(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN()) .eq(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN())
,CarInformation::getCarInformationVin ,CarInformation::getCarInformationVIN
, carInformationListReq.getCarInformationVIN()) , carInformationListReq.getCarInformationVIN())
.eq(StringUtils.isNotNull(carInformationListReq.getCarTypeId()) .eq(StringUtils.isNotNull(carInformationListReq.getCarTypeId())
,CarType::getCarTypeId, carInformationListReq.getCarTypeId()) ,CarType::getCarTypeId, carInformationListReq.getCarTypeId())
@ -79,7 +79,7 @@ public class CarInformationServiceImpl
,CarInformation::getCarInformationState ,CarInformation::getCarInformationState
, carInformationListReq.getCarInformationState()) , carInformationListReq.getCarInformationState())
.like(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN()) .like(StringUtils.isNotEmpty(carInformationListReq.getCarInformationVIN())
,CarInformation::getCarInformationVin ,CarInformation::getCarInformationVIN
, carInformationListReq.getCarInformationVIN()) , carInformationListReq.getCarInformationVIN())
.eq(StringUtils.isNotEmpty( carInformationListReq.getCarInformationMotorModel()) .eq(StringUtils.isNotEmpty( carInformationListReq.getCarInformationMotorModel())
,CarInformation::getCarInformationMotorModel ,CarInformation::getCarInformationMotorModel

View File

@ -12,7 +12,7 @@ import com.muyu.domain.req.FaultCodeListReq;
import com.muyu.domain.req.FaultCodeUpdReq; import com.muyu.domain.req.FaultCodeUpdReq;
import com.muyu.domain.resp.FaultCodeListResp; import com.muyu.domain.resp.FaultCodeListResp;
import com.muyu.domain.resp.FaultCodeTotalListResp; import com.muyu.domain.resp.FaultCodeTotalListResp;
import com.muyu.domain.vo.FaultCodeVO; import com.muyu.domain.resp.FaultConditionListResp;
import com.muyu.server.mapper.FaultCodeMapper; import com.muyu.server.mapper.FaultCodeMapper;
import com.muyu.server.service.FaultCodeService; import com.muyu.server.service.FaultCodeService;
import com.muyu.server.service.FaultLabelService; import com.muyu.server.service.FaultLabelService;
@ -44,6 +44,8 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
*/ */
@Override @Override
public FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq) { public FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq) {
LambdaQueryWrapper<FaultCode> queryWrapper = new LambdaQueryWrapper<>();
long count = this.count(queryWrapper);
MPJLambdaWrapper<FaultCode> wrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<FaultCode> wrapper = new MPJLambdaWrapper<>();
wrapper.select( wrapper.select(
@ -51,7 +53,6 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
FaultCode::getMessageTypeId, FaultCode::getMessageTypeId,
FaultCode::getFaultcodeNumber, FaultCode::getFaultcodeNumber,
FaultCode::getFaultGroup, FaultCode::getFaultGroup,
FaultCode::getFaultcodeId,
FaultCode::getFaultValue, FaultCode::getFaultValue,
FaultCode::getIsWarning) FaultCode::getIsWarning)
.select( .select(
@ -62,10 +63,9 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
FaultCode::getFaultcodeNumber,faultCodeListReq.getFaultcodeNumber()) FaultCode::getFaultcodeNumber,faultCodeListReq.getFaultcodeNumber())
.eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultBit()), .eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultBit()),
FaultCode::getFaultBit, faultCodeListReq.getFaultBit()); FaultCode::getFaultBit, faultCodeListReq.getFaultBit());
Page<FaultCodeListResp> page = faultCodeMapper.selectJoinPage(new Page<>(faultCodeListReq.getPageNum(), faultCodeListReq.getPageSize()), wrapper.last("LIMIT "+ ((faultCodeListReq.getPageNum()-1)*faultCodeListReq.getPageSize())+", "+faultCodeListReq.getPageSize());
FaultCodeListResp.class, wrapper); List<FaultCodeListResp> faultCodeListResps = faultCodeMapper.selectJoinList(FaultCodeListResp.class, wrapper);
return FaultCodeTotalListResp.faultCodeTotalListResp(faultCodeListResps,count);
return FaultCodeTotalListResp.faultCodeTotalListResp(page.getRecords(),page.getTotal());
} }

View File

@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.muyu.domain.CarType; import com.muyu.domain.CarType;
import com.muyu.domain.FaultCode;
import com.muyu.domain.FaultCondition; import com.muyu.domain.FaultCondition;
import com.muyu.domain.FaultLabel; import com.muyu.domain.FaultLabel;
import com.muyu.domain.req.FaultConditionAddReq; import com.muyu.domain.req.FaultConditionAddReq;
import com.muyu.domain.req.FaultConditionListReq; import com.muyu.domain.req.FaultConditionListReq;
import com.muyu.domain.resp.FaultConditionListResp; import com.muyu.domain.resp.FaultConditionListResp;
import com.muyu.domain.resp.FaultConditionTotalListResp; import com.muyu.domain.resp.FaultConditionTotalListResp;
import com.muyu.domain.resp.FaultLogListResp;
import com.muyu.server.mapper.FaultConditionMapper; import com.muyu.server.mapper.FaultConditionMapper;
import com.muyu.server.service.FaultConditionService; import com.muyu.server.service.FaultConditionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -42,8 +44,14 @@ public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper,
*/ */
@Override @Override
public FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq) { public FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq) {
LambdaQueryWrapper<FaultCondition> queryWrapper = new LambdaQueryWrapper<>();
long count = this.count(queryWrapper);
MPJLambdaWrapper<FaultCondition> wrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<FaultCondition> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(FaultCondition.class) wrapper.select(FaultCondition::getCarconditionId,
FaultCondition::getCarTypeId,
FaultCondition::getMessageTypeId,
FaultCondition::getFaultconditionIdentification,
FaultCondition::getFaultconditionParameter)
.select(CarType::getCarTypeName) .select(CarType::getCarTypeName)
.select(FaultLabel::getMessageTypeName, .select(FaultLabel::getMessageTypeName,
FaultLabel::getMessageTypeCode) FaultLabel::getMessageTypeCode)
@ -55,9 +63,9 @@ public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper,
if (faultConditionListReq.getMessageTypeId()!=0){ if (faultConditionListReq.getMessageTypeId()!=0){
wrapper.eq(FaultLabel::getMessageTypeId, faultConditionListReq.getMessageTypeId()); wrapper.eq(FaultLabel::getMessageTypeId, faultConditionListReq.getMessageTypeId());
} }
Page<FaultConditionListResp> page = faultConditionMapper.selectJoinPage(new Page<>(faultConditionListReq.getPageNum(), faultConditionListReq.getPageSize()), wrapper.last("LIMIT "+ ((faultConditionListReq.getPageNum()-1)*faultConditionListReq.getPageSize())+", "+faultConditionListReq.getPageSize());
FaultConditionListResp.class, wrapper); List<FaultConditionListResp> faultConditionListResps = faultConditionMapper.selectJoinList(FaultConditionListResp.class, wrapper);
return FaultConditionTotalListResp.faultConditionTotalListResp(page.getRecords(),page.getTotal()); return FaultConditionTotalListResp.faultConditionTotalListResp(faultConditionListResps,count);
} }

View File

@ -7,6 +7,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.StringUtils;
import com.muyu.domain.CarInformation; import com.muyu.domain.CarInformation;
import com.muyu.domain.FaultCode; import com.muyu.domain.FaultCode;
import com.muyu.domain.FaultCondition;
import com.muyu.domain.FaultLog; import com.muyu.domain.FaultLog;
import com.muyu.domain.req.FaultLogListReq; import com.muyu.domain.req.FaultLogListReq;
import com.muyu.domain.resp.FaultLogListResp; import com.muyu.domain.resp.FaultLogListResp;
@ -15,6 +16,9 @@ import com.muyu.server.mapper.FaultLogMapper;
import com.muyu.server.service.FaultLogService; import com.muyu.server.service.FaultLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* *
* @Authorweiran * @Authorweiran
@ -35,11 +39,17 @@ public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> i
*/ */
@Override @Override
public FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq) { public FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq) {
LambdaQueryWrapper<FaultLog> queryWrapper = new LambdaQueryWrapper<>();
long count = this.count(queryWrapper);
MPJLambdaWrapper<FaultLog> wrapper = new MPJLambdaWrapper<>(); MPJLambdaWrapper<FaultLog> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(FaultLog.class) wrapper.select(FaultLog::getLogId,
FaultLog::getFaultcodeId,
FaultLog::getCarInformationId,
FaultLog::getCarVin,
FaultLog::getStartwarningTime,
FaultLog::getEndwarningTime)
.select(FaultCode::getFaultcodeNumber) .select(FaultCode::getFaultcodeNumber)
.select(CarInformation::getCarInformationVin) .select(CarInformation::getCarInformationVIN)
.leftJoin(FaultCode.class,FaultCode::getFaultcodeId,FaultLog::getFaultcodeId) .leftJoin(FaultCode.class,FaultCode::getFaultcodeId,FaultLog::getFaultcodeId)
.leftJoin(CarInformation.class,CarInformation::getCarInformationId,FaultLog::getCarInformationId) .leftJoin(CarInformation.class,CarInformation::getCarInformationId,FaultLog::getCarInformationId)
.eq(StringUtils.isNotEmpty(faultLogListReq.getCarVin()), .eq(StringUtils.isNotEmpty(faultLogListReq.getCarVin()),
@ -50,8 +60,8 @@ public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> i
if (faultLogListReq.getEndwarningTime()!=null){ if (faultLogListReq.getEndwarningTime()!=null){
wrapper.eq(FaultLog::getEndwarningTime,faultLogListReq.getEndwarningTime()); wrapper.eq(FaultLog::getEndwarningTime,faultLogListReq.getEndwarningTime());
} }
Page<FaultLogListResp> ipage = faultLogMapper.selectJoinPage(new Page<>(faultLogListReq.getPageNum(), wrapper.last("LIMIT "+ ((faultLogListReq.getPageNum()-1)*faultLogListReq.getPageSize())+", "+faultLogListReq.getPageSize());
faultLogListReq.getPageSize()), FaultLogListResp.class, wrapper); List<FaultLogListResp> faultLogListResps = faultLogMapper.selectJoinList(FaultLogListResp.class, wrapper);
return FaultLogTotalListResp.faultLogTotalListResp(ipage.getRecords(),ipage.getTotal()); return FaultLogTotalListResp.faultLogTotalListResp(faultLogListResps,count);
} }
} }