diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 534f1eb..0ddbc4d 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,17 +31,8 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
@Resource
- private PgAlarmTypeManager pgAlarmTypeManager;
-
- @Resource
private PgAlarmManager pgAlarmManager;
- @Resource
- private PgUserManager pgPatrolerManager;
-
- @Resource
- private PgDeviceManager pgDeviceManager;
-
/**
* 获取报警信息
*/
@@ -53,7 +44,7 @@
@FormParam("endDay") String endDay,
@FormParam("isNew") String isNew,
@FormParam("page") int page,
- @FormParam("row") int rows) throws Exception {
+ @FormParam("rows") int rows) throws Exception {
Map resultMap = new HashMap<>();
String msg = "";
List pgAlarmDtoList = new ArrayList<>();
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 534f1eb..0ddbc4d 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,17 +31,8 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
@Resource
- private PgAlarmTypeManager pgAlarmTypeManager;
-
- @Resource
private PgAlarmManager pgAlarmManager;
- @Resource
- private PgUserManager pgPatrolerManager;
-
- @Resource
- private PgDeviceManager pgDeviceManager;
-
/**
* 获取报警信息
*/
@@ -53,7 +44,7 @@
@FormParam("endDay") String endDay,
@FormParam("isNew") String isNew,
@FormParam("page") int page,
- @FormParam("row") int rows) throws Exception {
+ @FormParam("rows") int rows) throws Exception {
Map resultMap = new HashMap<>();
String msg = "";
List pgAlarmDtoList = new ArrayList<>();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
index bf92fe4..b4b826e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
@@ -27,7 +27,6 @@
/**
* Created by zxh on 2018/3/27.
*/
-
@Component
@Path("pgConstruction")
public class PgConstructionRs {
@@ -56,9 +55,9 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String result = "";
String msg = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -78,9 +77,9 @@
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
logger.info("保存成功");
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -111,7 +110,7 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception{
Map resultMap = new HashMap();
@@ -136,9 +135,9 @@
pgConstruction.setCs_charge(cs_charge);
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -199,14 +198,15 @@
@Produces(MediaType.APPLICATION_JSON)
public Map searchConstruction(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName")String pgName,
@FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)throws Exception{
- Map resultMap=new HashMap();
+ @FormParam("endTime")String endTime,
+ @FormParam("page") int page,
+ @FormParam("rows") int rows)throws Exception{
+ Map resultMap=new HashMap<>();
String msg="";
- List pgConstructionDtoList=new ArrayList();
+ List pgConstructionDtoList=new ArrayList<>();
try{
- pgConstructionDtoList=pgConstructionManager.getPgContructionDtoByNameOrType(cs_name,cs_type,pgName,startTime,endTime);
+ pgConstructionDtoList=pgConstructionManager.getPgContructionDto(cs_name,cs_type,startTime,endTime,page,rows);
msg="信息获取成功";
}
catch(Exception e)
@@ -229,10 +229,10 @@
public Map getConstructionByTimeAndStatus(@FormParam("startTime") String startTime,
@FormParam("endTime") String endTime,
@FormParam("statisticType") String statisticType) throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String msg = "";
- List pgConstructionStiatisticList=new ArrayList();
+ List pgConstructionStiatisticList=new ArrayList<>();
try {
pgConstructionStiatisticList = pgConstructionManager.getConstructionByTimeAndStatus(startTime, endTime, statisticType);
if(pgConstructionStiatisticList==null)
@@ -259,8 +259,6 @@
String msg="";
List pgConstructionStiatisticList=new ArrayList<>();
- System.out.println("statisticType"+statisticType+"&&&&&&");
-
try{
pgConstructionStiatisticList=statisticType.equals("0")?pgConstructionManager.getStatisticByType():
pgConstructionManager.getStatisticByPar();
@@ -316,15 +314,14 @@
@Path("getConstructionDev")
@Produces(MediaType.APPLICATION_JSON)
public Map getConstructionDev(@FormParam("id") String id) throws Exception{
- Map resultMap=new HashMap();
+ Map resultMap=new HashMap<>();
String msg="";
- List pgDeviceDtoList =new ArrayList();
+ List pgDeviceDtoList =new ArrayList<>();
try{
-
PgConstruction pgConstruction=pgConstructionManager.get(Long.valueOf(id));
- pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getPgName());
+ pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getParName());
if(pgDeviceDtoList==null)
msg="信息获取失败";
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 534f1eb..0ddbc4d 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,17 +31,8 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
@Resource
- private PgAlarmTypeManager pgAlarmTypeManager;
-
- @Resource
private PgAlarmManager pgAlarmManager;
- @Resource
- private PgUserManager pgPatrolerManager;
-
- @Resource
- private PgDeviceManager pgDeviceManager;
-
/**
* 获取报警信息
*/
@@ -53,7 +44,7 @@
@FormParam("endDay") String endDay,
@FormParam("isNew") String isNew,
@FormParam("page") int page,
- @FormParam("row") int rows) throws Exception {
+ @FormParam("rows") int rows) throws Exception {
Map resultMap = new HashMap<>();
String msg = "";
List pgAlarmDtoList = new ArrayList<>();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
index bf92fe4..b4b826e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
@@ -27,7 +27,6 @@
/**
* Created by zxh on 2018/3/27.
*/
-
@Component
@Path("pgConstruction")
public class PgConstructionRs {
@@ -56,9 +55,9 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String result = "";
String msg = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -78,9 +77,9 @@
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
logger.info("保存成功");
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -111,7 +110,7 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception{
Map resultMap = new HashMap();
@@ -136,9 +135,9 @@
pgConstruction.setCs_charge(cs_charge);
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -199,14 +198,15 @@
@Produces(MediaType.APPLICATION_JSON)
public Map searchConstruction(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName")String pgName,
@FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)throws Exception{
- Map resultMap=new HashMap();
+ @FormParam("endTime")String endTime,
+ @FormParam("page") int page,
+ @FormParam("rows") int rows)throws Exception{
+ Map resultMap=new HashMap<>();
String msg="";
- List pgConstructionDtoList=new ArrayList();
+ List pgConstructionDtoList=new ArrayList<>();
try{
- pgConstructionDtoList=pgConstructionManager.getPgContructionDtoByNameOrType(cs_name,cs_type,pgName,startTime,endTime);
+ pgConstructionDtoList=pgConstructionManager.getPgContructionDto(cs_name,cs_type,startTime,endTime,page,rows);
msg="信息获取成功";
}
catch(Exception e)
@@ -229,10 +229,10 @@
public Map getConstructionByTimeAndStatus(@FormParam("startTime") String startTime,
@FormParam("endTime") String endTime,
@FormParam("statisticType") String statisticType) throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String msg = "";
- List pgConstructionStiatisticList=new ArrayList();
+ List pgConstructionStiatisticList=new ArrayList<>();
try {
pgConstructionStiatisticList = pgConstructionManager.getConstructionByTimeAndStatus(startTime, endTime, statisticType);
if(pgConstructionStiatisticList==null)
@@ -259,8 +259,6 @@
String msg="";
List pgConstructionStiatisticList=new ArrayList<>();
- System.out.println("statisticType"+statisticType+"&&&&&&");
-
try{
pgConstructionStiatisticList=statisticType.equals("0")?pgConstructionManager.getStatisticByType():
pgConstructionManager.getStatisticByPar();
@@ -316,15 +314,14 @@
@Path("getConstructionDev")
@Produces(MediaType.APPLICATION_JSON)
public Map getConstructionDev(@FormParam("id") String id) throws Exception{
- Map resultMap=new HashMap();
+ Map resultMap=new HashMap<>();
String msg="";
- List pgDeviceDtoList =new ArrayList();
+ List pgDeviceDtoList =new ArrayList<>();
try{
-
PgConstruction pgConstruction=pgConstructionManager.get(Long.valueOf(id));
- pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getPgName());
+ pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getParName());
if(pgDeviceDtoList==null)
msg="信息获取失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index 326b0c6..90d001c 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -33,7 +33,6 @@
private static Logger logger = LoggerFactory.getLogger(pgStatisticRs.class);
@Resource
private PgCsDocumentManager pgCsDocumentManager;
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@Resource
private PgConstructionManager pgConstructionManager;
@@ -44,7 +43,6 @@
@Path("addConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map addConstructDoc(
- @FormParam("list_name") String list_name,
@FormParam("doc_name") String doc_name,
@FormParam("construct_doc") String construct_doc,
@FormParam("cs_name") String cs_name)throws Exception {
@@ -58,13 +56,12 @@
if (StringUtils.isBlank(construct_doc)||StringUtils.isBlank(doc_name))
pgCsDocument.setConstruct_doc("");
else {
- pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name, list_name));
+ pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name,"ConstructDoc"));
}
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
- pgCsDocument.setList_name(list_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocument.setActive(1);
pgCsDocumentManager.save(pgCsDocument);
@@ -87,7 +84,6 @@
@Path("editConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
- @FormParam("list_name") String List_name,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -99,12 +95,11 @@
PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
if (pgCsDocument == null) {
result = "false";
- msg = "不存在该预案信息";
+ msg = "不存在施工文档";
} else {
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
- pgCsDocument.setActive(1);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocumentManager.save(pgCsDocument);
@@ -160,37 +155,28 @@
}
/*
- 按工程名称、工程类别、施工时间查询
+ 查询
*/
@POST
@Path("queryConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
- public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
- @FormParam("cs_type")String cs_type,
- @FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)
+ public Map queryConstructDoc(@FormParam("cs_name")String cs_name)
throws Exception{
- Map resultMap = new HashMap();
- List pgCsDocumentDtoList = new ArrayList();
+ Map resultMap = new HashMap<>();
+ List pgCsDocumentDtoList = new ArrayList<>();
String msg="";
String result="";
try {
- pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name, cs_type, startTime,endTime);
+ pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name);
if (pgCsDocumentDtoList != null)
- {
- result = "true";
msg = "获取数据成功";
- }else
- {
- result = "false";
+ else
msg = "没有满足条件的数据";
- }
}catch (Exception e){
e.printStackTrace();
- result = "false";
msg = "获取失败";
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 534f1eb..0ddbc4d 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,17 +31,8 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
@Resource
- private PgAlarmTypeManager pgAlarmTypeManager;
-
- @Resource
private PgAlarmManager pgAlarmManager;
- @Resource
- private PgUserManager pgPatrolerManager;
-
- @Resource
- private PgDeviceManager pgDeviceManager;
-
/**
* 获取报警信息
*/
@@ -53,7 +44,7 @@
@FormParam("endDay") String endDay,
@FormParam("isNew") String isNew,
@FormParam("page") int page,
- @FormParam("row") int rows) throws Exception {
+ @FormParam("rows") int rows) throws Exception {
Map resultMap = new HashMap<>();
String msg = "";
List pgAlarmDtoList = new ArrayList<>();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
index bf92fe4..b4b826e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
@@ -27,7 +27,6 @@
/**
* Created by zxh on 2018/3/27.
*/
-
@Component
@Path("pgConstruction")
public class PgConstructionRs {
@@ -56,9 +55,9 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String result = "";
String msg = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -78,9 +77,9 @@
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
logger.info("保存成功");
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -111,7 +110,7 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception{
Map resultMap = new HashMap();
@@ -136,9 +135,9 @@
pgConstruction.setCs_charge(cs_charge);
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -199,14 +198,15 @@
@Produces(MediaType.APPLICATION_JSON)
public Map searchConstruction(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName")String pgName,
@FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)throws Exception{
- Map resultMap=new HashMap();
+ @FormParam("endTime")String endTime,
+ @FormParam("page") int page,
+ @FormParam("rows") int rows)throws Exception{
+ Map resultMap=new HashMap<>();
String msg="";
- List pgConstructionDtoList=new ArrayList();
+ List pgConstructionDtoList=new ArrayList<>();
try{
- pgConstructionDtoList=pgConstructionManager.getPgContructionDtoByNameOrType(cs_name,cs_type,pgName,startTime,endTime);
+ pgConstructionDtoList=pgConstructionManager.getPgContructionDto(cs_name,cs_type,startTime,endTime,page,rows);
msg="信息获取成功";
}
catch(Exception e)
@@ -229,10 +229,10 @@
public Map getConstructionByTimeAndStatus(@FormParam("startTime") String startTime,
@FormParam("endTime") String endTime,
@FormParam("statisticType") String statisticType) throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String msg = "";
- List pgConstructionStiatisticList=new ArrayList();
+ List pgConstructionStiatisticList=new ArrayList<>();
try {
pgConstructionStiatisticList = pgConstructionManager.getConstructionByTimeAndStatus(startTime, endTime, statisticType);
if(pgConstructionStiatisticList==null)
@@ -259,8 +259,6 @@
String msg="";
List pgConstructionStiatisticList=new ArrayList<>();
- System.out.println("statisticType"+statisticType+"&&&&&&");
-
try{
pgConstructionStiatisticList=statisticType.equals("0")?pgConstructionManager.getStatisticByType():
pgConstructionManager.getStatisticByPar();
@@ -316,15 +314,14 @@
@Path("getConstructionDev")
@Produces(MediaType.APPLICATION_JSON)
public Map getConstructionDev(@FormParam("id") String id) throws Exception{
- Map resultMap=new HashMap();
+ Map resultMap=new HashMap<>();
String msg="";
- List pgDeviceDtoList =new ArrayList();
+ List pgDeviceDtoList =new ArrayList<>();
try{
-
PgConstruction pgConstruction=pgConstructionManager.get(Long.valueOf(id));
- pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getPgName());
+ pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getParName());
if(pgDeviceDtoList==null)
msg="信息获取失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index 326b0c6..90d001c 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -33,7 +33,6 @@
private static Logger logger = LoggerFactory.getLogger(pgStatisticRs.class);
@Resource
private PgCsDocumentManager pgCsDocumentManager;
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@Resource
private PgConstructionManager pgConstructionManager;
@@ -44,7 +43,6 @@
@Path("addConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map addConstructDoc(
- @FormParam("list_name") String list_name,
@FormParam("doc_name") String doc_name,
@FormParam("construct_doc") String construct_doc,
@FormParam("cs_name") String cs_name)throws Exception {
@@ -58,13 +56,12 @@
if (StringUtils.isBlank(construct_doc)||StringUtils.isBlank(doc_name))
pgCsDocument.setConstruct_doc("");
else {
- pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name, list_name));
+ pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name,"ConstructDoc"));
}
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
- pgCsDocument.setList_name(list_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocument.setActive(1);
pgCsDocumentManager.save(pgCsDocument);
@@ -87,7 +84,6 @@
@Path("editConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
- @FormParam("list_name") String List_name,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -99,12 +95,11 @@
PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
if (pgCsDocument == null) {
result = "false";
- msg = "不存在该预案信息";
+ msg = "不存在施工文档";
} else {
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
- pgCsDocument.setActive(1);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocumentManager.save(pgCsDocument);
@@ -160,37 +155,28 @@
}
/*
- 按工程名称、工程类别、施工时间查询
+ 查询
*/
@POST
@Path("queryConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
- public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
- @FormParam("cs_type")String cs_type,
- @FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)
+ public Map queryConstructDoc(@FormParam("cs_name")String cs_name)
throws Exception{
- Map resultMap = new HashMap();
- List pgCsDocumentDtoList = new ArrayList();
+ Map resultMap = new HashMap<>();
+ List pgCsDocumentDtoList = new ArrayList<>();
String msg="";
String result="";
try {
- pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name, cs_type, startTime,endTime);
+ pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name);
if (pgCsDocumentDtoList != null)
- {
- result = "true";
msg = "获取数据成功";
- }else
- {
- result = "false";
+ else
msg = "没有满足条件的数据";
- }
}catch (Exception e){
e.printStackTrace();
- result = "false";
msg = "获取失败";
}
diff --git "a/~$\350\257\264\346\230\21620191207.docx" "b/~$\350\257\264\346\230\21620191207.docx"
deleted file mode 100644
index dd1a455..0000000
--- "a/~$\350\257\264\346\230\21620191207.docx"
+++ /dev/null
Binary files differ
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b3467ab..25ded8a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,24 +7,21 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -52,18 +49,18 @@
-
+
-
+
-
+
-
+
@@ -71,16 +68,16 @@
-
+
-
+
-
-
+
+
@@ -138,42 +135,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -181,68 +178,38 @@
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -258,15 +225,6 @@
- compositeFilter
- alarmTypeId
- getPipeGalleryByPgName
- getPgDeviceByDevType
- message
- getConstructionByType
- getPgCameraListByPosition
- incriter
- I
inCriteria
getPgPlanResulList
getPileAcuListByPileAcuStr
@@ -288,6 +246,15 @@
getMonthAlarmNum
searchConstruction
getPersonNumInPgByMonth
+ PGCONSTRUCTIONTYPEID
+ pgConstructionTypeId
+ saveFiles
+ getDtoByObject
+ getAllPgCsDocument
+ getPgContructionByNameOrType
+ "","",
+ getPgContructionDtoByNameOrType
+ getConstruction
@@ -296,14 +263,6 @@
-
-
-
-
-
-
-
-
@@ -340,13 +299,21 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -454,7 +421,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -466,6 +469,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -685,7 +710,7 @@
-
+
1564361618083
@@ -785,11 +810,18 @@
1574039946670
-
+
+ 1575775489149
+
+
+
+ 1575775489149
+
+
-
+
@@ -804,7 +836,7 @@
-
+
@@ -815,7 +847,7 @@
-
+
@@ -899,7 +931,6 @@
-
@@ -907,7 +938,8 @@
-
+
+
@@ -930,24 +962,6 @@
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
- 206
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
- 197
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
- 106
-
-
-
@@ -956,62 +970,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1026,13 +984,6 @@
-
-
-
-
-
-
-
@@ -1103,13 +1054,6 @@
-
-
-
-
-
-
-
@@ -1124,13 +1068,6 @@
-
-
-
-
-
-
-
@@ -1191,13 +1128,6 @@
-
-
-
-
-
-
-
@@ -1219,13 +1149,6 @@
-
-
-
-
-
-
-
@@ -1233,20 +1156,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,99 +1163,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
@@ -1358,21 +1185,232 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
index 9819ca0..799a06a 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstruction.java
@@ -1,9 +1,5 @@
package com.casic.PgInterface.construction.domain;
-import com.casic.PgInterface.devTable.domain.PgPartition;
-import org.hibernate.annotations.NotFound;
-import org.hibernate.annotations.NotFoundAction;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -18,24 +14,27 @@
public class PgConstruction implements Serializable{
private static final long serialVersionUID = 1L;
- private long id;
- private String cs_name;//项目名称
+ private Long id;
+ private String cs_name;//施工名称
private String cs_detail;//施工内容
private Date cs_beginTime;//施工开始时间
private Date cs_endTime;//施工结束时间
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String pgName;//施工区域
- private PgConstructionType pgConstructionTypeId;//项目状态
- private List pgCsDocumentList;//施工文档
+ private String parName;//施工区域
+ private Long pgConstructionTypeId;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_ID")
- public long getId(){ return id; }
+ public Long getId() {
+ return id;
+ }
- public void setId(long id){ this.id = id; }
+ public void setId(Long id) {
+ this.id = id;
+ }
@Column(name = "CS_NAME")
public String getCs_name(){ return cs_name; }
@@ -72,44 +71,21 @@
public void setCs_type(String cs_type){ this.cs_type = cs_type; }
-
- @Column(name = "PGNAME")
- public String getPgName() {
- return pgName;
+ @Column(name = "PARNAME")
+ public String getParName() {
+ return parName;
}
- public void setPgName(String pgName) {
- this.pgName = pgName;
+ public void setParName(String parName) {
+ this.parName = parName;
}
-// @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
-// @NotFound(action = NotFoundAction.IGNORE)
-// @JoinColumn(name = "PAPARTITION_ID")
-// public PgPartition getPgPartitionId() {
-// return pgPartitionId;
-// }
-//
-// public void setPgPartitionId(PgPartition pgPartitionId) {
-// this.pgPartitionId = pgPartitionId;
-// }
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionId")
- public List getPgCsDocumentList() {
- return pgCsDocumentList;
- }
-
- public void setPgCsDocumentList(List pgCsDocumentList) {
- this.pgCsDocumentList = pgCsDocumentList;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTIONTYPE_ID")
- public PgConstructionType getPgConstructionTypeId() {
+ @Column(name = "PGCONSTRUCTIONTYPE_ID")
+ public Long getPgConstructionTypeId() {
return pgConstructionTypeId;
}
- public void setPgConstructionTypeId(PgConstructionType pgConstructionTypeId) {
+ public void setPgConstructionTypeId(Long pgConstructionTypeId) {
this.pgConstructionTypeId = pgConstructionTypeId;
}
@@ -118,4 +94,4 @@
public void setActive(int active){ this.active = active; }
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
index 6909234..609fcda 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgConstructionType.java
@@ -13,18 +13,17 @@
public class PgConstructionType implements Serializable {
private static final long serialVersionUID = 1L;
- private long id;
- private String typeName;//项目状态
- private List pgConstructionList;//项目
+ private Long id;
+ private String typeName;//施工状态
private int active;//状态位
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_CONSTRUCTION_TYPE_ID")
- public long getId() {
+ public Long getId() {
return id;
}
- public void setId(long id) {
+ public void setId(Long id) {
this.id = id;
}
@@ -46,12 +45,4 @@
this.active = active;
}
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgConstructionTypeId")
- public List getPgConstructionList() {
- return pgConstructionList;
- }
-
- public void setPgConstructionList(List pgConstructionList) {
- this.pgConstructionList = pgConstructionList;
- }
}
diff --git a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
index 14c7457..9cf916b 100644
--- a/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
+++ b/src/main/java/com/casic/PgInterface/construction/domain/PgCsDocument.java
@@ -17,10 +17,9 @@
private static final long serialVersionUID = 1L;
private long id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String construct_doc;//施工文档相对路径
- private PgConstruction pgConstructionId;//项目
+ private Long pgConstructionId;//施工信息
private int active;//状态位
@Id
@@ -33,15 +32,6 @@
this.id = id;
}
- @Column(name = "LIST_NAME")
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
@Column(name = "DOC_NAME")
public String getDoc_name() {
return doc_name;
@@ -60,14 +50,12 @@
this.construct_doc = construct_doc;
}
- @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
- @NotFound(action = NotFoundAction.IGNORE)
- @JoinColumn(name = "PGCONSTRUCTION_ID")
- public PgConstruction getPgConstructionId() {
+ @Column(name = "PGCONSTRUCTION_ID")
+ public Long getPgConstructionId() {
return pgConstructionId;
}
- public void setPgConstructionId(PgConstruction pgConstructionId) {
+ public void setPgConstructionId(Long pgConstructionId) {
this.pgConstructionId = pgConstructionId;
}
@@ -80,4 +68,4 @@
this.active = active;
}
-}
+}
\ No newline at end of file
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 ff5ff18..373c3ad 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructionDto.java
@@ -1,6 +1,7 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
import java.text.SimpleDateFormat;
/**
@@ -16,10 +17,8 @@
private String cs_charge;//施工负责人
private String cs_phone;//联系方式
private String cs_type;//工程类别
- private String ConstructionType;//项目状态
- private String pgName;//所属仓
- private String active;//状态位
- private String doc_name;//施工文档
+ private String ConstructionType;//施工状态
+ private String parName;//所属仓
public String getId() {
return id;
@@ -85,10 +84,6 @@
this.cs_type = cs_type;
}
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public String getConstructionType() {
return ConstructionType;
}
@@ -97,23 +92,17 @@
ConstructionType = constructionType;
}
- public String getDoc_name() {
- return doc_name;
+ public String getParName() {
+ return parName;
}
- public void setDoc_name(String doc_name) {
- this.doc_name = doc_name;
+ public void setParName(String parName) {
+ this.parName = parName;
}
- public String getPgName() {
- return pgName;
- }
+ public PgConstructionDto(){}
- public void setPgName(String pgName) {
- this.pgName = pgName;
- }
-
- public PgConstructionDto(PgConstruction pgConstruction) {
+ public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {
if (pgConstruction == null) {
return;
@@ -135,12 +124,13 @@
this.setCs_phone(pgConstruction.getCs_phone());
this.setCs_type(pgConstruction.getCs_type());
- if(pgConstruction.getPgConstructionTypeId()==null)
+ if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
this.setConstructionType("");
else
- this.setConstructionType(pgConstruction.getPgConstructionTypeId().getTypeName());
- this.setActive(String.valueOf(pgConstruction.getActive()));
- this.setPgName(pgConstruction.getPgName());
+ this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());
+
+ this.setParName(pgConstruction.getParName());
}
}
+
}
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 c07d5c2..d595089 100644
--- a/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
+++ b/src/main/java/com/casic/PgInterface/construction/dto/PgCsDocumentDto.java
@@ -1,8 +1,9 @@
package com.casic.PgInterface.construction.dto;
import com.casic.PgInterface.construction.domain.PgCsDocument;
-
-import java.text.SimpleDateFormat;
+import com.casic.PgInterface.construction.manager.PgConstructionManager;
+import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;
+import com.casic.PgInterface.core.util.DateUtils;
/**
* Created by zxh on 2018/3/28.
@@ -10,13 +11,10 @@
public class PgCsDocumentDto{
private String id;
- private String list_name;//表单名称
private String doc_name;//文档名称
private String cs_name;//项目名称
private String cs_type;//工程类别
private String cs_time;//施工时间
- private String construct_doc;//施工文档
- private String active;//状态位
public String getId() {
return id;
@@ -26,14 +24,6 @@
this.id = id;
}
- public String getList_name() {
- return list_name;
- }
-
- public void setList_name(String list_name) {
- this.list_name = list_name;
- }
-
public String getDoc_name(){ return doc_name; }
public void setDoc_name(String doc_name){ this.doc_name = doc_name; }
@@ -62,31 +52,27 @@
this.cs_time = cs_time;
}
- public String getConstruct_doc(){ return construct_doc; }
-
- public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }
-
- public String getActive(){ return active; }
-
- public void setActive(String active){ this.active = active; }
-
public PgCsDocumentDto(){}
- public PgCsDocumentDto (PgCsDocument pgCsDocument)
+ public PgCsDocumentDto (PgCsDocument pgCsDocument, PgConstructionManager pgConstructionManager,
+ PgConstructionTypeManager pgConstructionTypeManager)
{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
this.setId(String.valueOf(pgCsDocument.getId()));
- this.setList_name(pgCsDocument.getList_name());
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()));
+
+ if(pgCsDocument.getPgConstructionId()==null||pgConstructionManager.get(pgCsDocument.getPgConstructionId())==null) {
+ this.setCs_name("");
+ this.setCs_type("");
+ this.setCs_time("");
+ }
+ else {
+ this.setCs_name(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_name());
+ if(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId()))==null)
+ this.setCs_type("");
+ else
+ this.setCs_type(pgConstructionTypeManager.get(pgConstructionManager.get(pgCsDocument.getPgConstructionId())).getTypeName());
+ this.setCs_time(DateUtils.sdf_day.format(pgConstructionManager.get(pgCsDocument.getPgConstructionId()).getCs_beginTime()));
+ }
}
}
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
index 75b2551..4df9e40 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java
@@ -1,11 +1,15 @@
package com.casic.PgInterface.construction.manager;
import com.casic.PgInterface.construction.domain.PgConstruction;
+import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.*;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import com.casic.PgInterface.core.page.Page;
import com.casic.PgInterface.core.util.DateUtils;
import com.casic.PgInterface.core.util.StringUtils;
+import com.casic.PgInterface.devTable.domain.PgAlarm;
import com.casic.PgInterface.devTable.domain.PgPartition;
+import com.casic.PgInterface.devTable.dto.PgAlarmDto;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
@@ -15,6 +19,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
/**
@@ -24,14 +29,12 @@
public class PgConstructionManager extends HibernateEntityDao {
@Resource
- private PgPartitionManager pgPartitionManager;
-
- @Resource
private PgConstructionTypeManager pgConstructionTypeManager;
public PgConstruction getPgContructionByName(String name) {
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.add(Restrictions.eq("cs_name", name));
+ if (StringUtils.isNotBlank(name))
+ criteria.add(Restrictions.eq("cs_name", name));
criteria.add(Restrictions.eq("active", 1));
List pgConstructionList = criteria.list();
@@ -42,17 +45,15 @@
return pgConstructionList.get(0);
}
- public List getPgContructionByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
+ public List getPgContructionDto(String cs_name, String cs_type,
+ String startTime, String endTime,
+ int page,int rows) {
try {
+
Criteria criteria = createCriteria(PgConstruction.class);
- criteria.addOrder(Order.desc("id"));
- if (StringUtils.isNotBlank(pgName))
- criteria.add(Restrictions.eq("pgName", pgName));
- if (StringUtils.isNotBlank(cs_name))
+ if(StringUtils.isNotBlank(cs_name))
criteria.add(Restrictions.eq("cs_name", cs_name));
- if (StringUtils.isNotBlank(cs_type))
+ if (StringUtils.isNotBlank(cs_type)&&!cs_type.contains("全部"))
criteria.add(Restrictions.eq("cs_type", cs_type));
if (StringUtils.isNotBlank(startTime)) {
@@ -64,29 +65,26 @@
calendar.add(Calendar.DATE, 1);
criteria.add(Restrictions.le("cs_beginTime", calendar.getTime()));
}
- return criteria.list();
- } catch (Exception e) {
- e.printStackTrace();
+ criteria.add(Restrictions.eq("active",1));
+
+ criteria.addOrder(Order.desc("id"));
+ Page pg = pagedQuery(criteria, page, rows);
+
+ List pgConstructionList = (List)pg.getResult();
+ List pgConstructionDtoList = new ArrayList<>();
+ for (PgConstruction pgConstruction : pgConstructionList) {
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction,pgConstructionTypeManager));
+ }
+
+ return pgConstructionDtoList;
+ }
+ catch(Exception ex){
+ ex.printStackTrace();
return null;
}
}
- public List getPgContructionDtoByNameOrType(String cs_name, String cs_type, String pgName,
- String startTime, String endTime) {
-
- PgPartition pgPartition=null;;
-
- List pgConstructionList = getPgContructionByNameOrType(cs_name, cs_type, pgName, startTime, endTime);
- List pgConstructionDtoList = new ArrayList();
-
- for (PgConstruction pgConstruction : pgConstructionList) {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
- }
-
- return pgConstructionDtoList;
- }
-
//yyyy-mm-dd
public List getConstructionByTimeAndStatus(String startTime, String endTime, String statisticType) {
@@ -139,15 +137,18 @@
String str="PAPARTITION_ID";
try {
- String hql="select pgName as pgName," +
- "count(*) as count from pg_construction t group by t.pgName";
+ String hql="select parName as parName," +
+ "count(*) as count from pg_construction t group by t.parName";
List objects=this.getSession().createSQLQuery(hql).list();
PgConstructionParStatisticDto pgConstructionParStatisticDto=null;
for(int i=0;i getConstructionNum(){
- String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
- "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
+ String sql="select (select p.typename from pg_construction_type p where p.id=t.pgconstructiontype_id) as typename," +
+ "count(*) as count from pg_construction t group by t.pgconstructiontype_id";
- List objects=this.getSession().createSQLQuery(sql).list();
+ List objects=this.getSession().createSQLQuery(sql).list();
- List pgConstructionTypeNumDtoList=new ArrayList();
+ List pgConstructionTypeNumDtoList=new ArrayList();
PgConstructionTypeNumStatisticDto pgConstructionTypeNumDto=null;
- for(Object[] objects1:objects){
- pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
- pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
- pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
+ for(Object[] objects1:objects){
+ pgConstructionTypeNumDto=new PgConstructionTypeNumStatisticDto();
+ pgConstructionTypeNumDto.setConstructStatus(String.valueOf(objects1[0]));
+ pgConstructionTypeNumDto.setConstructNum(String.valueOf(objects1[1]));
- pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
- }
- return pgConstructionTypeNumDtoList;
+ pgConstructionTypeNumDtoList.add(pgConstructionTypeNumDto);
+ }
+ return pgConstructionTypeNumDtoList;
}
public List getConstructionToday(){
- String hql="from PgConstruction pgConstruction where " +
- "pgConstruction.pgConstructionTypeId.typeName = '在建'";
+ String hql="select id,cs_name,cs_detail,cs_beginTime,cs_endTime,cs_charge,cs_phone,cs_type,parName,PGCONSTRUCTIONTYPE_ID from PG_CONSTRUCTION where " +
+ "PGCONSTRUCTIONTYPE_ID = (select id from PG_CONSTRUCTION_TYPE where TYPENAME= '在建')";
- List pgConstructionList=(List)this.getSession().createQuery(hql).list();
- List pgConstructionDtoList=new ArrayList();
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- pgConstructionDtoList.add(new PgConstructionDto(pgConstruction));
+ List objects=this.getSession().createSQLQuery(hql).list();
+ List pgConstructionDtoList=new ArrayList<>();
+ try {
+ for (Object[] objects1 : objects) {
+ PgConstruction pgConstruction = new PgConstruction();
+ pgConstruction.setId(objects1[0] == null ? null : Long.valueOf(objects1[0].toString()));
+ pgConstruction.setCs_name(objects1[1] == null ? "" : objects1[1].toString());
+ pgConstruction.setCs_detail(objects1[2] == null ? "" : objects1[2].toString());
+ pgConstruction.setCs_beginTime(objects1[3] == null ? null : DateUtils.sdf_day.parse(objects1[3].toString()));
+ pgConstruction.setCs_endTime(objects1[4] == null ? null : DateUtils.sdf_day.parse(objects1[4].toString()));
+ pgConstruction.setCs_charge(objects1[5] == null ? "" : objects1[5].toString());
+ pgConstruction.setCs_phone(objects1[6] == null ? "" : objects1[6].toString());
+ pgConstruction.setCs_type(objects1[7] == null ? "" : objects1[7].toString());
+ pgConstruction.setParName(objects1[8] == null ? "" : objects1[8].toString());
+ pgConstruction.setPgConstructionTypeId(objects1[9] == null ? null : Long.valueOf(objects1[9].toString()));
+
+ pgConstructionDtoList.add(new PgConstructionDto(pgConstruction, pgConstructionTypeManager));
+ }
}
-
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
return pgConstructionDtoList;
}
public List getPgConstructionList() {
- String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE,t.ACTIVE, " +
- "t.PGNAME, " +
+ String sql = "SELECT t.ID,t.CS_NAME,t.CS_DETAIL,t.CS_BEGINTIME,t.CS_ENDTIME,t.CS_CHARGE,t.CS_PHONE,t.CS_TYPE, " +
+ "t.PARNAME, " +
"(SELECT n.TYPENAME FROM PG_CONSTRUCTION_TYPE n WHERE n.ID = t.PGCONSTRUCTIONTYPE_ID) AS TYPENAME" +
" FROM PG_CONSTRUCTION t WHERE ACTIVE = 1";
- List pgConstructionDtoList = new ArrayList();
+ List pgConstructionDtoList = new ArrayList<>();
List objects = this.getSession().createSQLQuery(sql).list();
if(objects.size()==0) return null;
for (int i = 0; i < objects.size() ; i++) {
- PgConstructionDto pgConstructionDto = new PgConstructionDto(null);
- pgConstructionDto.setId(String.valueOf(objects.get(i)[0]));
- pgConstructionDto.setCs_name(String.valueOf(objects.get(i)[1]));
- pgConstructionDto.setCs_detail(String.valueOf(objects.get(i)[2]));
- pgConstructionDto.setCs_beginTime(String.valueOf(objects.get(i)[3]));
- pgConstructionDto.setCs_endTime(String.valueOf(objects.get(i)[4]));
- pgConstructionDto.setCs_charge(String.valueOf(objects.get(i)[5]));
- pgConstructionDto.setCs_phone(String.valueOf(objects.get(i)[6]));
- pgConstructionDto.setCs_type(String.valueOf(objects.get(i)[7]));
- pgConstructionDto.setActive(String.valueOf(objects.get(i)[8]));
- pgConstructionDto.setPgName(String.valueOf(objects.get(i)[9]));
- pgConstructionDto.setConstructionType(String.valueOf(objects.get(i)[10]));
+ PgConstructionDto pgConstructionDto = new PgConstructionDto();
+
+ pgConstructionDto.setId(objects.get(i)[0]==null?null:objects.get(i)[0].toString());
+ pgConstructionDto.setCs_name(objects.get(i)[1]==null?"":objects.get(i)[1].toString());
+ pgConstructionDto.setCs_detail(objects.get(i)[2]==null?"":objects.get(i)[2].toString());
+ pgConstructionDto.setCs_beginTime(objects.get(i)[3]==null? "":objects.get(i)[3].toString());
+ pgConstructionDto.setCs_endTime(objects.get(i)[4]==null? "":objects.get(i)[4].toString());
+ pgConstructionDto.setCs_charge(objects.get(i)[5]==null?"":objects.get(i)[5].toString());
+ pgConstructionDto.setCs_phone(objects.get(i)[6]==null?"":objects.get(i)[6].toString());
+ pgConstructionDto.setCs_type(objects.get(i)[7]==null?"":objects.get(i)[7].toString());
+ pgConstructionDto.setParName(objects.get(i)[8]==null?"":objects.get(i)[8].toString());
+ pgConstructionDto.setConstructionType(objects.get(i)[9]==null?"":objects.get(i)[9].toString());
pgConstructionDtoList.add(pgConstructionDto);
}
return pgConstructionDtoList;
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index ecbdd0d..df41317 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -106,29 +106,23 @@
}
/*查询*/
- public List getAllDocData(String cs_name ,String cs_type,String startTime,String endTime) {
+ public List getAllDocData(String cs_name) {
- List pgCsDocumentDtoList = new ArrayList();
+ List pgCsDocumentDtoList = new ArrayList<>();
try {
- List pgConstructionList = pgConstructionManager.getPgContructionByNameOrType(cs_name,
- cs_type, null,startTime, endTime);
- if(pgConstructionList==null||pgConstructionList.size()==0) {
-
- pgCsDocumentDtoList=getAllPgCsDocument();
- return pgCsDocumentDtoList;
- }
+ PgConstruction pgConstruction = pgConstructionManager.getPgContructionByName(cs_name);
+ if(pgConstruction==null)
+ return null;
else
{
- for(PgConstruction pgConstruction : pgConstructionList)
- {
- String sql="select * from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
- List objectList=this.getSession().createSQLQuery(sql).list();
+ String sql="select id,doc_name from PG_CSDOCUMENT where PGCONSTRUCTION_ID = " + pgConstruction.getId() +" and active = 1";
+ List objectList=this.getSession().createSQLQuery(sql).list();
- for(Object[] objectArray : objectList)
- {
- pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
- }
+ for(Object[] objectArray : objectList)
+ {
+ pgCsDocumentDtoList.add(getDtoByObject(objectArray,pgConstruction));
}
+
return pgCsDocumentDtoList;
}
} catch (Exception ex) {
@@ -139,27 +133,13 @@
private PgCsDocumentDto getDtoByObject(Object[] objectArray,PgConstruction pgConstruction){
PgCsDocumentDto pgCsDocumentDto=new PgCsDocumentDto();
- pgCsDocumentDto.setId(String.valueOf(objectArray[0]));
- pgCsDocumentDto.setActive(String.valueOf(objectArray[1]));
- pgCsDocumentDto.setConstruct_doc(String.valueOf(objectArray[2]));
- pgCsDocumentDto.setDoc_name(String.valueOf(objectArray[3]));
- pgCsDocumentDto.setList_name(String.valueOf(objectArray[4]));
+ pgCsDocumentDto.setId(objectArray[0]==null?"":objectArray[0].toString());
+ pgCsDocumentDto.setDoc_name(objectArray[1]==null?"":objectArray[1].toString());
pgCsDocumentDto.setCs_name(pgConstruction.getCs_name());
pgCsDocumentDto.setCs_type(pgConstruction.getCs_type());
return pgCsDocumentDto;
}
- public List getAllPgCsDocument() {
- Criteria criteria=createCriteria(PgCsDocument.class);
- criteria.add(Restrictions.eq("active",1));
-
- List pgCsDocumentList=criteria.list();
- List pgCsDocumentDtoList = new ArrayList();
- for (PgCsDocument pgCsDocument : pgCsDocumentList) {
- pgCsDocumentDtoList.add(new PgCsDocumentDto(pgCsDocument));
- }
- return pgCsDocumentDtoList;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
index 9d18f2f..aee6c31 100644
--- a/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
+++ b/src/main/java/com/casic/PgInterface/core/util/DateUtils.java
@@ -10,5 +10,4 @@
public static SimpleDateFormat sdf_day_time = new SimpleDateFormat("yyyyMMddhhmmss");
public static final SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static final SimpleDateFormat sdf_month=new SimpleDateFormat("yyyy-MM");
- //public static final SimpleDateFormat sdf_week=new SimpleDateFormat("iw");
}
\ No newline at end of file
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
index 74738ad..a43965c 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java
@@ -148,28 +148,6 @@
Query query=this.getSession().createQuery(hql);
ListpgAlarmList=query.list();
- /*
- Criteria criteria=createCriteria(PgAlarm.class);
-
- if(isDevFault!=null) {
- if (isDevFault.equals("true"))
- criteria.add(Restrictions.eq("alarmTypeId", pgAlarmType));
- else
- criteria.add(Restrictions.ne("alarmTypeId", pgAlarmType));
- }
- criteria.add(Restrictions.eq("active",1));*/
- /*
- Date endTime=new Date();
-
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.HOUR_OF_DAY, 0);//控制时
- calendar.set(Calendar.MINUTE, 0);//控制分
- calendar.set(Calendar.SECOND, 0);//控制秒
-
- criteria.add(Restrictions.ge("alarmDate", calendar.getTime()));
-
- criteria.add(Restrictions.le("alarmDate", endTime));*/
-
//List pgAlarmList = (List)criteria.list();
List pgAlarmDtoList=new ArrayList<>();
for(PgAlarm pgAlarm : pgAlarmList)
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
index 48fab47..7547560 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java
@@ -115,10 +115,13 @@
}
//根据分区获取摄像机列表
- public List getPgCameraListByPartition(String partition) {
+ public List getPgCameraListByPartition(String parName) {
+
+ String[] parArray=parName.split(",");
+
Criteria criteria=createCriteria(PgDevice.class);
- criteria.add(Restrictions.eq("partition",partition));
- criteria.add(Restrictions.eq("devType","球机"));
+ criteria.add(Restrictions.in("partition",parArray));
+
criteria.add(Restrictions.or(Restrictions.eq("devType","球机"),Restrictions.eq("devType","枪机")));
List pgDeviceList=criteria.list();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
index 534f1eb..0ddbc4d 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java
@@ -31,17 +31,8 @@
private static Logger logger = LoggerFactory.getLogger(PgAlarmRs.class);
@Resource
- private PgAlarmTypeManager pgAlarmTypeManager;
-
- @Resource
private PgAlarmManager pgAlarmManager;
- @Resource
- private PgUserManager pgPatrolerManager;
-
- @Resource
- private PgDeviceManager pgDeviceManager;
-
/**
* 获取报警信息
*/
@@ -53,7 +44,7 @@
@FormParam("endDay") String endDay,
@FormParam("isNew") String isNew,
@FormParam("page") int page,
- @FormParam("row") int rows) throws Exception {
+ @FormParam("rows") int rows) throws Exception {
Map resultMap = new HashMap<>();
String msg = "";
List pgAlarmDtoList = new ArrayList<>();
diff --git a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
index bf92fe4..b4b826e 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgConstructionRs.java
@@ -27,7 +27,6 @@
/**
* Created by zxh on 2018/3/27.
*/
-
@Component
@Path("pgConstruction")
public class PgConstructionRs {
@@ -56,9 +55,9 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String result = "";
String msg = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -78,9 +77,9 @@
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
logger.info("保存成功");
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -111,7 +110,7 @@
@FormParam("cs_charge")String cs_charge,
@FormParam("cs_phone")String cs_phone,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName") String pgName)
+ @FormParam("parName") String parName)
throws Exception{
Map resultMap = new HashMap();
@@ -136,9 +135,9 @@
pgConstruction.setCs_charge(cs_charge);
pgConstruction.setCs_phone(cs_phone);
pgConstruction.setCs_type(cs_type);
- pgConstruction.setPgConstructionTypeId(pgConstructionType);
+ pgConstruction.setPgConstructionTypeId(pgConstructionType.getId());
pgConstruction.setActive(1);
- pgConstruction.setPgName(pgName);
+ pgConstruction.setParName(parName);
pgConstructionManager.save(pgConstruction);
result = "true";
@@ -199,14 +198,15 @@
@Produces(MediaType.APPLICATION_JSON)
public Map searchConstruction(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
- @FormParam("pgName")String pgName,
@FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)throws Exception{
- Map resultMap=new HashMap();
+ @FormParam("endTime")String endTime,
+ @FormParam("page") int page,
+ @FormParam("rows") int rows)throws Exception{
+ Map resultMap=new HashMap<>();
String msg="";
- List pgConstructionDtoList=new ArrayList();
+ List pgConstructionDtoList=new ArrayList<>();
try{
- pgConstructionDtoList=pgConstructionManager.getPgContructionDtoByNameOrType(cs_name,cs_type,pgName,startTime,endTime);
+ pgConstructionDtoList=pgConstructionManager.getPgContructionDto(cs_name,cs_type,startTime,endTime,page,rows);
msg="信息获取成功";
}
catch(Exception e)
@@ -229,10 +229,10 @@
public Map getConstructionByTimeAndStatus(@FormParam("startTime") String startTime,
@FormParam("endTime") String endTime,
@FormParam("statisticType") String statisticType) throws Exception {
- Map resultMap = new HashMap();
+ Map resultMap = new HashMap<>();
String msg = "";
- List pgConstructionStiatisticList=new ArrayList();
+ List pgConstructionStiatisticList=new ArrayList<>();
try {
pgConstructionStiatisticList = pgConstructionManager.getConstructionByTimeAndStatus(startTime, endTime, statisticType);
if(pgConstructionStiatisticList==null)
@@ -259,8 +259,6 @@
String msg="";
List pgConstructionStiatisticList=new ArrayList<>();
- System.out.println("statisticType"+statisticType+"&&&&&&");
-
try{
pgConstructionStiatisticList=statisticType.equals("0")?pgConstructionManager.getStatisticByType():
pgConstructionManager.getStatisticByPar();
@@ -316,15 +314,14 @@
@Path("getConstructionDev")
@Produces(MediaType.APPLICATION_JSON)
public Map getConstructionDev(@FormParam("id") String id) throws Exception{
- Map resultMap=new HashMap();
+ Map resultMap=new HashMap<>();
String msg="";
- List pgDeviceDtoList =new ArrayList();
+ List pgDeviceDtoList =new ArrayList<>();
try{
-
PgConstruction pgConstruction=pgConstructionManager.get(Long.valueOf(id));
- pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getPgName());
+ pgDeviceDtoList=pgDeviceManager.getPgCameraListByPartition(pgConstruction.getParName());
if(pgDeviceDtoList==null)
msg="信息获取失败";
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index 326b0c6..90d001c 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -33,7 +33,6 @@
private static Logger logger = LoggerFactory.getLogger(pgStatisticRs.class);
@Resource
private PgCsDocumentManager pgCsDocumentManager;
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@Resource
private PgConstructionManager pgConstructionManager;
@@ -44,7 +43,6 @@
@Path("addConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map addConstructDoc(
- @FormParam("list_name") String list_name,
@FormParam("doc_name") String doc_name,
@FormParam("construct_doc") String construct_doc,
@FormParam("cs_name") String cs_name)throws Exception {
@@ -58,13 +56,12 @@
if (StringUtils.isBlank(construct_doc)||StringUtils.isBlank(doc_name))
pgCsDocument.setConstruct_doc("");
else {
- pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name, list_name));
+ pgCsDocument.setConstruct_doc(pgCsDocumentManager.saveFiles(construct_doc, doc_name,"ConstructDoc"));
}
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
- pgCsDocument.setList_name(list_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocument.setActive(1);
pgCsDocumentManager.save(pgCsDocument);
@@ -87,7 +84,6 @@
@Path("editConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
- @FormParam("list_name") String List_name,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -99,12 +95,11 @@
PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
if (pgCsDocument == null) {
result = "false";
- msg = "不存在该预案信息";
+ msg = "不存在施工文档";
} else {
PgConstruction pgConstruction=pgConstructionManager.getPgContructionByName(cs_name);
pgCsDocument.setDoc_name(doc_name);
- pgCsDocument.setPgConstructionId(pgConstruction);
- pgCsDocument.setActive(1);
+ pgCsDocument.setPgConstructionId(pgConstruction.getId());
pgCsDocumentManager.save(pgCsDocument);
@@ -160,37 +155,28 @@
}
/*
- 按工程名称、工程类别、施工时间查询
+ 查询
*/
@POST
@Path("queryConstructDoc")
@Produces(MediaType.APPLICATION_JSON)
- public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
- @FormParam("cs_type")String cs_type,
- @FormParam("startTime")String startTime,
- @FormParam("endTime")String endTime)
+ public Map queryConstructDoc(@FormParam("cs_name")String cs_name)
throws Exception{
- Map resultMap = new HashMap();
- List pgCsDocumentDtoList = new ArrayList();
+ Map resultMap = new HashMap<>();
+ List pgCsDocumentDtoList = new ArrayList<>();
String msg="";
String result="";
try {
- pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name, cs_type, startTime,endTime);
+ pgCsDocumentDtoList = pgCsDocumentManager.getAllDocData(cs_name);
if (pgCsDocumentDtoList != null)
- {
- result = "true";
msg = "获取数据成功";
- }else
- {
- result = "false";
+ else
msg = "没有满足条件的数据";
- }
}catch (Exception e){
e.printStackTrace();
- result = "false";
msg = "获取失败";
}
diff --git "a/~$\350\257\264\346\230\21620191207.docx" "b/~$\350\257\264\346\230\21620191207.docx"
deleted file mode 100644
index dd1a455..0000000
--- "a/~$\350\257\264\346\230\21620191207.docx"
+++ /dev/null
Binary files differ
diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx"
index 87b8f7b..81b60ae 100644
--- "a/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx"
+++ "b/\346\216\245\345\217\243\350\257\264\346\230\21620191207.docx"
Binary files differ