|
@@ -60,34 +60,13 @@ public class DiagnosticLogServiceImpl extends ServiceImpl<DiagnosticLogMapper, D
|
|
|
Integer pageSize = dto.getPageSize();
|
|
|
LocalDateTime beginTime = dto.getBeginTime();
|
|
|
LocalDateTime endTime = dto.getEndTime();
|
|
|
- User one = new User();
|
|
|
- if (StringUtils.isNotBlank(dto.getAccount())) {
|
|
|
- //根据用户名查询用户
|
|
|
- one = userService.lambdaQuery()
|
|
|
- .eq(User::getUsername, dto.getAccount())
|
|
|
- .one();
|
|
|
-
|
|
|
- if (BeanUtil.isEmpty(one)){
|
|
|
- throw new BadReqException("该查询用户不存在");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ String vciSn = dto.getVciSn();
|
|
|
+ String account = dto.getAccount();
|
|
|
|
|
|
- VciInfo vciInfo = new VciInfo();
|
|
|
- if (StringUtils.isNotBlank(dto.getVciSn())) {
|
|
|
- //根据vciSn查询VCI
|
|
|
- vciInfo = vciInfoService.lambdaQuery()
|
|
|
- .eq(VciInfo::getVciNum, dto.getVciSn())
|
|
|
- .one();
|
|
|
-
|
|
|
- if (BeanUtil.isEmpty(vciInfo)){
|
|
|
- throw new BadReqException("该查询vci不存在");
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
Page<DiagnosticLog> page = this.lambdaQuery()
|
|
|
- .like(StringUtils.isNotBlank(dto.getAccount()), DiagnosticLog::getUserId, one.getId())
|
|
|
- .like(StringUtils.isNotBlank(dto.getVciSn()), DiagnosticLog::getVciId, vciInfo.getId())
|
|
|
+ .like(StringUtils.isNotBlank(account), DiagnosticLog::getUsername, account)
|
|
|
+ .like(StringUtils.isNotBlank(vciSn), DiagnosticLog::getVciSn, vciSn)
|
|
|
.ge(beginTime != null, DiagnosticLog::getCreateTime, beginTime)
|
|
|
.le(endTime != null, DiagnosticLog::getCreateTime, endTime)
|
|
|
.orderByDesc(DiagnosticLog::getCreateTime)
|
|
@@ -107,16 +86,14 @@ public class DiagnosticLogServiceImpl extends ServiceImpl<DiagnosticLogMapper, D
|
|
|
List<DiaLogQueryVO> diaLogQueryVOS = new ArrayList<>();
|
|
|
for (DiagnosticLog record : records) {
|
|
|
DiaLogQueryVO diaLogQueryVO = BeanUtil.copyProperties(record, DiaLogQueryVO.class);
|
|
|
- User user = userService.getById(record.getUserId());
|
|
|
- diaLogQueryVO.setAccount(user.getUsername());
|
|
|
+ diaLogQueryVO.setAccount(record.getUsername());
|
|
|
Brand brand = brandService.getById(record.getBrandId());
|
|
|
diaLogQueryVO.setBrand(brand.getBrandCn());
|
|
|
|
|
|
Client client = clientService.getById(record.getClientId());
|
|
|
diaLogQueryVO.setClientNum(client.getNumber());
|
|
|
|
|
|
- VciInfo vci = vciInfoService.getById(record.getVciId());
|
|
|
- diaLogQueryVO.setVciSn(vci.getVciNum());
|
|
|
+ diaLogQueryVO.setVciSn(record.getVciSn());
|
|
|
|
|
|
//todo 车型id vehicleId 查询车型
|
|
|
|
|
@@ -201,7 +178,7 @@ public class DiagnosticLogServiceImpl extends ServiceImpl<DiagnosticLogMapper, D
|
|
|
if (BeanUtil.isEmpty(brand)){
|
|
|
throw new BadReqException("该品牌不存在!!!");
|
|
|
}
|
|
|
- diagnosticLog.setVciId(vciInfo.getId());
|
|
|
+ diagnosticLog.setVciSn(vciInfo.getVciNum());
|
|
|
diagnosticLog.setBrandId(brand.getId());
|
|
|
diagnosticLog.setCreateTime(LocalDateTime.now());
|
|
|
diagnosticLog.setUpdateTime(LocalDateTime.now());
|