diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 88ad11e..2952f12 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -74,7 +74,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 88ad11e..2952f12 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -74,7 +74,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java new file mode 100644 index 0000000..8563141 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import com.casic.PgInterface.patroler.manager.PgPatrolManager; +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/3/28. + */ +@Component +@Path("pgPatrol") +public class PgPatrolRs { + + PgPatrolManager pgPatrolManager = new PgPatrolManager(); + + @Resource + public void setPgPatrolManager(PgPatrolManager pgPatrolManager) { + this.pgPatrolManager = pgPatrolManager; + } + + /** + * 新增巡检记录 + */ + @POST + @Path("addPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map addPatrol(@FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgPatrol pgPatrol = new PgPatrol(); + + try { + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + pgPatrol.setActive("1"); + + pgPatrolManager.save(pgPatrol); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改巡检记录 + */ + @POST + @Path("editPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map editPatrol(@FormParam("id") String id, + @FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgPatrol pgPatrol = pgPatrolManager.get(id); + + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + + pgPatrolManager.save(pgPatrol); + msg = "巡检记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "巡检记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取巡检信息 + */ + @POST + @Path("getPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map getPatrol() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgPatrolDtoList=new ArrayList(); + + try{ + pgPatrolDtoList=pgPatrolManager.getPgPatrolList(); + if(pgPatrolDtoList==null||pgPatrolDtoList.size()==0) + msg="不存在巡检记录"; + else + msg="巡检记录获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="巡检记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 88ad11e..2952f12 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -74,7 +74,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java new file mode 100644 index 0000000..8563141 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import com.casic.PgInterface.patroler.manager.PgPatrolManager; +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/3/28. + */ +@Component +@Path("pgPatrol") +public class PgPatrolRs { + + PgPatrolManager pgPatrolManager = new PgPatrolManager(); + + @Resource + public void setPgPatrolManager(PgPatrolManager pgPatrolManager) { + this.pgPatrolManager = pgPatrolManager; + } + + /** + * 新增巡检记录 + */ + @POST + @Path("addPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map addPatrol(@FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgPatrol pgPatrol = new PgPatrol(); + + try { + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + pgPatrol.setActive("1"); + + pgPatrolManager.save(pgPatrol); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改巡检记录 + */ + @POST + @Path("editPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map editPatrol(@FormParam("id") String id, + @FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgPatrol pgPatrol = pgPatrolManager.get(id); + + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + + pgPatrolManager.save(pgPatrol); + msg = "巡检记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "巡检记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取巡检信息 + */ + @POST + @Path("getPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map getPatrol() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgPatrolDtoList=new ArrayList(); + + try{ + pgPatrolDtoList=pgPatrolManager.getPgPatrolList(); + if(pgPatrolDtoList==null||pgPatrolDtoList.size()==0) + msg="不存在巡检记录"; + else + msg="巡检记录获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="巡检记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 1eeb589..57b8ec8 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -110,7 +110,7 @@ e.printStackTrace(); } } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 88ad11e..2952f12 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -74,7 +74,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java new file mode 100644 index 0000000..8563141 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import com.casic.PgInterface.patroler.manager.PgPatrolManager; +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/3/28. + */ +@Component +@Path("pgPatrol") +public class PgPatrolRs { + + PgPatrolManager pgPatrolManager = new PgPatrolManager(); + + @Resource + public void setPgPatrolManager(PgPatrolManager pgPatrolManager) { + this.pgPatrolManager = pgPatrolManager; + } + + /** + * 新增巡检记录 + */ + @POST + @Path("addPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map addPatrol(@FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgPatrol pgPatrol = new PgPatrol(); + + try { + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + pgPatrol.setActive("1"); + + pgPatrolManager.save(pgPatrol); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改巡检记录 + */ + @POST + @Path("editPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map editPatrol(@FormParam("id") String id, + @FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgPatrol pgPatrol = pgPatrolManager.get(id); + + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + + pgPatrolManager.save(pgPatrol); + msg = "巡检记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "巡检记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取巡检信息 + */ + @POST + @Path("getPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map getPatrol() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgPatrolDtoList=new ArrayList(); + + try{ + pgPatrolDtoList=pgPatrolManager.getPgPatrolList(); + if(pgPatrolDtoList==null||pgPatrolDtoList.size()==0) + msg="不存在巡检记录"; + else + msg="巡检记录获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="巡检记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 1eeb589..57b8ec8 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -110,7 +110,7 @@ e.printStackTrace(); } } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgReserveController.java b/src/main/java/com/casic/PgInterface/rs/PgReserveController.java index 165f3f3..27b1482 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgReserveController.java +++ b/src/main/java/com/casic/PgInterface/rs/PgReserveController.java @@ -126,7 +126,7 @@ ex.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2d1aff8..f00f0ea 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,24 +2,24 @@ - - - + + + + + + + + - - + - - - - + + + + - - - - @@ -43,7 +43,63 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,13 +117,10 @@ @@ -290,10 +357,6 @@ - @@ -936,7 +981,7 @@ - + @@ -945,6 +990,7 @@ + @@ -955,7 +1001,6 @@ - @@ -990,7 +1035,8 @@ - @@ -1002,134 +1048,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,13 +1092,6 @@ - - - - - - - @@ -1202,21 +1113,6 @@ - - - - - - - - - - - - - - - @@ -1237,24 +1133,6 @@ - - - - - - - - - - - - - - - - - - @@ -1277,34 +1155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1313,25 +1163,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1356,27 +1187,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1409,54 +1219,318 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + - + - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java new file mode 100644 index 0000000..efd87d9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgMaintain.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_MAINTAIN") +@SequenceGenerator(name = "SEQ_PG_MAINTAIN_ID", sequenceName = "SEQ_PG_MAINTAIN_ID",allocationSize=1,initialValue=1) +public class PgMaintain implements Serializable { + private static final long serialVersionUID = 1L; + private long id; + private String mainTainer;//维护人员 + private Date beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_MAINTAIN_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "MAINTAINER") + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java new file mode 100644 index 0000000..7ce01a5 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/domain/PgPatrol.java @@ -0,0 +1,77 @@ +package com.casic.PgInterface.patroler.domain; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * Created by yxw on 2018/3/28. + */ +@Entity +@Table(name = "PG_PATROL") +@SequenceGenerator(name = "SEQ_PG_PATROL_ID", sequenceName = "SEQ_PG_PATROL_ID",allocationSize=1,initialValue=1) +public class PgPatrol implements Serializable{ + private static final long serialVersionUID = 1L; + private long id; + private String patroler; + private Date beginTime; + private String timeLimt; + private String describe; + private String active; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_PATROL_ID") + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + @Column(name = "PATROLER") + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + @Column(name = "BEGINTIME") + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + @Column(name = "TIMELIMT") + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + @Column(name = "DESCRIBE") + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + @Column(name = "ACTIVE") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java new file mode 100644 index 0000000..602d295 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgMaintainDto.java @@ -0,0 +1,79 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgMaintain; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgMaintainDto implements Serializable { + + private String id; + private String mainTainer;//维护人员 + private String beginTime;//开始时间 + private String timeLimt;//计划工期 + private String describe;//任务描述 + private String active;//状态位 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMainTainer() { + return mainTainer; + } + + public void setMainTainer(String mainTainer) { + this.mainTainer = mainTainer; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgMaintainDto(PgMaintain pgMaintain) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setMainTainer(pgMaintain.getMainTainer()); + this.setBeginTime(sdf.format(pgMaintain.getBeginTime())); + this.setTimeLimt(pgMaintain.getTimeLimt()); + this.setDescribe(pgMaintain.getDescribe()); + this.setActive(pgMaintain.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java new file mode 100644 index 0000000..65ae5b3 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/dto/PgPatrolDto.java @@ -0,0 +1,80 @@ +package com.casic.PgInterface.patroler.dto; + +import com.casic.PgInterface.patroler.domain.PgPatrol; + +import java.io.Serializable; +import java.text.SimpleDateFormat; + +/** + * Created by yxw on 2018/3/28. + */ +public class PgPatrolDto implements Serializable { + + private String id; + private String patroler;//巡检人员 + private String beginTime;//开始时间 + private String timeLimt;//预计工期 + private String describe;//任务描述 + private String active;//状态表 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatroler() { + return patroler; + } + + public void setPatroler(String patroler) { + this.patroler = patroler; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getTimeLimt() { + return timeLimt; + } + + public void setTimeLimt(String timeLimt) { + this.timeLimt = timeLimt; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public PgPatrolDto(PgPatrol pgPatrol) + { + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + this.setId(String.valueOf(pgPatrol.getId())); + this.setPatroler(patroler); + this.setBeginTime(sdf.format(pgPatrol.getBeginTime())); + this.setTimeLimt(pgPatrol.getTimeLimt()); + this.setDescribe(pgPatrol.getDescribe()); + this.setActive(pgPatrol.getActive()); + } + +} diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java new file mode 100644 index 0000000..c9ce290 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgMaintainManager extends HibernateEntityDao{ + + public List getPgMaintainList() { + Criteria criteria=createCriteria(PgMaintain.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgMaintainList=criteria.list(); + List pgMaintainDtoList=new ArrayList(); + for(PgMaintain pgMaintain:pgMaintainList) + { + pgMaintainDtoList.add(new PgMaintainDto(pgMaintain)); + } + return pgMaintainDtoList; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java new file mode 100644 index 0000000..ba64ea9 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgPatrolManager.java @@ -0,0 +1,34 @@ +package com.casic.PgInterface.patroler.manager; + +import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import org.hibernate.Criteria; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Restrictions; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by yxw on 2018/3/28. + */ +@Service +public class PgPatrolManager extends HibernateEntityDao { + + public List getPgPatrolList() { + Criteria criteria=createCriteria(PgPatrol.class); + criteria.add(Restrictions.eq("active", 1)); + criteria.addOrder(Order.desc("id")); + + List pgPatrolList=criteria.list(); + List pgPatrolDtoList=new ArrayList(); + for(PgPatrol pgPatrol:pgPatrolList) + { + pgPatrolDtoList.add(new PgPatrolDto(pgPatrol)); + } + return pgPatrolDtoList; + } + +} diff --git a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java index bc4127f..e3e8351 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAlarmRs.java @@ -147,7 +147,7 @@ pgAlarm.setAlarmValue(alarmValue); pgAlarm.setAlarmDate(sdf.parse(alarmDate)); pgAlarm.setDescription(description); - pgAlarm.setPatrolerId(pgPatrolerManager.getPatrolerByuserName(userName)); + pgAlarm.setUserId(pgPatrolerManager.getPatrolerByuserName(userName)); pgAlarm.setAlarmDevId(pgDeviceManager.getDeviceBydevCode(devCode)); pgAlarm.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java index 20540d5..279f505 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceRs.java @@ -177,7 +177,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java index b6c84aa..1e8c508 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgDeviceTypeRs.java @@ -93,7 +93,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; diff --git a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java index 03ef508..22d843d 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInPgPersonRs.java @@ -65,7 +65,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index e40ea8e..b4f721e 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -57,10 +57,10 @@ String msg = ""; PgLog pgLog=new PgLog(); try { - PgUser pgPatroler = new PgUser(); - pgPatroler = pgPatrolerManager.getPatrolerByuserName(userName); + PgUser pgUser = new PgUser(); + pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - pgLog.setPatrolerId(pgPatroler); + pgLog.setUserId(pgUser); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); @@ -74,7 +74,7 @@ msg = "保存失败"; e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } @@ -108,6 +108,4 @@ } - - } diff --git a/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java new file mode 100644 index 0000000..a508d72 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgMaintainRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgMaintain; +import com.casic.PgInterface.patroler.dto.PgMaintainDto; +import com.casic.PgInterface.patroler.manager.PgMaintainManager; +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/3/28. + */ +@Component +@Path("pgMaintain") +public class PgMaintainRs { + + PgMaintainManager pgMaintainManager=new PgMaintainManager(); + + @Resource + public void setPgMaintainManager(PgMaintainManager pgMaintainManager) { + this.pgMaintainManager = pgMaintainManager; + } + + /** + * 新增维护记录 + */ + @POST + @Path("addMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map addMaintain(@FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgMaintain pgMaintain=new PgMaintain(); + + try { + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + pgMaintain.setActive("1"); + + pgMaintainManager.save(pgMaintain); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改维护记录 + */ + @POST + @Path("editMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map editMaintain(@FormParam("id") String id, + @FormParam("mainTainer") String mainTainer, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgMaintain pgMaintain = pgMaintainManager.get(id); + + pgMaintain.setMainTainer(mainTainer); + pgMaintain.setBeginTime(sdf.parse(beginTime)); + pgMaintain.setTimeLimt(timeLimt); + pgMaintain.setDescribe(describe); + + pgMaintainManager.save(pgMaintain); + msg = "维护记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "维护记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取维护信息 + */ + @POST + @Path("getMaintain") + @Produces(MediaType.APPLICATION_JSON) + public Map getMaintain() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgMaintainDtoList=new ArrayList(); + + try{ + pgMaintainDtoList=pgMaintainManager.getPgMaintainList(); + if(pgMaintainDtoList==null||pgMaintainDtoList.size()==0) + msg="不存在维护记录"; + else + msg="维护获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="维护记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java index 88ad11e..2952f12 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPartitionRs.java @@ -74,7 +74,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java new file mode 100644 index 0000000..8563141 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgPatrolRs.java @@ -0,0 +1,144 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.patroler.domain.PgPatrol; +import com.casic.PgInterface.patroler.dto.PgPatrolDto; +import com.casic.PgInterface.patroler.manager.PgPatrolManager; +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/3/28. + */ +@Component +@Path("pgPatrol") +public class PgPatrolRs { + + PgPatrolManager pgPatrolManager = new PgPatrolManager(); + + @Resource + public void setPgPatrolManager(PgPatrolManager pgPatrolManager) { + this.pgPatrolManager = pgPatrolManager; + } + + /** + * 新增巡检记录 + */ + @POST + @Path("addPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map addPatrol(@FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + PgPatrol pgPatrol = new PgPatrol(); + + try { + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + pgPatrol.setActive("1"); + + pgPatrolManager.save(pgPatrol); + result = "true"; + msg = "保存成功"; + } catch (Exception e) { + result = "false"; + msg = "保存失败"; + e.printStackTrace(); + } + resultMap.put("result", result); + resultMap.put("msg", msg); + return resultMap; + } + + /** + * 修改巡检记录 + */ + @POST + @Path("editPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map editPatrol(@FormParam("id") String id, + @FormParam("patroler") String patroler, + @FormParam("beginTime") String beginTime, + @FormParam("timeLimt") String timeLimt, + @FormParam("describe") String describe) + throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + try { + PgPatrol pgPatrol = pgPatrolManager.get(id); + + pgPatrol.setPatroler(patroler); + pgPatrol.setBeginTime(sdf.parse(beginTime)); + pgPatrol.setTimeLimt(timeLimt); + pgPatrol.setDescribe(describe); + + pgPatrolManager.save(pgPatrol); + msg = "巡检记录编辑成功"; + result = "true"; + } catch (Exception e) { + e.printStackTrace(); + msg = "巡检记录修改出错"; + result = "false"; + } + + resultMap.put("result", result); + resultMap.put("msg", msg); + + return resultMap; + } + + /* + * 获取巡检信息 + */ + @POST + @Path("getPatrol") + @Produces(MediaType.APPLICATION_JSON) + public Map getPatrol() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + List pgPatrolDtoList=new ArrayList(); + + try{ + pgPatrolDtoList=pgPatrolManager.getPgPatrolList(); + if(pgPatrolDtoList==null||pgPatrolDtoList.size()==0) + msg="不存在巡检记录"; + else + msg="巡检记录获取成功"; + result="true"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="巡检记录获取失败"; + result="false"; + } + resultMap.put("msg",msg); + resultMap.put("result",result); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 1eeb589..57b8ec8 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -110,7 +110,7 @@ e.printStackTrace(); } } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgReserveController.java b/src/main/java/com/casic/PgInterface/rs/PgReserveController.java index 165f3f3..27b1482 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgReserveController.java +++ b/src/main/java/com/casic/PgInterface/rs/PgReserveController.java @@ -126,7 +126,7 @@ ex.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; } diff --git a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java index 7733e50..7f0c8d5 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgUserRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgUserRs.java @@ -101,7 +101,7 @@ e.printStackTrace(); } - resultMap.put("success", result); + resultMap.put("result", result); resultMap.put("msg", msg); return resultMap; }