diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
new file mode 100644
index 0000000..8f049c8
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
@@ -0,0 +1,213 @@
+package com.casic.PgInterface.rs;
+
+import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgPartitionDto;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
+import com.casic.PgInterface.devTable.manager.PgPartitionManager;
+import com.casic.PgInterface.devTable.manager.PgRoadManager;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Path("pgRoad")
+public class PgRoadRs {
+ private static Logger logger = LoggerFactory.getLogger(PgRoad.class);
+
+ @Resource
+ private PgRoadManager pgRoadManager;
+
+ @Resource
+ private PgPartitionManager pgPartitionManager;
+
+ /**
+ * 获取道路信息
+ */
+ @POST
+ @Path("getRoadList")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getRoadList(){
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgRoadDtoList=new ArrayList();
+ try{
+ pgRoadDtoList = pgRoadManager.getAllRoad();
+ if (pgRoadDtoList.size() == 0)
+ msg = "没有道路信息";
+ else
+ msg = "道路信息获取成功";
+ }
+ catch(Exception e){
+ msg="道路信息获取失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgRoadDtoList);
+
+ return resultMap;
+ }
+
+ /**
+ * 新增道路信息
+ */
+ @POST
+ @Path("addRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map addRoad(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ try{
+ PgRoad pgRoad=new PgRoad();
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+
+ msg="新增道路成功";
+ result="true";
+ }
+ catch (Exception e){
+ msg="新增道路失败";
+ result="true";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 编辑道路信息
+ */
+ @POST
+ @Path("editRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map editRoad(@FormParam("id") String id,
+ @FormParam("roadName") String roadName)throws Exception{
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+
+ try {
+ PgRoad pgRoad=pgRoadManager.get(Long.valueOf(id));
+
+ if(pgRoad==null)
+ {
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+ msg="道路信息保存成功";
+ result="true";
+ }
+ }
+ catch(Exception e){
+ msg="道路信息编辑失败";
+ result="false";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 删除道路阈值
+ */
+ @POST
+ @Path("deleteRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map deleteRoad(@FormParam("id") String id) throws Exception {
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+ PgRoad pgRoad=null;
+
+ try{
+ pgRoad=pgRoadManager.get(Long.valueOf(id));
+ if(pgRoad==null){
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setActive(0);
+ pgRoadManager.save(pgRoad);
+ msg="道路删除成功";
+ result="true";
+ }
+ }
+ catch (Exception e){
+ msg="道路删除出错";
+ result="false";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 根据道路获取分区信息
+ */
+ @POST
+ @Path("getParNameByRoadName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getParNameByRoadName(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ List pgPartitionDtoList=null;
+ try{
+ PgRoad pgRoad=pgRoadManager.getPgRoadByName(roadName);
+ if(pgRoad==null)
+ msg="不存在道路信息";
+ else
+ {
+ pgPartitionDtoList=pgPartitionManager.getPgPartitonDtoByRoad(pgRoad);
+ if(pgPartitionDtoList==null||pgPartitionDtoList.size()==0)
+ msg="该道路没有分区信息";
+ else
+ msg="分区信息获取成功";
+ }
+ }
+ catch (Exception e)
+ {
+ msg="分区信息获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPartitionDtoList);
+
+ return resultMap;
+ }
+
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
new file mode 100644
index 0000000..8f049c8
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
@@ -0,0 +1,213 @@
+package com.casic.PgInterface.rs;
+
+import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgPartitionDto;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
+import com.casic.PgInterface.devTable.manager.PgPartitionManager;
+import com.casic.PgInterface.devTable.manager.PgRoadManager;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Path("pgRoad")
+public class PgRoadRs {
+ private static Logger logger = LoggerFactory.getLogger(PgRoad.class);
+
+ @Resource
+ private PgRoadManager pgRoadManager;
+
+ @Resource
+ private PgPartitionManager pgPartitionManager;
+
+ /**
+ * 获取道路信息
+ */
+ @POST
+ @Path("getRoadList")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getRoadList(){
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgRoadDtoList=new ArrayList();
+ try{
+ pgRoadDtoList = pgRoadManager.getAllRoad();
+ if (pgRoadDtoList.size() == 0)
+ msg = "没有道路信息";
+ else
+ msg = "道路信息获取成功";
+ }
+ catch(Exception e){
+ msg="道路信息获取失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgRoadDtoList);
+
+ return resultMap;
+ }
+
+ /**
+ * 新增道路信息
+ */
+ @POST
+ @Path("addRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map addRoad(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ try{
+ PgRoad pgRoad=new PgRoad();
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+
+ msg="新增道路成功";
+ result="true";
+ }
+ catch (Exception e){
+ msg="新增道路失败";
+ result="true";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 编辑道路信息
+ */
+ @POST
+ @Path("editRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map editRoad(@FormParam("id") String id,
+ @FormParam("roadName") String roadName)throws Exception{
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+
+ try {
+ PgRoad pgRoad=pgRoadManager.get(Long.valueOf(id));
+
+ if(pgRoad==null)
+ {
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+ msg="道路信息保存成功";
+ result="true";
+ }
+ }
+ catch(Exception e){
+ msg="道路信息编辑失败";
+ result="false";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 删除道路阈值
+ */
+ @POST
+ @Path("deleteRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map deleteRoad(@FormParam("id") String id) throws Exception {
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+ PgRoad pgRoad=null;
+
+ try{
+ pgRoad=pgRoadManager.get(Long.valueOf(id));
+ if(pgRoad==null){
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setActive(0);
+ pgRoadManager.save(pgRoad);
+ msg="道路删除成功";
+ result="true";
+ }
+ }
+ catch (Exception e){
+ msg="道路删除出错";
+ result="false";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 根据道路获取分区信息
+ */
+ @POST
+ @Path("getParNameByRoadName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getParNameByRoadName(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ List pgPartitionDtoList=null;
+ try{
+ PgRoad pgRoad=pgRoadManager.getPgRoadByName(roadName);
+ if(pgRoad==null)
+ msg="不存在道路信息";
+ else
+ {
+ pgPartitionDtoList=pgPartitionManager.getPgPartitonDtoByRoad(pgRoad);
+ if(pgPartitionDtoList==null||pgPartitionDtoList.size()==0)
+ msg="该道路没有分区信息";
+ else
+ msg="分区信息获取成功";
+ }
+ }
+ catch (Exception e)
+ {
+ msg="分区信息获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPartitionDtoList);
+
+ return resultMap;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
index 612597e..6d310bd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
@@ -1,6 +1,5 @@
package com.casic.PgInterface.rs;
-import com.casic.PgInterface.patroler.domain.PgRole;
import com.casic.PgInterface.patroler.domain.PgUser;
import com.casic.PgInterface.patroler.dto.PgUserDto;
import com.casic.PgInterface.patroler.manager.PgRoleManager;
@@ -78,14 +77,14 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role)throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ )throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
if (pgUserManager.userNameIsExits(userName)) {
result = "false";
@@ -99,7 +98,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUser.setActive(1);
logger.info("成功保存");
@@ -129,20 +128,15 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role) throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ ) throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- /*
- if (pgUserManager.userNameIsExits(userName)) {
- result = "false";
- msg = "用户名已经存在!";
- } else {
- */
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
PgUser pgUser = pgUserManager.get(Long.valueOf(id));
pgUser.setUserName(userName);
@@ -150,7 +144,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUserManager.save(pgUser);
result = "true";
msg = "编辑成功";
@@ -201,5 +195,37 @@
return resultMap;
}
+ /**
+ * 登录
+ */
+ @POST
+ @Path("signIn")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map signIn(@FormParam("userName") String userName,
+ @FormParam("passWord") String passWord) {
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+ try{
+ if(pgUserManager.signIn(userName,passWord)==true)
+ {
+ msg="登录成功";
+ result="true";
+ }
+ else {
+ msg="登录失败";
+ result="false";
+ }
+ }
+ catch(Exception e){
+ msg="登陆失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
new file mode 100644
index 0000000..8f049c8
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
@@ -0,0 +1,213 @@
+package com.casic.PgInterface.rs;
+
+import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgPartitionDto;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
+import com.casic.PgInterface.devTable.manager.PgPartitionManager;
+import com.casic.PgInterface.devTable.manager.PgRoadManager;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Path("pgRoad")
+public class PgRoadRs {
+ private static Logger logger = LoggerFactory.getLogger(PgRoad.class);
+
+ @Resource
+ private PgRoadManager pgRoadManager;
+
+ @Resource
+ private PgPartitionManager pgPartitionManager;
+
+ /**
+ * 获取道路信息
+ */
+ @POST
+ @Path("getRoadList")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getRoadList(){
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgRoadDtoList=new ArrayList();
+ try{
+ pgRoadDtoList = pgRoadManager.getAllRoad();
+ if (pgRoadDtoList.size() == 0)
+ msg = "没有道路信息";
+ else
+ msg = "道路信息获取成功";
+ }
+ catch(Exception e){
+ msg="道路信息获取失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgRoadDtoList);
+
+ return resultMap;
+ }
+
+ /**
+ * 新增道路信息
+ */
+ @POST
+ @Path("addRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map addRoad(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ try{
+ PgRoad pgRoad=new PgRoad();
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+
+ msg="新增道路成功";
+ result="true";
+ }
+ catch (Exception e){
+ msg="新增道路失败";
+ result="true";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 编辑道路信息
+ */
+ @POST
+ @Path("editRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map editRoad(@FormParam("id") String id,
+ @FormParam("roadName") String roadName)throws Exception{
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+
+ try {
+ PgRoad pgRoad=pgRoadManager.get(Long.valueOf(id));
+
+ if(pgRoad==null)
+ {
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+ msg="道路信息保存成功";
+ result="true";
+ }
+ }
+ catch(Exception e){
+ msg="道路信息编辑失败";
+ result="false";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 删除道路阈值
+ */
+ @POST
+ @Path("deleteRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map deleteRoad(@FormParam("id") String id) throws Exception {
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+ PgRoad pgRoad=null;
+
+ try{
+ pgRoad=pgRoadManager.get(Long.valueOf(id));
+ if(pgRoad==null){
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setActive(0);
+ pgRoadManager.save(pgRoad);
+ msg="道路删除成功";
+ result="true";
+ }
+ }
+ catch (Exception e){
+ msg="道路删除出错";
+ result="false";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 根据道路获取分区信息
+ */
+ @POST
+ @Path("getParNameByRoadName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getParNameByRoadName(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ List pgPartitionDtoList=null;
+ try{
+ PgRoad pgRoad=pgRoadManager.getPgRoadByName(roadName);
+ if(pgRoad==null)
+ msg="不存在道路信息";
+ else
+ {
+ pgPartitionDtoList=pgPartitionManager.getPgPartitonDtoByRoad(pgRoad);
+ if(pgPartitionDtoList==null||pgPartitionDtoList.size()==0)
+ msg="该道路没有分区信息";
+ else
+ msg="分区信息获取成功";
+ }
+ }
+ catch (Exception e)
+ {
+ msg="分区信息获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPartitionDtoList);
+
+ return resultMap;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
index 612597e..6d310bd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
@@ -1,6 +1,5 @@
package com.casic.PgInterface.rs;
-import com.casic.PgInterface.patroler.domain.PgRole;
import com.casic.PgInterface.patroler.domain.PgUser;
import com.casic.PgInterface.patroler.dto.PgUserDto;
import com.casic.PgInterface.patroler.manager.PgRoleManager;
@@ -78,14 +77,14 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role)throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ )throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
if (pgUserManager.userNameIsExits(userName)) {
result = "false";
@@ -99,7 +98,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUser.setActive(1);
logger.info("成功保存");
@@ -129,20 +128,15 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role) throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ ) throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- /*
- if (pgUserManager.userNameIsExits(userName)) {
- result = "false";
- msg = "用户名已经存在!";
- } else {
- */
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
PgUser pgUser = pgUserManager.get(Long.valueOf(id));
pgUser.setUserName(userName);
@@ -150,7 +144,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUserManager.save(pgUser);
result = "true";
msg = "编辑成功";
@@ -201,5 +195,37 @@
return resultMap;
}
+ /**
+ * 登录
+ */
+ @POST
+ @Path("signIn")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map signIn(@FormParam("userName") String userName,
+ @FormParam("passWord") String passWord) {
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+ try{
+ if(pgUserManager.signIn(userName,passWord)==true)
+ {
+ msg="登录成功";
+ result="true";
+ }
+ else {
+ msg="登录失败";
+ result="false";
+ }
+ }
+ catch(Exception e){
+ msg="登陆失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
diff --git a/~WRL2471.tmp b/~WRL2471.tmp
new file mode 100644
index 0000000..c307c0b
--- /dev/null
+++ b/~WRL2471.tmp
Binary files differ
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
new file mode 100644
index 0000000..8f049c8
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
@@ -0,0 +1,213 @@
+package com.casic.PgInterface.rs;
+
+import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgPartitionDto;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
+import com.casic.PgInterface.devTable.manager.PgPartitionManager;
+import com.casic.PgInterface.devTable.manager.PgRoadManager;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Path("pgRoad")
+public class PgRoadRs {
+ private static Logger logger = LoggerFactory.getLogger(PgRoad.class);
+
+ @Resource
+ private PgRoadManager pgRoadManager;
+
+ @Resource
+ private PgPartitionManager pgPartitionManager;
+
+ /**
+ * 获取道路信息
+ */
+ @POST
+ @Path("getRoadList")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getRoadList(){
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgRoadDtoList=new ArrayList();
+ try{
+ pgRoadDtoList = pgRoadManager.getAllRoad();
+ if (pgRoadDtoList.size() == 0)
+ msg = "没有道路信息";
+ else
+ msg = "道路信息获取成功";
+ }
+ catch(Exception e){
+ msg="道路信息获取失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgRoadDtoList);
+
+ return resultMap;
+ }
+
+ /**
+ * 新增道路信息
+ */
+ @POST
+ @Path("addRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map addRoad(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ try{
+ PgRoad pgRoad=new PgRoad();
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+
+ msg="新增道路成功";
+ result="true";
+ }
+ catch (Exception e){
+ msg="新增道路失败";
+ result="true";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 编辑道路信息
+ */
+ @POST
+ @Path("editRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map editRoad(@FormParam("id") String id,
+ @FormParam("roadName") String roadName)throws Exception{
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+
+ try {
+ PgRoad pgRoad=pgRoadManager.get(Long.valueOf(id));
+
+ if(pgRoad==null)
+ {
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+ msg="道路信息保存成功";
+ result="true";
+ }
+ }
+ catch(Exception e){
+ msg="道路信息编辑失败";
+ result="false";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 删除道路阈值
+ */
+ @POST
+ @Path("deleteRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map deleteRoad(@FormParam("id") String id) throws Exception {
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+ PgRoad pgRoad=null;
+
+ try{
+ pgRoad=pgRoadManager.get(Long.valueOf(id));
+ if(pgRoad==null){
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setActive(0);
+ pgRoadManager.save(pgRoad);
+ msg="道路删除成功";
+ result="true";
+ }
+ }
+ catch (Exception e){
+ msg="道路删除出错";
+ result="false";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 根据道路获取分区信息
+ */
+ @POST
+ @Path("getParNameByRoadName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getParNameByRoadName(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ List pgPartitionDtoList=null;
+ try{
+ PgRoad pgRoad=pgRoadManager.getPgRoadByName(roadName);
+ if(pgRoad==null)
+ msg="不存在道路信息";
+ else
+ {
+ pgPartitionDtoList=pgPartitionManager.getPgPartitonDtoByRoad(pgRoad);
+ if(pgPartitionDtoList==null||pgPartitionDtoList.size()==0)
+ msg="该道路没有分区信息";
+ else
+ msg="分区信息获取成功";
+ }
+ }
+ catch (Exception e)
+ {
+ msg="分区信息获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPartitionDtoList);
+
+ return resultMap;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
index 612597e..6d310bd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
@@ -1,6 +1,5 @@
package com.casic.PgInterface.rs;
-import com.casic.PgInterface.patroler.domain.PgRole;
import com.casic.PgInterface.patroler.domain.PgUser;
import com.casic.PgInterface.patroler.dto.PgUserDto;
import com.casic.PgInterface.patroler.manager.PgRoleManager;
@@ -78,14 +77,14 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role)throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ )throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
if (pgUserManager.userNameIsExits(userName)) {
result = "false";
@@ -99,7 +98,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUser.setActive(1);
logger.info("成功保存");
@@ -129,20 +128,15 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role) throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ ) throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- /*
- if (pgUserManager.userNameIsExits(userName)) {
- result = "false";
- msg = "用户名已经存在!";
- } else {
- */
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
PgUser pgUser = pgUserManager.get(Long.valueOf(id));
pgUser.setUserName(userName);
@@ -150,7 +144,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUserManager.save(pgUser);
result = "true";
msg = "编辑成功";
@@ -201,5 +195,37 @@
return resultMap;
}
+ /**
+ * 登录
+ */
+ @POST
+ @Path("signIn")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map signIn(@FormParam("userName") String userName,
+ @FormParam("passWord") String passWord) {
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+ try{
+ if(pgUserManager.signIn(userName,passWord)==true)
+ {
+ msg="登录成功";
+ result="true";
+ }
+ else {
+ msg="登录失败";
+ result="false";
+ }
+ }
+ catch(Exception e){
+ msg="登陆失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
diff --git a/~WRL2471.tmp b/~WRL2471.tmp
new file mode 100644
index 0000000..c307c0b
--- /dev/null
+++ b/~WRL2471.tmp
Binary files differ
diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index 7b64854..78fc55c 100644
--- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 2e977ca..2b77de9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,31 +7,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
@@ -69,26 +64,28 @@
-
+
-
+
+
-
+
+
-
+
@@ -99,47 +96,11 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -164,6 +125,8 @@
getPipeGallerys
getInPgNum
getTodayInPgInfo
+ getInPgPerson
+ getAlarmInfo
@@ -184,30 +147,39 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -270,11 +242,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -326,24 +298,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -397,7 +351,7 @@
-
+
@@ -835,14 +789,7 @@
-
-
-
- 1513847487904
-
-
-
- 1513847487904
+
1514511858811
@@ -1180,11 +1127,18 @@
1539848140371
-
+
+ 1541380241817
+
+
+
+ 1541380241817
+
+
-
+
@@ -1196,21 +1150,21 @@
-
+
-
+
-
+
-
+
@@ -1219,7 +1173,7 @@
-
+
@@ -1339,83 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1430,13 +1307,6 @@
-
-
-
-
-
-
-
@@ -1445,20 +1315,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1480,13 +1336,6 @@
-
-
-
-
-
-
-
@@ -1543,13 +1392,6 @@
-
-
-
-
-
-
-
@@ -1571,13 +1413,6 @@
-
-
-
-
-
-
-
@@ -1613,13 +1448,6 @@
-
-
-
-
-
-
-
@@ -1639,13 +1467,6 @@
-
-
-
-
-
-
-
@@ -1653,35 +1474,242 @@
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1689,18 +1717,15 @@
-
-
+
+
-
+
-
-
-
-
-
+
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
index 220d7a8..eba8814 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java
@@ -11,7 +11,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String roadName;
-
+ private int active;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID")
@@ -23,7 +23,6 @@
this.id = id;
}
-
@Column(name = "ROADNAME")
public String getRoadName() {
return roadName;
@@ -32,4 +31,14 @@
public void setRoadName(String roadName) {
this.roadName = roadName;
}
-}
+
+ @Column(name="ACTIVE")
+ public int getActive() {
+ return active;
+ }
+
+ public void setActive(int active) {
+ this.active = active;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
new file mode 100644
index 0000000..5a96acc
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeDto{
+
+ private String pipeLineType;
+
+ public String getPipeLineType() {
+ return pipeLineType;
+ }
+
+ public void setPipeLineType(String pipeLineType) {
+ this.pipeLineType = pipeLineType;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
new file mode 100644
index 0000000..03154b3
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineTypeNumDto.java
@@ -0,0 +1,14 @@
+package com.casic.PgInterface.devTable.dto;
+
+public class PgPipeLineTypeNumDto extends PgPipeLineTypeDto {
+
+ private String num;
+
+ public String getNum() {
+ return num;
+ }
+
+ public void setNum(String num) {
+ this.num = num;
+ }
+}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
index 0cb61e3..0a61485 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java
@@ -10,6 +10,7 @@
private long id;
private String roadName;
+ private String active;
public long getId() {
return id;
@@ -27,11 +28,19 @@
this.roadName = roadName;
}
- public static PgRoadDto ConvertToDTO(PgRoad pgRoad)
- {
+ public String getActive() {
+ return active;
+ }
+
+ public void setActive(String active) {
+ this.active = active;
+ }
+
+ public static PgRoadDto ConvertToDTO(PgRoad pgRoad){
PgRoadDto pgRoadDto=new PgRoadDto();
pgRoadDto.setId(pgRoad.getId());
pgRoadDto.setRoadName(pgRoad.getRoadName());
+ pgRoadDto.setActive(String.valueOf(pgRoad.getActive()));
return pgRoadDto;
}
@@ -44,4 +53,5 @@
return pgRoadDtoList;
}
-}
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 594283e..6708e09 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -30,7 +30,7 @@
//获取当前报警消息列表
public List getAllAlarm() {
Criteria criteria = createCriteria(PgAlarm.class);
- criteria.add(Restrictions.eq("active", 1));
+// criteria.add(Restrictions.eq("active", 1));
criteria.addOrder(Order.desc("id"));
List pgAlarmList = criteria.list();
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 82cf045..3a3bccd 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java
@@ -2,6 +2,7 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.domain.PgRoad;
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPartitionDto;
import org.hibernate.Criteria;
@@ -85,6 +86,17 @@
return pgPartitionDtoList;
}
+ public List getPgPartitonDtoByRoad(PgRoad pgRoad){
+ Criteria criteria = getSession().createCriteria(PgPartition.class);
+ criteria.add(Restrictions.eq("pgRoadId", pgRoad.getId()));
+ criteria.add(Restrictions.eq("active",1));
+ List pgPartitionList = criteria.list();
+ List pgPartitionDtoList=new ArrayList();
+ for(PgPartition pgPartition:pgPartitionList){
+ pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager));
+ }
+ return pgPartitionDtoList;
+ }
}
\ No newline at end of file
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 4cfa880..46063a6 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -4,6 +4,8 @@
import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
@@ -56,19 +58,38 @@
return pgPipeLineLengthStaticList;
}
- public List getPipeType() {
+ public List getPipeType() {
String sql = "select distinct LINE_TYPE from PG_PIPELINE";
List objectList = this.getSession().createSQLQuery(sql).list();
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
for(Object ob : objectList)
{
- stringList.add(String.valueOf(ob));
+ PgPipeLineTypeDto pgPipeLineTypeDto=new PgPipeLineTypeDto();
+ pgPipeLineTypeDto.setPipeLineType(String.valueOf(ob));
+ pgPipeLineTypeDtoList.add(pgPipeLineTypeDto);
}
- return stringList;
+ return pgPipeLineTypeDtoList;
}
-}
+ public List getPipeTypeNum(){
+ String sql="select LINE_TYPE,count(*) from pg_pipeline group by line_type";
+ List objectList = this.getSession().createSQLQuery(sql).list();
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ for(Object[] ob:objectList){
+ PgPipeLineTypeNumDto pgPipeLineTypeNumDto=new PgPipeLineTypeNumDto();
+
+ pgPipeLineTypeNumDto.setPipeLineType(String.valueOf(ob[0]));
+ pgPipeLineTypeNumDto.setNum(String.valueOf(ob[1]));
+
+ pgPipeLineTypeNumDtoList.add(pgPipeLineTypeNumDto);
+ }
+
+ return pgPipeLineTypeNumDtoList;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
index 3e02b42..a9de66a 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java
@@ -2,15 +2,31 @@
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
-
+import java.util.ArrayList;
import java.util.List;
@Service
public class PgRoadManager extends HibernateEntityDao {
+ public List getAllRoad(){
+ Criteria criteria = createCriteria(PgRoad.class);
+ criteria.add(Restrictions.eq("active", 1));
+ criteria.addOrder(Order.desc("id"));
+
+ List pgRoadList = criteria.list();
+ List pgRoadDtoList = new ArrayList();
+ for (PgRoad pgRoad : pgRoadList) {
+ pgRoadDtoList.add(PgRoadDto.ConvertToDTO(pgRoad));
+ }
+
+ return pgRoadDtoList;
+ }
+
public PgRoad getPgRoadByName(String roadName){
Criteria criteria=createCriteria(PgRoad.class);
@@ -23,4 +39,6 @@
return null;
}
-}
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
index a76886e..6ecca34 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgRole.java
@@ -5,7 +5,6 @@
import javax.persistence.*;
import java.io.Serializable;
-import java.util.List;
/**
* Created by yxw on 2018/3/19.
@@ -20,7 +19,7 @@
private String role;
private int active;
private PgAuthority pgAuthorityId;
- private List pgUsers;
+// private List pgUsers;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROLE_ID")
@@ -60,14 +59,14 @@
public void setPgAuthorityId(PgAuthority pgAuthorityId) {
this.pgAuthorityId = pgAuthorityId;
}
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
- public List getPgUsers() {
- return pgUsers;
- }
-
- public void setPgUsers(List pgUsers) {
- this.pgUsers = pgUsers;
- }
+//
+// @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgRoleId")
+// public List getPgUsers() {
+// return pgUsers;
+// }
+//
+// public void setPgUsers(List pgUsers) {
+// this.pgUsers = pgUsers;
+// }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
index a3c865b..9fdc491 100644
--- a/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
+++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgUser.java
@@ -1,8 +1,6 @@
package com.casic.PgInterface.patroler.domain;
import com.casic.PgInterface.devTable.domain.PgAlarm;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
import javax.persistence.*;
import java.io.Serializable;
@@ -24,7 +22,7 @@
private String post;//职务
private String phoneNumber;//电话
private int active;//状态位
- private PgRole pgRoleId;//权限
+// private PgRole pgRoleId;//权限
private List pgAlarms;
private List pgLogs;
@@ -92,16 +90,16 @@
this.active = active;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "ROLEID")
- public PgRole getPgRoleId() {
- return pgRoleId;
- }
-
- public void setPgRoleId(PgRole pgRoleId) {
- this.pgRoleId = pgRoleId;
- }
+// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
+// @NotFound(action = NotFoundAction.IGNORE)
+// @JoinColumn(name = "ROLEID")
+// public PgRole getPgRoleId() {
+// return pgRoleId;
+// }
+//
+// public void setPgRoleId(PgRole pgRoleId) {
+// this.pgRoleId = pgRoleId;
+// }
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userId")
public List getPgAlarms() {
diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
index c2a2ee1..d2b9db4 100644
--- a/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
+++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgUserManager.java
@@ -35,8 +35,7 @@
}
//查询人员是否存在
- public boolean userNameIsExits(String userName)
- {
+ public boolean userNameIsExits(String userName) {
Criteria criteria = getSession().createCriteria(PgUser.class);
criteria.add(Restrictions.eq("active", 1));
criteria.add(Restrictions.eq("userName", userName));
@@ -59,4 +58,14 @@
return null;
}
+ public boolean signIn(String userName,String passWord){
+
+ String sql="select PASSWORD from PG_USER where USERNAME = '"+userName+"' and active = 1";
+
+ Object object=this.getSession().createSQLQuery(sql).list();
+
+ if(String.valueOf(((List) object).get(0)).equals(passWord)) return true;
+ else return false;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 2b9c5ec..2f2cb55 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,34 +31,18 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
+ @Resource
private PgAlarmTypeManager pgAlarmTypeManager;
+ @Resource
private PgAlarmManager pgAlarmManager;
+ @Resource
private PgUserManager pgPatrolerManager;
+ @Resource
private PgDeviceManager pgDeviceManager;
- @Resource
- public void setPgAlarmManager(PgAlarmManager pgAlarmManager) {
- this.pgAlarmManager = pgAlarmManager;
- }
-
- @Resource
- public void setPgPatrolerManager(PgUserManager pgPatrolerManager) {
- this.pgPatrolerManager = pgPatrolerManager;
- }
-
- @Resource
- public void setPgDeviceManager(PgDeviceManager pgDeviceManager) {
- this.pgDeviceManager = pgDeviceManager;
- }
-
- @Resource
- public void setPgAlarmTypeManager(PgAlarmTypeManager pgAlarmTypeManager) {
- this.pgAlarmTypeManager = pgAlarmTypeManager;
- }
-
/**
* 获取报警信息
*/
@@ -137,10 +121,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
PgAlarm pgAlarm = new PgAlarm();
-// if (!pgPatrolerManager.userNameIsExits(userName)) {
-// result = "false";
-// msg = "不存在该用户!";
-// } else {
pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType));
pgAlarm.setAlarmValue(alarmValue);
pgAlarm.setAlarmDate(sdf.parse(alarmDate));
@@ -153,7 +133,6 @@
pgAlarmManager.save(pgAlarm);
result = "true";
msg = "保存成功";
-// }
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
index 5a71af5..6b53265 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java
@@ -53,8 +53,6 @@
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
-// PgInPgStatus pgInPgStatus = new PgInPgStatus();
-
PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
if (pgInPgPerson == null) {
PgInPgPerson pgInPgPerson1=new PgInPgPerson();
@@ -66,7 +64,6 @@
pgInPgPerson1.setAssetCode(assetCode);
pgInPgPersonManager.save(pgInPgPerson1);
-// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName);
result = "true";
msg = "保存成功";
}
@@ -74,11 +71,6 @@
result = "false";
msg = "存在人员信息";
}
- /* pgInPgStatus.setInTime(sdf.parse(inTime));
- pgInPgStatus.setPgInPgPersonId(pgInPgPerson);
-
- pgInPgStatusManager.save(pgInPgStatus);*/
-
} catch (Exception e) {
result = "false";
msg = "保存失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
index 41f7374..36f8a2e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -5,6 +5,8 @@
import com.casic.PgInterface.devTable.domain.PipeGallery;
import com.casic.PgInterface.devTable.dto.PgPipeLineDto;
import com.casic.PgInterface.devTable.dto.PgPipeLineLengthStatic;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeDto;
+import com.casic.PgInterface.devTable.dto.PgPipeLineTypeNumDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PgPipeLineManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;
@@ -56,8 +58,7 @@
@FormParam("diameter") String diameter,
@FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
- @FormParam("parName") String parName)
- throws Exception {
+ @FormParam("parName") String parName) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -213,8 +214,7 @@
@POST
@Path("getPipeLineByLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByLineType(@FormParam("lineType") String lineType)
- throws Exception {
+ public Map getPipeLineByLineType(@FormParam("lineType") String lineType) throws Exception {
Map resultMap = new HashMap();
String msg = "";
List pgPipeLineDtoList=new ArrayList();
@@ -236,8 +236,7 @@
@POST
@Path("getPipeLineByName")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineByName(@FormParam("lineName") String lineName)
- throws Exception {
+ public Map getPipeLineByName(@FormParam("lineName") String lineName) throws Exception {
Map resultMap = new HashMap();
String msg = "";
PgPipeLineDto pgPipeLineDto=null;
@@ -288,20 +287,49 @@
@POST
@Path("getPipeLineType")
@Produces(MediaType.APPLICATION_JSON)
- public Map getPipeLineType()
- throws Exception {
+ public Map getPipeLineType() throws Exception {
Map resultMap = new HashMap();
String msg = "";
- List stringList=new ArrayList();
+ List pgPipeLineTypeDtoList=new ArrayList();
try {
- stringList = pgPipeLineManager.getPipeType();
+ pgPipeLineTypeDtoList = pgPipeLineManager.getPipeType();
msg = "获取成功";
} catch (Exception e) {
msg = "获取失败";
e.printStackTrace();
}
resultMap.put("msg", msg);
- resultMap.put("result", stringList);
+ resultMap.put("result", pgPipeLineTypeDtoList);
+ return resultMap;
+ }
+
+ /**
+ * 根据管线名称获取管线数量
+ */
+ @POST
+ @Path("getPipeNumStatic")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeNumStatic() throws Exception{
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgPipeLineTypeNumDtoList=new ArrayList();
+
+ try{
+ pgPipeLineTypeNumDtoList=pgPipeLineManager.getPipeTypeNum();
+
+ if(pgPipeLineTypeNumDtoList==null)
+ msg="不存在管线类型占比";
+ else
+ msg="管线占比获取成功";
+ }
+ catch (Exception e){
+ msg="管线占比数量获取失败";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPipeLineTypeNumDtoList);
+
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
new file mode 100644
index 0000000..8f049c8
--- /dev/null
+++ b/src/main/java/com/casic/PgInterface/rs/PgRoadRs.java
@@ -0,0 +1,213 @@
+package com.casic.PgInterface.rs;
+
+import com.casic.PgInterface.devTable.domain.PgRoad;
+import com.casic.PgInterface.devTable.dto.PgPartitionDto;
+import com.casic.PgInterface.devTable.dto.PgRoadDto;
+import com.casic.PgInterface.devTable.manager.PgPartitionManager;
+import com.casic.PgInterface.devTable.manager.PgRoadManager;
+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.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Path("pgRoad")
+public class PgRoadRs {
+ private static Logger logger = LoggerFactory.getLogger(PgRoad.class);
+
+ @Resource
+ private PgRoadManager pgRoadManager;
+
+ @Resource
+ private PgPartitionManager pgPartitionManager;
+
+ /**
+ * 获取道路信息
+ */
+ @POST
+ @Path("getRoadList")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getRoadList(){
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ List pgRoadDtoList=new ArrayList();
+ try{
+ pgRoadDtoList = pgRoadManager.getAllRoad();
+ if (pgRoadDtoList.size() == 0)
+ msg = "没有道路信息";
+ else
+ msg = "道路信息获取成功";
+ }
+ catch(Exception e){
+ msg="道路信息获取失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgRoadDtoList);
+
+ return resultMap;
+ }
+
+ /**
+ * 新增道路信息
+ */
+ @POST
+ @Path("addRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map addRoad(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ try{
+ PgRoad pgRoad=new PgRoad();
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+
+ msg="新增道路成功";
+ result="true";
+ }
+ catch (Exception e){
+ msg="新增道路失败";
+ result="true";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 编辑道路信息
+ */
+ @POST
+ @Path("editRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map editRoad(@FormParam("id") String id,
+ @FormParam("roadName") String roadName)throws Exception{
+
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+
+ try {
+ PgRoad pgRoad=pgRoadManager.get(Long.valueOf(id));
+
+ if(pgRoad==null)
+ {
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setRoadName(roadName);
+ pgRoad.setActive(1);
+
+ pgRoadManager.save(pgRoad);
+ msg="道路信息保存成功";
+ result="true";
+ }
+ }
+ catch(Exception e){
+ msg="道路信息编辑失败";
+ result="false";
+ e.printStackTrace();
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 删除道路阈值
+ */
+ @POST
+ @Path("deleteRoad")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map deleteRoad(@FormParam("id") String id) throws Exception {
+ Map resultMap=new HashMap();
+
+ String msg="";
+ String result="";
+ PgRoad pgRoad=null;
+
+ try{
+ pgRoad=pgRoadManager.get(Long.valueOf(id));
+ if(pgRoad==null){
+ msg="不存在道路信息";
+ result="false";
+ }
+ else{
+ pgRoad.setActive(0);
+ pgRoadManager.save(pgRoad);
+ msg="道路删除成功";
+ result="true";
+ }
+ }
+ catch (Exception e){
+ msg="道路删除出错";
+ result="false";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
+ /**
+ * 根据道路获取分区信息
+ */
+ @POST
+ @Path("getParNameByRoadName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getParNameByRoadName(@FormParam("roadName") String roadName)throws Exception{
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+
+ List pgPartitionDtoList=null;
+ try{
+ PgRoad pgRoad=pgRoadManager.getPgRoadByName(roadName);
+ if(pgRoad==null)
+ msg="不存在道路信息";
+ else
+ {
+ pgPartitionDtoList=pgPartitionManager.getPgPartitonDtoByRoad(pgRoad);
+ if(pgPartitionDtoList==null||pgPartitionDtoList.size()==0)
+ msg="该道路没有分区信息";
+ else
+ msg="分区信息获取成功";
+ }
+ }
+ catch (Exception e)
+ {
+ msg="分区信息获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",pgPartitionDtoList);
+
+ return resultMap;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
index 612597e..6d310bd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java
@@ -1,6 +1,5 @@
package com.casic.PgInterface.rs;
-import com.casic.PgInterface.patroler.domain.PgRole;
import com.casic.PgInterface.patroler.domain.PgUser;
import com.casic.PgInterface.patroler.dto.PgUserDto;
import com.casic.PgInterface.patroler.manager.PgRoleManager;
@@ -78,14 +77,14 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role)throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ )throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
if (pgUserManager.userNameIsExits(userName)) {
result = "false";
@@ -99,7 +98,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUser.setActive(1);
logger.info("成功保存");
@@ -129,20 +128,15 @@
@FormParam("password") String password,
@FormParam("department") String department,
@FormParam("post") String post,
- @FormParam("phoneNumber") String phoneNumber,
- @FormParam("role") String role) throws Exception {
+ @FormParam("phoneNumber") String phoneNumber
+ ) throws Exception {
Map resultMap = new HashMap();
String result = "";
String msg = "";
try {
- /*
- if (pgUserManager.userNameIsExits(userName)) {
- result = "false";
- msg = "用户名已经存在!";
- } else {
- */
- PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
+
+// PgRole pgRole=pgRoleManager.getPgRoleByRole(role);
PgUser pgUser = pgUserManager.get(Long.valueOf(id));
pgUser.setUserName(userName);
@@ -150,7 +144,7 @@
pgUser.setDepartment(department);
pgUser.setPost(post);
pgUser.setPhoneNumber(phoneNumber);
- pgUser.setPgRoleId(pgRole);
+// pgUser.setPgRoleId(pgRole);
pgUserManager.save(pgUser);
result = "true";
msg = "编辑成功";
@@ -201,5 +195,37 @@
return resultMap;
}
+ /**
+ * 登录
+ */
+ @POST
+ @Path("signIn")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map signIn(@FormParam("userName") String userName,
+ @FormParam("passWord") String passWord) {
+ Map resultMap=new HashMap();
+ String msg="";
+ String result="";
+ try{
+ if(pgUserManager.signIn(userName,passWord)==true)
+ {
+ msg="登录成功";
+ result="true";
+ }
+ else {
+ msg="登录失败";
+ result="false";
+ }
+ }
+ catch(Exception e){
+ msg="登陆失败";
+ e.printStackTrace();
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
diff --git a/~WRL2471.tmp b/~WRL2471.tmp
new file mode 100644
index 0000000..c307c0b
--- /dev/null
+++ b/~WRL2471.tmp
Binary files differ
diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index 7b64854..78fc55c 100644
--- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ
diff --git "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index b464352..dfc15bf 100644
--- "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ