diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java index 8485cce..fa66327 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java @@ -101,4 +101,16 @@ return pgInPgInfoDtoList; } + public PgInPgPerson getPgInPgPersonByAssetCode(String assetCode) { + Criteria criteria = createCriteria(PgInPgPerson.class); + criteria.add(Restrictions.eq("assetCode", assetCode)); + criteria.addOrder(Order.desc("id")); + List pgInPgPersonList = criteria.list(); + + if (pgInPgPersonList != null && pgInPgPersonList.size() != 0) + return pgInPgPersonList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index aea24b4..b4424eb 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -106,4 +106,17 @@ return pgInPgInfoDtoList; } + public PgInPgStatus getPgInPgStatusByPgInPgPerson(PgInPgPerson pgInPgPerson){ + Criteria criteria = createCriteria(PgInPgStatus.class); + criteria.add(Restrictions.eq("pgInPgPersonId", pgInPgPerson)); +// criteria.add(Restrictions.eq("outTime",null)); + criteria.addOrder(Order.asc("id")); + + List pgInPgStatusList = criteria.list(); + if(pgInPgStatusList!=null&&pgInPgStatusList.size()!=0) + return pgInPgStatusList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java index 8485cce..fa66327 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java @@ -101,4 +101,16 @@ return pgInPgInfoDtoList; } + public PgInPgPerson getPgInPgPersonByAssetCode(String assetCode) { + Criteria criteria = createCriteria(PgInPgPerson.class); + criteria.add(Restrictions.eq("assetCode", assetCode)); + criteria.addOrder(Order.desc("id")); + List pgInPgPersonList = criteria.list(); + + if (pgInPgPersonList != null && pgInPgPersonList.size() != 0) + return pgInPgPersonList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index aea24b4..b4424eb 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -106,4 +106,17 @@ return pgInPgInfoDtoList; } + public PgInPgStatus getPgInPgStatusByPgInPgPerson(PgInPgPerson pgInPgPerson){ + Criteria criteria = createCriteria(PgInPgStatus.class); + criteria.add(Restrictions.eq("pgInPgPersonId", pgInPgPerson)); +// criteria.add(Restrictions.eq("outTime",null)); + criteria.addOrder(Order.asc("id")); + + List pgInPgStatusList = criteria.list(); + if(pgInPgStatusList!=null&&pgInPgStatusList.size()!=0) + return pgInPgStatusList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index c6b9e87..2b9c5ec 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -137,10 +137,10 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { PgAlarm pgAlarm = new PgAlarm(); - if (!pgPatrolerManager.userNameIsExits(userName)) { - result = "false"; - msg = "不存在该用户!"; - } else { +// if (!pgPatrolerManager.userNameIsExits(userName)) { +// result = "false"; +// msg = "不存在该用户!"; +// } else { pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType)); pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); @@ -153,7 +153,7 @@ pgAlarmManager.save(pgAlarm); result = "true"; msg = "保存成功"; - } +// } } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java index 2e2fd96..5ff22a7 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java @@ -201,5 +201,33 @@ return resultMap; } + /** + * 根据设备类型报警阈值 + */ + @POST + @Path("getAlarmRuleByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getAlarmRuleByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgAlarmRule pgAlarmRule = null; + PgAlarmRuleDto pgAlarmRuleDto=null; + + try { + pgAlarmRule = pgAlarmRuleManager.getAlarmRuleBydevType(devType); + if (pgAlarmRule == null) + msg = "不存在报警阈值记录"; + else + msg = "报警阈值获取成功"; + } catch (Exception ex) { + ex.printStackTrace(); + msg = "报警阈值获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", new PgAlarmRuleDto(pgAlarmRule)); + + return resultMap; + } } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java index 8485cce..fa66327 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java @@ -101,4 +101,16 @@ return pgInPgInfoDtoList; } + public PgInPgPerson getPgInPgPersonByAssetCode(String assetCode) { + Criteria criteria = createCriteria(PgInPgPerson.class); + criteria.add(Restrictions.eq("assetCode", assetCode)); + criteria.addOrder(Order.desc("id")); + List pgInPgPersonList = criteria.list(); + + if (pgInPgPersonList != null && pgInPgPersonList.size() != 0) + return pgInPgPersonList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index aea24b4..b4424eb 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -106,4 +106,17 @@ return pgInPgInfoDtoList; } + public PgInPgStatus getPgInPgStatusByPgInPgPerson(PgInPgPerson pgInPgPerson){ + Criteria criteria = createCriteria(PgInPgStatus.class); + criteria.add(Restrictions.eq("pgInPgPersonId", pgInPgPerson)); +// criteria.add(Restrictions.eq("outTime",null)); + criteria.addOrder(Order.asc("id")); + + List pgInPgStatusList = criteria.list(); + if(pgInPgStatusList!=null&&pgInPgStatusList.size()!=0) + return pgInPgStatusList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index c6b9e87..2b9c5ec 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -137,10 +137,10 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { PgAlarm pgAlarm = new PgAlarm(); - if (!pgPatrolerManager.userNameIsExits(userName)) { - result = "false"; - msg = "不存在该用户!"; - } else { +// if (!pgPatrolerManager.userNameIsExits(userName)) { +// result = "false"; +// msg = "不存在该用户!"; +// } else { pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType)); pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); @@ -153,7 +153,7 @@ pgAlarmManager.save(pgAlarm); result = "true"; msg = "保存成功"; - } +// } } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java index 2e2fd96..5ff22a7 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java @@ -201,5 +201,33 @@ return resultMap; } + /** + * 根据设备类型报警阈值 + */ + @POST + @Path("getAlarmRuleByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getAlarmRuleByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgAlarmRule pgAlarmRule = null; + PgAlarmRuleDto pgAlarmRuleDto=null; + + try { + pgAlarmRule = pgAlarmRuleManager.getAlarmRuleBydevType(devType); + if (pgAlarmRule == null) + msg = "不存在报警阈值记录"; + else + msg = "报警阈值获取成功"; + } catch (Exception ex) { + ex.printStackTrace(); + msg = "报警阈值获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", new PgAlarmRuleDto(pgAlarmRule)); + + return resultMap; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 08220b8..5a71af5 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -45,15 +45,15 @@ @Produces(MediaType.APPLICATION_JSON) public Map addInPgPerson(@FormParam("userName") String userName, @FormParam("phoneNumber") String phoneNumber, - @FormParam("inTime") String inTime, - @FormParam("personType") String personType) throws Exception { + @FormParam("personType") String personType, + @FormParam("assetCode") String assetCode) throws Exception { Map resultMap = new HashMap(); String result = ""; String msg = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - PgInPgStatus pgInPgStatus = new PgInPgStatus(); +// PgInPgStatus pgInPgStatus = new PgInPgStatus(); PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); if (pgInPgPerson == null) { @@ -63,17 +63,22 @@ pgInPgPerson1.setPhoneNumber(phoneNumber); pgInPgPerson1.setPersonType(personType); pgInPgPerson1.setIsInPg(1); + pgInPgPerson1.setAssetCode(assetCode); pgInPgPersonManager.save(pgInPgPerson1); - pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); +// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); + result = "true"; + msg = "保存成功"; } - - pgInPgStatus.setInTime(sdf.parse(inTime)); + else { + result = "false"; + msg = "存在人员信息"; + } + /* pgInPgStatus.setInTime(sdf.parse(inTime)); pgInPgStatus.setPgInPgPersonId(pgInPgPerson); - pgInPgStatusManager.save(pgInPgStatus); - result = "true"; - msg = "保存成功"; + pgInPgStatusManager.save(pgInPgStatus);*/ + } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java new file mode 100644 index 0000000..507b3fe --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java @@ -0,0 +1,96 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.core.util.DateUtils; +import com.casic.PgInterface.patroler.domain.PgInPgPerson; +import com.casic.PgInterface.patroler.domain.PgInPgStatus; +import com.casic.PgInterface.patroler.manager.PgInPgPersonManager; +import com.casic.PgInterface.patroler.manager.PgInPgStatusManager; +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.HashMap; +import java.util.Map; + +@Component +@Path("pgInPgStatus") +public class PgInPgStatusRs { + @Resource + private PgInPgStatusManager pgInPgStatusManager; + + @Resource + private PgInPgPersonManager pgInPgPersonManager; + + @POST + @Path("addPgInTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgInTime(@FormParam("inTime") String inTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgStatus pgInPgStatus=new PgInPgStatus(); + + if(inTime!=null) + pgInPgStatus.setInTime(DateUtils.sdf4.parse(inTime)); + pgInPgStatus.setPgInPgPersonId(pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode)); + + pgInPgStatusManager.save(pgInPgStatus); + msg="入廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="入廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + @POST + @Path("addPgOutTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgOutTime(@FormParam("outTime") String outTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgPerson pgInPgPerson=pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode); + + pgInPgPerson.setIsInPg(0); + pgInPgPersonManager.save(pgInPgPerson); + + PgInPgStatus pgInPgStatus=pgInPgStatusManager.getPgInPgStatusByPgInPgPerson(pgInPgPerson); + if(outTime!=null) + pgInPgStatus.setOutTime(DateUtils.sdf4.parse(outTime)); + + pgInPgStatusManager.save(pgInPgStatus); + + msg="出廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="出廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java index 8485cce..fa66327 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java @@ -101,4 +101,16 @@ return pgInPgInfoDtoList; } + public PgInPgPerson getPgInPgPersonByAssetCode(String assetCode) { + Criteria criteria = createCriteria(PgInPgPerson.class); + criteria.add(Restrictions.eq("assetCode", assetCode)); + criteria.addOrder(Order.desc("id")); + List pgInPgPersonList = criteria.list(); + + if (pgInPgPersonList != null && pgInPgPersonList.size() != 0) + return pgInPgPersonList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index aea24b4..b4424eb 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -106,4 +106,17 @@ return pgInPgInfoDtoList; } + public PgInPgStatus getPgInPgStatusByPgInPgPerson(PgInPgPerson pgInPgPerson){ + Criteria criteria = createCriteria(PgInPgStatus.class); + criteria.add(Restrictions.eq("pgInPgPersonId", pgInPgPerson)); +// criteria.add(Restrictions.eq("outTime",null)); + criteria.addOrder(Order.asc("id")); + + List pgInPgStatusList = criteria.list(); + if(pgInPgStatusList!=null&&pgInPgStatusList.size()!=0) + return pgInPgStatusList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index c6b9e87..2b9c5ec 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -137,10 +137,10 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { PgAlarm pgAlarm = new PgAlarm(); - if (!pgPatrolerManager.userNameIsExits(userName)) { - result = "false"; - msg = "不存在该用户!"; - } else { +// if (!pgPatrolerManager.userNameIsExits(userName)) { +// result = "false"; +// msg = "不存在该用户!"; +// } else { pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType)); pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); @@ -153,7 +153,7 @@ pgAlarmManager.save(pgAlarm); result = "true"; msg = "保存成功"; - } +// } } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java index 2e2fd96..5ff22a7 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java @@ -201,5 +201,33 @@ return resultMap; } + /** + * 根据设备类型报警阈值 + */ + @POST + @Path("getAlarmRuleByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getAlarmRuleByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgAlarmRule pgAlarmRule = null; + PgAlarmRuleDto pgAlarmRuleDto=null; + + try { + pgAlarmRule = pgAlarmRuleManager.getAlarmRuleBydevType(devType); + if (pgAlarmRule == null) + msg = "不存在报警阈值记录"; + else + msg = "报警阈值获取成功"; + } catch (Exception ex) { + ex.printStackTrace(); + msg = "报警阈值获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", new PgAlarmRuleDto(pgAlarmRule)); + + return resultMap; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 08220b8..5a71af5 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -45,15 +45,15 @@ @Produces(MediaType.APPLICATION_JSON) public Map addInPgPerson(@FormParam("userName") String userName, @FormParam("phoneNumber") String phoneNumber, - @FormParam("inTime") String inTime, - @FormParam("personType") String personType) throws Exception { + @FormParam("personType") String personType, + @FormParam("assetCode") String assetCode) throws Exception { Map resultMap = new HashMap(); String result = ""; String msg = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - PgInPgStatus pgInPgStatus = new PgInPgStatus(); +// PgInPgStatus pgInPgStatus = new PgInPgStatus(); PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); if (pgInPgPerson == null) { @@ -63,17 +63,22 @@ pgInPgPerson1.setPhoneNumber(phoneNumber); pgInPgPerson1.setPersonType(personType); pgInPgPerson1.setIsInPg(1); + pgInPgPerson1.setAssetCode(assetCode); pgInPgPersonManager.save(pgInPgPerson1); - pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); +// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); + result = "true"; + msg = "保存成功"; } - - pgInPgStatus.setInTime(sdf.parse(inTime)); + else { + result = "false"; + msg = "存在人员信息"; + } + /* pgInPgStatus.setInTime(sdf.parse(inTime)); pgInPgStatus.setPgInPgPersonId(pgInPgPerson); - pgInPgStatusManager.save(pgInPgStatus); - result = "true"; - msg = "保存成功"; + pgInPgStatusManager.save(pgInPgStatus);*/ + } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java new file mode 100644 index 0000000..507b3fe --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java @@ -0,0 +1,96 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.core.util.DateUtils; +import com.casic.PgInterface.patroler.domain.PgInPgPerson; +import com.casic.PgInterface.patroler.domain.PgInPgStatus; +import com.casic.PgInterface.patroler.manager.PgInPgPersonManager; +import com.casic.PgInterface.patroler.manager.PgInPgStatusManager; +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.HashMap; +import java.util.Map; + +@Component +@Path("pgInPgStatus") +public class PgInPgStatusRs { + @Resource + private PgInPgStatusManager pgInPgStatusManager; + + @Resource + private PgInPgPersonManager pgInPgPersonManager; + + @POST + @Path("addPgInTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgInTime(@FormParam("inTime") String inTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgStatus pgInPgStatus=new PgInPgStatus(); + + if(inTime!=null) + pgInPgStatus.setInTime(DateUtils.sdf4.parse(inTime)); + pgInPgStatus.setPgInPgPersonId(pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode)); + + pgInPgStatusManager.save(pgInPgStatus); + msg="入廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="入廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + @POST + @Path("addPgOutTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgOutTime(@FormParam("outTime") String outTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgPerson pgInPgPerson=pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode); + + pgInPgPerson.setIsInPg(0); + pgInPgPersonManager.save(pgInPgPerson); + + PgInPgStatus pgInPgStatus=pgInPgStatusManager.getPgInPgStatusByPgInPgPerson(pgInPgPerson); + if(outTime!=null) + pgInPgStatus.setOutTime(DateUtils.sdf4.parse(outTime)); + + pgInPgStatusManager.save(pgInPgStatus); + + msg="出廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="出廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 23693f4..998345b 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -26,20 +26,11 @@ private static Logger logger = LoggerFactory.getLogger(PgLogRs.class); + @Resource private PgLogManager pgLogManager; - + @Resource private PgUserManager pgPatrolerManager; - @Resource - public void setPgLogManager(PgLogManager pgLogManager) { - this.pgLogManager = pgLogManager; - } - - @Resource - public void setPgPatrolerManager(PgUserManager pgPatrolerManager) { - this.pgPatrolerManager = pgPatrolerManager; - } - /** * 新增日志 */ diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 98ff2e5..dfcb131 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -146,7 +146,10 @@ List pgInPgInfoDtoList = new ArrayList(); try { pgInPgInfoDtoList = pgInPgStatusManager.getTodayInPgInfo(); - msg = "信息获取成功"; + if(pgInPgInfoDtoList!=null||pgInPgInfoDtoList.size()!=0) + msg = "信息获取成功"; + else + msg="当天没有入廊人员信息"; } catch (Exception e) { e.printStackTrace(); msg = "信息获取失败"; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + + - - @@ -315,7 +397,8 @@ - + + @@ -744,13 +827,15 @@ - - - 1512955169294 - 1513847487904 @@ -1088,11 +1173,18 @@ - - @@ -1104,31 +1196,35 @@ - - + - + + + + - + - + - + - - + + + + @@ -1139,7 +1235,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1181,7 +1319,8 @@ - @@ -1200,237 +1339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1438,13 +1346,6 @@ - - - - - - - @@ -1466,13 +1367,6 @@ - - - - - - - @@ -1480,20 +1374,6 @@ - - - - - - - - - - - - - - @@ -1501,13 +1381,6 @@ - - - - - - - @@ -1515,40 +1388,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1560,38 +1399,307 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java index 5545fac..955d4d5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPartition.java @@ -19,7 +19,7 @@ private long id; private String parName;//分区名称 - private String road;//所属道路 +// private String road;//所属道路 private String pgPosition;//仓段位置 private String pgNum;//仓位数量 private String pgType;//仓位类型 @@ -27,6 +27,7 @@ private Date buildDate;//建设年代 private String material;//建设材质 private int active;//状态位 + private long pgRoadId;//所属道路 private List pipeGalleryList;//管廊仓 private List pgConstructionList;//施工 @@ -49,14 +50,14 @@ this.parName = parName; } - @Column(name = "ROAD") - public String getRoad() { - return road; - } - - public void setRoad(String road) { - this.road = road; - } +// @Column(name = "ROAD") +// public String getRoad() { +// return road; +// } +// +// public void setRoad(String road) { +// this.road = road; +// } @Column(name = "PGPOSITION") public String getPgPosition() { @@ -121,6 +122,16 @@ this.active = active; } + @Column(name="PGROADID") + public long getPgRoadId() { + return pgRoadId; + } + + public void setPgRoadId(long pgRoadId) { + this.pgRoadId = pgRoadId; + } + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgPartitionId") public List getPipeGalleryList() { return pipeGalleryList; diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java new file mode 100644 index 0000000..220d7a8 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgRoad.java @@ -0,0 +1,35 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +@Table(name = "PG_ROAD") +@SequenceGenerator(name = "SEQ_PG_ROAD_ID", sequenceName = "SEQ_PG_ROAD_ID",allocationSize=1,initialValue=1) +public class PgRoad implements Serializable{ + + private static final long serialVersionUID = 1L; + private long id; + private String roadName; + + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_ROAD_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + @Column(name = "ROADNAME") + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java index 07cc505..2f212f5 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -131,4 +131,5 @@ this.setActive(String.valueOf(pgAlarm.getActive())); this.setDevType(pgAlarm.getAlarmDevId().getDevType()); } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java index 95c18b4..63860f6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPartitionDto.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.devTable.dto; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import java.io.Serializable; import java.text.SimpleDateFormat; @@ -21,7 +22,6 @@ private String material;//建设材质 private String active;//状态位 - public String getId() { return id; } @@ -102,13 +102,13 @@ this.material = material; } - public PgPartitionDto(PgPartition pgPartition) + public PgPartitionDto(PgPartition pgPartition,PgRoadManager pgRoadManager) { SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPartition.getId())); this.setParName(pgPartition.getParName()); - this.setRoad(pgPartition.getRoad()); + this.setRoad(pgRoadManager.get(pgPartition.getPgRoadId()).getRoadName()); this.setPgPosition(pgPartition.getPgPosition()); this.setPgNum(pgPartition.getPgNum()); this.setPgType(pgPartition.getPgType()); diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java new file mode 100644 index 0000000..0cb61e3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgRoadDto.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgRoad; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class PgRoadDto implements Serializable { + + private long id; + private String roadName; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public static PgRoadDto ConvertToDTO(PgRoad pgRoad) + { + PgRoadDto pgRoadDto=new PgRoadDto(); + pgRoadDto.setId(pgRoad.getId()); + pgRoadDto.setRoadName(pgRoad.getRoadName()); + + return pgRoadDto; + } + + public static List ConvertToDTOList(List pgRoadList){ + List pgRoadDtoList=new ArrayList(); + for(PgRoad pgRoad:pgRoadList){ + pgRoadDtoList.add(ConvertToDTO(pgRoad)); + } + + return pgRoadDtoList; + } +} 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 cf407bb..594283e 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -7,7 +7,6 @@ import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; -import com.casic.PgInterface.patroler.dto.PgInPgInfoDto; import org.hibernate.Criteria; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; @@ -147,11 +146,12 @@ Criteria criteria=createCriteria(PgAlarm.class); criteria.add(Restrictions.eq("active",1)); - if(isDevFault.equals("true")) - criteria.add(Restrictions.eq("alarmTypeId",pgAlarmType)); - else - criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); - + if(isDevFault!=null) { + if (isDevFault.equals("true")) + criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType)); + else + criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType)); + } List pgAlarmList = criteria.list(); List pgAlarmDtoList=new ArrayList(); for(PgAlarm pgAlarm : pgAlarmList) 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 65842d3..82cf045 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPartitionManager.java @@ -9,6 +9,7 @@ import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,9 @@ @Service public class PgPartitionManager extends HibernateEntityDao { + @Resource + PgRoadManager pgRoadManager; + public PgPartition getPartitionByParName(String parName) { Criteria criteria = getSession().createCriteria(PgPartition.class); criteria.add(Restrictions.eq("parName", parName)); @@ -60,7 +64,7 @@ List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; @@ -76,7 +80,7 @@ return null; List pgPartitionDtoList=new ArrayList(); for(PgPartition pgPartition:pgPartitionList) { - pgPartitionDtoList.add(new PgPartitionDto(pgPartition)); + pgPartitionDtoList.add(new PgPartitionDto(pgPartition,pgRoadManager)); } return pgPartitionDtoList; } diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java new file mode 100644 index 0000000..3e02b42 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgRoadManager.java @@ -0,0 +1,26 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PgRoadManager extends HibernateEntityDao { + + public PgRoad getPgRoadByName(String roadName){ + Criteria criteria=createCriteria(PgRoad.class); + + criteria.add(Restrictions.eq("roadName",roadName)); + List pgRoadList=criteria.list(); + + if(pgRoadList!=null&&pgRoadList.size()!=0) + return pgRoadList.get(0); + else + return null; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java index 913428b..9bbeb14 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgPerson.java @@ -18,6 +18,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别:监控人员、外巡人员和内巡(维修)人员 private int isInPg;//是否在廊内 + private String assetCode;//资产编号 private List pgInPgStatuses; @Id @@ -66,6 +67,15 @@ this.isInPg = isInPg; } + @Column(name = "ASSETCODE") + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgInPgPersonId") public List getPgInPgStatuses() { return pgInPgStatuses; @@ -75,4 +85,4 @@ this.pgInPgStatuses = pgInPgStatuses; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java index 6ac1a71..de643b9 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgInPgStatus.java @@ -59,4 +59,5 @@ public void setPgInPgPersonId(PgInPgPerson pgInPgPersonId) { this.pgInPgPersonId = pgInPgPersonId; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java index 2edddc8..725077a 100644 --- a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -21,6 +21,9 @@ private Date beginTime;//开始时间 private String timeLimt;//计划工期 private String describe;//任务描述 + //项目, + + private int active;//状态位 private List pgMaintainDocList;//施工文档 private PgMaintainType pgMaintainType;//维护类别 diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java index 69fc7f3..a347ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgPersonDto.java @@ -14,7 +14,7 @@ private String phoneNumber;//联系方式 private String personType;//人员类别 private String isInPg; - + private String assetCode; private String inPgNum; public String getId() { @@ -65,13 +65,22 @@ this.inPgNum = inPgNum; } + public String getAssetCode() { + return assetCode; + } + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + public PgInPgPersonDto(PgInPgPerson pgInPgPerson) { this.setId(String.valueOf(pgInPgPerson.getId())); this.setUserName(pgInPgPerson.getUserName()); this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setPersonType(pgInPgPerson.getPersonType()); + this.setAssetCode(pgInPgPerson.getAssetCode()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java index 34cf237..c132c98 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgAlarmRuleManager.java @@ -36,7 +36,8 @@ criteria.add(Restrictions.eq("devType", devType)); List pgAlarmRuleList=criteria.list(); - if(pgAlarmRuleList.size()==0) + + if(pgAlarmRuleList==null||pgAlarmRuleList.size()==0) return null; else return pgAlarmRuleList.get(0); diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java index 8485cce..fa66327 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgPersonManager.java @@ -101,4 +101,16 @@ return pgInPgInfoDtoList; } + public PgInPgPerson getPgInPgPersonByAssetCode(String assetCode) { + Criteria criteria = createCriteria(PgInPgPerson.class); + criteria.add(Restrictions.eq("assetCode", assetCode)); + criteria.addOrder(Order.desc("id")); + List pgInPgPersonList = criteria.list(); + + if (pgInPgPersonList != null && pgInPgPersonList.size() != 0) + return pgInPgPersonList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index aea24b4..b4424eb 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -106,4 +106,17 @@ return pgInPgInfoDtoList; } + public PgInPgStatus getPgInPgStatusByPgInPgPerson(PgInPgPerson pgInPgPerson){ + Criteria criteria = createCriteria(PgInPgStatus.class); + criteria.add(Restrictions.eq("pgInPgPersonId", pgInPgPerson)); +// criteria.add(Restrictions.eq("outTime",null)); + criteria.addOrder(Order.asc("id")); + + List pgInPgStatusList = criteria.list(); + if(pgInPgStatusList!=null&&pgInPgStatusList.size()!=0) + return pgInPgStatusList.get(0); + else + return null; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index c6b9e87..2b9c5ec 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -137,10 +137,10 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { PgAlarm pgAlarm = new PgAlarm(); - if (!pgPatrolerManager.userNameIsExits(userName)) { - result = "false"; - msg = "不存在该用户!"; - } else { +// if (!pgPatrolerManager.userNameIsExits(userName)) { +// result = "false"; +// msg = "不存在该用户!"; +// } else { pgAlarm.setAlarmTypeId(pgAlarmTypeManager.getAlarmTypeByAlarmType(alarmType)); pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); @@ -153,7 +153,7 @@ pgAlarmManager.save(pgAlarm); result = "true"; msg = "保存成功"; - } +// } } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java index 2e2fd96..5ff22a7 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRuleRs.java @@ -201,5 +201,33 @@ return resultMap; } + /** + * 根据设备类型报警阈值 + */ + @POST + @Path("getAlarmRuleByDevType") + @Produces(MediaType.APPLICATION_JSON) + public Map getAlarmRuleByDevType(@FormParam("devType") String devType) throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + PgAlarmRule pgAlarmRule = null; + PgAlarmRuleDto pgAlarmRuleDto=null; + + try { + pgAlarmRule = pgAlarmRuleManager.getAlarmRuleBydevType(devType); + if (pgAlarmRule == null) + msg = "不存在报警阈值记录"; + else + msg = "报警阈值获取成功"; + } catch (Exception ex) { + ex.printStackTrace(); + msg = "报警阈值获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", new PgAlarmRuleDto(pgAlarmRule)); + + return resultMap; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 08220b8..5a71af5 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -45,15 +45,15 @@ @Produces(MediaType.APPLICATION_JSON) public Map addInPgPerson(@FormParam("userName") String userName, @FormParam("phoneNumber") String phoneNumber, - @FormParam("inTime") String inTime, - @FormParam("personType") String personType) throws Exception { + @FormParam("personType") String personType, + @FormParam("assetCode") String assetCode) throws Exception { Map resultMap = new HashMap(); String result = ""; String msg = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { - PgInPgStatus pgInPgStatus = new PgInPgStatus(); +// PgInPgStatus pgInPgStatus = new PgInPgStatus(); PgInPgPerson pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); if (pgInPgPerson == null) { @@ -63,17 +63,22 @@ pgInPgPerson1.setPhoneNumber(phoneNumber); pgInPgPerson1.setPersonType(personType); pgInPgPerson1.setIsInPg(1); + pgInPgPerson1.setAssetCode(assetCode); pgInPgPersonManager.save(pgInPgPerson1); - pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); +// pgInPgPerson = pgInPgPersonManager.getPersonByUserName(userName); + result = "true"; + msg = "保存成功"; } - - pgInPgStatus.setInTime(sdf.parse(inTime)); + else { + result = "false"; + msg = "存在人员信息"; + } + /* pgInPgStatus.setInTime(sdf.parse(inTime)); pgInPgStatus.setPgInPgPersonId(pgInPgPerson); - pgInPgStatusManager.save(pgInPgStatus); - result = "true"; - msg = "保存成功"; + pgInPgStatusManager.save(pgInPgStatus);*/ + } catch (Exception e) { result = "false"; msg = "保存失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java new file mode 100644 index 0000000..507b3fe --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgStatusRs.java @@ -0,0 +1,96 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.core.util.DateUtils; +import com.casic.PgInterface.patroler.domain.PgInPgPerson; +import com.casic.PgInterface.patroler.domain.PgInPgStatus; +import com.casic.PgInterface.patroler.manager.PgInPgPersonManager; +import com.casic.PgInterface.patroler.manager.PgInPgStatusManager; +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.HashMap; +import java.util.Map; + +@Component +@Path("pgInPgStatus") +public class PgInPgStatusRs { + @Resource + private PgInPgStatusManager pgInPgStatusManager; + + @Resource + private PgInPgPersonManager pgInPgPersonManager; + + @POST + @Path("addPgInTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgInTime(@FormParam("inTime") String inTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgStatus pgInPgStatus=new PgInPgStatus(); + + if(inTime!=null) + pgInPgStatus.setInTime(DateUtils.sdf4.parse(inTime)); + pgInPgStatus.setPgInPgPersonId(pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode)); + + pgInPgStatusManager.save(pgInPgStatus); + msg="入廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="入廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + @POST + @Path("addPgOutTime") + @Produces(MediaType.APPLICATION_JSON) + public Map addPgOutTime(@FormParam("outTime") String outTime, + @FormParam("assetCode") String assetCode){ + Map resultMap=new HashMap(); + + String result=""; + String msg=""; + try{ + PgInPgPerson pgInPgPerson=pgInPgPersonManager.getPgInPgPersonByAssetCode(assetCode); + + pgInPgPerson.setIsInPg(0); + pgInPgPersonManager.save(pgInPgPerson); + + PgInPgStatus pgInPgStatus=pgInPgStatusManager.getPgInPgStatusByPgInPgPerson(pgInPgPerson); + if(outTime!=null) + pgInPgStatus.setOutTime(DateUtils.sdf4.parse(outTime)); + + pgInPgStatusManager.save(pgInPgStatus); + + msg="出廊时间提交成功"; + result="true"; + } + catch (Exception e){ + e.printStackTrace(); + msg="出廊时间提交失败"; + result="false"; + } + + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 23693f4..998345b 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -26,20 +26,11 @@ private static Logger logger = LoggerFactory.getLogger(PgLogRs.class); + @Resource private PgLogManager pgLogManager; - + @Resource private PgUserManager pgPatrolerManager; - @Resource - public void setPgLogManager(PgLogManager pgLogManager) { - this.pgLogManager = pgLogManager; - } - - @Resource - public void setPgPatrolerManager(PgUserManager pgPatrolerManager) { - this.pgPatrolerManager = pgPatrolerManager; - } - /** * 新增日志 */ diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 98ff2e5..dfcb131 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -146,7 +146,10 @@ List pgInPgInfoDtoList = new ArrayList(); try { pgInPgInfoDtoList = pgInPgStatusManager.getTodayInPgInfo(); - msg = "信息获取成功"; + if(pgInPgInfoDtoList!=null||pgInPgInfoDtoList.size()!=0) + msg = "信息获取成功"; + else + msg="当天没有入廊人员信息"; } catch (Exception e) { e.printStackTrace(); msg = "信息获取失败"; diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 8942bee..d3c10d4 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.devTable.domain.PgPartition; import com.casic.PgInterface.devTable.dto.PgPartitionDto; 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; @@ -27,8 +28,8 @@ @Resource private PgPartitionManager pgPartitionManager; - - + @Resource + private PgRoadManager pgRoadManager; /** * 新增分区 @@ -56,7 +57,7 @@ } else { PgPartition pgPartition = new PgPartition(); pgPartition.setParName(parName); - pgPartition.setRoad(road); + pgPartition.setPgRoadId(pgRoadManager.getPgRoadByName(road).getId()); pgPartition.setPgPosition(pgPosition); pgPartition.setPgNum(pgNum); pgPartition.setPgType(pgType); @@ -87,14 +88,14 @@ @Path("editPartition") @Produces(MediaType.APPLICATION_JSON) public Map editPartition(@FormParam("id") String id, - @FormParam("parName") String parName, - @FormParam("road") String road, - @FormParam("pgPosition") String pgPosition, - @FormParam("pgNum") String pgNum, - @FormParam("pgType") String pgType, - @FormParam("pgLength") String pgLength, - @FormParam("buildDate") String buildDate, - @FormParam("material") String material) throws Exception { + @FormParam("parName") String parName, + @FormParam("road") String road, + @FormParam("pgPosition") String pgPosition, + @FormParam("pgNum") String pgNum, + @FormParam("pgType") String pgType, + @FormParam("pgLength") String pgLength, + @FormParam("buildDate") String buildDate, + @FormParam("material") String material) throws Exception { Map resultMap = new HashMap(); String result = ""; @@ -104,25 +105,25 @@ SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); try { - if (pgPartitionManager.isExitPartition(parName,id)) { - result = "false"; - msg = "已存在分区:"+parName; - } else { - PgPartition pgPartition = pgPartitionManager.get(Long.valueOf(id)); - pgPartition.setParName(parName); - pgPartition.setRoad(road); - pgPartition.setPgPosition(pgPosition); - pgPartition.setPgNum(pgNum); - pgPartition.setPgType(pgType); - pgPartition.setPgLength(pgLength); - pgPartition.setBuildDate(sdf.parse(buildDate)); - pgPartition.setMaterial(material); - pgPartition.setActive(1); + if (pgPartitionManager.isExitPartition(parName,id)) { + result = "false"; + msg = "已存在分区:"+parName; + } else { + PgPartition pgPartition = pgPartitionManager.get(Long.valueOf(id)); + pgPartition.setParName(parName); + pgPartition.setPgRoadId(pgRoadManager.getPgRoadByName(road).getId()); + pgPartition.setPgPosition(pgPosition); + pgPartition.setPgNum(pgNum); + pgPartition.setPgType(pgType); + pgPartition.setPgLength(pgLength); + pgPartition.setBuildDate(sdf.parse(buildDate)); + pgPartition.setMaterial(material); + pgPartition.setActive(1); - pgPartitionManager.save(pgPartition); - result = "true"; - msg = "编辑成功"; - } + pgPartitionManager.save(pgPartition); + result = "true"; + msg = "编辑成功"; + } } catch (Exception e) { result = "false"; diff --git a/~WRL1302.tmp b/~WRL1302.tmp deleted file mode 100644 index 88ef0d2..0000000 --- a/~WRL1302.tmp +++ /dev/null Binary files differ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d07097f..2e977ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,17 +6,31 @@ - - + + + + + - - - + + + + + + + + + + + + + - + + @@ -24,6 +38,7 @@ + - - + + - - + + + + + + + + + + + - - - - - - + - + - - + + - - - - - - + + + + + + + + + + + + + @@ -111,17 +146,24 @@ + + + pgPipeLineLengthStatic.setLineType(String.valueOf(objectArray[0])) getDeviceStatisticByDevType getPersonNumInPgByMonth - getTodayInPgInfo getConstructionToday constructionType getConstructionNum getPipeGallerys getInPgNum + getTodayInPgInfo @@ -141,11 +183,31 @@ @@ -209,8 +271,8 @@ - @@ -222,6 +284,8 @@ + + @@ -271,21 +335,39 @@ - + - + + + + + + + + + + + + + + + + + + + + +