diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2fb8fc1..f5b9489 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2fb8fc1..f5b9489 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgStatusList=criteria.list(); - if(pgInPgStatusList!=null) + List pgInPgStatusList = criteria.list(); + if (pgInPgStatusList != null) return pgInPgStatusList.get(0); else return null; @@ -37,13 +41,62 @@ return Integer.parseInt(String.valueOf(object)); } - public int getInPgNum() - { - String hql="select count(*) from PgInPgStatus"; + public int getInPgNum() { + String hql = "select count(*) from PgInPgStatus"; - Object object=this.getSession().createQuery(hql).uniqueResult(); + Object object = this.getSession().createQuery(hql).uniqueResult(); return Integer.parseInt(String.valueOf(object)); } + public int getMonthInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + + " = to_char(" + new Date() + ",'yyyy-mm')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + public int getWeekInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + + " = to_char(" + new Date() + ",'iw')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + //yyyy-mm-dd + public List getPgInPersonListByDay() { + + List pgInPgInfoDtoList = new ArrayList(); + PgInPgInfoDto pgInPgInfoDto = null; + + String sql = "select count(*), to_char(t.intime, 'yyyy-mm-dd') from pg_inpg_status t group " + + "by to_char(t.intime, 'yyyy-mm-dd')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for (int i = 0; i < objects.size(); i++) { + pgInPgInfoDto.setInPgNum(String.valueOf(objects.get(i)[0])); + pgInPgInfoDto.setInPgTime(DateUtils.sdf_day.format(objects.get(i)[1])); + pgInPgInfoDtoList.add(pgInPgInfoDto); + } + return pgInPgInfoDtoList; + } + + public List getTodayInPgInfo() { + List pgInPgInfoDtoList=new ArrayList(); + + String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + + " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); + for(PgInPgStatus pgInPgStatus : pgInPgStatusList) + { + pgInPgInfoDtoList.add(new PgInPgInfoDto(pgInPgStatus)); + } + + return pgInPgInfoDtoList; + } + } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2fb8fc1..f5b9489 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgStatusList=criteria.list(); - if(pgInPgStatusList!=null) + List pgInPgStatusList = criteria.list(); + if (pgInPgStatusList != null) return pgInPgStatusList.get(0); else return null; @@ -37,13 +41,62 @@ return Integer.parseInt(String.valueOf(object)); } - public int getInPgNum() - { - String hql="select count(*) from PgInPgStatus"; + public int getInPgNum() { + String hql = "select count(*) from PgInPgStatus"; - Object object=this.getSession().createQuery(hql).uniqueResult(); + Object object = this.getSession().createQuery(hql).uniqueResult(); return Integer.parseInt(String.valueOf(object)); } + public int getMonthInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + + " = to_char(" + new Date() + ",'yyyy-mm')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + public int getWeekInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + + " = to_char(" + new Date() + ",'iw')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + //yyyy-mm-dd + public List getPgInPersonListByDay() { + + List pgInPgInfoDtoList = new ArrayList(); + PgInPgInfoDto pgInPgInfoDto = null; + + String sql = "select count(*), to_char(t.intime, 'yyyy-mm-dd') from pg_inpg_status t group " + + "by to_char(t.intime, 'yyyy-mm-dd')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for (int i = 0; i < objects.size(); i++) { + pgInPgInfoDto.setInPgNum(String.valueOf(objects.get(i)[0])); + pgInPgInfoDto.setInPgTime(DateUtils.sdf_day.format(objects.get(i)[1])); + pgInPgInfoDtoList.add(pgInPgInfoDto); + } + return pgInPgInfoDtoList; + } + + public List getTodayInPgInfo() { + List pgInPgInfoDtoList=new ArrayList(); + + String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + + " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); + for(PgInPgStatus pgInPgStatus : pgInPgStatusList) + { + pgInPgInfoDtoList.add(new PgInPgInfoDto(pgInPgStatus)); + } + + return pgInPgInfoDtoList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java index 2737d78..c22aa95 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.patroler.domain.PgMaintain; -import com.casic.PgInterface.patroler.domain.PgPatrol; import com.casic.PgInterface.patroler.dto.PgMaintainDto; import com.casic.PgInterface.patroler.dto.PgPatrolMaintainInfoDto; import org.hibernate.Criteria; @@ -38,7 +37,7 @@ public List getPgMaintainByMaintainerOrTime(String mainTainer,String startTime,String endTime) { try { - Criteria criteria = createCriteria(PgPatrol.class); + Criteria criteria = createCriteria(PgMaintain.class); if (StringUtils.isNotBlank(mainTainer)) { criteria.add(Restrictions.eq("mainTainer", mainTainer)); } @@ -76,7 +75,7 @@ String sql=""; String dateType=""; List pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -99,10 +98,11 @@ "by to_char(t.BEGINTIME, '"+dateType+"')"; List objects = this.getSession().createSQLQuery(sql).list(); - for(int i=0;i - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgStatusList=criteria.list(); - if(pgInPgStatusList!=null) + List pgInPgStatusList = criteria.list(); + if (pgInPgStatusList != null) return pgInPgStatusList.get(0); else return null; @@ -37,13 +41,62 @@ return Integer.parseInt(String.valueOf(object)); } - public int getInPgNum() - { - String hql="select count(*) from PgInPgStatus"; + public int getInPgNum() { + String hql = "select count(*) from PgInPgStatus"; - Object object=this.getSession().createQuery(hql).uniqueResult(); + Object object = this.getSession().createQuery(hql).uniqueResult(); return Integer.parseInt(String.valueOf(object)); } + public int getMonthInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + + " = to_char(" + new Date() + ",'yyyy-mm')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + public int getWeekInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + + " = to_char(" + new Date() + ",'iw')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + //yyyy-mm-dd + public List getPgInPersonListByDay() { + + List pgInPgInfoDtoList = new ArrayList(); + PgInPgInfoDto pgInPgInfoDto = null; + + String sql = "select count(*), to_char(t.intime, 'yyyy-mm-dd') from pg_inpg_status t group " + + "by to_char(t.intime, 'yyyy-mm-dd')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for (int i = 0; i < objects.size(); i++) { + pgInPgInfoDto.setInPgNum(String.valueOf(objects.get(i)[0])); + pgInPgInfoDto.setInPgTime(DateUtils.sdf_day.format(objects.get(i)[1])); + pgInPgInfoDtoList.add(pgInPgInfoDto); + } + return pgInPgInfoDtoList; + } + + public List getTodayInPgInfo() { + List pgInPgInfoDtoList=new ArrayList(); + + String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + + " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); + for(PgInPgStatus pgInPgStatus : pgInPgStatusList) + { + pgInPgInfoDtoList.add(new PgInPgInfoDto(pgInPgStatus)); + } + + return pgInPgInfoDtoList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java index 2737d78..c22aa95 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.patroler.domain.PgMaintain; -import com.casic.PgInterface.patroler.domain.PgPatrol; import com.casic.PgInterface.patroler.dto.PgMaintainDto; import com.casic.PgInterface.patroler.dto.PgPatrolMaintainInfoDto; import org.hibernate.Criteria; @@ -38,7 +37,7 @@ public List getPgMaintainByMaintainerOrTime(String mainTainer,String startTime,String endTime) { try { - Criteria criteria = createCriteria(PgPatrol.class); + Criteria criteria = createCriteria(PgMaintain.class); if (StringUtils.isNotBlank(mainTainer)) { criteria.add(Restrictions.eq("mainTainer", mainTainer)); } @@ -76,7 +75,7 @@ String sql=""; String dateType=""; List pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -99,10 +98,11 @@ "by to_char(t.BEGINTIME, '"+dateType+"')"; List objects = this.getSession().createSQLQuery(sql).list(); - for(int i=0;i pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -101,8 +101,10 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgStatusList=criteria.list(); - if(pgInPgStatusList!=null) + List pgInPgStatusList = criteria.list(); + if (pgInPgStatusList != null) return pgInPgStatusList.get(0); else return null; @@ -37,13 +41,62 @@ return Integer.parseInt(String.valueOf(object)); } - public int getInPgNum() - { - String hql="select count(*) from PgInPgStatus"; + public int getInPgNum() { + String hql = "select count(*) from PgInPgStatus"; - Object object=this.getSession().createQuery(hql).uniqueResult(); + Object object = this.getSession().createQuery(hql).uniqueResult(); return Integer.parseInt(String.valueOf(object)); } + public int getMonthInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + + " = to_char(" + new Date() + ",'yyyy-mm')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + public int getWeekInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + + " = to_char(" + new Date() + ",'iw')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + //yyyy-mm-dd + public List getPgInPersonListByDay() { + + List pgInPgInfoDtoList = new ArrayList(); + PgInPgInfoDto pgInPgInfoDto = null; + + String sql = "select count(*), to_char(t.intime, 'yyyy-mm-dd') from pg_inpg_status t group " + + "by to_char(t.intime, 'yyyy-mm-dd')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for (int i = 0; i < objects.size(); i++) { + pgInPgInfoDto.setInPgNum(String.valueOf(objects.get(i)[0])); + pgInPgInfoDto.setInPgTime(DateUtils.sdf_day.format(objects.get(i)[1])); + pgInPgInfoDtoList.add(pgInPgInfoDto); + } + return pgInPgInfoDtoList; + } + + public List getTodayInPgInfo() { + List pgInPgInfoDtoList=new ArrayList(); + + String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + + " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); + for(PgInPgStatus pgInPgStatus : pgInPgStatusList) + { + pgInPgInfoDtoList.add(new PgInPgInfoDto(pgInPgStatus)); + } + + return pgInPgInfoDtoList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java index 2737d78..c22aa95 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.patroler.domain.PgMaintain; -import com.casic.PgInterface.patroler.domain.PgPatrol; import com.casic.PgInterface.patroler.dto.PgMaintainDto; import com.casic.PgInterface.patroler.dto.PgPatrolMaintainInfoDto; import org.hibernate.Criteria; @@ -38,7 +37,7 @@ public List getPgMaintainByMaintainerOrTime(String mainTainer,String startTime,String endTime) { try { - Criteria criteria = createCriteria(PgPatrol.class); + Criteria criteria = createCriteria(PgMaintain.class); if (StringUtils.isNotBlank(mainTainer)) { criteria.add(Restrictions.eq("mainTainer", mainTainer)); } @@ -76,7 +75,7 @@ String sql=""; String dateType=""; List pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -99,10 +98,11 @@ "by to_char(t.BEGINTIME, '"+dateType+"')"; List objects = this.getSession().createSQLQuery(sql).list(); - for(int i=0;i pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -101,8 +101,10 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i getMonthInPgPersonNum() throws Exception + { + Map resultMap=new HashMap(); + String result=""; + String msg=""; + int inNum=0; + + try{ + inNum=pgInPgStatusManager.getMonthInPgPersonNum(); + msg="入廊人员次数获取成功"; + }catch(Exception e){ + e.printStackTrace(); + msg="入廊人员次数获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result",String.valueOf(inNum)); + + return resultMap; + } + + /** + * 获取本周入廊人员次数 + */ + @POST + @Path("getWeekInPgPersonNum") + @Produces(MediaType.APPLICATION_JSON) + private Map getWeekInPgPersonNum() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + int inNum = 0; + try { + inNum = pgInPgStatusManager.getWeekInPgPersonNum(); + msg = "入廊人员次数获取成功"; + } catch (Exception e) { + e.printStackTrace(); + msg = "入廊人员次数获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", String.valueOf(inNum)); + + return resultMap; + } + + /* + * 按照天统计入廊人员次数 + */ + @POST + @Path("getDayInPgStatistic") + @Produces(MediaType.APPLICATION_JSON) + private Map getDayInPgStatistic() throws Exception{ + Map resultMap=new HashMap(); + String msg = ""; + + List pgInPgInfoDtoList=new ArrayList(); + try{ + pgInPgInfoDtoList=pgInPgStatusManager.getPgInPersonListByDay(); + if(pgInPgInfoDtoList==null) + msg="信息获取失败"; + else + msg="信息获取成功"; + }catch(Exception e) + { + e.printStackTrace(); + msg="信息获取失败"; + } + + resultMap.put("msg",msg); + resultMap.put("result",pgInPgInfoDtoList); + return resultMap; + } + + /* + * 入廊人员当天情况统计 + */ + @POST + @Path("getTodayInPgInfo") + @Produces(MediaType.APPLICATION_JSON) + public Map getTodayInPgInfo() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + + List pgInPgInfoDtoList = new ArrayList(); + try { + pgInPgInfoDtoList = pgInPgStatusManager.getTodayInPgInfo(); + msg = "信息获取成功"; + } catch (Exception e) { + e.printStackTrace(); + msg = "信息获取成功"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgInPgInfoDtoList); + + return resultMap; + } + + +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2fb8fc1..f5b9489 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -28,13 +35,18 @@ - - + + - - + + - + + + + + + @@ -58,8 +70,6 @@ @@ -169,7 +181,8 @@ - @@ -201,21 +214,6 @@ - - - - - - - - - - - @@ -308,8 +306,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -735,7 +778,8 @@ - + + 1510219102698 @@ -853,13 +897,17 @@ 1523158539385 1523158539385 - - - + @@ -880,7 +928,7 @@ - + @@ -893,19 +941,19 @@ - + - + - + @@ -914,7 +962,7 @@ - + @@ -970,7 +1018,7 @@ @@ -978,48 +1026,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1094,13 +1100,6 @@ - - - - - - - @@ -1199,62 +1198,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1269,13 +1212,6 @@ - - - - - - - @@ -1290,13 +1226,6 @@ - - - - - - - @@ -1304,27 +1233,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1332,12 +1240,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - + + + + + + diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java index 7542298..1dd7a93 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmTjManager.java @@ -1,7 +1,6 @@ package com.casic.PgInterface.devTable.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; -import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.devTable.domain.PgAlarm; import com.casic.PgInterface.devTable.domain.PgAlarmType; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; @@ -59,7 +58,7 @@ String sql=""; String dateType=""; List pgAlarmTjDtoList=new ArrayList(); - PgAlarmTjDto pgAlarmTjDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -84,8 +83,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgInfoDtoList=new ArrayList(); - PgInPgInfoDto pgInPgInfoDto=null; int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -95,8 +93,9 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i pgInPgStatusList=criteria.list(); - if(pgInPgStatusList!=null) + List pgInPgStatusList = criteria.list(); + if (pgInPgStatusList != null) return pgInPgStatusList.get(0); else return null; @@ -37,13 +41,62 @@ return Integer.parseInt(String.valueOf(object)); } - public int getInPgNum() - { - String hql="select count(*) from PgInPgStatus"; + public int getInPgNum() { + String hql = "select count(*) from PgInPgStatus"; - Object object=this.getSession().createQuery(hql).uniqueResult(); + Object object = this.getSession().createQuery(hql).uniqueResult(); return Integer.parseInt(String.valueOf(object)); } + public int getMonthInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + + " = to_char(" + new Date() + ",'yyyy-mm')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + public int getWeekInPgPersonNum() { + String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + + " = to_char(" + new Date() + ",'iw')"; + + Object object = this.getSession().createQuery(hql).uniqueResult(); + + return Integer.parseInt(String.valueOf(object)); + } + + //yyyy-mm-dd + public List getPgInPersonListByDay() { + + List pgInPgInfoDtoList = new ArrayList(); + PgInPgInfoDto pgInPgInfoDto = null; + + String sql = "select count(*), to_char(t.intime, 'yyyy-mm-dd') from pg_inpg_status t group " + + "by to_char(t.intime, 'yyyy-mm-dd')"; + + List objects = this.getSession().createSQLQuery(sql).list(); + for (int i = 0; i < objects.size(); i++) { + pgInPgInfoDto.setInPgNum(String.valueOf(objects.get(i)[0])); + pgInPgInfoDto.setInPgTime(DateUtils.sdf_day.format(objects.get(i)[1])); + pgInPgInfoDtoList.add(pgInPgInfoDto); + } + return pgInPgInfoDtoList; + } + + public List getTodayInPgInfo() { + List pgInPgInfoDtoList=new ArrayList(); + + String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + + " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); + for(PgInPgStatus pgInPgStatus : pgInPgStatusList) + { + pgInPgInfoDtoList.add(new PgInPgInfoDto(pgInPgStatus)); + } + + return pgInPgInfoDtoList; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java index 2737d78..c22aa95 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgMaintainManager.java @@ -4,7 +4,6 @@ import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.patroler.domain.PgMaintain; -import com.casic.PgInterface.patroler.domain.PgPatrol; import com.casic.PgInterface.patroler.dto.PgMaintainDto; import com.casic.PgInterface.patroler.dto.PgPatrolMaintainInfoDto; import org.hibernate.Criteria; @@ -38,7 +37,7 @@ public List getPgMaintainByMaintainerOrTime(String mainTainer,String startTime,String endTime) { try { - Criteria criteria = createCriteria(PgPatrol.class); + Criteria criteria = createCriteria(PgMaintain.class); if (StringUtils.isNotBlank(mainTainer)) { criteria.add(Restrictions.eq("mainTainer", mainTainer)); } @@ -76,7 +75,7 @@ String sql=""; String dateType=""; List pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -99,10 +98,11 @@ "by to_char(t.BEGINTIME, '"+dateType+"')"; List objects = this.getSession().createSQLQuery(sql).list(); - for(int i=0;i pgPatrolMaintainInfoDtoList=new ArrayList(); - PgPatrolMaintainInfoDto pgPatrolMaintainInfoDto=null; + int type=Integer.valueOf(statisticType); switch(type) { case 0://年 @@ -101,8 +101,10 @@ List objects = this.getSession().createSQLQuery(sql).list(); for(int i=0;i getMonthInPgPersonNum() throws Exception + { + Map resultMap=new HashMap(); + String result=""; + String msg=""; + int inNum=0; + + try{ + inNum=pgInPgStatusManager.getMonthInPgPersonNum(); + msg="入廊人员次数获取成功"; + }catch(Exception e){ + e.printStackTrace(); + msg="入廊人员次数获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result",String.valueOf(inNum)); + + return resultMap; + } + + /** + * 获取本周入廊人员次数 + */ + @POST + @Path("getWeekInPgPersonNum") + @Produces(MediaType.APPLICATION_JSON) + private Map getWeekInPgPersonNum() throws Exception { + Map resultMap = new HashMap(); + String result = ""; + String msg = ""; + int inNum = 0; + try { + inNum = pgInPgStatusManager.getWeekInPgPersonNum(); + msg = "入廊人员次数获取成功"; + } catch (Exception e) { + e.printStackTrace(); + msg = "入廊人员次数获取失败"; + } + + resultMap.put("msg", msg); + resultMap.put("result", String.valueOf(inNum)); + + return resultMap; + } + + /* + * 按照天统计入廊人员次数 + */ + @POST + @Path("getDayInPgStatistic") + @Produces(MediaType.APPLICATION_JSON) + private Map getDayInPgStatistic() throws Exception{ + Map resultMap=new HashMap(); + String msg = ""; + + List pgInPgInfoDtoList=new ArrayList(); + try{ + pgInPgInfoDtoList=pgInPgStatusManager.getPgInPersonListByDay(); + if(pgInPgInfoDtoList==null) + msg="信息获取失败"; + else + msg="信息获取成功"; + }catch(Exception e) + { + e.printStackTrace(); + msg="信息获取失败"; + } + + resultMap.put("msg",msg); + resultMap.put("result",pgInPgInfoDtoList); + return resultMap; + } + + /* + * 入廊人员当天情况统计 + */ + @POST + @Path("getTodayInPgInfo") + @Produces(MediaType.APPLICATION_JSON) + public Map getTodayInPgInfo() throws Exception { + Map resultMap = new HashMap(); + String msg = ""; + + List pgInPgInfoDtoList = new ArrayList(); + try { + pgInPgInfoDtoList = pgInPgStatusManager.getTodayInPgInfo(); + msg = "信息获取成功"; + } catch (Exception e) { + e.printStackTrace(); + msg = "信息获取成功"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgInPgInfoDtoList); + + return resultMap; + } + + +} \ No newline at end of file diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 9e6dcac..69a73ca 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ