mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
设备管理-添加配件
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.lihongjie.coal.device.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.device.entity.DevicePartVo;
|
||||
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
@@ -8,6 +9,8 @@ import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CreateDeviceDto extends OrgCommonDto {
|
||||
|
||||
@@ -33,7 +36,7 @@ public class CreateDeviceDto extends OrgCommonDto {
|
||||
@Comment("设备位置")
|
||||
private String location;
|
||||
|
||||
|
||||
private List<DevicePartVo> parts;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.lihongjie.coal.device.dto;
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.base.dto.SimpleDto;
|
||||
import cn.lihongjie.coal.common.DictCode;
|
||||
import cn.lihongjie.coal.device.entity.DevicePartVo;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
|
||||
import jakarta.persistence.ManyToOne;
|
||||
@@ -12,6 +13,8 @@ import lombok.Data;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeviceDto extends OrgCommonDto {
|
||||
|
||||
@@ -41,7 +44,7 @@ public class DeviceDto extends OrgCommonDto {
|
||||
|
||||
private SimpleDto manager;
|
||||
|
||||
|
||||
private List<DevicePartVo> parts;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lihongjie.coal.device.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.device.entity.DevicePartVo;
|
||||
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
@@ -8,6 +9,8 @@ import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UpdateDeviceDto extends OrgCommonDto {
|
||||
@Comment("设备型号")
|
||||
@@ -30,4 +33,6 @@ public class UpdateDeviceDto extends OrgCommonDto {
|
||||
|
||||
@Comment("设备位置")
|
||||
private String location;
|
||||
|
||||
private List<DevicePartVo> parts;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.lihongjie.coal.deviceCategory.entity.DeviceCategoryEntity;
|
||||
import cn.lihongjie.coal.deviceSupplier.entity.DeviceSupplierEntity;
|
||||
import cn.lihongjie.coal.user.entity.UserEntity;
|
||||
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
@@ -13,6 +14,8 @@ import lombok.Data;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class DeviceEntity extends OrgCommonEntity {
|
||||
@@ -46,6 +49,9 @@ public class DeviceEntity extends OrgCommonEntity {
|
||||
|
||||
|
||||
|
||||
@ElementCollection
|
||||
private List<DevicePartVo> parts;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.lihongjie.coal.device.entity;
|
||||
|
||||
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class DevicePartVo {
|
||||
|
||||
|
||||
@Comment("零件编码")
|
||||
private String code;
|
||||
|
||||
@Comment("零件名称")
|
||||
private String name;
|
||||
|
||||
@Comment("零件型号")
|
||||
private String model;
|
||||
|
||||
@Comment("零件厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@Comment("联系方式")
|
||||
private String contact;
|
||||
|
||||
|
||||
@Comment("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Comment("关联附件")
|
||||
@Column(columnDefinition = "text[]")
|
||||
@Type(ListArrayType.class)
|
||||
private List<String> fileIds;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user