diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/src/main/resources/spring/applicationContext-springmvc.xml b/src/main/resources/spring/applicationContext-springmvc.xml index a84bcd6..e246e57 100644 --- a/src/main/resources/spring/applicationContext-springmvc.xml +++ b/src/main/resources/spring/applicationContext-springmvc.xml @@ -34,11 +34,6 @@ - - - - - diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/src/main/resources/spring/applicationContext-springmvc.xml b/src/main/resources/spring/applicationContext-springmvc.xml index a84bcd6..e246e57 100644 --- a/src/main/resources/spring/applicationContext-springmvc.xml +++ b/src/main/resources/spring/applicationContext-springmvc.xml @@ -34,11 +34,6 @@ - - - - - diff --git a/src/main/resources/spring/applicationContext.xml b/src/main/resources/spring/applicationContext.xml index a4774d3..f093fc2 100644 --- a/src/main/resources/spring/applicationContext.xml +++ b/src/main/resources/spring/applicationContext.xml @@ -35,4 +35,10 @@ + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/src/main/resources/spring/applicationContext-springmvc.xml b/src/main/resources/spring/applicationContext-springmvc.xml index a84bcd6..e246e57 100644 --- a/src/main/resources/spring/applicationContext-springmvc.xml +++ b/src/main/resources/spring/applicationContext-springmvc.xml @@ -34,11 +34,6 @@ - - - - - diff --git a/src/main/resources/spring/applicationContext.xml b/src/main/resources/spring/applicationContext.xml index a4774d3..f093fc2 100644 --- a/src/main/resources/spring/applicationContext.xml +++ b/src/main/resources/spring/applicationContext.xml @@ -35,4 +35,10 @@ + + + + + \ No newline at end of file diff --git "a/~$\350\257\264\346\230\21620190910.docx" "b/~$\350\257\264\346\230\21620190910.docx" new file mode 100644 index 0000000..7ab3eeb --- /dev/null +++ "b/~$\350\257\264\346\230\21620190910.docx" Binary files differ diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/src/main/resources/spring/applicationContext-springmvc.xml b/src/main/resources/spring/applicationContext-springmvc.xml index a84bcd6..e246e57 100644 --- a/src/main/resources/spring/applicationContext-springmvc.xml +++ b/src/main/resources/spring/applicationContext-springmvc.xml @@ -34,11 +34,6 @@ - - - - - diff --git a/src/main/resources/spring/applicationContext.xml b/src/main/resources/spring/applicationContext.xml index a4774d3..f093fc2 100644 --- a/src/main/resources/spring/applicationContext.xml +++ b/src/main/resources/spring/applicationContext.xml @@ -35,4 +35,10 @@ + + + + + \ No newline at end of file diff --git "a/~$\350\257\264\346\230\21620190910.docx" "b/~$\350\257\264\346\230\21620190910.docx" new file mode 100644 index 0000000..7ab3eeb --- /dev/null +++ "b/~$\350\257\264\346\230\21620190910.docx" Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" index 0650e1e..4407b37 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" Binary files differ diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml new file mode 100644 index 0000000..41f5a90 --- /dev/null +++ b/.idea/artifacts/PgInterface_war.xml @@ -0,0 +1,8 @@ + + + $PROJECT_DIR$/target + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface_war_exploded.xml b/.idea/artifacts/PgInterface_war_exploded.xml new file mode 100644 index 0000000..52a4834 --- /dev/null +++ b/.idea/artifacts/PgInterface_war_exploded.xml @@ -0,0 +1,102 @@ + + + $PROJECT_DIR$/target/PgInterface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fd7389f..566613a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,27 +7,16 @@ - - - - - - - - + + + - - - - - - - - - - - - + + + + + + @@ -37,42 +26,60 @@ + + + + @@ -523,7 +432,14 @@ - + + + + + + + + 1564361618083 @@ -595,11 +511,18 @@ - - @@ -611,9 +534,9 @@ - + - + @@ -621,11 +544,10 @@ - - + @@ -636,18 +558,19 @@ - + + - + - + - + @@ -713,7 +636,8 @@ - @@ -727,42 +651,11 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -868,13 +761,6 @@ - - - - - - - @@ -952,13 +838,6 @@ - - - - - - - @@ -973,13 +852,6 @@ - - - - - - - @@ -987,13 +859,7 @@ - - - - - - - + @@ -1015,34 +881,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1050,197 +892,90 @@ - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + - + - - - - - + + - + - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java index bb6bf1e..4f98571 100644 --- a/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java +++ b/src/main/java/com/casic/PgInterface/maintenance/manager/PgAssetPlanManager.java @@ -1,6 +1,7 @@ package com.casic.PgInterface.maintenance.manager; 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.maintenance.domain.PgAssetPlan; import com.casic.PgInterface.maintenance.dto.PgAssetPlanStatic; @@ -11,26 +12,42 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; @Service public class PgAssetPlanManager extends HibernateEntityDao { - public List getPgAssetPlanDtoList(String inSpectionPlace){ + public List getPgAssetPlanDtoList(String startDay,String endDay,String inSpectionPlace){ Criteria criteria=createCriteria(PgAssetPlan.class); + try { + if (StringUtils.isNotBlank(inSpectionPlace)) + criteria.add(Restrictions.like("INSPECTION_PRACE", "%" + inSpectionPlace + "%")); - if(StringUtils.isNotBlank(inSpectionPlace)) - criteria.add(Restrictions.like("INSPECTION_PRACE","%"+inSpectionPlace+"%")); - criteria.addOrder(Order.desc("id")); + if (StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)) { + criteria.add(Restrictions.ge("FREQUENCYDATE", DateUtils.sdf_day.parse(startDay))); - List pgAssetPlanList=criteria.list(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateUtils.sdf_day.parse(endDay)); + calendar.add(Calendar.DATE, 1); + criteria.add(Restrictions.le("FREQUENCYDATE", calendar.getTime())); + } - List pgAssetPlanDtoList=PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + criteria.addOrder(Order.desc("id")); - if(pgAssetPlanDtoList==null||pgAssetPlanDtoList.size()==0) + List pgAssetPlanList = criteria.list(); + + List pgAssetPlanDtoList = PgAssetPlanDto.ConvertToPgAssetDtoList(pgAssetPlanList); + + if (pgAssetPlanDtoList == null || pgAssetPlanDtoList.size() == 0) + return null; + else + return pgAssetPlanDtoList; + } + catch(Exception ex){ + ex.printStackTrace(); return null; - else - return pgAssetPlanDtoList; + } } public List getPgAssetPlanStaticLisByTime( diff --git a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java index 19d3b8c..4533e1a 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgAssetPlanRs.java @@ -28,13 +28,15 @@ @POST @Path("getPgAssetPlanList") @Produces(MediaType.APPLICATION_JSON) - public Map getPgAssetPlanList(@FormParam("inSpectionPlace") String inSpectionPlace){ + public Map getPgAssetPlanList(@FormParam("startDay") String startDay, + @FormParam("endDay") String endDay, + @FormParam("inSpectionPlace") String inSpectionPlace){ Map resultMap=new HashMap<>(); String msg=""; List pgAssetPlanDtoList=new ArrayList<>(); try{ - pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(inSpectionPlace); + pgAssetPlanDtoList=pgAssetPlanManager.getPgAssetPlanDtoList(startDay,endDay,inSpectionPlace); if(pgAssetPlanDtoList!=null&&pgAssetPlanDtoList.size()!=0) msg="巡检信息获取成功"; else diff --git a/src/main/resources/spring/applicationContext-springmvc.xml b/src/main/resources/spring/applicationContext-springmvc.xml index a84bcd6..e246e57 100644 --- a/src/main/resources/spring/applicationContext-springmvc.xml +++ b/src/main/resources/spring/applicationContext-springmvc.xml @@ -34,11 +34,6 @@ - - - - - diff --git a/src/main/resources/spring/applicationContext.xml b/src/main/resources/spring/applicationContext.xml index a4774d3..f093fc2 100644 --- a/src/main/resources/spring/applicationContext.xml +++ b/src/main/resources/spring/applicationContext.xml @@ -35,4 +35,10 @@ + + + + + \ No newline at end of file diff --git "a/~$\350\257\264\346\230\21620190910.docx" "b/~$\350\257\264\346\230\21620190910.docx" new file mode 100644 index 0000000..7ab3eeb --- /dev/null +++ "b/~$\350\257\264\346\230\21620190910.docx" Binary files differ diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" index 0650e1e..4407b37 100644 --- "a/\346\216\245\345\217\243\350\257\264\346\230\21620190910.docx" +++ "b/\346\216\245\345\217\243\350\257\264\346\230\21620190910.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\21620190828.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\21620190828.docx" index 2dccbc8..1049d7f 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\21620190828.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\21620190828.docx" Binary files differ