diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $PROJECT_DIR$/target - - - - - \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java index 2393258..482b7e6 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java @@ -3,10 +3,13 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; +import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -14,7 +17,7 @@ public PgSection getPgSectionByRoadAndLine(String lineName,Long roadId){ - Criteria criteria=createCriteria(PgPile.class); + Criteria criteria=createCriteria(PgSection.class); criteria.add(Restrictions.eq("lineName",lineName)); criteria.add(Restrictions.eq("roadId",roadId)); criteria.add(Restrictions.eq("active",true)); @@ -26,5 +29,20 @@ return pgSectionList.get(0); } + public List getLineType(){ + + List pgLineTypeList=new ArrayList<>(); + String sql="select distinct linename from pg_section where active = 1"; + + List objList=this.getSession().createSQLQuery(sql).list(); + for(Object object : objList) + { + PgLineType pgLineType=new PgLineType(); + pgLineType.setLineType(String.valueOf(object)); + pgLineTypeList.add(pgLineType); + } + + return pgLineTypeList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java index 277cf3f..05a9709 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java @@ -4,10 +4,12 @@ import com.casic.PgInterface.intelPlan.dto.PgPlanResultRe; import com.casic.PgInterface.intelPlan.dto.PgPlanTask; import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import com.casic.PgInterface.test.PlanData; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ModelAttribute; import javax.annotation.Resource; +import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -27,25 +29,20 @@ @POST @Path("getPlanResult") @Produces(MediaType.APPLICATION_JSON) - public Map getPlanResult(@ModelAttribute PgPlanParams pgPlanParams){ + public Map getPlanResult(@FormParam("planParamStr") String planParamStr){ Map resultMap=new HashMap<>(); String msg=""; - List pgPlanTaskList=new ArrayList<>(); + //List pgPlanTaskList=pgPlanParams.getPgPlanTaskList(); + List pgPlanTaskList=new PgPlanParams().getPgPlanParamsByString(planParamStr); List pgPlanResultReList=new ArrayList<>(); try{ - if(pgPlanParams==null){ - msg="请输入规划任务"; - } - else { - pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); if(pgPlanResultReList==null) msg="管线智能规划出错"; else msg="管线智能规划完成"; - } } catch(Exception ex){ msg="智能规划出错"; @@ -58,4 +55,29 @@ return resultMap; } + /* + 规划测试 + */ + @POST + @Path("getPlanResultTest") + @Produces(MediaType.APPLICATION_JSON) + public Map getPlanResultTest(){ + Map resultMap=new HashMap<>(); + PlanData planData=new PlanData(); + List pgPlanResultReList=new ArrayList<>(); + try{ + PgPlanParams pgPlanParams=planData.getPlanData(); + + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + resultMap.put("msg","管线智能规划完成"); + resultMap.put("result",pgPlanResultReList); + return resultMap; + } + } \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java index 2393258..482b7e6 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java @@ -3,10 +3,13 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; +import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -14,7 +17,7 @@ public PgSection getPgSectionByRoadAndLine(String lineName,Long roadId){ - Criteria criteria=createCriteria(PgPile.class); + Criteria criteria=createCriteria(PgSection.class); criteria.add(Restrictions.eq("lineName",lineName)); criteria.add(Restrictions.eq("roadId",roadId)); criteria.add(Restrictions.eq("active",true)); @@ -26,5 +29,20 @@ return pgSectionList.get(0); } + public List getLineType(){ + + List pgLineTypeList=new ArrayList<>(); + String sql="select distinct linename from pg_section where active = 1"; + + List objList=this.getSession().createSQLQuery(sql).list(); + for(Object object : objList) + { + PgLineType pgLineType=new PgLineType(); + pgLineType.setLineType(String.valueOf(object)); + pgLineTypeList.add(pgLineType); + } + + return pgLineTypeList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java index 277cf3f..05a9709 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java @@ -4,10 +4,12 @@ import com.casic.PgInterface.intelPlan.dto.PgPlanResultRe; import com.casic.PgInterface.intelPlan.dto.PgPlanTask; import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import com.casic.PgInterface.test.PlanData; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ModelAttribute; import javax.annotation.Resource; +import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -27,25 +29,20 @@ @POST @Path("getPlanResult") @Produces(MediaType.APPLICATION_JSON) - public Map getPlanResult(@ModelAttribute PgPlanParams pgPlanParams){ + public Map getPlanResult(@FormParam("planParamStr") String planParamStr){ Map resultMap=new HashMap<>(); String msg=""; - List pgPlanTaskList=new ArrayList<>(); + //List pgPlanTaskList=pgPlanParams.getPgPlanTaskList(); + List pgPlanTaskList=new PgPlanParams().getPgPlanParamsByString(planParamStr); List pgPlanResultReList=new ArrayList<>(); try{ - if(pgPlanParams==null){ - msg="请输入规划任务"; - } - else { - pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); if(pgPlanResultReList==null) msg="管线智能规划出错"; else msg="管线智能规划完成"; - } } catch(Exception ex){ msg="智能规划出错"; @@ -58,4 +55,29 @@ return resultMap; } + /* + 规划测试 + */ + @POST + @Path("getPlanResultTest") + @Produces(MediaType.APPLICATION_JSON) + public Map getPlanResultTest(){ + Map resultMap=new HashMap<>(); + PlanData planData=new PlanData(); + List pgPlanResultReList=new ArrayList<>(); + try{ + PgPlanParams pgPlanParams=planData.getPlanData(); + + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + resultMap.put("msg","管线智能规划完成"); + resultMap.put("result",pgPlanResultReList); + return resultMap; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java new file mode 100644 index 0000000..378af00 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java @@ -0,0 +1,59 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Path("pgLineHole") +public class PgLineHoleRs { + + @Resource + private PgLineHoleManager pgLineHoleManager; + + @Resource + private PgPileAcuManager pgPileAcuManager; + + @POST + @Path("getPgLineAcuHole") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgLineAcuHole(@FormParam("acuCode") String acuCode) throws Exception { + Map resultMap = new HashMap<>(); + String msg = ""; + String result=""; + List pgLineHoleDTOList=new ArrayList<>(); + + try { + PgPileAcu pgPileAcu=pgPileAcuManager.getPgPileAcuByCode(acuCode); + if(pgPileAcu==null){ + msg="不存在分区"; + }else{ + pgLineHoleDTOList=pgLineHoleManager.getCurrentHoleByAcu(pgPileAcu.getId()); + if(pgLineHoleDTOList!=null&&pgLineHoleDTOList.size()!=0) + msg="获取成功"; + else + msg="未找到入廊数据"; + } + } catch (Exception e) { + e.printStackTrace(); + msg = "获取失败"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgLineHoleDTOList); + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 1621666..39cff52 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; +import javax.validation.constraints.Null; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -48,8 +49,10 @@ try { PgUser pgUser = new PgUser(); pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - - pgLog.setUserId(pgUser.getId()); + if(pgUser== null) + pgLog.setUserId(null); + else + pgLog.setUserId(pgUser.getId()); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java index 2393258..482b7e6 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java @@ -3,10 +3,13 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; +import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -14,7 +17,7 @@ public PgSection getPgSectionByRoadAndLine(String lineName,Long roadId){ - Criteria criteria=createCriteria(PgPile.class); + Criteria criteria=createCriteria(PgSection.class); criteria.add(Restrictions.eq("lineName",lineName)); criteria.add(Restrictions.eq("roadId",roadId)); criteria.add(Restrictions.eq("active",true)); @@ -26,5 +29,20 @@ return pgSectionList.get(0); } + public List getLineType(){ + + List pgLineTypeList=new ArrayList<>(); + String sql="select distinct linename from pg_section where active = 1"; + + List objList=this.getSession().createSQLQuery(sql).list(); + for(Object object : objList) + { + PgLineType pgLineType=new PgLineType(); + pgLineType.setLineType(String.valueOf(object)); + pgLineTypeList.add(pgLineType); + } + + return pgLineTypeList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java index 277cf3f..05a9709 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java @@ -4,10 +4,12 @@ import com.casic.PgInterface.intelPlan.dto.PgPlanResultRe; import com.casic.PgInterface.intelPlan.dto.PgPlanTask; import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import com.casic.PgInterface.test.PlanData; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ModelAttribute; import javax.annotation.Resource; +import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -27,25 +29,20 @@ @POST @Path("getPlanResult") @Produces(MediaType.APPLICATION_JSON) - public Map getPlanResult(@ModelAttribute PgPlanParams pgPlanParams){ + public Map getPlanResult(@FormParam("planParamStr") String planParamStr){ Map resultMap=new HashMap<>(); String msg=""; - List pgPlanTaskList=new ArrayList<>(); + //List pgPlanTaskList=pgPlanParams.getPgPlanTaskList(); + List pgPlanTaskList=new PgPlanParams().getPgPlanParamsByString(planParamStr); List pgPlanResultReList=new ArrayList<>(); try{ - if(pgPlanParams==null){ - msg="请输入规划任务"; - } - else { - pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); if(pgPlanResultReList==null) msg="管线智能规划出错"; else msg="管线智能规划完成"; - } } catch(Exception ex){ msg="智能规划出错"; @@ -58,4 +55,29 @@ return resultMap; } + /* + 规划测试 + */ + @POST + @Path("getPlanResultTest") + @Produces(MediaType.APPLICATION_JSON) + public Map getPlanResultTest(){ + Map resultMap=new HashMap<>(); + PlanData planData=new PlanData(); + List pgPlanResultReList=new ArrayList<>(); + try{ + PgPlanParams pgPlanParams=planData.getPlanData(); + + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + resultMap.put("msg","管线智能规划完成"); + resultMap.put("result",pgPlanResultReList); + return resultMap; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java new file mode 100644 index 0000000..378af00 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java @@ -0,0 +1,59 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Path("pgLineHole") +public class PgLineHoleRs { + + @Resource + private PgLineHoleManager pgLineHoleManager; + + @Resource + private PgPileAcuManager pgPileAcuManager; + + @POST + @Path("getPgLineAcuHole") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgLineAcuHole(@FormParam("acuCode") String acuCode) throws Exception { + Map resultMap = new HashMap<>(); + String msg = ""; + String result=""; + List pgLineHoleDTOList=new ArrayList<>(); + + try { + PgPileAcu pgPileAcu=pgPileAcuManager.getPgPileAcuByCode(acuCode); + if(pgPileAcu==null){ + msg="不存在分区"; + }else{ + pgLineHoleDTOList=pgLineHoleManager.getCurrentHoleByAcu(pgPileAcu.getId()); + if(pgLineHoleDTOList!=null&&pgLineHoleDTOList.size()!=0) + msg="获取成功"; + else + msg="未找到入廊数据"; + } + } catch (Exception e) { + e.printStackTrace(); + msg = "获取失败"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgLineHoleDTOList); + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 1621666..39cff52 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; +import javax.validation.constraints.Null; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -48,8 +49,10 @@ try { PgUser pgUser = new PgUser(); pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - - pgLog.setUserId(pgUser.getId()); + if(pgUser== null) + pgLog.setUserId(null); + else + pgLog.setUserId(pgUser.getId()); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java index a93ae7a..cf62954 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java @@ -67,11 +67,11 @@ try{ pgPileDTOList=pgPileManager.getPgPileDTOList(); - msg="桩号列表获取成功"; + msg="获取成功"; } catch(Exception ex){ pgPileDTOList=null; - msg="桩号列表获取成失败"; + msg="获取成失败"; ex.printStackTrace(); } resultMap.put("result",pgPileDTOList); @@ -118,4 +118,4 @@ return resultMap; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 8c3ac4b..b42a182 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -40,10 +40,7 @@ @POST @Path("addPipeLine") @Produces(MediaType.APPLICATION_JSON) - public Map addLog(@FormParam("lineCode") String lineCode, - @FormParam("lineName") String lineType, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("diameter") String diameter, + public Map addLog( @FormParam("lineType") String lineType, @FormParam("secRow") String secRow, @FormParam("secColumn") String secColumn, @FormParam("pileAcuList") String pileAcuList) throws Exception { @@ -53,12 +50,14 @@ Map resultMap = new HashMap<>(); try { - resultMap = pgPipeLineManager.addPipeLine(lineCode,lineType,ownerUnit,diameter,secRow,secColumn,pileAcuList); + resultMap = pgPipeLineManager.addPipeLine(lineType,secRow,secColumn,pileAcuList); + resultMap.put("msg","提交成功"); + resultMap.put("result","true"); } catch (Exception e) { e.printStackTrace(); resultMap.put("result","false"); - resultMap.put("msg","保存失败"); + resultMap.put("msg","提交失败"); return resultMap; } @@ -94,7 +93,7 @@ @Path("getPipeLineByCode") @Produces(MediaType.APPLICATION_JSON) public Map getPipeLineByName(@FormParam("lineCode") String lineCode) throws Exception { - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); String msg = ""; PgPipeLineDto pgPipeLineDto=null; try { diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java index 2393258..482b7e6 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java @@ -3,10 +3,13 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; +import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -14,7 +17,7 @@ public PgSection getPgSectionByRoadAndLine(String lineName,Long roadId){ - Criteria criteria=createCriteria(PgPile.class); + Criteria criteria=createCriteria(PgSection.class); criteria.add(Restrictions.eq("lineName",lineName)); criteria.add(Restrictions.eq("roadId",roadId)); criteria.add(Restrictions.eq("active",true)); @@ -26,5 +29,20 @@ return pgSectionList.get(0); } + public List getLineType(){ + + List pgLineTypeList=new ArrayList<>(); + String sql="select distinct linename from pg_section where active = 1"; + + List objList=this.getSession().createSQLQuery(sql).list(); + for(Object object : objList) + { + PgLineType pgLineType=new PgLineType(); + pgLineType.setLineType(String.valueOf(object)); + pgLineTypeList.add(pgLineType); + } + + return pgLineTypeList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java index 277cf3f..05a9709 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java @@ -4,10 +4,12 @@ import com.casic.PgInterface.intelPlan.dto.PgPlanResultRe; import com.casic.PgInterface.intelPlan.dto.PgPlanTask; import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import com.casic.PgInterface.test.PlanData; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ModelAttribute; import javax.annotation.Resource; +import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -27,25 +29,20 @@ @POST @Path("getPlanResult") @Produces(MediaType.APPLICATION_JSON) - public Map getPlanResult(@ModelAttribute PgPlanParams pgPlanParams){ + public Map getPlanResult(@FormParam("planParamStr") String planParamStr){ Map resultMap=new HashMap<>(); String msg=""; - List pgPlanTaskList=new ArrayList<>(); + //List pgPlanTaskList=pgPlanParams.getPgPlanTaskList(); + List pgPlanTaskList=new PgPlanParams().getPgPlanParamsByString(planParamStr); List pgPlanResultReList=new ArrayList<>(); try{ - if(pgPlanParams==null){ - msg="请输入规划任务"; - } - else { - pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); if(pgPlanResultReList==null) msg="管线智能规划出错"; else msg="管线智能规划完成"; - } } catch(Exception ex){ msg="智能规划出错"; @@ -58,4 +55,29 @@ return resultMap; } + /* + 规划测试 + */ + @POST + @Path("getPlanResultTest") + @Produces(MediaType.APPLICATION_JSON) + public Map getPlanResultTest(){ + Map resultMap=new HashMap<>(); + PlanData planData=new PlanData(); + List pgPlanResultReList=new ArrayList<>(); + try{ + PgPlanParams pgPlanParams=planData.getPlanData(); + + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + resultMap.put("msg","管线智能规划完成"); + resultMap.put("result",pgPlanResultReList); + return resultMap; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java new file mode 100644 index 0000000..378af00 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java @@ -0,0 +1,59 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Path("pgLineHole") +public class PgLineHoleRs { + + @Resource + private PgLineHoleManager pgLineHoleManager; + + @Resource + private PgPileAcuManager pgPileAcuManager; + + @POST + @Path("getPgLineAcuHole") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgLineAcuHole(@FormParam("acuCode") String acuCode) throws Exception { + Map resultMap = new HashMap<>(); + String msg = ""; + String result=""; + List pgLineHoleDTOList=new ArrayList<>(); + + try { + PgPileAcu pgPileAcu=pgPileAcuManager.getPgPileAcuByCode(acuCode); + if(pgPileAcu==null){ + msg="不存在分区"; + }else{ + pgLineHoleDTOList=pgLineHoleManager.getCurrentHoleByAcu(pgPileAcu.getId()); + if(pgLineHoleDTOList!=null&&pgLineHoleDTOList.size()!=0) + msg="获取成功"; + else + msg="未找到入廊数据"; + } + } catch (Exception e) { + e.printStackTrace(); + msg = "获取失败"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgLineHoleDTOList); + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 1621666..39cff52 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; +import javax.validation.constraints.Null; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -48,8 +49,10 @@ try { PgUser pgUser = new PgUser(); pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - - pgLog.setUserId(pgUser.getId()); + if(pgUser== null) + pgLog.setUserId(null); + else + pgLog.setUserId(pgUser.getId()); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java index a93ae7a..cf62954 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java @@ -67,11 +67,11 @@ try{ pgPileDTOList=pgPileManager.getPgPileDTOList(); - msg="桩号列表获取成功"; + msg="获取成功"; } catch(Exception ex){ pgPileDTOList=null; - msg="桩号列表获取成失败"; + msg="获取成失败"; ex.printStackTrace(); } resultMap.put("result",pgPileDTOList); @@ -118,4 +118,4 @@ return resultMap; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 8c3ac4b..b42a182 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -40,10 +40,7 @@ @POST @Path("addPipeLine") @Produces(MediaType.APPLICATION_JSON) - public Map addLog(@FormParam("lineCode") String lineCode, - @FormParam("lineName") String lineType, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("diameter") String diameter, + public Map addLog( @FormParam("lineType") String lineType, @FormParam("secRow") String secRow, @FormParam("secColumn") String secColumn, @FormParam("pileAcuList") String pileAcuList) throws Exception { @@ -53,12 +50,14 @@ Map resultMap = new HashMap<>(); try { - resultMap = pgPipeLineManager.addPipeLine(lineCode,lineType,ownerUnit,diameter,secRow,secColumn,pileAcuList); + resultMap = pgPipeLineManager.addPipeLine(lineType,secRow,secColumn,pileAcuList); + resultMap.put("msg","提交成功"); + resultMap.put("result","true"); } catch (Exception e) { e.printStackTrace(); resultMap.put("result","false"); - resultMap.put("msg","保存失败"); + resultMap.put("msg","提交失败"); return resultMap; } @@ -94,7 +93,7 @@ @Path("getPipeLineByCode") @Produces(MediaType.APPLICATION_JSON) public Map getPipeLineByName(@FormParam("lineCode") String lineCode) throws Exception { - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); String msg = ""; PgPipeLineDto pgPipeLineDto=null; try { diff --git a/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java b/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java index 9cb65d1..0e413b8 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import com.casic.PgInterface.intelPlan.manager.PgSectionManager; import org.springframework.stereotype.Component; @@ -12,7 +13,9 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; @Component @@ -96,4 +99,27 @@ return resultMap; } + + @POST + @Path("getLineType") + @Produces(MediaType.APPLICATION_JSON) + public Map getLineType(){ + Map resultMap=new HashMap<>(); + List pgLineTypeList=new ArrayList<>(); + String msg=""; + + try{ + pgLineTypeList=pgSectionManager.getLineType(); + msg="获取成功"; + } + catch(Exception ex){ + ex.printStackTrace(); + msg="获取失败"; + } + + resultMap.put("msg",msg); + resultMap.put("result",pgLineTypeList); + + return resultMap; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/test/PlanData.java b/src/main/java/com/casic/PgInterface/test/PlanData.java new file mode 100644 index 0000000..358d73e --- /dev/null +++ b/src/main/java/com/casic/PgInterface/test/PlanData.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.test; + +import com.casic.PgInterface.intelPlan.dto.PgPlanParams; +import com.casic.PgInterface.intelPlan.dto.PgPlanTask; + +import java.util.ArrayList; +import java.util.List; + +public class PlanData { + + public PgPlanParams getPlanData(){ + + PgPlanParams pgPlanParams=new PgPlanParams(); + List pgPlanTaskList=new ArrayList<>(); + + PgPlanTask pgPlanTask=new PgPlanTask(); + pgPlanTask.setLineName("10KV"); + pgPlanTask.setTaskKey("test1"); + List acuList=new ArrayList<>(); + + acuList.add("01区"); + acuList.add("02区"); + acuList.add("03区"); + acuList.add("04区"); + acuList.add("05区"); + pgPlanTask.setPileAcuList(acuList); + + PgPlanTask pgPlanTask1=new PgPlanTask(); + pgPlanTask1.setLineName("10KV"); + pgPlanTask1.setTaskKey("test2"); + List acuList1=new ArrayList<>(); + + acuList1.add("11区"); + acuList1.add("12区"); + acuList1.add("13区"); + pgPlanTask1.setPileAcuList(acuList1); + + pgPlanTaskList.add(pgPlanTask); + pgPlanTaskList.add(pgPlanTask1); + pgPlanParams.setPgPlanTaskList(pgPlanTaskList); + + return pgPlanParams; + } + +} \ No newline at end of file diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@ + + + + + - @@ -738,9 +670,8 @@ - - + @@ -749,9 +680,9 @@ - + - + @@ -777,7 +708,7 @@ - + @@ -841,7 +772,8 @@ - @@ -860,48 +792,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -986,13 +876,6 @@ - - - - - - - @@ -1000,13 +883,6 @@ - - - - - - - @@ -1021,62 +897,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1084,48 +904,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1149,30 +927,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -1180,64 +934,225 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - @@ -1296,11 +1211,12 @@ - Web|PgInterface + PgInterface diff --git a/PgInterface.iml b/PgInterface.iml index 30b90ae..94ce0b1 100644 --- a/PgInterface.iml +++ b/PgInterface.iml @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java index 5c2c8c7..45efe50 100644 --- a/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java +++ b/src/main/java/com/casic/PgInterface/core/hibernate/HibernateGenericDao.java @@ -129,7 +129,7 @@ if (isAsc) { criteria.addOrder(Order.asc(orderBy)); } else { - criteria.addOrder(Order.desc(orderBy)); + } return criteria; diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java index 27f01b3..2f9a15c 100644 --- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java +++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java @@ -104,8 +104,7 @@ return pgPipeLineTypeNumDtoList; } - public Map addPipeLine(String lineCode, String lineType, String ownerUnit, String diameter, - String secRow, String secColumn, String pileAcuList){ + public Map addPipeLine(String lineType,String secRow, String secColumn, String pileAcuList){ Map resultMap=new HashMap<>(); String msg=""; String result=""; @@ -115,10 +114,7 @@ Long acuLength=pgPileAcuManager.getAcuListLength(pgPileAcuList); try{ PgPipeLine pgPipeLine=new PgPipeLine(); - pgPipeLine.setLineCode(lineCode); pgPipeLine.setLineType(lineType); - pgPipeLine.setOwnerUnit(ownerUnit); - pgPipeLine.setDiameter(diameter); pgPipeLine.setLength(acuLength); pgPipeLine.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java index a085001..c8810f8 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/domain/PgLineHole.java @@ -9,7 +9,7 @@ public class PgLineHole implements Serializable { private Long id; - private String lineName;//入廊管线ID + private String lineName;//入廊管线 private Long pileAcuId;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java index 010b438..8559da7 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineHoleDTO.java @@ -1,10 +1,18 @@ package com.casic.PgInterface.intelPlan.dto; +import com.casic.PgInterface.devTable.manager.PgRoadManager; +import com.casic.PgInterface.intelPlan.domain.PgLineHole; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; + +import java.util.ArrayList; +import java.util.List; + public class PgLineHoleDTO { private Long id; private String lineName;//管线 - private Long pileAcuId;//桩分区ID + private String road; + private String pileAcuCode;//桩分区ID private Long secRow;//行号 private Long secColumn;//列号 private boolean active;//状态位 @@ -25,12 +33,20 @@ this.lineName = lineName; } - public Long getPileAcuId() { - return pileAcuId; + public String getRoad() { + return road; } - public void setPileAcuId(Long pileAcuId) { - this.pileAcuId = pileAcuId; + public void setRoad(String road) { + this.road = road; + } + + public String getPileAcuCode() { + return pileAcuCode; + } + + public void setPileAcuCode(String pileAcuCode) { + this.pileAcuCode = pileAcuCode; } public Long getSecRow() { @@ -56,4 +72,38 @@ public void setActive(boolean active) { this.active = active; } + + public static PgLineHoleDTO ConvertToDTO(PgLineHole pgLineHole, PgPileAcuManager pgPileAcuManager, PgRoadManager pgRoadManager){ + + PgLineHoleDTO pgLineHoleDTO=new PgLineHoleDTO(); + pgLineHoleDTO.setId(pgLineHole.getId()); + pgLineHoleDTO.setLineName(pgLineHole.getLineName()); + pgLineHoleDTO.setSecColumn(pgLineHole.getSecColumn()); + pgLineHoleDTO.setSecRow(pgLineHole.getSecRow()); + if(pgLineHole.getPileAcuId()==null||pgPileAcuManager.get(pgLineHole.getPileAcuId())==null) + pgLineHoleDTO.setPileAcuCode(""); + else + { + pgLineHoleDTO.setPileAcuCode(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getAcuCode()); + + if(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId())==null) + pgLineHoleDTO.setRoad(""); + else + pgLineHoleDTO.setRoad(pgRoadManager.get(pgPileAcuManager.get(pgLineHole.getPileAcuId()).getRoadId()).getRoadName()); + } + + return pgLineHoleDTO; + + } + + public static List ConvertToDTOList(List pgLineHoleList, + PgPileAcuManager pgPileAcuManager,PgRoadManager pgRoadManager){ + List pgLineHoleDTOList=new ArrayList<>(); + + for(PgLineHole pgLineHole:pgLineHoleList){ + pgLineHoleDTOList.add(ConvertToDTO(pgLineHole,pgPileAcuManager,pgRoadManager)); + } + + return pgLineHoleDTOList; + } } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java new file mode 100644 index 0000000..3344311 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgLineType.java @@ -0,0 +1,14 @@ +package com.casic.PgInterface.intelPlan.dto; + +public class PgLineType { + + private String lineType; + + public String getLineType() { + return lineType; + } + + public void setLineType(String lineType) { + this.lineType = lineType; + } +} diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java index 45a2ceb..5a76933 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanParams.java @@ -1,5 +1,10 @@ package com.casic.PgInterface.intelPlan.dto; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; + import java.util.List; public class PgPlanParams { @@ -14,4 +19,17 @@ this.pgPlanTaskList = pgPlanTaskList; } + public List getPgPlanParamsByString(String paramsStr){ + + try { + String jsonString=String.valueOf(JSON.parse(paramsStr)); + PgPlanParams pgPlanParams = JSONObject.parseObject(jsonString, new TypeReference() {}); + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + return pgPlanTaskList; + } + catch(Exception ex){ + return null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java index 12abaa8..f216360 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/dto/PgPlanResultRe.java @@ -22,4 +22,5 @@ public void setPgPlanResultList(List pgPlanResultList) { this.pgPlanResultList = pgPlanResultList; } -} + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java index 1ed5723..71ea765 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgLineHoleManager.java @@ -1,17 +1,28 @@ package com.casic.PgInterface.intelPlan.manager; import com.casic.PgInterface.core.hibernate.HibernateEntityDao; +import com.casic.PgInterface.devTable.domain.PgRoad; +import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgLineHole; import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class PgLineHoleManager extends HibernateEntityDao { + @Resource + private PgPileAcuManager pgPileAcuManager; + + @Resource + private PgRoadManager pgRoadManager; + public List getPgLineHole(String lineName,Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); @@ -35,18 +46,19 @@ return false; } - public List getCurrentHoleByAcu(Long pileAcuId){ + public List getCurrentHoleByAcu(Long pileAcuId){ Criteria criteria=createCriteria(PgLineHole.class); criteria.add(Restrictions.eq("pileAcuId",pileAcuId)); criteria.add(Restrictions.eq("active",true)); List pgLineHoleList=criteria.list(); - + List pgLineHoleDTOList=new ArrayList<>(); if(pgLineHoleList==null||pgLineHoleList.size()==0) return null; else - return pgLineHoleList; + pgLineHoleDTOList=PgLineHoleDTO.ConvertToDTOList(pgLineHoleList,pgPileAcuManager,pgRoadManager); + return pgLineHoleDTOList; } public void addPgLIneHole(List pgPileAcuList,String lineName,String secRow,String secColumn){ diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java index 2947ec4..0fd9e1f 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileAcuManager.java @@ -83,7 +83,6 @@ //获取pgPlanResultList PgSection pgSection=pgSectionManager.getPgSectionByRoadAndLine(lineName,raodId); pgPlanResultList=getPlanResult(lineName,pgPileAcuList,pgSection); - } catch(Exception ex){ ex.printStackTrace(); @@ -109,18 +108,21 @@ pgPlanResult.setSecRow(row); pgPlanResult.setLength(getAcuListLength(pgPileAcuList)); pgPlanResultList.add(pgPlanResult); + + return pgPlanResultList; } } } - return pgPlanResultList; + return null; } private boolean canPlanLine(String lineName,List pgPileAcuList,int row,int column){ try { for (PgPileAcu pgPileAcu : pgPileAcuList) { List pgLineHoleList = pgLineHoleManager.getPgLineHole(lineName, pgPileAcu.getId()); - if (pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) return false; + if(pgLineHoleList!=null&&pgLineHoleList.size()!=0&&pgLineHoleManager.isExistLine(pgLineHoleList, row, column)) + return false; } return true; } @@ -132,7 +134,7 @@ public Long getAcuListLength(List pgPileAcuList){ - Long length=null; + long length=0; for(PgPileAcu pgPileAcu:pgPileAcuList){ length+=pgPileAcu.getLength(); } diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java index 31ce1a4..7038b4d 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgPileManager.java @@ -4,6 +4,7 @@ import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.dto.PgPileDTO; import org.hibernate.Criteria; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ public List getPgPileDTOList(){ Criteria criteria=createCriteria(PgPile.class); criteria.add(Restrictions.eq("active",true)); + criteria.addOrder(Order.desc("id")); List pgPileList=criteria.list(); List pgPileDTOList=new ArrayList<>(); diff --git a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java index 2393258..482b7e6 100644 --- a/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java +++ b/src/main/java/com/casic/PgInterface/intelPlan/manager/PgSectionManager.java @@ -3,10 +3,13 @@ import com.casic.PgInterface.core.hibernate.HibernateEntityDao; import com.casic.PgInterface.intelPlan.domain.PgPile; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; +import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; @Service @@ -14,7 +17,7 @@ public PgSection getPgSectionByRoadAndLine(String lineName,Long roadId){ - Criteria criteria=createCriteria(PgPile.class); + Criteria criteria=createCriteria(PgSection.class); criteria.add(Restrictions.eq("lineName",lineName)); criteria.add(Restrictions.eq("roadId",roadId)); criteria.add(Restrictions.eq("active",true)); @@ -26,5 +29,20 @@ return pgSectionList.get(0); } + public List getLineType(){ + + List pgLineTypeList=new ArrayList<>(); + String sql="select distinct linename from pg_section where active = 1"; + + List objList=this.getSession().createSQLQuery(sql).list(); + for(Object object : objList) + { + PgLineType pgLineType=new PgLineType(); + pgLineType.setLineType(String.valueOf(object)); + pgLineTypeList.add(pgLineType); + } + + return pgLineTypeList; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java index 277cf3f..05a9709 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgInNewPlanRs.java @@ -4,10 +4,12 @@ import com.casic.PgInterface.intelPlan.dto.PgPlanResultRe; import com.casic.PgInterface.intelPlan.dto.PgPlanTask; import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import com.casic.PgInterface.test.PlanData; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ModelAttribute; import javax.annotation.Resource; +import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -27,25 +29,20 @@ @POST @Path("getPlanResult") @Produces(MediaType.APPLICATION_JSON) - public Map getPlanResult(@ModelAttribute PgPlanParams pgPlanParams){ + public Map getPlanResult(@FormParam("planParamStr") String planParamStr){ Map resultMap=new HashMap<>(); String msg=""; - List pgPlanTaskList=new ArrayList<>(); + //List pgPlanTaskList=pgPlanParams.getPgPlanTaskList(); + List pgPlanTaskList=new PgPlanParams().getPgPlanParamsByString(planParamStr); List pgPlanResultReList=new ArrayList<>(); try{ - if(pgPlanParams==null){ - msg="请输入规划任务"; - } - else { - pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); if(pgPlanResultReList==null) msg="管线智能规划出错"; else msg="管线智能规划完成"; - } } catch(Exception ex){ msg="智能规划出错"; @@ -58,4 +55,29 @@ return resultMap; } + /* + 规划测试 + */ + @POST + @Path("getPlanResultTest") + @Produces(MediaType.APPLICATION_JSON) + public Map getPlanResultTest(){ + Map resultMap=new HashMap<>(); + PlanData planData=new PlanData(); + List pgPlanResultReList=new ArrayList<>(); + try{ + PgPlanParams pgPlanParams=planData.getPlanData(); + + List pgPlanTaskList = pgPlanParams.getPgPlanTaskList(); + pgPlanResultReList=pgPileAcuManager.getPgPlanResultList(pgPlanTaskList); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + resultMap.put("msg","管线智能规划完成"); + resultMap.put("result",pgPlanResultReList); + return resultMap; + } + } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java new file mode 100644 index 0000000..378af00 --- /dev/null +++ b/src/main/java/com/casic/PgInterface/rs/PgLineHoleRs.java @@ -0,0 +1,59 @@ +package com.casic.PgInterface.rs; + +import com.casic.PgInterface.intelPlan.domain.PgPileAcu; +import com.casic.PgInterface.intelPlan.dto.PgLineHoleDTO; +import com.casic.PgInterface.intelPlan.manager.PgLineHoleManager; +import com.casic.PgInterface.intelPlan.manager.PgPileAcuManager; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import javax.ws.rs.FormParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Path("pgLineHole") +public class PgLineHoleRs { + + @Resource + private PgLineHoleManager pgLineHoleManager; + + @Resource + private PgPileAcuManager pgPileAcuManager; + + @POST + @Path("getPgLineAcuHole") + @Produces(MediaType.APPLICATION_JSON) + public Map getPgLineAcuHole(@FormParam("acuCode") String acuCode) throws Exception { + Map resultMap = new HashMap<>(); + String msg = ""; + String result=""; + List pgLineHoleDTOList=new ArrayList<>(); + + try { + PgPileAcu pgPileAcu=pgPileAcuManager.getPgPileAcuByCode(acuCode); + if(pgPileAcu==null){ + msg="不存在分区"; + }else{ + pgLineHoleDTOList=pgLineHoleManager.getCurrentHoleByAcu(pgPileAcu.getId()); + if(pgLineHoleDTOList!=null&&pgLineHoleDTOList.size()!=0) + msg="获取成功"; + else + msg="未找到入廊数据"; + } + } catch (Exception e) { + e.printStackTrace(); + msg = "获取失败"; + } + resultMap.put("msg", msg); + resultMap.put("result", pgLineHoleDTOList); + return resultMap; + } + +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java index 1621666..39cff52 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; +import javax.validation.constraints.Null; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -48,8 +49,10 @@ try { PgUser pgUser = new PgUser(); pgUser = pgPatrolerManager.getPatrolerByuserName(userName); - - pgLog.setUserId(pgUser.getId()); + if(pgUser== null) + pgLog.setUserId(null); + else + pgLog.setUserId(pgUser.getId()); pgLog.setOperate(operate); pgLog.setOperateTime(new Date()); pgLog.setActive(1); diff --git a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java index a93ae7a..cf62954 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPileRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPileRs.java @@ -67,11 +67,11 @@ try{ pgPileDTOList=pgPileManager.getPgPileDTOList(); - msg="桩号列表获取成功"; + msg="获取成功"; } catch(Exception ex){ pgPileDTOList=null; - msg="桩号列表获取成失败"; + msg="获取成失败"; ex.printStackTrace(); } resultMap.put("result",pgPileDTOList); @@ -118,4 +118,4 @@ return resultMap; } -} +} \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java index 8c3ac4b..b42a182 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java @@ -40,10 +40,7 @@ @POST @Path("addPipeLine") @Produces(MediaType.APPLICATION_JSON) - public Map addLog(@FormParam("lineCode") String lineCode, - @FormParam("lineName") String lineType, - @FormParam("ownerUnit") String ownerUnit, - @FormParam("diameter") String diameter, + public Map addLog( @FormParam("lineType") String lineType, @FormParam("secRow") String secRow, @FormParam("secColumn") String secColumn, @FormParam("pileAcuList") String pileAcuList) throws Exception { @@ -53,12 +50,14 @@ Map resultMap = new HashMap<>(); try { - resultMap = pgPipeLineManager.addPipeLine(lineCode,lineType,ownerUnit,diameter,secRow,secColumn,pileAcuList); + resultMap = pgPipeLineManager.addPipeLine(lineType,secRow,secColumn,pileAcuList); + resultMap.put("msg","提交成功"); + resultMap.put("result","true"); } catch (Exception e) { e.printStackTrace(); resultMap.put("result","false"); - resultMap.put("msg","保存失败"); + resultMap.put("msg","提交失败"); return resultMap; } @@ -94,7 +93,7 @@ @Path("getPipeLineByCode") @Produces(MediaType.APPLICATION_JSON) public Map getPipeLineByName(@FormParam("lineCode") String lineCode) throws Exception { - Map resultMap = new HashMap(); + Map resultMap = new HashMap<>(); String msg = ""; PgPipeLineDto pgPipeLineDto=null; try { diff --git a/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java b/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java index 9cb65d1..0e413b8 100644 --- a/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java +++ b/src/main/java/com/casic/PgInterface/rs/PgSectionRs.java @@ -3,6 +3,7 @@ import com.casic.PgInterface.devTable.domain.PgRoad; import com.casic.PgInterface.devTable.manager.PgRoadManager; import com.casic.PgInterface.intelPlan.domain.PgSection; +import com.casic.PgInterface.intelPlan.dto.PgLineType; import com.casic.PgInterface.intelPlan.manager.PgSectionManager; import org.springframework.stereotype.Component; @@ -12,7 +13,9 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; @Component @@ -96,4 +99,27 @@ return resultMap; } + + @POST + @Path("getLineType") + @Produces(MediaType.APPLICATION_JSON) + public Map getLineType(){ + Map resultMap=new HashMap<>(); + List pgLineTypeList=new ArrayList<>(); + String msg=""; + + try{ + pgLineTypeList=pgSectionManager.getLineType(); + msg="获取成功"; + } + catch(Exception ex){ + ex.printStackTrace(); + msg="获取失败"; + } + + resultMap.put("msg",msg); + resultMap.put("result",pgLineTypeList); + + return resultMap; + } } \ No newline at end of file diff --git a/src/main/java/com/casic/PgInterface/test/PlanData.java b/src/main/java/com/casic/PgInterface/test/PlanData.java new file mode 100644 index 0000000..358d73e --- /dev/null +++ b/src/main/java/com/casic/PgInterface/test/PlanData.java @@ -0,0 +1,45 @@ +package com.casic.PgInterface.test; + +import com.casic.PgInterface.intelPlan.dto.PgPlanParams; +import com.casic.PgInterface.intelPlan.dto.PgPlanTask; + +import java.util.ArrayList; +import java.util.List; + +public class PlanData { + + public PgPlanParams getPlanData(){ + + PgPlanParams pgPlanParams=new PgPlanParams(); + List pgPlanTaskList=new ArrayList<>(); + + PgPlanTask pgPlanTask=new PgPlanTask(); + pgPlanTask.setLineName("10KV"); + pgPlanTask.setTaskKey("test1"); + List acuList=new ArrayList<>(); + + acuList.add("01区"); + acuList.add("02区"); + acuList.add("03区"); + acuList.add("04区"); + acuList.add("05区"); + pgPlanTask.setPileAcuList(acuList); + + PgPlanTask pgPlanTask1=new PgPlanTask(); + pgPlanTask1.setLineName("10KV"); + pgPlanTask1.setTaskKey("test2"); + List acuList1=new ArrayList<>(); + + acuList1.add("11区"); + acuList1.add("12区"); + acuList1.add("13区"); + pgPlanTask1.setPileAcuList(acuList1); + + pgPlanTaskList.add(pgPlanTask); + pgPlanTaskList.add(pgPlanTask1); + pgPlanParams.setPgPlanTaskList(pgPlanTaskList); + + return pgPlanParams; + } + +} \ No newline at end of file diff --git a/src/main/resources/bin/fastjson-1.2.53.jar b/src/main/resources/bin/fastjson-1.2.53.jar new file mode 100644 index 0000000..1a8cd08 --- /dev/null +++ b/src/main/resources/bin/fastjson-1.2.53.jar Binary files differ diff --git "a/\346\231\272\350\203\275\350\247\204\345\210\222.docx" "b/\346\231\272\350\203\275\350\247\204\345\210\222.docx" index bd2407d..055787f 100644 --- "a/\346\231\272\350\203\275\350\247\204\345\210\222.docx" +++ "b/\346\231\272\350\203\275\350\247\204\345\210\222.docx" Binary files differ diff --git a/.idea/artifacts/PgInterface.xml b/.idea/artifacts/PgInterface.xml index b8260a5..2c54522 100644 --- a/.idea/artifacts/PgInterface.xml +++ b/.idea/artifacts/PgInterface.xml @@ -91,6 +91,7 @@ + diff --git a/.idea/artifacts/PgInterface_war.xml b/.idea/artifacts/PgInterface_war.xml deleted file mode 100644 index 41f5a90..0000000 --- a/.idea/artifacts/PgInterface_war.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - $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 deleted file mode 100644 index 52a4834..0000000 --- a/.idea/artifacts/PgInterface_war_exploded.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - $PROJECT_DIR$/target/PgInterface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/fastjson_1_2_53.xml b/.idea/libraries/fastjson_1_2_53.xml new file mode 100644 index 0000000..caf0ea2 --- /dev/null +++ b/.idea/libraries/fastjson_1_2_53.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6c05feb..82b1019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,47 +7,32 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + - - - + + + + + + + + + + + - - - - - - - - - - - + + @@ -78,8 +63,8 @@ - - + + @@ -87,40 +72,41 @@ - - + + - - + + - + - - + + - + + - + @@ -137,20 +123,21 @@ - + - + + - + @@ -158,72 +145,47 @@ - + - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - @@ -232,14 +194,34 @@ - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + @@ -269,8 +251,14 @@ I inCriteria getPgPlanResulList - getPipeLineBylineName getPileAcuListByPileAcuStr + distinct + order + canPlanLine + isExistLine + getPlanResult + pgPipeLine + getPipeLineBylineName @@ -279,12 +267,6 @@