diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java index eacfb52..05a5901 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java @@ -34,7 +34,7 @@ try { Criteria criteria = createCriteria(PgLog.class); if (StringUtils.isNotBlank(userName)) { - criteria.add(Restrictions.eq("patrolerId", pgPatrolerManager.getPatrolerByuserName(userName))); + criteria.add(Restrictions.eq("userId", pgPatrolerManager.getPatrolerByuserName(userName))); } if (StringUtils.isNotBlank(startTime)) { diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java index eacfb52..05a5901 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java @@ -34,7 +34,7 @@ try { Criteria criteria = createCriteria(PgLog.class); if (StringUtils.isNotBlank(userName)) { - criteria.add(Restrictions.eq("patrolerId", pgPatrolerManager.getPatrolerByuserName(userName))); + criteria.add(Restrictions.eq("userId", pgPatrolerManager.getPatrolerByuserName(userName))); } if (StringUtils.isNotBlank(startTime)) { diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 4f83629..0c68382 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -1,5 +1,7 @@ package com.casic.PgInterface.rs; +import com.casic.PgInterface.construction.dto.PgConstructionDto; +import com.casic.PgInterface.construction.manager.PgConstructionManager; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgAlarmManager; @@ -32,6 +34,8 @@ private PgAlarmManager pgAlarmManager; + private PgConstructionManager pgConstructionManager; + @Resource public void setPgInPgPersonManager(PgInPgPersonManager pgInPgPersonManager) { this.pgInPgPersonManager = pgInPgPersonManager; @@ -47,6 +51,12 @@ this.pgAlarmManager = pgAlarmManager; } + @Resource + public void setPgConstructionManager(PgConstructionManager pgConstructionManager) { + this.pgConstructionManager = pgConstructionManager; + } + + //入廊人员 /** * 获取本月入廊人员次数 @@ -271,6 +281,57 @@ return resultMap; } + //施工统计 + /* + 累计施工数量\在建施工数\完工施工数 + */ + @POST + @Path("getConstructionNum") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionNum(@FormParam("constructionType") String constructionType) throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + int constructNum=0; + try{ + constructNum=pgConstructionManager.getConstructionNum(constructionType); + msg="施工数量获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工数量统计"; + } + + resultMap.put("msg",msg); + resultMap.put("result",String.valueOf(constructNum)); + + return resultMap; + } + + /* + 当天在建工程 + */ + @POST + @Path("getConstructionToday") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionToday() throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + + List pgConstructionDtoList=new ArrayList(); + try{ + + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工信息统计失败"; + } + resultMap.put("msg",msg); + // resultMap.put("result",pgConstructionDtoList); + + return resultMap; + } } \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java index eacfb52..05a5901 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java @@ -34,7 +34,7 @@ try { Criteria criteria = createCriteria(PgLog.class); if (StringUtils.isNotBlank(userName)) { - criteria.add(Restrictions.eq("patrolerId", pgPatrolerManager.getPatrolerByuserName(userName))); + criteria.add(Restrictions.eq("userId", pgPatrolerManager.getPatrolerByuserName(userName))); } if (StringUtils.isNotBlank(startTime)) { diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 4f83629..0c68382 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -1,5 +1,7 @@ package com.casic.PgInterface.rs; +import com.casic.PgInterface.construction.dto.PgConstructionDto; +import com.casic.PgInterface.construction.manager.PgConstructionManager; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgAlarmManager; @@ -32,6 +34,8 @@ private PgAlarmManager pgAlarmManager; + private PgConstructionManager pgConstructionManager; + @Resource public void setPgInPgPersonManager(PgInPgPersonManager pgInPgPersonManager) { this.pgInPgPersonManager = pgInPgPersonManager; @@ -47,6 +51,12 @@ this.pgAlarmManager = pgAlarmManager; } + @Resource + public void setPgConstructionManager(PgConstructionManager pgConstructionManager) { + this.pgConstructionManager = pgConstructionManager; + } + + //入廊人员 /** * 获取本月入廊人员次数 @@ -271,6 +281,57 @@ return resultMap; } + //施工统计 + /* + 累计施工数量\在建施工数\完工施工数 + */ + @POST + @Path("getConstructionNum") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionNum(@FormParam("constructionType") String constructionType) throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + int constructNum=0; + try{ + constructNum=pgConstructionManager.getConstructionNum(constructionType); + msg="施工数量获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工数量统计"; + } + + resultMap.put("msg",msg); + resultMap.put("result",String.valueOf(constructNum)); + + return resultMap; + } + + /* + 当天在建工程 + */ + @POST + @Path("getConstructionToday") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionToday() throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + + List pgConstructionDtoList=new ArrayList(); + try{ + + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工信息统计失败"; + } + resultMap.put("msg",msg); + // resultMap.put("result",pgConstructionDtoList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL0458.tmp b/~WRL0458.tmp new file mode 100644 index 0000000..63f4e43 --- /dev/null +++ b/~WRL0458.tmp Binary files differ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java index eacfb52..05a5901 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java @@ -34,7 +34,7 @@ try { Criteria criteria = createCriteria(PgLog.class); if (StringUtils.isNotBlank(userName)) { - criteria.add(Restrictions.eq("patrolerId", pgPatrolerManager.getPatrolerByuserName(userName))); + criteria.add(Restrictions.eq("userId", pgPatrolerManager.getPatrolerByuserName(userName))); } if (StringUtils.isNotBlank(startTime)) { diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 4f83629..0c68382 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -1,5 +1,7 @@ package com.casic.PgInterface.rs; +import com.casic.PgInterface.construction.dto.PgConstructionDto; +import com.casic.PgInterface.construction.manager.PgConstructionManager; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgAlarmManager; @@ -32,6 +34,8 @@ private PgAlarmManager pgAlarmManager; + private PgConstructionManager pgConstructionManager; + @Resource public void setPgInPgPersonManager(PgInPgPersonManager pgInPgPersonManager) { this.pgInPgPersonManager = pgInPgPersonManager; @@ -47,6 +51,12 @@ this.pgAlarmManager = pgAlarmManager; } + @Resource + public void setPgConstructionManager(PgConstructionManager pgConstructionManager) { + this.pgConstructionManager = pgConstructionManager; + } + + //入廊人员 /** * 获取本月入廊人员次数 @@ -271,6 +281,57 @@ return resultMap; } + //施工统计 + /* + 累计施工数量\在建施工数\完工施工数 + */ + @POST + @Path("getConstructionNum") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionNum(@FormParam("constructionType") String constructionType) throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + int constructNum=0; + try{ + constructNum=pgConstructionManager.getConstructionNum(constructionType); + msg="施工数量获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工数量统计"; + } + + resultMap.put("msg",msg); + resultMap.put("result",String.valueOf(constructNum)); + + return resultMap; + } + + /* + 当天在建工程 + */ + @POST + @Path("getConstructionToday") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionToday() throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + + List pgConstructionDtoList=new ArrayList(); + try{ + + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工信息统计失败"; + } + resultMap.put("msg",msg); + // resultMap.put("result",pgConstructionDtoList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL0458.tmp b/~WRL0458.tmp new file mode 100644 index 0000000..63f4e43 --- /dev/null +++ b/~WRL0458.tmp Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 63f4e43..bcfda82 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 276272c..d0c9fa4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,21 +2,16 @@ - - - - - - - - - - + + + + + - + @@ -58,14 +53,12 @@ @@ -169,7 +164,7 @@ - - - + @@ -1012,7 +1061,7 @@ - + @@ -1025,7 +1074,7 @@ - + @@ -1038,7 +1087,7 @@ - + @@ -1102,7 +1151,6 @@ - @@ -1127,11 +1175,12 @@ - - @@ -1139,111 +1188,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1258,20 +1202,6 @@ - - - - - - - - - - - - - - @@ -1286,39 +1216,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1355,7 +1256,6 @@ - @@ -1363,10 +1263,6 @@ - - - - @@ -1374,7 +1270,6 @@ - @@ -1382,7 +1277,6 @@ - @@ -1390,12 +1284,6 @@ - - - - - - @@ -1403,7 +1291,6 @@ - @@ -1411,7 +1298,6 @@ - @@ -1419,30 +1305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1450,7 +1312,6 @@ - @@ -1458,25 +1319,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1484,11 +1326,6 @@ - - - - - @@ -1496,17 +1333,6 @@ - - - - - - - - - - - @@ -1518,31 +1344,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1552,12 +1356,12 @@ - + - - + + - + @@ -1566,14 +1370,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -1581,6 +1479,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java index 8aea66f..0844d9b 100644 --- a/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java +++ b/src/main/java/com/casic/PgInterface/construction/dto/PgConstructTjDto.java @@ -8,7 +8,7 @@ public class PgConstructTjDto implements Serializable { private String constructNum;//施工数量 - private String constructionTime;//施工时间 + private String constructionTime;//时间 private String constructType;//施工类型 private String constructStatus;//施工状态 private String constructPartition;//施工区域 diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java index 5b90c2b..ae9deae 100644 --- a/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java +++ b/src/main/java/com/casic/PgInterface/construction/manager/PgConstructionManager.java @@ -1,12 +1,14 @@ package com.casic.PgInterface.construction.manager; import com.casic.PgInterface.construction.domain.PgConstruction; +import com.casic.PgInterface.construction.domain.PgConstructionType; import com.casic.PgInterface.construction.dto.PgConstructTjDto; import com.casic.PgInterface.construction.dto.PgConstructionDto; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.core.util.DateUtils; import com.casic.PgInterface.core.util.StringUtils; import com.casic.PgInterface.devTable.domain.PgPartition; +import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgPartitionManager; import org.hibernate.Criteria; import org.hibernate.criterion.Order; @@ -24,19 +26,20 @@ @Service public class PgConstructionManager extends HibernateEntityDao { - Calendar calendar_now = Calendar.getInstance(); - int year = calendar_now.get(Calendar.YEAR); - int month = calendar_now.get(Calendar.MONTH) + 1; - int day = calendar_now.get(Calendar.DAY_OF_MONTH); - String date_now = String.valueOf(year + "-" + month + "-" + day); - private PgPartitionManager pgPartitionManager; + private PgConstructionTypeManager pgConstructionTypeManager; + @Resource public void setPgPartitionManager(PgPartitionManager pgPartitionManager) { this.pgPartitionManager = pgPartitionManager; } + @Resource + public void setPgConstructionTypeManager(PgConstructionTypeManager pgConstructionTypeManager) { + this.pgConstructionTypeManager = pgConstructionTypeManager; + } + public PgConstruction getPgContructionByName(String name) { Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("cs_name", name)); @@ -159,14 +162,32 @@ } } - public List getConstructionToday() { - List pgConstructionDtoList = new ArrayList(); + public int getConstructionNum(String constructionType){ + PgConstructionType pgConstructionType=pgConstructionTypeManager.getConstructionTypeByType(constructionType); + Criteria criteria = createCriteria(PgConstruction.class); criteria.add(Restrictions.eq("active", 1)); + if(pgConstructionType!=null) + criteria.add(Restrictions.eq("pgConstructionTypeId",pgConstructionType)); - List pgConstructionList = criteria.list(); - for (PgConstruction pgConstruction : pgConstructionList) { - pgConstructionDtoList.add(new PgConstructionDto(pgConstruction)); + List pgConstructionList=criteria.list(); + if(pgConstructionList==null) + return 0; + else + return pgConstructionList.size(); + } + + public List getConstructionToday(){ + + String hql="from PgConstruction pgConstruction where " + + "pgConstruction.pgConstructionTypeId.typeName = '在建'"; + + List pgConstructionList=(List)this.getSession().createQuery(hql).list(); + List pgConstructionDtoList=new ArrayList(); + + for(PgConstruction pgConstruction : pgConstructionList) + { + } return pgConstructionDtoList; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java index 85789a0..3f798cc 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgAlarmManager.java @@ -97,7 +97,7 @@ public int getMonthAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; @@ -110,7 +110,7 @@ public int getWeekAlarmNum(String isDevFault) { String hql = "select count(*) from PgAlarm pgAlarm where to_char(pgAlarm.alarmDate, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; if (isDevFault.equals("true")) hql += " where pgAlarm.alarmTypeId.alarmType = '设备运行状态报警'"; diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java index dabcc7f..9e09465 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgInPgStatusManager.java @@ -51,7 +51,7 @@ public int getMonthInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'yyyy-mm')" + - " = to_char(" + new Date() + ",'yyyy-mm')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -60,7 +60,7 @@ public int getWeekInPgPersonNum() { String hql = "select count(*) from PgInPgStatus where to_char(inTime, 'iw')" + - " = to_char(" + new Date() + ",'iw')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'iw')"; Object object = this.getSession().createQuery(hql).uniqueResult(); @@ -90,7 +90,7 @@ List pgInPgInfoDtoList=new ArrayList(); String sql = "select * from PgInPgStatus where to_char(inTime, 'yyyy-mm-dd')" + - " = to_char(" + new Date() + ",'yyyy-mm-dd')"; + " = to_char(" + DateUtils.sdf4.format(new Date()) + ",'yyyy-mm-dd')"; List pgInPgStatusList=(List)this.getSession().createSQLQuery(sql).list(); for(PgInPgStatus pgInPgStatus : pgInPgStatusList) { diff --git a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java index eacfb52..05a5901 100644 --- a/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java +++ b/src/main/java/com/casic/PgInterface/patroler/manager/PgLogManager.java @@ -34,7 +34,7 @@ try { Criteria criteria = createCriteria(PgLog.class); if (StringUtils.isNotBlank(userName)) { - criteria.add(Restrictions.eq("patrolerId", pgPatrolerManager.getPatrolerByuserName(userName))); + criteria.add(Restrictions.eq("userId", pgPatrolerManager.getPatrolerByuserName(userName))); } if (StringUtils.isNotBlank(startTime)) { diff --git a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java index 4f83629..0c68382 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgOverViewRs.java @@ -1,5 +1,7 @@ package com.casic.PgInterface.rs; +import com.casic.PgInterface.construction.dto.PgConstructionDto; +import com.casic.PgInterface.construction.manager.PgConstructionManager; import com.casic.PgInterface.devTable.dto.PgAlarmDto; import com.casic.PgInterface.devTable.dto.PgAlarmTjDto; import com.casic.PgInterface.devTable.manager.PgAlarmManager; @@ -32,6 +34,8 @@ private PgAlarmManager pgAlarmManager; + private PgConstructionManager pgConstructionManager; + @Resource public void setPgInPgPersonManager(PgInPgPersonManager pgInPgPersonManager) { this.pgInPgPersonManager = pgInPgPersonManager; @@ -47,6 +51,12 @@ this.pgAlarmManager = pgAlarmManager; } + @Resource + public void setPgConstructionManager(PgConstructionManager pgConstructionManager) { + this.pgConstructionManager = pgConstructionManager; + } + + //入廊人员 /** * 获取本月入廊人员次数 @@ -271,6 +281,57 @@ return resultMap; } + //施工统计 + /* + 累计施工数量\在建施工数\完工施工数 + */ + @POST + @Path("getConstructionNum") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionNum(@FormParam("constructionType") String constructionType) throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + int constructNum=0; + try{ + constructNum=pgConstructionManager.getConstructionNum(constructionType); + msg="施工数量获取成功"; + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工数量统计"; + } + + resultMap.put("msg",msg); + resultMap.put("result",String.valueOf(constructNum)); + + return resultMap; + } + + /* + 当天在建工程 + */ + @POST + @Path("getConstructionToday") + @Produces(MediaType.APPLICATION_JSON) + public Map getConstructionToday() throws Exception{ + Map resultMap = new HashMap(); + String msg = ""; + + List pgConstructionDtoList=new ArrayList(); + try{ + + } + catch(Exception e) + { + e.printStackTrace(); + msg="施工信息统计失败"; + } + resultMap.put("msg",msg); + // resultMap.put("result",pgConstructionDtoList); + + return resultMap; + } } \ No newline at end of file diff --git a/~WRL0458.tmp b/~WRL0458.tmp new file mode 100644 index 0000000..63f4e43 --- /dev/null +++ b/~WRL0458.tmp Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index 63f4e43..bcfda82 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ diff --git "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" index d01d485..11ce103 100644 --- "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" +++ "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" Binary files differ