forked from dyf/fys-Multi-tenant
feat(equipment): 添加设备维修图片功能并优化维修记录相关接口- 新增 DeviceRepairImages 相关实体、Mapper 和 XML 文件- 重构 DeviceRepairRecords 相关接口和实现类,支持图片上传
- 新增 RepairImageType 枚举类 - 优化 DeviceRepairRecordsVo,增加图片列表和设备名称字段
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
package com.fuyuanshen.equipment.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import com.fuyuanshen.equipment.enums.RepairImageType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设备维修图片对象 device_repair_images
|
||||
*
|
||||
*
|
||||
* @date 2025-09-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("device_repair_images")
|
||||
public class DeviceRepairImages extends TenantEntity {
|
||||
/**
|
||||
* 维修图片ID
|
||||
*/
|
||||
@TableId(value = "image_id", type = IdType.AUTO)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private Long imageId;
|
||||
/**
|
||||
* 维修记录ID
|
||||
*/
|
||||
@Schema(title = "维修记录ID")
|
||||
private Long recordId;
|
||||
/**
|
||||
* 图片类型(维修前/维修后)
|
||||
*/
|
||||
@Schema(title = "图片类型(维修前/维修后)")
|
||||
private RepairImageType imageType;
|
||||
/**
|
||||
* 图片存储路径
|
||||
*/
|
||||
@Schema(title = "图片存储路径")
|
||||
private String imageUrl;
|
||||
}
|
||||
@ -26,7 +26,8 @@ public class DeviceRepairRecords extends TenantEntity {
|
||||
/**
|
||||
* 维修记录ID
|
||||
*/
|
||||
@TableId(value = "record_id")
|
||||
@TableId(value = "record_id", type = IdType.AUTO)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
package com.fuyuanshen.equipment.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||
import com.fuyuanshen.equipment.domain.DeviceRepairRecords;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 设备维修记录业务对象 device_repair_records
|
||||
@ -37,6 +41,7 @@ public class DeviceRepairRecordsBo extends BaseEntity {
|
||||
/**
|
||||
* 维修时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotNull(message = "维修时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date repairTime;
|
||||
|
||||
@ -58,5 +63,11 @@ public class DeviceRepairRecordsBo extends BaseEntity {
|
||||
@NotBlank(message = "维修人员不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String repairPerson;
|
||||
|
||||
@Schema(title = "维修前图片")
|
||||
@JsonIgnore
|
||||
private MultipartFile beforeFile;
|
||||
|
||||
@Schema(title = "维修后图片")
|
||||
@JsonIgnore
|
||||
private MultipartFile afterFile;
|
||||
}
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
package com.fuyuanshen.equipment.domain.query;
|
||||
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备维修记录查询
|
||||
*
|
||||
* @Description:
|
||||
* @Author: WY
|
||||
* @Date: 2025/5/16
|
||||
**/
|
||||
@Data
|
||||
public class DeviceRepairRecordsQueryCriteria extends BaseEntity {
|
||||
/**
|
||||
* 维修记录ID
|
||||
*/
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 维修时间
|
||||
*/
|
||||
private Date repairTime;
|
||||
|
||||
/**
|
||||
* 维修部位
|
||||
*/
|
||||
private String repairPart;
|
||||
|
||||
/**
|
||||
* 维修原因
|
||||
*/
|
||||
private String repairReason;
|
||||
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
private String repairPerson;
|
||||
|
||||
@Schema(title = "维修开始时间")
|
||||
private Date repairBeginTime;
|
||||
@Schema(title = "维修结束时间")
|
||||
private Date repairEndTime;
|
||||
|
||||
@Schema(title = "所属客户")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(title = "com.fuyuanshen")
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private Integer pageNum = 1;
|
||||
|
||||
/**
|
||||
* 每页数据量
|
||||
*/
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.fuyuanshen.equipment.domain.DeviceRepairImages;
|
||||
import com.fuyuanshen.equipment.domain.DeviceRepairRecords;
|
||||
import com.fuyuanshen.equipment.enums.RepairImageType;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 设备维修图片视图对象 device_repair_records
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-01
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DeviceRepairImages.class)
|
||||
public class DeviceRepairImagesVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 维修图片ID
|
||||
*/
|
||||
@Schema(title = "维修图片ID")
|
||||
private Long imageId;
|
||||
/**
|
||||
* 维修记录ID
|
||||
*/
|
||||
@Schema(title = "维修记录ID")
|
||||
private Long recordId;
|
||||
/**
|
||||
* 图片类型(维修前/维修后)
|
||||
*/
|
||||
@Schema(title = "图片类型(维修前/维修后)")
|
||||
private RepairImageType imageType;
|
||||
/**
|
||||
* 图片存储路径
|
||||
*/
|
||||
@Schema(title = "图片存储路径")
|
||||
private String imageUrl;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import com.fuyuanshen.equipment.domain.DeviceRepairRecords;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
@ -13,7 +14,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -25,7 +26,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DeviceRepairRecords.class)
|
||||
public class DeviceRepairRecordsVo implements Serializable {
|
||||
public class DeviceRepairRecordsVo extends TenantEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -65,6 +66,12 @@ public class DeviceRepairRecordsVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "维修人员")
|
||||
private String repairPerson;
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
private List<DeviceRepairImagesVo> images;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user