Browse Source

企业增加附件字段,创建附件实体

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@282 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 years ago
parent
commit
05ebd0090e

+ 74 - 0
src/main/java/com/uas/platform/b2b/model/Attach.java

@@ -0,0 +1,74 @@
+package com.uas.platform.b2b.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="attachs")
+public class Attach {
+	
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "attachs_gen")
+	@SequenceGenerator(name = "attachs_gen", sequenceName = "attachs_seq", allocationSize = 1)
+	@Column(name = "at_id")
+	private Long atId;
+	/**
+	 * 路径
+	 */
+	@Column(name = "at_path")
+	private String atPath;
+	/**
+	 * 描述语
+	 */
+	@Column(name = "at_description")
+	private String atDescription;
+	/**
+	 * 文件类型
+	 */
+	@Column(name="at_type")
+	private String atType;
+	/**
+	 * 文件名称
+	 */
+	@Column(name="at_name")
+	private String atName;
+	
+	public Long getAtId() {
+		return atId;
+	}
+	public void setAtId(Long atId) {
+		this.atId = atId;
+	}
+	public String getAtPath() {
+		return atPath;
+	}
+	public void setAtPath(String atPath) {
+		this.atPath = atPath;
+	}
+	public String getAtDescription() {
+		return atDescription;
+	}
+	public void setAtDescription(String atDescription) {
+		this.atDescription = atDescription;
+	}
+	public String getAtType() {
+		return atType;
+	}
+	public void setAtType(String atType) {
+		this.atType = atType;
+	}
+	public String getAtName() {
+		return atName;
+	}
+	public void setAtName(String atName) {
+		this.atName = atName;
+	}
+	
+	
+
+}

+ 30 - 0
src/main/java/com/uas/platform/b2b/model/Enterprise.java

@@ -6,9 +6,12 @@ import java.io.Serializable;
 import java.util.Date;
 
 import javax.persistence.Cacheable;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 import javax.validation.constraints.NotNull;
@@ -94,6 +97,17 @@ public class Enterprise implements Serializable {
 	 */
 	@Column(name = "en_businesscode")
 	private String enBusinesscode;
+	/**
+	 * 营业执照图片路径id
+	 */
+	@OneToOne(cascade = { CascadeType.ALL })
+	@JoinColumn(name = "en_bussinesscodeattach", insertable = false, updatable = false)
+	private Attach enBussinesscodeAttach;
+	/**
+	 * 产品ID
+	 */
+	@Column(name = "en_bussinesscodeattach")
+	private Long enBussinesscodeAttachId;
 	/**
 	 * 纳税人识别号
 	 */
@@ -278,6 +292,22 @@ public class Enterprise implements Serializable {
 		this.enEmail = enEmail;
 	}
 
+	public Attach getEnBussinesscodeAttach() {
+		return enBussinesscodeAttach;
+	}
+
+	public void setEnBussinesscodeAttach(Attach enBussinesscodeAttach) {
+		this.enBussinesscodeAttach = enBussinesscodeAttach;
+	}
+
+	public Long getEnBussinesscodeAttachId() {
+		return enBussinesscodeAttachId;
+	}
+
+	public void setEnBussinesscodeAttachId(Long enBussinesscodeAttachId) {
+		this.enBussinesscodeAttachId = enBussinesscodeAttachId;
+	}
+
 	@JsonIgnore
 	public boolean isEnabled() {
 		return this.getEnable() != null && this.getEnable() == Constant.YES;

+ 15 - 0
src/main/java/com/uas/platform/b2b/model/FileUpload.java

@@ -0,0 +1,15 @@
+package com.uas.platform.b2b.model;
+
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+public class FileUpload {
+	private CommonsMultipartFile file;
+
+	public CommonsMultipartFile getFile() {
+		return file;
+	}
+
+	public void setFile(CommonsMultipartFile file) {
+		this.file = file;
+	}
+}