diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java index b08ac4c..4b94a41 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -129,7 +129,7 @@ try { PgMaintain pgMaintain = pgMaintainManager.get(Long.valueOf(id)); PgMaintainType pgMaintainType=pgMaintainTypeManager.getMaintainTypeByMode(model); - if(pgMaintainType.equals(null)){ + if(pgMaintainType==null){ msg="不存在维护类型"; result="false"; } diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java index b08ac4c..4b94a41 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -129,7 +129,7 @@ try { PgMaintain pgMaintain = pgMaintainManager.get(Long.valueOf(id)); PgMaintainType pgMaintainType=pgMaintainTypeManager.getMaintainTypeByMode(model); - if(pgMaintainType.equals(null)){ + if(pgMaintainType==null){ msg="不存在维护类型"; result="false"; } diff --git a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java index 5be00cf..967555d 100644 --- a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java +++ b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java @@ -109,7 +109,7 @@ e.printStackTrace(); } resultMap.put("msg", msg); - //resultMap.put("result", ); + resultMap.put("result", pgDeviceTypeStatisticDtoList); return resultMap; } diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java index b08ac4c..4b94a41 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -129,7 +129,7 @@ try { PgMaintain pgMaintain = pgMaintainManager.get(Long.valueOf(id)); PgMaintainType pgMaintainType=pgMaintainTypeManager.getMaintainTypeByMode(model); - if(pgMaintainType.equals(null)){ + if(pgMaintainType==null){ msg="不存在维护类型"; result="false"; } diff --git a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java index 5be00cf..967555d 100644 --- a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java +++ b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java @@ -109,7 +109,7 @@ e.printStackTrace(); } resultMap.put("msg", msg); - //resultMap.put("result", ); + resultMap.put("result", pgDeviceTypeStatisticDtoList); return resultMap; } diff --git "a/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" new file mode 100644 index 0000000..2cf26f4 --- /dev/null +++ "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java index b08ac4c..4b94a41 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -129,7 +129,7 @@ try { PgMaintain pgMaintain = pgMaintainManager.get(Long.valueOf(id)); PgMaintainType pgMaintainType=pgMaintainTypeManager.getMaintainTypeByMode(model); - if(pgMaintainType.equals(null)){ + if(pgMaintainType==null){ msg="不存在维护类型"; result="false"; } diff --git a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java index 5be00cf..967555d 100644 --- a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java +++ b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java @@ -109,7 +109,7 @@ e.printStackTrace(); } resultMap.put("msg", msg); - //resultMap.put("result", ); + resultMap.put("result", pgDeviceTypeStatisticDtoList); return resultMap; } diff --git "a/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" new file mode 100644 index 0000000..2cf26f4 --- /dev/null +++ "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 5fe9a55..cfb9d96 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git a/.idea/misc.xml b/.idea/misc.xml index 69518f2..3076b71 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d2692dd..cb9ab25 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,20 @@ - - + + + + + - - + + + - - + + + + @@ -34,64 +40,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -109,16 +58,6 @@ @@ -288,6 +237,10 @@ - @@ -1340,20 +1267,20 @@ - + - + - + - + @@ -1418,8 +1345,6 @@ - - @@ -1443,11 +1368,27 @@ - - @@ -1455,178 +1396,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1645,14 +1414,6 @@ - - - - - - - - @@ -1663,21 +1424,6 @@ - - - - - - - - - - - - - - - @@ -1703,7 +1449,6 @@ - @@ -1711,15 +1456,6 @@ - - - - - - - - - @@ -1727,7 +1463,6 @@ - @@ -1735,29 +1470,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1765,18 +1477,6 @@ - - - - - - - - - - - - @@ -1784,17 +1484,6 @@ - - - - - - - - - - - @@ -1802,56 +1491,332 @@ - - + - - + - - - - - - - - + - - + - - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1895,7 +1860,7 @@ - 1.7 + 1.8 - PgInterface + Web|PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 043b7bf..7707837 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -18,7 +18,7 @@ - + diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java new file mode 100644 index 0000000..770dd74 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgEquipment.java @@ -0,0 +1,98 @@ +package com.casic.PgInterface.devTable.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/9/3. + */ +@Entity +@Table(name = "PG_EQUIPMENT") +@SequenceGenerator(name = "SEQ_PG_EQUIPMENT_ID", sequenceName = "SEQ_PG_EQUIPMENT_ID", allocationSize = 1, initialValue = 1) +public class PgEquipment implements Serializable { + private static final long serialVersionUID = 1L; + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private Date enterDate;//入库时间 + private String curUser;//当前使用人 + private int active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_EQUIPMENT_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "EQ_NAME") + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + @Column(name = "EQ_CODE") + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + @Column(name = "EQ_TYPE") + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + @Column(name = "PARTITION") + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + @Column(name = "ENTER_DATE") + public Date getEnterDate() { + return enterDate; + } + + public void setEnterDate(Date enterDate) { + this.enterDate = enterDate; + } + + @Column(name = "CUR_USER") + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + @Column(name = "ACTIVE") + public int getActive() { + return active; + } + + public void setActive(int active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java new file mode 100644 index 0000000..238bc39 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgEquipmentDto.java @@ -0,0 +1,93 @@ +package com.casic.PgInterface.devTable.dto; + +import com.casic.PgInterface.devTable.domain.PgEquipment; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/9/3. + */ + +public class PgEquipmentDto implements Serializable { + + private long id; + private String eqName;//名称 + private String eqCode;//编号 + private String eqType;//类型 + private String ownerUnit;//权属单位 + private String enterDate;//入库时间 + private String curUser;//当前使用人 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEqName() { + return eqName; + } + + public void setEqName(String eqName) { + this.eqName = eqName; + } + + public String getEqCode() { + return eqCode; + } + + public void setEqCode(String eqCode) { + this.eqCode = eqCode; + } + + public String getEqType() { + return eqType; + } + + public void setEqType(String eqType) { + this.eqType = eqType; + } + + public String getOwnerUnit() { + return ownerUnit; + } + + public void setOwnerUnit(String ownerUnit) { + this.ownerUnit = ownerUnit; + } + + public String getEnterDate() { + return enterDate; + } + + public void setEnterDate(String enterDate) { + this.enterDate = enterDate; + } + + public String getCurUser() { + return curUser; + } + + public void setCurUser(String curUser) { + this.curUser = curUser; + } + + public PgEquipmentDto(PgEquipment equipment) { + if (equipment == null) return; + + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(equipment.getId()); + this.setEqName(equipment.getEqName()); + this.setEqCode(equipment.getEqCode()); + this.setCurUser(equipment.getCurUser()); + this.setEqType(equipment.getEqType()); + this.setOwnerUnit(equipment.getOwnerUnit()); + this.setEnterDate(sdf.format(equipment.getEnterDate())); + + } + +} 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 5f713f6..0db81c4 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgDeviceManager.java @@ -78,7 +78,7 @@ //根据设备类型统计设备资产 public List getDeviceStatisticByDevType(){ - String hql="select device.devType,count(*) from PG_DEVICE device group by device.devType"; + String hql="select device.DEVTYPE,count(*) from PG_DEVICE device group by device.DEVTYPE"; List pgDeviceTypeStatisticDtoList=this.getSession().createSQLQuery(hql).list(); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java new file mode 100644 index 0000000..b4ba6bb --- /dev/null +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgEquipmentManager.java @@ -0,0 +1,47 @@ +package com.casic.PgInterface.devTable.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/9/3. + */ +@Service +public class PgEquipmentManager extends HibernateEntityDao { + + public PgEquipment getEquipmentByCode(String eqCode) { + + Criteria criteria = getSession().createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("eqCode", eqCode)); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList = criteria.list(); + + if(pgEquipmentList!=null&&pgEquipmentList.size()!=0) + return pgEquipmentList.get(0); + else + return null; + } + + public List getEquipmentDtiList() + { + Criteria criteria=createCriteria(PgEquipment.class); + criteria.add(Restrictions.eq("active",1)); + + List pgEquipmentList=criteria.list(); + List pgEquipmentDtoList = new ArrayList(); + for(PgEquipment pgEquipment:pgEquipmentList) + { + pgEquipmentDtoList.add(new PgEquipmentDto(pgEquipment)); + } + + return pgEquipmentDtoList; + } +} diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index bf66e8b..8d8db5d 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -40,7 +40,7 @@ } public String getPipeLengthByName(String lineType) { - String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'"; + String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where LINE_TYPE = '" + lineType + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java index 82803b3..8922712 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java @@ -60,7 +60,7 @@ public String getPgLengthByName(String pgName) { - String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'"; + String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where PG_NAME = '" + pgName + "'"; String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult()); diff --git a/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java new file mode 100644 index 0000000..86f14ff --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgEquipmentRs.java @@ -0,0 +1,188 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.devTable.domain.PgEquipment; +import com.casic.PgInterface.devTable.dto.PgEquipmentDto; +import com.casic.PgInterface.devTable.manager.PgEquipmentManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by yxw on 2018/9/3. + */ +@Component +@Path("pgEquipment") +public class PgEquipmentRs { + @Resource + PgEquipmentManager pgEquipmentManager; + + /** + * 新增工器具 + */ + @POST + @Path("addEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) + throws Exception { + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + if (pgEquipmentManager.getEquipmentByCode(eqCode)!=null) { + result = "false"; + msg = "已存在编号"; + } else { + PgEquipment pgEquipment=new PgEquipment(); + + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + pgEquipment.setActive(1); + + pgEquipmentManager.save(pgEquipment); + result = "true"; + msg = "保存成功"; + } + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /** + * 维护工器具 + */ + @POST + @Path("editEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map addEquipment(@FormParam("id") String id, + @FormParam("eqName") String eqName, + @FormParam("eqCode") String eqCode, + @FormParam("eqType") String eqType, + @FormParam("ownerUnit") String ownerUnit, + @FormParam("enterDate") String enterDate, + @FormParam("curUser") String curUser) { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setEqName(eqName); + pgEquipment.setEqType(eqType); + pgEquipment.setEqCode(eqCode); + pgEquipment.setCurUser(curUser); + pgEquipment.setOwnerUnit(ownerUnit); + pgEquipment.setEnterDate(sdf.parse(enterDate)); + + pgEquipmentManager.save(pgEquipment); + } + } catch (Exception e) { + e.printStackTrace(); + result = "false"; + msg = "编辑失败"; + } + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取工器具信息 + */ + @POST + @Path("getEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map getEquipment() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + List pgEquipmentDtoList=new ArrayList(); + + try{ + pgEquipmentDtoList=pgEquipmentManager.getEquipmentDtiList(); + if(pgEquipmentDtoList==null||pgEquipmentDtoList.size()==0) + msg="不存在工器具记录"; + else + msg="维获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + } + resultMap.put("msg",msg); + resultMap.put("result",pgEquipmentDtoList); + + return resultMap; + } + + /** + * 删除 + */ + @POST + @Path("deleteEquipment") + @Produces(MediaType.APPLICATION_JSON) + public Map deleteEquipment(@FormParam("id") String id)throws Exception { + HashMap resultMap = new HashMap(); + String msg = ""; + String result = ""; + + try { + PgEquipment pgEquipment=pgEquipmentManager.get(id); + if(pgEquipment==null) + { + msg="不存在工器具"; + result="false"; + } + else + { + pgEquipment.setActive(0); + msg="删除成功"; + result="true"; + } + }catch(Exception e){ + e.printStackTrace(); + msg="设备信息获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + return resultMap; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java index b08ac4c..4b94a41 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -129,7 +129,7 @@ try { PgMaintain pgMaintain = pgMaintainManager.get(Long.valueOf(id)); PgMaintainType pgMaintainType=pgMaintainTypeManager.getMaintainTypeByMode(model); - if(pgMaintainType.equals(null)){ + if(pgMaintainType==null){ msg="不存在维护类型"; result="false"; } diff --git a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java index 5be00cf..967555d 100644 --- a/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java +++ b/src/main/java/com/casic/PgInterface/rs/pgStatisticRs.java @@ -109,7 +109,7 @@ e.printStackTrace(); } resultMap.put("msg", msg); - //resultMap.put("result", ); + resultMap.put("result", pgDeviceTypeStatisticDtoList); return resultMap; } diff --git "a/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" new file mode 100644 index 0000000..2cf26f4 --- /dev/null +++ "b/~$\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 5fe9a55..cfb9d96 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 6a96541..b464352 100644 --- "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ