Commit 9be30d29 by 章家宝

feat:检测报告代码提交

1 parent 28179408
......@@ -97,14 +97,14 @@ public class InspectionWorkOrderController {
@Operation(summary = "分页检测工单", description = "分页查询检测工单列表")
@PostMapping("/page")
public BaseResp<Page<InspectionWORespVO>> pageList(@Valid @RequestBody Pagination<InspectionWorkOrder> pagination) {
public Page<InspectionWORespVO> pageList(@Valid @RequestBody Pagination<InspectionWorkOrder> pagination) {
log.info("分页查询检测工单请求: offset={}, limit={}", pagination.getOffset(), pagination.getLimit());
try {
Page<InspectionWORespVO> result = inspectionWorkOrderService.pageList(pagination);
return BaseResp.success(result);
return result;
} catch (Exception e) {
log.error("分页查询检测工单失败!系统异常!", e);
return BaseResp.fail("系统异常: " + e.getMessage());
return null;
}
}
......
package com.glsx.usedcar.converts;
import com.glsx.usedcar.module.inspect.entity.InspectionReportOpLog;
import com.glsx.usedcar.module.inspect.vo.InspectionReportOpLogRespVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* 检测报告日志实体转VO转换器
*/
@Mapper(componentModel = "spring")
public interface InspectionReportOpLogConverter {
InspectionReportOpLogConverter INSTANCE = Mappers.getMapper(InspectionReportOpLogConverter.class);
/**
* 单条日志实体转VO
*/
InspectionReportOpLogRespVO inspectionReportOpLogMapRespVO(InspectionReportOpLog opLog);
/**
* 日志列表实体转VO列表
*/
List<InspectionReportOpLogRespVO> inspectionReportOpLogMapRespVO(List<InspectionReportOpLog> opLogList);
}
\ No newline at end of file
......@@ -74,4 +74,10 @@ public interface InspectionReportRepository extends BaseRepository<InspectionRep
@Override
@EntityGraph(attributePaths = {"vehicle", "workOrder"})
Page<InspectionReport> findAll(Specification<InspectionReport> spec, Pageable pageable);
List<InspectionReport> findByVehicleAndBindStatusAndDeleteFlag(Vehicle vehicle, int status, String deleteFlag);
@EntityGraph(attributePaths = {"vehicle", "workOrder"})
Optional<InspectionReport> findByIdAndDeleteFlag(Long id, String deleteFlag);
}
\ No newline at end of file
......@@ -2,9 +2,7 @@ package com.glsx.usedcar.module.inspect.entity;
import com.fasterxml.jackson.annotation.JsonView;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.*;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
......@@ -77,6 +75,15 @@ public class InspectionReportOpLog extends AuditingEntity implements Serializabl
@Column(name = "operator_id", nullable = false)
private Long operatorId;
/**
* 平台标识:0 检测师 1 后台(修正:原注释错误标注为操作类型)
*/
@JsonView(value = InspectionWorkOrderOpLog.Summary.class)
@NotNull(groups = {CreateValidGroup.class, UpdateValidGroup.class})
@Column(name = "plate_type", nullable = false, columnDefinition = "tinyint(2)") // 对齐MySQL的tinyint(2)类型
private Integer plateType;
/**
* 操作人姓名
*/
......
package com.glsx.usedcar.module.inspect.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.*;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "检测报告详情返回")
public class InspectionReportDetailRespVO {
@Schema(description = "报告ID")
private Long id;
@Schema(description = "关联工单ID")
private Long workOrderId;
@Schema(description = "检测结论")
private String conclusion;
@Schema(description = "报告信息")
private InspectionReportRespVO inspectionReportRespVO;
@Schema(description = "检测评分")
private Double score;
@Schema(description = "日志信息")
private List<InspectionReportOpLogRespVO> logList;
}
\ No newline at end of file
package com.glsx.usedcar.module.inspect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@Schema(description = "检测报告日志信息")
public class InspectionReportOpLogRespVO {
/**
* 操作类型
* 1:创建报告;2:修改评分/级别;3:修改绑定状态;4:绑定报告;5:解绑报告;6:删除报告;7:其他修改
*/
@Schema(description = "操作类型 1:创建报告;2:修改评分/级别;3:修改绑定状态;4:绑定报告;5:解绑报告;6:删除报告;7:其他修改")
private Integer operationType;
/**
* 操作内容描述
*/
@Schema(description = "操作内容描述")
private String operationContent;
/**
* 操作时间
*/
@Schema(description = "操作时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime operationTime;
/**
* 操作描述
*/
@Schema(description = "操作描述")
private String description;
/**
* 操作人姓名
*/
@Schema(description = "操作人姓名")
private String operatorName;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import java.math.BigDecimal;
@Data
@Schema(description = "检测报告分页返回")
public class InspectionReportRespVO {
@Schema(description = "报告ID", example = "10001")
@Schema(description = "报告ID")
private Long id;
@Schema(description = "报告编号(唯一)", example = "REPORT20260317001")
......
......@@ -20,10 +20,6 @@ public class InspectionReportUpdateVO implements Serializable {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "1")
private Long id;
@Schema(description = "报告编号(唯一)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "REP20260312001")
@Size(max = 50, message = "报告编号长度不能超过50个字符")
private String reportNo;
@Schema(description = "关联工单号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "WO20260312001")
@Size(max = 50, message = "关联工单号长度不能超过50个字符")
private String woId;
......@@ -31,26 +27,6 @@ public class InspectionReportUpdateVO implements Serializable {
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "1001")
private Integer vehicleId;
@Schema(description = "车型名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2023款 宝马3系 325Li M运动套装")
@Size(max = 128, message = "车型名称长度不能超过128个字符")
private String carTypeName;
@Schema(description = "车源号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "CS20260312001")
@Size(max = 64, message = "车源号长度不能超过64个字符")
private String carSourceNo;
@Schema(description = "车辆识别码(VIN码)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "LVGDS123456789012")
@Size(max = 17, message = "VIN码长度不能超过17个字符")
private String vin;
@Schema(description = "车牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "京A12345")
@Size(max = 20, message = "车牌号长度不能超过20个字符")
private String plateNo;
@Schema(description = "车辆状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "AUCTIONING")
@Size(max = 64, message = "车辆状态长度不能超过64个字符")
private String vehicleStatus;
@Schema(description = "评分(保留1位小数)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "4.0")
private BigDecimal score;
......@@ -58,9 +34,6 @@ public class InspectionReportUpdateVO implements Serializable {
@Size(max = 1, message = "评分级别只能是单个字符")
private String scoreLevel;
@Schema(description = "绑定状态(1:已绑定;2:未绑定)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2")
private Integer bindStatus;
@Schema(description = "H5链接地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "https://xxx.com/report/REP20260312001")
@Size(max = 512, message = "H5链接地址长度不能超过512个字符")
private String h5Url;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!