|
@@ -3,7 +3,9 @@ package com.om.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.om.entity.dto.AppDiagLogDTO;
|
|
|
import com.om.entity.dto.DiaLogQueryPageDTO;
|
|
|
+import com.om.entity.dto.DiagnoseLogVehicleInfo;
|
|
|
import com.om.entity.po.*;
|
|
|
import com.om.entity.vo.DiaLogQueryPageVO;
|
|
|
import com.om.entity.vo.DiaLogQueryVO;
|
|
@@ -15,6 +17,7 @@ import com.om.utils.HuaweiObsUtil;
|
|
|
import com.om.utils.Result;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDate;
|
|
@@ -170,4 +173,42 @@ public class DiagnosticLogServiceImpl extends ServiceImpl<DiagnosticLogMapper, D
|
|
|
String downloadUrl = obsUtil.getDownloadUrl(nameLog, prefix);
|
|
|
return Result.ok(downloadUrl);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public Result updateDiagLog(AppDiagLogDTO dto) {
|
|
|
+ if (BeanUtil.isEmpty(dto)){
|
|
|
+ throw new BadReqException("参数为空!!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String guid = dto.getGuid();
|
|
|
+
|
|
|
+ List<DiagnoseLogVehicleInfo> vehicleInfo = dto.getVehicleInfo();
|
|
|
+
|
|
|
+ for (DiagnoseLogVehicleInfo diagnoseLogVehicleInfo : vehicleInfo) {
|
|
|
+ DiagnosticLog diagnosticLog = BeanUtil.copyProperties(diagnoseLogVehicleInfo, DiagnosticLog.class);
|
|
|
+
|
|
|
+ VciInfo vciInfo = vciInfoService.lambdaQuery()
|
|
|
+ .eq(VciInfo::getVciNum, diagnoseLogVehicleInfo.getVciSn())
|
|
|
+ .one();
|
|
|
+ if (BeanUtil.isEmpty(vciInfo)){
|
|
|
+ throw new BadReqException("该vci设备不存在!!!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Brand brand = brandService.lambdaQuery()
|
|
|
+ .eq(Brand::getBrandCn, diagnoseLogVehicleInfo.getBrand())
|
|
|
+ .one();
|
|
|
+ if (BeanUtil.isEmpty(brand)){
|
|
|
+ throw new BadReqException("该品牌不存在!!!");
|
|
|
+ }
|
|
|
+ diagnosticLog.setVciId(vciInfo.getId());
|
|
|
+ diagnosticLog.setBrandId(brand.getId());
|
|
|
+ diagnosticLog.setCreateTime(LocalDateTime.now());
|
|
|
+ diagnosticLog.setUpdateTime(LocalDateTime.now());
|
|
|
+ //todo 上传
|
|
|
+ this.save(diagnosticLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.ok();
|
|
|
+ }
|
|
|
}
|