Commit 6c857393 by 章家宝

feat:补充提交

1 parent 881b74ef
...@@ -117,9 +117,6 @@ public class InspectionReportExportBean implements Serializable { ...@@ -117,9 +117,6 @@ public class InspectionReportExportBean implements Serializable {
this.createTime = createTime != null ? createTime.format(DATE_TIME_FORMATTER) : ""; this.createTime = createTime != null ? createTime.format(DATE_TIME_FORMATTER) : "";
this.updateTime = updateTime != null ? updateTime.format(DATE_TIME_FORMATTER) : ""; this.updateTime = updateTime != null ? updateTime.format(DATE_TIME_FORMATTER) : "";
// 评分
this.score = vo.getScore() != null ? vo.getScore().toString() : "";
// 绑定状态转换 // 绑定状态转换
this.bindStatus = switch (vo.getBindStatus()) { this.bindStatus = switch (vo.getBindStatus()) {
case 1 -> "已绑定"; case 1 -> "已绑定";
......
...@@ -55,15 +55,6 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep ...@@ -55,15 +55,6 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep
List<InspectionReport> findByBindStatusAndDeleteFlag(Integer bindStatus, String deleteFlag); List<InspectionReport> findByBindStatusAndDeleteFlag(Integer bindStatus, String deleteFlag);
/** /**
* 根据评分级别查询未删除的检测报告
*
* @param scoreLevel 评分级别(ABCDEF)
* @param deleteFlag 删除标识
* @return 检测报告列表
*/
List<InspectionReport> findByScoreLevelAndDeleteFlag(String scoreLevel, String deleteFlag);
/**
* 分页查询检测报告(关联查询车辆、工单信息,避免N+1查询) * 分页查询检测报告(关联查询车辆、工单信息,避免N+1查询)
* 参考 InspectionWorkOrderRepository 的 EntityGraph 写法 * 参考 InspectionWorkOrderRepository 的 EntityGraph 写法
* *
...@@ -72,12 +63,12 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep ...@@ -72,12 +63,12 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep
* @return 检测报告分页结果 * @return 检测报告分页结果
*/ */
@Override @Override
@EntityGraph(attributePaths = {"vehicle", "workOrder"}) @EntityGraph(attributePaths = {"vehicle", "workOrder", "inspectionRecord"})
Page<InspectionReport> findAll(Specification<InspectionReport> spec, Pageable pageable); Page<InspectionReport> findAll(Specification<InspectionReport> spec, Pageable pageable);
List<InspectionReport> findByVehicleAndBindStatusAndDeleteFlag(Vehicle vehicle, int status, String deleteFlag); List<InspectionReport> findByVehicleAndBindStatusAndDeleteFlag(Vehicle vehicle, int status, String deleteFlag);
@EntityGraph(attributePaths = {"vehicle", "workOrder"}) @EntityGraph(attributePaths = {"vehicle", "workOrder", "inspectionRecord"})
Optional<InspectionReport> findByIdAndDeleteFlag(Long id, String deleteFlag); Optional<InspectionReport> findByIdAndDeleteFlag(Long id, String deleteFlag);
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,6 +18,8 @@ import com.glsx.usedcar.module.vehicle.entity.*; ...@@ -18,6 +18,8 @@ import com.glsx.usedcar.module.vehicle.entity.*;
import com.glsx.usedcar.util.RedisCacheUtil; import com.glsx.usedcar.util.RedisCacheUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
...@@ -50,7 +52,9 @@ public class InspectionReportService { ...@@ -50,7 +52,9 @@ public class InspectionReportService {
private final VehicleDao vehicleDao; private final VehicleDao vehicleDao;
private final InspectionRecordRepository inspectionRecordRepository; private final InspectionRecordRepository inspectionRecordRepository;
private final InspectorConfig inspectorConfig; private final InspectorConfig inspectorConfig;
private final InspectionRecordService InspectionRecordService; @Lazy
@Autowired
private InspectionRecordService InspectionRecordService;
// ======================== 日志保存方法(核心,接收真实操作人) ======================== // ======================== 日志保存方法(核心,接收真实操作人) ========================
/** /**
......
package com.glsx.usedcar.module.inspect.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 检测记录返回VO(与检测记录主表一对一)
*/
@Data
@Schema(description = "检测记录返回VO")
public class InspectionRecordRespVO {
@Schema(description = "记录ID", example = "1")
private Long id;
@Schema(description = "关联任务ID(一对一)", example = "1001")
private Long taskId;
@Schema(description = "使用的模版ID", example = "2001")
private Long templateId;
@Schema(description = "模版编码(快照)", example = "INSPECT_TPL_001")
private String templateCode;
@Schema(description = "模版版本号(快照)", example = "V1.0.0")
private String templateVersion;
@Schema(description = "检测进度百分比 0-100", example = "80")
private Integer progress;
@Schema(description = "已完成模块数", example = "5")
private Integer completedModules;
@Schema(description = "所在的一级模块ID", example = "3001")
private Long locationModule;
@Schema(description = "开始检测时间", example = "2026-03-11 09:00:00")
private LocalDateTime startTime;
@Schema(description = "完成检测时间", example = "2026-03-11 10:30:00")
private LocalDateTime completeTime;
@Schema(description = "外观评分", example = "96.00")
private BigDecimal exteriorScore;
@Schema(description = "外观评分依据", example = "车身无明显划痕,漆面保持良好")
private String exteriorComment;
@Schema(description = "骨架评级(A/B/C/D)", example = "A")
private String skeletonLevel;
@Schema(description = "骨架评级依据", example = "骨架无变形、无修复痕迹")
private String skeletonComment;
@Schema(description = "内饰评级(A/B/C/D)", example = "B")
private String interiorLevel;
@Schema(description = "内饰评级依据", example = "座椅轻微磨损,中控台无破损")
private String interiorComment;
@Schema(description = "综合评分", example = "95.50")
private BigDecimal overallScore;
@Schema(description = "综合评价", example = "车辆整体状况良好,无重大事故、火烧、涉水情况")
private String overallComment;
@Schema(description = "扩展字段(JSON格式文本)", example = "{\"key\":\"value\"}")
private String extJson;
@Schema(description = "备注", example = "检测过程顺利")
private String remark;
@Schema(description = "删除标识 N:未删除 D:已删除", example = "N")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,6 @@ import com.glsx.usedcar.module.vehicle.entity.Vehicle; ...@@ -5,7 +5,6 @@ import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
...@@ -23,11 +22,8 @@ public class InspectionReportRespVO { ...@@ -23,11 +22,8 @@ public class InspectionReportRespVO {
@Schema(description = "车辆信息") @Schema(description = "车辆信息")
private Vehicle vehicle; private Vehicle vehicle;
@Schema(description = "检测评分(保留1位小数)", example = "95.5") @Schema(description = "检测记录信息")
private BigDecimal score; private InspectionRecordRespVO inspectionRecord;
@Schema(description = "评分级别(ABCDEF)", example = "A")
private String scoreLevel;
@Schema(description = "绑定状态(1:已绑定;2:未绑定)", example = "1") @Schema(description = "绑定状态(1:已绑定;2:未绑定)", example = "1")
private Integer bindStatus; private Integer bindStatus;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!