diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java index 620bbf3..c1c1c68 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -65,12 +65,14 @@ this.active = active; } - public PgMaintainDto(PgMaintain pgMaintain) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgMaintainDto(PgMaintain pgMaintain) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setMainTainer(pgMaintain.getMainTainer()); - this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + if (pgMaintain.getBeginTime() != null) + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgMaintain.getTimeLimt()); this.setDescribe(pgMaintain.getDescribe()); this.setActive(String.valueOf(pgMaintain.getActive())); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java index 620bbf3..c1c1c68 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -65,12 +65,14 @@ this.active = active; } - public PgMaintainDto(PgMaintain pgMaintain) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgMaintainDto(PgMaintain pgMaintain) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setMainTainer(pgMaintain.getMainTainer()); - this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + if (pgMaintain.getBeginTime() != null) + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgMaintain.getTimeLimt()); this.setDescribe(pgMaintain.getDescribe()); this.setActive(String.valueOf(pgMaintain.getActive())); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java index 2f101b0..c760b93 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.patroler.domain.PgPatrolDoc; import java.io.Serializable; -import java.text.SimpleDateFormat; /** * Created by Administrator on 2018/4/24. @@ -86,11 +85,13 @@ } - public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) - { + public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) { this.setId(String.valueOf(pgPatrolDoc.getPgpatrol_id())); this.setPatroler(pgPatrolDoc.getPgpatrol_id().getPatroler()); - this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + if (pgPatrolDoc.getPgpatrol_id().getBeginTime() != null) + this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + else + this.setBeginTime(""); this.setList_name(pgPatrolDoc.getList_name()); this.setFile_name(pgPatrolDoc.getFile_name()); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java index 620bbf3..c1c1c68 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -65,12 +65,14 @@ this.active = active; } - public PgMaintainDto(PgMaintain pgMaintain) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgMaintainDto(PgMaintain pgMaintain) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setMainTainer(pgMaintain.getMainTainer()); - this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + if (pgMaintain.getBeginTime() != null) + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgMaintain.getTimeLimt()); this.setDescribe(pgMaintain.getDescribe()); this.setActive(String.valueOf(pgMaintain.getActive())); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java index 2f101b0..c760b93 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.patroler.domain.PgPatrolDoc; import java.io.Serializable; -import java.text.SimpleDateFormat; /** * Created by Administrator on 2018/4/24. @@ -86,11 +85,13 @@ } - public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) - { + public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) { this.setId(String.valueOf(pgPatrolDoc.getPgpatrol_id())); this.setPatroler(pgPatrolDoc.getPgpatrol_id().getPatroler()); - this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + if (pgPatrolDoc.getPgpatrol_id().getBeginTime() != null) + this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + else + this.setBeginTime(""); this.setList_name(pgPatrolDoc.getList_name()); this.setFile_name(pgPatrolDoc.getFile_name()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java index 39fd3c5..fbf4ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -65,13 +65,15 @@ this.active = active; } - public PgPatrolDto(PgPatrol pgPatrol) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgPatrolDto(PgPatrol pgPatrol) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgPatrol.getId())); this.setPatroler(patroler); - this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + if (pgPatrol.getBeginTime() != null) + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgPatrol.getTimeLimt()); this.setDescribe(pgPatrol.getDescribe()); this.setActive(String.valueOf(pgPatrol.getActive())); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java index 620bbf3..c1c1c68 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -65,12 +65,14 @@ this.active = active; } - public PgMaintainDto(PgMaintain pgMaintain) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgMaintainDto(PgMaintain pgMaintain) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setMainTainer(pgMaintain.getMainTainer()); - this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + if (pgMaintain.getBeginTime() != null) + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgMaintain.getTimeLimt()); this.setDescribe(pgMaintain.getDescribe()); this.setActive(String.valueOf(pgMaintain.getActive())); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java index 2f101b0..c760b93 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.patroler.domain.PgPatrolDoc; import java.io.Serializable; -import java.text.SimpleDateFormat; /** * Created by Administrator on 2018/4/24. @@ -86,11 +85,13 @@ } - public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) - { + public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) { this.setId(String.valueOf(pgPatrolDoc.getPgpatrol_id())); this.setPatroler(pgPatrolDoc.getPgpatrol_id().getPatroler()); - this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + if (pgPatrolDoc.getPgpatrol_id().getBeginTime() != null) + this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + else + this.setBeginTime(""); this.setList_name(pgPatrolDoc.getList_name()); this.setFile_name(pgPatrolDoc.getFile_name()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java index 39fd3c5..fbf4ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -65,13 +65,15 @@ this.active = active; } - public PgPatrolDto(PgPatrol pgPatrol) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgPatrolDto(PgPatrol pgPatrol) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgPatrol.getId())); this.setPatroler(patroler); - this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + if (pgPatrol.getBeginTime() != null) + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgPatrol.getTimeLimt()); this.setDescribe(pgPatrol.getDescribe()); this.setActive(String.valueOf(pgPatrol.getActive())); diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index d46f284..be5c5e4 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -109,7 +109,7 @@ /* * 按照天统计入廊人员次数 - */ + */ @POST @Path("getDayInPgStatistic") @Produces(MediaType.APPLICATION_JSON) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9df45c2..95d7134 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,26 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -30,7 +46,22 @@ - + + + + + + + + + + + + + + + + @@ -48,16 +79,6 @@ @@ -192,6 +223,21 @@ + + + + + + + + + + + @@ -227,6 +273,36 @@ + + + + + + + + + + + + + @@ -275,6 +351,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -336,19 +510,60 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -884,7 +1099,8 @@ - + + 1510219102698 @@ -1042,11 +1258,15 @@ 1528783523876 1528783523876 - - @@ -1078,10 +1298,11 @@ + - + @@ -1094,7 +1315,7 @@ - + @@ -1103,7 +1324,6 @@ - @@ -1123,7 +1343,6 @@ - @@ -1148,19 +1367,12 @@ - - - - file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java - 63 - - - - @@ -1168,333 +1380,94 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1503,58 +1476,348 @@ - - - - - - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java index 4fa1888..9cda025 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java @@ -105,15 +105,20 @@ ConstructionType = constructionType; } - public PgConstructionDto(PgConstruction pgConstruction) - { + public PgConstructionDto(PgConstruction pgConstruction) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgConstruction.getId())); this.setCs_name(pgConstruction.getCs_name()); this.setCs_detail(pgConstruction.getCs_detail()); - this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); - this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + if (pgConstruction.getCs_beginTime() != null) + this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime())); + else + this.setCs_beginTime(""); + if (pgConstruction.getCs_endTime() != null) + this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime())); + else + this.setCs_endTime(""); this.setCs_charge(pgConstruction.getCs_charge()); this.setCs_phone(pgConstruction.getCs_phone()); this.setCs_type(pgConstruction.getCs_type()); @@ -121,4 +126,5 @@ this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName()); this.setActive(String.valueOf(pgConstruction.getActive())); } + } diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java index 867388a..e685e27 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java @@ -80,7 +80,10 @@ this.setDoc_name(pgCsDocument.getDoc_name()); this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name()); this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type()); + if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null) this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime())); + else + this.setCs_time(""); this.setConstruct_doc(pgCsDocument.getConstruct_doc()); this.setActive(String.valueOf(pgCsDocument.getActive())); diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java index 52ed419..7608e8a 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCh4Dto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCh4Dto(PgCh4 pgCh4) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCh4Dto(PgCh4 pgCh4) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCh4.getId())); this.setValue(pgCh4.getCh4()); - this.setLogTime(sdf.format(pgCh4.getLogTime())); - this.setUpTime(sdf.format(pgCh4.getUpTime())); + if (pgCh4.getLogTime() != null) + this.setLogTime(sdf.format(pgCh4.getLogTime())); + else + this.setLogTime(""); + if (pgCh4.getUpTime() != null) + this.setUpTime(sdf.format(pgCh4.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCh4.getPgDeviceId().getDevCode()); this.setDevName(pgCh4.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java index b13d01c..530c1b9 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgCoDto.java @@ -65,16 +65,21 @@ this.devName = devName; } - public PgCoDto(PgCo pgCo) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgCoDto(PgCo pgCo) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgCo.getId())); this.setValue(pgCo.getCo()); - this.setLogTime(sdf.format(pgCo.getLogTime())); - this.setUpTime(sdf.format(pgCo.getUpTime())); + if (pgCo.getLogTime() != null) + this.setLogTime(sdf.format(pgCo.getLogTime())); + else + this.setLogTime(""); + if (pgCo.getUpTime() != null) + this.setUpTime(sdf.format(pgCo.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgCo.getPgDeviceId().getDevCode()); this.setDevName(pgCo.getPgDeviceId().getAssetName()); - } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java index c3928ac..72f857d 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgLocationDto.java @@ -83,17 +83,22 @@ this.post = post; } - public PgLocationDto(PgLocation pgLocation) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLocationDto(PgLocation pgLocation) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLocation.getId())); this.setUserName(pgLocation.getPgPatrolerId().getUserName()); this.setDepartment(pgLocation.getPgPatrolerId().getDepartment()); this.setPost(pgLocation.getPgPatrolerId().getPost()); this.setDevice(pgLocation.getPgDeviceId().getAssetName()); - this.setIntoTime(sdf.format(pgLocation.getIntoTime())); - this.setOutTime(sdf.format(pgLocation.getOutTime())); + if (pgLocation.getIntoTime() != null) + this.setIntoTime(sdf.format(pgLocation.getIntoTime())); + else + this.setIntoTime(""); + if (pgLocation.getOutTime() != null) + this.setOutTime(sdf.format(pgLocation.getOutTime())); + else + this.setOutTime(""); this.setPosition(pgLocation.getPosition()); } } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java index bdbbe58..f2f2847 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgO2Dto.java @@ -65,14 +65,19 @@ this.devName = devName; } - public PgO2Dto (PgO2 pgO2) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgO2Dto (PgO2 pgO2) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgO2.getId())); this.setValue(pgO2.getO2()); - this.setUpTime(sdf.format(pgO2.getUpTime())); - this.setLogTime(sdf.format(pgO2.getLogTime())); + if (pgO2.getUpTime() != null) + this.setUpTime(sdf.format(pgO2.getUpTime())); + else + this.setUpTime(""); + if (pgO2.getLogTime() != null) + this.setLogTime(sdf.format(pgO2.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgO2.getPgDeviceId().getDevCode()); this.setDevName(pgO2.getPgDeviceId().getAssetName()); } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java index f69078d..0f7d40b 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgShDto.java @@ -65,15 +65,21 @@ this.devName = devName; } - public PgShDto(PgSh pgSh) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgShDto(PgSh pgSh) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgSh.getId())); this.setValue(pgSh.getSh()); - this.setUpTime(sdf.format(pgSh.getUpTime())); - this.setLogTime(sdf.format(pgSh.getLogTime())); + if (pgSh.getUpTime() != null) + this.setUpTime(sdf.format(pgSh.getUpTime())); + else + this.setUpTime(""); + if (pgSh.getLogTime() != null) + this.setLogTime(sdf.format(pgSh.getLogTime())); + else + this.setLogTime(""); this.setDevCode(pgSh.getPgDeviceId().getDevCode()); this.setDevName(pgSh.getPgDeviceId().getAssetName()); } + } diff --git a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java index db9cfda..d948129 100644 --- a/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java +++ b/src/main/java/com/casic/PgInterface/devData/dto/PgTempHumDto.java @@ -74,17 +74,21 @@ this.devName = devName; } - public PgTempHumDto(PgTempHum pgTempHum) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgTempHumDto(PgTempHum pgTempHum) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgTempHum.getId())); this.setHum(pgTempHum.getHum()); this.setTemp(pgTempHum.getTemp()); - this.setLogTime(sdf.format(pgTempHum.getLogTime())); - this.setUpTime(sdf.format(pgTempHum.getUpTime())); + if (pgTempHum.getLogTime() != null) + this.setLogTime(sdf.format(pgTempHum.getLogTime())); + else + this.setLogTime(""); + if (pgTempHum.getUpTime() != null) + this.setUpTime(sdf.format(pgTempHum.getUpTime())); + else + this.setUpTime(""); this.setDevCode(pgTempHum.getPgDeviceId().getDevCode()); this.setDevName(pgTempHum.getPgDeviceId().getAssetName()); - } } diff --git a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java index a226aa0..f74d1fb 100644 --- a/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java +++ b/src/main/java/com/casic/PgInterface/devData/manager/PgCh4Manager.java @@ -41,6 +41,8 @@ criteria.add(Restrictions.le("upTime",calendar.getTime())); } + criteria.addOrder(Order.desc("upTime")); + List pgCh4List=criteria.list(); for (PgCh4 pgCh4 : pgCh4List) { 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 975c11b..656c0e6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgAlarmDto.java @@ -107,13 +107,15 @@ this.setId(String.valueOf(pgAlarm.getId())); this.setAlarmType(pgAlarm.getAlarmTypeId().getAlarmType()); this.setAlarmValue(pgAlarm.getAlarmValue()); - this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + if (pgAlarm.getAlarmDate() != null) + this.setAlarmDate(sdf.format(pgAlarm.getAlarmDate())); + else + this.setAlarmDate(""); this.setDescription(pgAlarm.getDescription()); this.setAlarmDevName(pgAlarm.getAlarmDevId().getAssetName()); this.setAlarmLocation(pgAlarm.getAlarmDevId().getPosition()); this.setUserName(pgAlarm.getUserId().getUserName()); this.setPhoneNumber(pgAlarm.getUserId().getPhoneNumber()); this.setActive(String.valueOf(pgAlarm.getActive())); - } } diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java index e7685ed..b9428b6 100644 --- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java @@ -110,15 +110,17 @@ this.active = active; } - public PgPipeLineDto(PgPipeLine pgPipeLine) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + public PgPipeLineDto(PgPipeLine pgPipeLine) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); this.setId(String.valueOf(pgPipeLine.getId())); this.setLineName(pgPipeLine.getLineName()); this.setLineType(pgPipeLine.getLineType()); this.setOwnerUnit(pgPipeLine.getOwnerUnit()); - this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + if (pgPipeLine.getEnterDate() != null) + this.setEnterDate(sdf.format(pgPipeLine.getEnterDate())); + else + this.setEnterDate(""); this.setLayerNum(pgPipeLine.getLayerNum()); this.setDiameter(pgPipeLine.getDiameter()); this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName()); 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 1601058..e5edcb4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -125,7 +125,7 @@ List pgAlarmTjDtoList = new ArrayList(); - String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm"; + String hql = "select count(*), to_char(pgAlarm.alarmDate, 'yyyy-mm-dd') from PgAlarm pgAlarm where 1=1 "; if (isDevFault.equals("true")) hql += " and pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -134,7 +134,7 @@ hql += " group by to_char(pgAlarm.alarmDate, 'yyyy-mm-dd')"; - List objects = this.getSession().createQuery(hql).list(); + List objects = (List)this.getSession().createQuery(hql).list(); for (int i = 0; i < objects.size(); i++) { PgAlarmTjDto pgAlarmTjDto = new PgAlarmTjDto(); pgAlarmTjDto.setAlarmNum(objects.get(i)[0].toString()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java index f36f35b..5863460 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgInfoDto.java @@ -90,7 +90,10 @@ this.setPhoneNumber(pgInPgPerson.getPhoneNumber()); this.setIsInPg(String.valueOf(pgInPgPerson.getIsInPg())); this.setPersonType(pgInPgPerson.getPersonType()); - this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + if (pgInPgStatus.getInTime() != null) + this.setLastInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setLastInTime(""); this.setInPgNum(String.valueOf(inPgNum)); } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java index e842335..8f79fc4 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgInPgStatusDto.java @@ -37,13 +37,18 @@ this.outTime = outTime; } - public PgInPgStatusDto(PgInPgStatus pgInPgStatus) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgInPgStatusDto(PgInPgStatus pgInPgStatus) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgInPgStatus.getId())); - this.setInTime(sdf.format(pgInPgStatus.getInTime())); - this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + if (pgInPgStatus.getInTime() != null) + this.setInTime(sdf.format(pgInPgStatus.getInTime())); + else + this.setInTime(""); + if (pgInPgStatus.getOutTime() != null) + this.setOutTime(sdf.format(pgInPgStatus.getOutTime())); + else + this.setOutTime(""); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java index 9316457..b10c42e 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgLogDto.java @@ -56,13 +56,15 @@ this.active = active; } - public PgLogDto(PgLog pgLog) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgLogDto(PgLog pgLog) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgLog.getId())); this.setOperate(pgLog.getOperate()); this.setUserName(pgLog.getUserId().getUserName()); - this.setOperateTime(sdf.format(pgLog.getOperateTime())); + if (pgLog.getOperateTime() != null) + this.setOperateTime(sdf.format(pgLog.getOperateTime())); + else + this.setOperateTime(""); this.setActive(String.valueOf(pgLog.getActive())); } } diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java index 620bbf3..c1c1c68 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -65,12 +65,14 @@ this.active = active; } - public PgMaintainDto(PgMaintain pgMaintain) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgMaintainDto(PgMaintain pgMaintain) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setMainTainer(pgMaintain.getMainTainer()); - this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + if (pgMaintain.getBeginTime() != null) + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgMaintain.getTimeLimt()); this.setDescribe(pgMaintain.getDescribe()); this.setActive(String.valueOf(pgMaintain.getActive())); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java index 2f101b0..c760b93 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDocDto.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.patroler.domain.PgPatrolDoc; import java.io.Serializable; -import java.text.SimpleDateFormat; /** * Created by Administrator on 2018/4/24. @@ -86,11 +85,13 @@ } - public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) - { + public PgPatrolDocDto(PgPatrolDoc pgPatrolDoc) { this.setId(String.valueOf(pgPatrolDoc.getPgpatrol_id())); this.setPatroler(pgPatrolDoc.getPgpatrol_id().getPatroler()); - this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + if (pgPatrolDoc.getPgpatrol_id().getBeginTime() != null) + this.setBeginTime(DateUtils.sdf4.format(pgPatrolDoc.getPgpatrol_id().getBeginTime())); + else + this.setBeginTime(""); this.setList_name(pgPatrolDoc.getList_name()); this.setFile_name(pgPatrolDoc.getFile_name()); diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java index 39fd3c5..fbf4ad2 100644 --- a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -65,13 +65,15 @@ this.active = active; } - public PgPatrolDto(PgPatrol pgPatrol) - { - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public PgPatrolDto(PgPatrol pgPatrol) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.setId(String.valueOf(pgPatrol.getId())); this.setPatroler(patroler); - this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + if (pgPatrol.getBeginTime() != null) + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + else + this.setBeginTime(""); this.setTimeLimt(pgPatrol.getTimeLimt()); this.setDescribe(pgPatrol.getDescribe()); this.setActive(String.valueOf(pgPatrol.getActive())); diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index d46f284..be5c5e4 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -109,7 +109,7 @@ /* * 按照天统计入廊人员次数 - */ + */ @POST @Path("getDayInPgStatistic") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index c260d95..2674aac 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -25,6 +25,7 @@ org.springframework.web.context.ContextLoaderListener + spring org.springframework.web.servlet.DispatcherServlet @@ -38,10 +39,12 @@ 1 + spring *.do + 401 /common/401.jsp @@ -58,9 +61,11 @@ java.lang.Throwable /common/500.jsp + org.springframework.web.context.request.RequestContextListener + \ No newline at end of file