diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 36547a7..2d1246f 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -51,6 +51,28 @@ } /** + * 根据设备类型获取设备信息 + */ + @POST + @Path("getPgDeviceByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgDeviceByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceDtoList=new ArrayList(); + try { + pgDeviceDtoList = pgDeviceManager.getDeviceByDevTypee(devType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgDeviceDtoList); + return resultMap; + } + + /** * 获取设备信息 */ @POST diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 36547a7..2d1246f 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -51,6 +51,28 @@ } /** + * 根据设备类型获取设备信息 + */ + @POST + @Path("getPgDeviceByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgDeviceByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceDtoList=new ArrayList(); + try { + pgDeviceDtoList = pgDeviceManager.getDeviceByDevTypee(devType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgDeviceDtoList); + return resultMap; + } + + /** * 获取设备信息 */ @POST diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 249b75c..88ad11e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -78,7 +78,9 @@ resultMap.put("msg", msg); return resultMap; } - + /* + *编辑分区 + */ @POST @Path("editPartition") @Produces(MediaType.APPLICATION_JSON) @@ -190,17 +192,17 @@ } /** - * 获取分区信息 + * 根据编号获取分区信息 */ @POST - @Path("getPartitionListByRoad") + @Path("getPartitionListByName") @Produces(MediaType.APPLICATION_JSON) - public Map getPartitionListByRoad(@FormParam("road") String road) throws Exception { + public Map getPartitionListByName(@FormParam("parName") String parName) throws Exception { Map resultMap = new HashMap(); String msg = ""; List pgPartitionDtoList = new ArrayList(); try { - pgPartitionDtoList = pgPartitionManager.getPartitionByRoad(road); + pgPartitionDtoList = pgPartitionManager.getPartitionByName(parName); msg = "获取成功"; } catch (Exception e) { msg = "获取失败"; @@ -211,5 +213,4 @@ return resultMap; } - } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 36547a7..2d1246f 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -51,6 +51,28 @@ } /** + * 根据设备类型获取设备信息 + */ + @POST + @Path("getPgDeviceByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgDeviceByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceDtoList=new ArrayList(); + try { + pgDeviceDtoList = pgDeviceManager.getDeviceByDevTypee(devType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgDeviceDtoList); + return resultMap; + } + + /** * 获取设备信息 */ @POST diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 249b75c..88ad11e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -78,7 +78,9 @@ resultMap.put("msg", msg); return resultMap; } - + /* + *编辑分区 + */ @POST @Path("editPartition") @Produces(MediaType.APPLICATION_JSON) @@ -190,17 +192,17 @@ } /** - * 获取分区信息 + * 根据编号获取分区信息 */ @POST - @Path("getPartitionListByRoad") + @Path("getPartitionListByName") @Produces(MediaType.APPLICATION_JSON) - public Map getPartitionListByRoad(@FormParam("road") String road) throws Exception { + public Map getPartitionListByName(@FormParam("parName") String parName) throws Exception { Map resultMap = new HashMap(); String msg = ""; List pgPartitionDtoList = new ArrayList(); try { - pgPartitionDtoList = pgPartitionManager.getPartitionByRoad(road); + pgPartitionDtoList = pgPartitionManager.getPartitionByName(parName); msg = "获取成功"; } catch (Exception e) { msg = "获取失败"; @@ -211,5 +213,4 @@ return resultMap; } - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 4c9feac..1eeb589 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -18,7 +18,9 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -52,29 +54,6 @@ } /** - * 获取管线信息 - */ - @POST - @Path("getPipeLineByName") - @Produces(MediaType.APPLICATION_JSON) - public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception { - Map resultMap = new HashMap(); - String msg = ""; - PgPipeLineDto pgPipeLineDto=null; - try { - PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); - pgPipeLineDto=new PgPipeLineDto(pgPipeLine); - msg = "获取成功"; - } catch (Exception e) { - msg = "获取失败"; - e.printStackTrace(); - } - resultMap.put("msg", msg); - resultMap.put("result", pgPipeLineDto); - return resultMap; - } - - /** * 新增管线 */ @POST @@ -232,6 +211,51 @@ return resultMap; } + /* + * 根据管线类型获取管线列表 + */ + @POST + @Path("getPipeLineByLineType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByLineType(@FormParam("lineType") String lineType) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgPipeLineDtoList=new ArrayList(); + try { + pgPipeLineDtoList = pgPipeLineManager.getPipeLineByLineType(lineType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDtoList); + return resultMap; + } + /** + * 根据管线名称获取管线信息 + */ + @POST + @Path("getPipeLineByName") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByName(@FormParam("lineName") String lineName) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgPipeLineDto pgPipeLineDto=null; + try { + PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); + pgPipeLineDto=new PgPipeLineDto(pgPipeLine); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDto); + return resultMap; + } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 36547a7..2d1246f 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -51,6 +51,28 @@ } /** + * 根据设备类型获取设备信息 + */ + @POST + @Path("getPgDeviceByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgDeviceByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceDtoList=new ArrayList(); + try { + pgDeviceDtoList = pgDeviceManager.getDeviceByDevTypee(devType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgDeviceDtoList); + return resultMap; + } + + /** * 获取设备信息 */ @POST diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 249b75c..88ad11e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -78,7 +78,9 @@ resultMap.put("msg", msg); return resultMap; } - + /* + *编辑分区 + */ @POST @Path("editPartition") @Produces(MediaType.APPLICATION_JSON) @@ -190,17 +192,17 @@ } /** - * 获取分区信息 + * 根据编号获取分区信息 */ @POST - @Path("getPartitionListByRoad") + @Path("getPartitionListByName") @Produces(MediaType.APPLICATION_JSON) - public Map getPartitionListByRoad(@FormParam("road") String road) throws Exception { + public Map getPartitionListByName(@FormParam("parName") String parName) throws Exception { Map resultMap = new HashMap(); String msg = ""; List pgPartitionDtoList = new ArrayList(); try { - pgPartitionDtoList = pgPartitionManager.getPartitionByRoad(road); + pgPartitionDtoList = pgPartitionManager.getPartitionByName(parName); msg = "获取成功"; } catch (Exception e) { msg = "获取失败"; @@ -211,5 +213,4 @@ return resultMap; } - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 4c9feac..1eeb589 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -18,7 +18,9 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -52,29 +54,6 @@ } /** - * 获取管线信息 - */ - @POST - @Path("getPipeLineByName") - @Produces(MediaType.APPLICATION_JSON) - public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception { - Map resultMap = new HashMap(); - String msg = ""; - PgPipeLineDto pgPipeLineDto=null; - try { - PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); - pgPipeLineDto=new PgPipeLineDto(pgPipeLine); - msg = "获取成功"; - } catch (Exception e) { - msg = "获取失败"; - e.printStackTrace(); - } - resultMap.put("msg", msg); - resultMap.put("result", pgPipeLineDto); - return resultMap; - } - - /** * 新增管线 */ @POST @@ -232,6 +211,51 @@ return resultMap; } + /* + * 根据管线类型获取管线列表 + */ + @POST + @Path("getPipeLineByLineType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByLineType(@FormParam("lineType") String lineType) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgPipeLineDtoList=new ArrayList(); + try { + pgPipeLineDtoList = pgPipeLineManager.getPipeLineByLineType(lineType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDtoList); + return resultMap; + } + /** + * 根据管线名称获取管线信息 + */ + @POST + @Path("getPipeLineByName") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByName(@FormParam("lineName") String lineName) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgPipeLineDto pgPipeLineDto=null; + try { + PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); + pgPipeLineDto=new PgPipeLineDto(pgPipeLine); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDto); + return resultMap; + } } diff --git a/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java b/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java deleted file mode 100644 index 2360251..0000000 --- a/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.casic.PgInterface.rs; - -import com.casic.PgInterface.devTable.domain.PgPartition; -import com.casic.PgInterface.devTable.domain.PgTexture; -import com.casic.PgInterface.devTable.domain.PipeGallery; -import com.casic.PgInterface.devTable.dto.PgTextureDto; -import com.casic.PgInterface.devTable.manager.PgPartitionManager; -import com.casic.PgInterface.devTable.manager.PgTextureManager; -import com.casic.PgInterface.devTable.manager.PipeGalleryManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.ws.rs.FormParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by yxw on 2017/11/7. - */ -@Component -@Path("pgTexture") -public class PgTextureRs { - - private static Logger logger = LoggerFactory.getLogger(PgTextureRs.class); - - private PgTextureManager pgTextureManager; - - private PipeGalleryManager pipeGalleryManager; - - private PgPartitionManager pgPartitionManager; - - @Resource - public void setPgTextureManager(PgTextureManager pgTextureManager) { - this.pgTextureManager = pgTextureManager; - } - - @Resource - public void setPipeGalleryManager(PipeGalleryManager pipeGalleryManager) { - this.pipeGalleryManager = pipeGalleryManager; - } - - @Resource - public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { - this.pgPartitionManager = pgPartitionManager; - } - - /** - * 获取管廊部件信息 - */ - @POST - @Path("getPgTextureByName") - @Produces(MediaType.APPLICATION_JSON) - public Map getPgTexture(@FormParam("textureName") String textureName) throws Exception { - Map resultMap = new HashMap(); - String msg = ""; - PgTextureDto pgTextureDto=null; - try { - PgTexture pgTexture = pgTextureManager.getPgTextureByName(textureName); - pgTextureDto=new PgTextureDto(pgTexture); - msg = "获取成功"; - } catch (Exception e) { - msg = "获取失败"; - e.printStackTrace(); - } - resultMap.put("msg", msg); - resultMap.put("result", pgTextureDto); - return resultMap; - } - - /** - * 新增管廊部件 - */ - @POST - @Path("addTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map addTexture(@FormParam("textureName") String textureName, - @FormParam("textureMaterial") String textureMaterial, - @FormParam("layerNum") String layerNum, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("buildDate") String buildDate, - @FormParam("pgName") String pgName, - @FormParam("parName") String parName) - throws Exception { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - Map resultMap = new HashMap(); - String result = ""; - String msg = ""; - PgTexture pgTexture = new PgTexture(); - - - PgPartition pgPartition = pgPartitionManager.getPartitionByParName(parName); - PipeGallery pipeGallery = pipeGalleryManager.getPipeGalleryByPgName(pgName,pgPartition); - - if (pgPartition == null) { - result = "false"; - msg = "不存在管廊仓和分区信息"; - } else { - try { - if(pgTextureManager.getPgTextureByName(textureName)!=null) - { - result = "false"; - msg = "已存在同名的部件"; - } - else { - pgTexture.setTextureName(textureName); - pgTexture.setTextureMaterial(textureMaterial); - pgTexture.setLayerNum(layerNum); - pgTexture.setOwnerUnit(ownerUnit); - pgTexture.setBuildDate(sdf.parse(buildDate)); - pgTexture.setPipeGalleryId(pipeGallery); - pgTexture.setActive(1); - - pgTextureManager.save(pgTexture); - result = "true"; - msg = "保存成功"; - } - } catch (Exception e) { - result = "false"; - msg = "保存失败"; - e.printStackTrace(); - } - resultMap.put("success", result); - resultMap.put("msg", msg); - } - resultMap.put("result",result); - resultMap.put("msg",msg); - return resultMap; - } - - /** - * 编辑管廊部件 - */ - @POST - @Path("editTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map editTexture(@FormParam("id") String id, - @FormParam("textureName") String textureName, - @FormParam("textureMaterial") String textureMaterial, - @FormParam("layerNum") String layerNum, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("buildDate") String buildDate, - @FormParam("pgName") String pgName, - @FormParam("parName") String parName) throws Exception { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - Map resultMap = new HashMap(); - String result = ""; - String msg = ""; - - PgPartition pgPartition = pgPartitionManager.getPartitionByParName(parName); - PipeGallery pipeGallery = pipeGalleryManager.getPipeGalleryByPgName(pgName,pgPartition); - if (pgPartition == null) { - result = "false"; - msg = "不存在管廊仓和分区信息"; - } else { - try { - /* - if(pgTextureManager.getPgTextureByName(textureName)!=null) - { - result = "false"; - msg = "已存在同名的部件"; - } - else { - */ - PgTexture pgTexture = pgTextureManager.get(Long.valueOf(id)); - pgTexture.setTextureName(textureName); - pgTexture.setTextureMaterial(textureMaterial); - pgTexture.setLayerNum(layerNum); - pgTexture.setOwnerUnit(ownerUnit); - pgTexture.setBuildDate(sdf.parse(buildDate)); - pgTexture.setPipeGalleryId(pipeGallery); - pgTexture.setActive(1); - - pgTextureManager.save(pgTexture); - result = "true"; - msg = "编辑成功"; - //} - } catch (Exception e) { - result = "false"; - msg = "编辑失败"; - e.printStackTrace(); - } - } - resultMap.put("result",result); - resultMap.put("msg",msg); - return resultMap; - } - - /** - * 删除管廊部件 - */ - @POST - @Path("deleteTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map deleteTexture(@FormParam("id") String id)throws Exception { - - Map resultMap = new HashMap(); - String msg=""; - String result="false"; - - try { - PgTexture pgTexture=pgTextureManager.get(Long.valueOf(id)); - if(pgTexture==null) { - msg = "不存在该部件信息"; - result="false"; - } - else - { - pgTexture.setActive(0); - pgTextureManager.save(pgTexture); - msg="部件删除成功"; - result="true"; - } - }catch(Exception e){ - e.printStackTrace(); - msg="部件删除失败"; - result="false"; - } - resultMap.put("msg",msg); - resultMap.put("result",result); - return resultMap; - } - - -} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3283f77..a2d1bcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,24 @@ + + + + + + + + + + + + - - + + + + + @@ -30,29 +45,45 @@ - - + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,6 +109,22 @@ @@ -138,9 +185,10 @@ - @@ -205,6 +253,36 @@ - @@ -778,7 +961,7 @@ - + @@ -790,20 +973,20 @@ + - - + - + @@ -812,6 +995,7 @@ + @@ -847,7 +1031,7 @@ - @@ -855,37 +1039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1005,20 +1158,6 @@ - - - - - - - - - - - - - - @@ -1047,13 +1186,6 @@ - - - - - - - @@ -1075,52 +1207,234 @@ - + - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1180,7 +1494,7 @@ - Web|PgInterface + Spring|PgInterface diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java index da8f617..29c6f36 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDevice.java @@ -85,7 +85,7 @@ this.position = position; } - @Column(name = "DEVTPYE") + @Column(name = "DEVTYPE") public String getDevType() { return devType; } diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java index 669b60f..bd00757 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgDeviceType.java @@ -16,7 +16,6 @@ private String devType; private int active; - @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_DEVICE_TYPE_ID") public long getId() { diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java deleted file mode 100644 index 4ebfbda..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgTexture.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.casic.PgInterface.devTable.domain; - -import org.hibernate.annotations.NotFound; -import org.hibernate.annotations.NotFoundAction; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -/** - * Created by yxw on 2017/10/30. - */ -@Entity -@Table(name = "PG_TEXTURE") -@SequenceGenerator(name = "SEQ_PG_TEXTURE_ID", sequenceName = "SEQ_PG_TEXTURE_ID", allocationSize = 1, initialValue = 1) -public class PgTexture implements Serializable { - private static final long serialVersionUID = 1L; - private long id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private Date buildDate;//建设年代 - private int active;//状态位 - private PipeGallery pipeGalleryId;//所在管廊信息 - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_TEXTURE_ID") - public long getId() - { - return id; - } - - public void setId(long id) - { - this.id = id; - } - - @Column(name = "TEXTURE_NAME") - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - @Column(name = "TEXTURE_MATERIAL") - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - @Column(name = "LAYERNUM") - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - @Column(name = "OWNERUNIT") - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - @Column(name = "BUILDDATE") - public Date getBuildDate() { - return buildDate; - } - - public void setBuildDate(Date buildDate) { - this.buildDate = buildDate; - } - - @Column(name = "ACTIVE") - public int getActive() { - return active; - } - - public void setActive(int active) { - this.active = active; - } - - @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST}) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "PGID") - public PipeGallery getPipeGalleryId() { - return pipeGalleryId; - } - - public void setPipeGalleryId(PipeGallery pipeGalleryId) { - this.pipeGalleryId = pipeGalleryId; - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java index 8e6e785..93ed145 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java @@ -20,7 +20,6 @@ private String pgName;//管廊名称 private int active;//状态位 private PgPartition pgPartitionId;// - private List pgTextureList; private List pgPipeLineList; @Id @@ -63,15 +62,6 @@ } @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") - public List getPgTextureList() { - return pgTextureList; - } - - public void setPgTextureList(List pgTextureList) { - this.pgTextureList = pgTextureList; - } - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "pipeGalleryId") public List getPgPipeLineList() { return pgPipeLineList; } @@ -80,5 +70,4 @@ this.pgPipeLineList = pgPipeLineList; } - } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java index e348f7a..2112276 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeDto.java @@ -38,10 +38,8 @@ } public PgDeviceTypeDto(PgDeviceType pgDeviceType) { - this.setId(String.valueOf(pgDeviceType.getId())); this.setDevType(pgDeviceType.getDevType()); this.setActive(String.valueOf(pgDeviceType.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java new file mode 100644 index 0000000..fcedae0 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgDeviceTypeStatisticDto.java @@ -0,0 +1,27 @@ +package com.casic.PgInterface.devTable.dto; + +/** + * Created by yxw on 2018/3/22. + */ +public class PgDeviceTypeStatisticDto { + + private String devType; + private String num; + + public String getDevType() { + return devType; + } + + public void setDevType(String devType) { + this.devType = devType; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java deleted file mode 100644 index 709dcea..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgTextureDto.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.casic.PgInterface.devTable.dto; - -import com.casic.PgInterface.devTable.domain.PgTexture; - -import java.io.Serializable; -import java.text.SimpleDateFormat; - -/** - * Created by yxw on 2017/10/30. - */ -public class PgTextureDto implements Serializable { - - private String id; - private String textureName;//名称 - private String textureMaterial;//材质 - private String layerNum;//所在层数 - private String ownerUnit;//权属单位 - private String buildDate;//建设年代 - private String active;//状态位 - private String pipeGallery;//仓位 - private String partition;//分区 - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTextureName() { - return textureName; - } - - public void setTextureName(String textureName) { - this.textureName = textureName; - } - - public String getTextureMaterial() { - return textureMaterial; - } - - public void setTextureMaterial(String textureMaterial) { - this.textureMaterial = textureMaterial; - } - - public String getLayerNum() { - return layerNum; - } - - public void setLayerNum(String layerNum) { - this.layerNum = layerNum; - } - - public String getOwnerUnit() { - return ownerUnit; - } - - public void setOwnerUnit(String ownerUnit) { - this.ownerUnit = ownerUnit; - } - - public String getBuildDate() { - return buildDate; - } - - public void setBuildDate(String buildDate) { - this.buildDate = buildDate; - } - - public String getActive() { - return active; - } - - public void setActive(String active) { - this.active = active; - } - - public String getPipeGallery() { - return pipeGallery; - } - - public void setPipeGallery(String pipeGallery) { - this.pipeGallery = pipeGallery; - } - - public String getPartition() { - return partition; - } - - public void setPartition(String partition) { - this.partition = partition; - } - - public PgTextureDto(PgTexture pgTexture) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - - this.setId(String.valueOf(pgTexture.getId())); - this.setTextureName(pgTexture.getTextureName()); - this.setTextureMaterial(pgTexture.getTextureMaterial()); - this.setLayerNum(pgTexture.getLayerNum()); - this.setOwnerUnit(pgTexture.getOwnerUnit()); - this.setBuildDate(sdf.format(pgTexture.getBuildDate())); - this.setActive(String.valueOf(pgTexture.getActive())); - this.setPipeGallery(pgTexture.getPipeGalleryId().getPgName()); - this.setPartition(pgTexture.getPipeGalleryId().getPgPartitionId().getParName()); - } - -} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java index 96bd97a..2ef89cf 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgDevice; import com.casic.PgInterface.devTable.dto.PgDeviceDto; +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -46,6 +47,20 @@ return pgDeviceList.get(0); } + //根据类型获取设备列表 + public List getDeviceByDevTypee(String devType) { + Criteria criteria=createCriteria(PgDevice.class); + criteria.add(Restrictions.eq("devType",devType)); + + List pgDeviceList=criteria.list(); + List pgDeviceDtoList = new ArrayList(); + + for (PgDevice pgDevice : pgDeviceList) { + pgDeviceDtoList.add(new PgDeviceDto(pgDevice)); + } + return pgDeviceDtoList; + } + //根据名字获取当前设备 public PgDevice getDeviceBydevCode(String devCode) { Criteria criteria=createCriteria(PgDevice.class); @@ -58,5 +73,14 @@ return pgDeviceList.get(0); } + //根据设备类型统计设备资产 + public List getDeviceStatisticByDevType() + { + String hql="select device.devType,count(*) from PG_DEVICE device group by devType"; + + List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); + + return pgDeviceTypeStatisticDtoList; + } } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java index c6f22cb..24c5b6c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -31,9 +31,9 @@ return null; } - public List getPartitionByRoad(String road) { + public List getPartitionByName(String parName) { Criteria criteria = getSession().createCriteria(PipeGallery.class); - criteria.add(Restrictions.eq("road", road)); + criteria.add(Restrictions.eq("parName", parName)); criteria.add(Restrictions.eq("active",1)); List pgPartitionList = criteria.list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 52fc47b..6ae2308 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -2,10 +2,12 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.devTable.domain.PgPipeLine; +import com.casic.PgInterface.devTable.dto.PgPipeLineDto; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -25,5 +27,17 @@ return pgPipeLineList.get(0); } + public List getPipeLineByLineType(String lineType) { + Criteria criteria = createCriteria(PgPipeLine.class); + criteria.add(Restrictions.eq("lineType", lineType)); + + List pgPipeLineList = criteria.list(); + List pgPipeLineDtoList = new ArrayList(); + for (PgPipeLine pgPipeLine : pgPipeLineList) { + pgPipeLineDtoList.add(new PgPipeLineDto(pgPipeLine)); + } + return pgPipeLineDtoList; + } + } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java deleted file mode 100644 index 56ff782..0000000 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgTextureManager.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.casic.PgInterface.devTable.manager; - -import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.devTable.domain.PgTexture; -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by yxw on 2017/10/30. - */ -@Service -public class PgTextureManager extends HibernateEntityDao { - - public PgTexture getPgTextureByName(String textureName) { - Criteria criteria = getSession().createCriteria(PgTexture.class); - criteria.add(Restrictions.eq("textureName", textureName)); - criteria.add(Restrictions.eq("active",1)); - - List pgTextureList = criteria.list(); - - //TODO LIST:为空判断 pipeGalleryList==null? - if (pgTextureList == null || pgTextureList.size() == 0) - return null; - else - return pgTextureList.get(0); - } - - - -} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java new file mode 100644 index 0000000..21e6c47 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgAuthority.java @@ -0,0 +1,8 @@ +package com.casic.PgInterface.patroler.domain; + +/** + * Created by yxw on 2018/3/19. + */ +public class PgAuthority { + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 36547a7..2d1246f 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -51,6 +51,28 @@ } /** + * 根据设备类型获取设备信息 + */ + @POST + @Path("getPgDeviceByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgDeviceByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceDtoList=new ArrayList(); + try { + pgDeviceDtoList = pgDeviceManager.getDeviceByDevTypee(devType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgDeviceDtoList); + return resultMap; + } + + /** * 获取设备信息 */ @POST diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 249b75c..88ad11e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -78,7 +78,9 @@ resultMap.put("msg", msg); return resultMap; } - + /* + *编辑分区 + */ @POST @Path("editPartition") @Produces(MediaType.APPLICATION_JSON) @@ -190,17 +192,17 @@ } /** - * 获取分区信息 + * 根据编号获取分区信息 */ @POST - @Path("getPartitionListByRoad") + @Path("getPartitionListByName") @Produces(MediaType.APPLICATION_JSON) - public Map getPartitionListByRoad(@FormParam("road") String road) throws Exception { + public Map getPartitionListByName(@FormParam("parName") String parName) throws Exception { Map resultMap = new HashMap(); String msg = ""; List pgPartitionDtoList = new ArrayList(); try { - pgPartitionDtoList = pgPartitionManager.getPartitionByRoad(road); + pgPartitionDtoList = pgPartitionManager.getPartitionByName(parName); msg = "获取成功"; } catch (Exception e) { msg = "获取失败"; @@ -211,5 +213,4 @@ return resultMap; } - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 4c9feac..1eeb589 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -18,7 +18,9 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -52,29 +54,6 @@ } /** - * 获取管线信息 - */ - @POST - @Path("getPipeLineByName") - @Produces(MediaType.APPLICATION_JSON) - public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception { - Map resultMap = new HashMap(); - String msg = ""; - PgPipeLineDto pgPipeLineDto=null; - try { - PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); - pgPipeLineDto=new PgPipeLineDto(pgPipeLine); - msg = "获取成功"; - } catch (Exception e) { - msg = "获取失败"; - e.printStackTrace(); - } - resultMap.put("msg", msg); - resultMap.put("result", pgPipeLineDto); - return resultMap; - } - - /** * 新增管线 */ @POST @@ -232,6 +211,51 @@ return resultMap; } + /* + * 根据管线类型获取管线列表 + */ + @POST + @Path("getPipeLineByLineType") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByLineType(@FormParam("lineType") String lineType) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgPipeLineDtoList=new ArrayList(); + try { + pgPipeLineDtoList = pgPipeLineManager.getPipeLineByLineType(lineType); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDtoList); + return resultMap; + } + /** + * 根据管线名称获取管线信息 + */ + @POST + @Path("getPipeLineByName") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineByName(@FormParam("lineName") String lineName) + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgPipeLineDto pgPipeLineDto=null; + try { + PgPipeLine pgPipeLine = pgPipeLineManager.getPipeLineBylineName(lineName); + pgPipeLineDto=new PgPipeLineDto(pgPipeLine); + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + resultMap.put("result", pgPipeLineDto); + return resultMap; + } } diff --git a/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java b/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java deleted file mode 100644 index 2360251..0000000 --- a/src/main/java/com/casic/PgInterface/rs/PgTextureRs.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.casic.PgInterface.rs; - -import com.casic.PgInterface.devTable.domain.PgPartition; -import com.casic.PgInterface.devTable.domain.PgTexture; -import com.casic.PgInterface.devTable.domain.PipeGallery; -import com.casic.PgInterface.devTable.dto.PgTextureDto; -import com.casic.PgInterface.devTable.manager.PgPartitionManager; -import com.casic.PgInterface.devTable.manager.PgTextureManager; -import com.casic.PgInterface.devTable.manager.PipeGalleryManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import javax.ws.rs.FormParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by yxw on 2017/11/7. - */ -@Component -@Path("pgTexture") -public class PgTextureRs { - - private static Logger logger = LoggerFactory.getLogger(PgTextureRs.class); - - private PgTextureManager pgTextureManager; - - private PipeGalleryManager pipeGalleryManager; - - private PgPartitionManager pgPartitionManager; - - @Resource - public void setPgTextureManager(PgTextureManager pgTextureManager) { - this.pgTextureManager = pgTextureManager; - } - - @Resource - public void setPipeGalleryManager(PipeGalleryManager pipeGalleryManager) { - this.pipeGalleryManager = pipeGalleryManager; - } - - @Resource - public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { - this.pgPartitionManager = pgPartitionManager; - } - - /** - * 获取管廊部件信息 - */ - @POST - @Path("getPgTextureByName") - @Produces(MediaType.APPLICATION_JSON) - public Map getPgTexture(@FormParam("textureName") String textureName) throws Exception { - Map resultMap = new HashMap(); - String msg = ""; - PgTextureDto pgTextureDto=null; - try { - PgTexture pgTexture = pgTextureManager.getPgTextureByName(textureName); - pgTextureDto=new PgTextureDto(pgTexture); - msg = "获取成功"; - } catch (Exception e) { - msg = "获取失败"; - e.printStackTrace(); - } - resultMap.put("msg", msg); - resultMap.put("result", pgTextureDto); - return resultMap; - } - - /** - * 新增管廊部件 - */ - @POST - @Path("addTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map addTexture(@FormParam("textureName") String textureName, - @FormParam("textureMaterial") String textureMaterial, - @FormParam("layerNum") String layerNum, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("buildDate") String buildDate, - @FormParam("pgName") String pgName, - @FormParam("parName") String parName) - throws Exception { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - Map resultMap = new HashMap(); - String result = ""; - String msg = ""; - PgTexture pgTexture = new PgTexture(); - - - PgPartition pgPartition = pgPartitionManager.getPartitionByParName(parName); - PipeGallery pipeGallery = pipeGalleryManager.getPipeGalleryByPgName(pgName,pgPartition); - - if (pgPartition == null) { - result = "false"; - msg = "不存在管廊仓和分区信息"; - } else { - try { - if(pgTextureManager.getPgTextureByName(textureName)!=null) - { - result = "false"; - msg = "已存在同名的部件"; - } - else { - pgTexture.setTextureName(textureName); - pgTexture.setTextureMaterial(textureMaterial); - pgTexture.setLayerNum(layerNum); - pgTexture.setOwnerUnit(ownerUnit); - pgTexture.setBuildDate(sdf.parse(buildDate)); - pgTexture.setPipeGalleryId(pipeGallery); - pgTexture.setActive(1); - - pgTextureManager.save(pgTexture); - result = "true"; - msg = "保存成功"; - } - } catch (Exception e) { - result = "false"; - msg = "保存失败"; - e.printStackTrace(); - } - resultMap.put("success", result); - resultMap.put("msg", msg); - } - resultMap.put("result",result); - resultMap.put("msg",msg); - return resultMap; - } - - /** - * 编辑管廊部件 - */ - @POST - @Path("editTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map editTexture(@FormParam("id") String id, - @FormParam("textureName") String textureName, - @FormParam("textureMaterial") String textureMaterial, - @FormParam("layerNum") String layerNum, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("buildDate") String buildDate, - @FormParam("pgName") String pgName, - @FormParam("parName") String parName) throws Exception { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - Map resultMap = new HashMap(); - String result = ""; - String msg = ""; - - PgPartition pgPartition = pgPartitionManager.getPartitionByParName(parName); - PipeGallery pipeGallery = pipeGalleryManager.getPipeGalleryByPgName(pgName,pgPartition); - if (pgPartition == null) { - result = "false"; - msg = "不存在管廊仓和分区信息"; - } else { - try { - /* - if(pgTextureManager.getPgTextureByName(textureName)!=null) - { - result = "false"; - msg = "已存在同名的部件"; - } - else { - */ - PgTexture pgTexture = pgTextureManager.get(Long.valueOf(id)); - pgTexture.setTextureName(textureName); - pgTexture.setTextureMaterial(textureMaterial); - pgTexture.setLayerNum(layerNum); - pgTexture.setOwnerUnit(ownerUnit); - pgTexture.setBuildDate(sdf.parse(buildDate)); - pgTexture.setPipeGalleryId(pipeGallery); - pgTexture.setActive(1); - - pgTextureManager.save(pgTexture); - result = "true"; - msg = "编辑成功"; - //} - } catch (Exception e) { - result = "false"; - msg = "编辑失败"; - e.printStackTrace(); - } - } - resultMap.put("result",result); - resultMap.put("msg",msg); - return resultMap; - } - - /** - * 删除管廊部件 - */ - @POST - @Path("deleteTexture") - @Produces(MediaType.APPLICATION_JSON) - public Map deleteTexture(@FormParam("id") String id)throws Exception { - - Map resultMap = new HashMap(); - String msg=""; - String result="false"; - - try { - PgTexture pgTexture=pgTextureManager.get(Long.valueOf(id)); - if(pgTexture==null) { - msg = "不存在该部件信息"; - result="false"; - } - else - { - pgTexture.setActive(0); - pgTextureManager.save(pgTexture); - msg="部件删除成功"; - result="true"; - } - }catch(Exception e){ - e.printStackTrace(); - msg="部件删除失败"; - result="false"; - } - resultMap.put("msg",msg); - resultMap.put("result",result); - return resultMap; - } - - -} diff --git a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java new file mode 100644 index 0000000..5be00cf --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java @@ -0,0 +1,117 @@ +package com.casic.PgInterface.rs; +/** + * Created by yxw on 2018/3/20. + */ + +import com.casic.PgInterface.devTable.dto.PgDeviceTypeStatisticDto; +import com.casic.PgInterface.devTable.manager.PgDeviceManager; +import com.casic.PgInterface.devTable.manager.PipeGalleryManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Path("pgStatistic") +public class pgStatisticRs{ + + private static Logger logger = LoggerFactory.getLogger(pgStatisticRs.class); + + private PipeGalleryManager pipeGalleryManager; + + private PgDeviceManager pgDeviceManager; + + @Resource + public void setPipeGalleryManager(PipeGalleryManager pipeGalleryManager) { + this.pipeGalleryManager = pipeGalleryManager; + } + + @Resource + public void setPgDeviceManager(PgDeviceManager pgDeviceManager) { + this.pgDeviceManager = pgDeviceManager; + } + + /* + *获取管廊仓体长度统计 + */ + @POST + @Path("getPgStatistic") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgStatistic() + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + + try { + + + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + //resultMap.put("result", ); + return resultMap; + } + /* + *获取管廊仓体长度统计 + */ + @POST + @Path("getPipeLineStatistic") + @Produces(MediaType.APPLICATION_JSON) + public Map getPipeLineStatistic() + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + + + try { + + + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + //resultMap.put("result", ); + return resultMap; + } + + /* + * 按照设备类型统计设备数量 + */ + @POST + @Path("getDeviceStatistic") + @Produces(MediaType.APPLICATION_JSON) + public Map getDeviceStatistic() + throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgDeviceTypeStatisticDtoList=new ArrayList(); + + try { + pgDeviceTypeStatisticDtoList=pgDeviceManager.getDeviceStatisticByDevType(); + + msg = "获取成功"; + } catch (Exception e) { + msg = "获取失败"; + e.printStackTrace(); + } + resultMap.put("msg", msg); + //resultMap.put("result", ); + return resultMap; + } + + +}