feat(asset): add inspection template and record system for vehicle checks
Implement the shared inspection template system backend (Chunk 1) including: - 4 database tables: template, template_item, record, record_item - 3 enums: InspectionSourceType, InspectionStatus, InspectionResult - 4 DO classes, 4 Mapper classes with query methods - 6 VO classes for request/response - MapStruct converter for DO/VO conversions - Template service: CRUD, match by bizType+vehicleType - Record service: create from template, clone, update items, complete - 2 REST controllers with permission annotations - Error codes for inspection and replacement modules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.asset.enums.inspection;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 验车结果枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum InspectionResultEnum {
|
||||
|
||||
PASS(1, "通过"),
|
||||
FAIL(2, "不通过"),
|
||||
NA(3, "不适用");
|
||||
|
||||
/**
|
||||
* 结果
|
||||
*/
|
||||
private final Integer result;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
public static InspectionResultEnum valueOf(Integer result) {
|
||||
return Arrays.stream(values())
|
||||
.filter(item -> item.getResult().equals(result))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.asset.enums.inspection;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 验车来源类型枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum InspectionSourceTypeEnum {
|
||||
|
||||
PREPARE(1, "备车"),
|
||||
DELIVERY(2, "交车"),
|
||||
RETURN(3, "还车");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
public static InspectionSourceTypeEnum valueOf(Integer type) {
|
||||
return Arrays.stream(values())
|
||||
.filter(item -> item.getType().equals(type))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.asset.enums.inspection;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 验车状态枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum InspectionStatusEnum {
|
||||
|
||||
PENDING(0, "待检"),
|
||||
IN_PROGRESS(1, "检查中"),
|
||||
COMPLETED(2, "已完成");
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
public static InspectionStatusEnum valueOf(Integer status) {
|
||||
return Arrays.stream(values())
|
||||
.filter(item -> item.getStatus().equals(status))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user