diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
index 16bb660..23693f4 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
@@ -107,4 +107,5 @@
return resultMap;
}
+
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
index 16bb660..23693f4 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
@@ -107,4 +107,5 @@
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 57b8ec8..8b14a87 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -65,6 +65,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName)
throws Exception {
@@ -97,6 +98,7 @@
pgPipeLine.setLayerNum(layerNum);
pgPipeLine.setEnterDate(sdf.parse(enterDate));
pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
pgPipeLine.setPipeGalleryId(pipeGallery);
pgPipeLine.setActive(1);
@@ -128,6 +130,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName) throws Exception {
@@ -152,20 +155,21 @@
}
else {
*/
- PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
+ PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
- pgPipeLine.setLineName(lineName);
- pgPipeLine.setLineType(lineType);
- pgPipeLine.setOwnerUnit(ownerUnit);
- pgPipeLine.setEnterDate(sdf.parse(enterDate));
- pgPipeLine.setLayerNum(layerNum);
- pgPipeLine.setDiameter(diameter);
- pgPipeLine.setPipeGalleryId(pipeGallery);
- pgPipeLine.setActive(1);
+ pgPipeLine.setLineName(lineName);
+ pgPipeLine.setLineType(lineType);
+ pgPipeLine.setOwnerUnit(ownerUnit);
+ pgPipeLine.setEnterDate(sdf.parse(enterDate));
+ pgPipeLine.setLayerNum(layerNum);
+ pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
+ pgPipeLine.setPipeGalleryId(pipeGallery);
+ pgPipeLine.setActive(1);
- pgPipeLineManager.save(pgPipeLine);
- result = "true";
- msg = "编辑成功";
+ pgPipeLineManager.save(pgPipeLine);
+ result = "true";
+ msg = "编辑成功";
//}
} catch (Exception e) {
result = "false";
@@ -258,4 +262,28 @@
return resultMap;
}
+ /**
+ * 根据管线类型获取管线长度
+ */
+ @POST
+ @Path("getPipeLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeLengthByName(@FormParam("lineType") String lineType)throws Exception{
+ Map resultMap = new HashMap();
+ String result = "";
+ String msg = "";
+ try {
+ result = pgPipeLineManager.getPipeLengthByName(lineType);
+ msg="管线长度获取成功";
+ }catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="管线长度统计失败";
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
}
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
index 16bb660..23693f4 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
@@ -107,4 +107,5 @@
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 57b8ec8..8b14a87 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -65,6 +65,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName)
throws Exception {
@@ -97,6 +98,7 @@
pgPipeLine.setLayerNum(layerNum);
pgPipeLine.setEnterDate(sdf.parse(enterDate));
pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
pgPipeLine.setPipeGalleryId(pipeGallery);
pgPipeLine.setActive(1);
@@ -128,6 +130,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName) throws Exception {
@@ -152,20 +155,21 @@
}
else {
*/
- PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
+ PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
- pgPipeLine.setLineName(lineName);
- pgPipeLine.setLineType(lineType);
- pgPipeLine.setOwnerUnit(ownerUnit);
- pgPipeLine.setEnterDate(sdf.parse(enterDate));
- pgPipeLine.setLayerNum(layerNum);
- pgPipeLine.setDiameter(diameter);
- pgPipeLine.setPipeGalleryId(pipeGallery);
- pgPipeLine.setActive(1);
+ pgPipeLine.setLineName(lineName);
+ pgPipeLine.setLineType(lineType);
+ pgPipeLine.setOwnerUnit(ownerUnit);
+ pgPipeLine.setEnterDate(sdf.parse(enterDate));
+ pgPipeLine.setLayerNum(layerNum);
+ pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
+ pgPipeLine.setPipeGalleryId(pipeGallery);
+ pgPipeLine.setActive(1);
- pgPipeLineManager.save(pgPipeLine);
- result = "true";
- msg = "编辑成功";
+ pgPipeLineManager.save(pgPipeLine);
+ result = "true";
+ msg = "编辑成功";
//}
} catch (Exception e) {
result = "false";
@@ -258,4 +262,28 @@
return resultMap;
}
+ /**
+ * 根据管线类型获取管线长度
+ */
+ @POST
+ @Path("getPipeLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeLengthByName(@FormParam("lineType") String lineType)throws Exception{
+ Map resultMap = new HashMap();
+ String result = "";
+ String msg = "";
+ try {
+ result = pgPipeLineManager.getPipeLengthByName(lineType);
+ msg="管线长度获取成功";
+ }catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="管线长度统计失败";
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
index 42f7d40..bb41cbd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
@@ -50,6 +50,7 @@
@Path("addPipeGallery")
@Produces(MediaType.APPLICATION_JSON)
public Map addPipeGallery(@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
String result = "";
@@ -67,6 +68,7 @@
msg = "已存在相同管廊";
} else {
pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Double.valueOf(parLength));
pipeGallery.setPgPartitionId(pgPartition);
pipeGallery.setActive(1);
logger.info("成功保存");
@@ -119,6 +121,7 @@
@Produces(MediaType.APPLICATION_JSON)
public Map editPipeGallery(@FormParam("id") String id,
@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
@@ -138,15 +141,16 @@
msg = "已存在相同管廊";
} else {
*/
- pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
+ pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
- pipeGallery.setPgName(pgName);
- pipeGallery.setPgPartitionId(pgPartition);
- pipeGallery.setActive(1);
+ pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Long.valueOf(parLength));
+ pipeGallery.setPgPartitionId(pgPartition);
+ pipeGallery.setActive(1);
- pipeGalleryManager.save(pipeGallery);
- result = "true";
- msg = "编辑成功";
+ pipeGalleryManager.save(pipeGallery);
+ result = "true";
+ msg = "编辑成功";
//}
}
} catch (Exception e) {
@@ -194,4 +198,31 @@
return resultMap;
}
+ /**
+ * 获取管廊仓体的长度
+ */
+ @POST
+ @Path("getPgLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPgLengthByName(@FormParam("pgName") String pgName)
+ {
+ Map resultMap=new HashMap();
+ String result="";
+ String msg="";
+
+ try{
+ result=pipeGalleryManager.getPgLengthByName(pgName);
+ msg="仓体长度获取成功";
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="仓体长度获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
index 16bb660..23693f4 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
@@ -107,4 +107,5 @@
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 57b8ec8..8b14a87 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -65,6 +65,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName)
throws Exception {
@@ -97,6 +98,7 @@
pgPipeLine.setLayerNum(layerNum);
pgPipeLine.setEnterDate(sdf.parse(enterDate));
pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
pgPipeLine.setPipeGalleryId(pipeGallery);
pgPipeLine.setActive(1);
@@ -128,6 +130,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName) throws Exception {
@@ -152,20 +155,21 @@
}
else {
*/
- PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
+ PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
- pgPipeLine.setLineName(lineName);
- pgPipeLine.setLineType(lineType);
- pgPipeLine.setOwnerUnit(ownerUnit);
- pgPipeLine.setEnterDate(sdf.parse(enterDate));
- pgPipeLine.setLayerNum(layerNum);
- pgPipeLine.setDiameter(diameter);
- pgPipeLine.setPipeGalleryId(pipeGallery);
- pgPipeLine.setActive(1);
+ pgPipeLine.setLineName(lineName);
+ pgPipeLine.setLineType(lineType);
+ pgPipeLine.setOwnerUnit(ownerUnit);
+ pgPipeLine.setEnterDate(sdf.parse(enterDate));
+ pgPipeLine.setLayerNum(layerNum);
+ pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
+ pgPipeLine.setPipeGalleryId(pipeGallery);
+ pgPipeLine.setActive(1);
- pgPipeLineManager.save(pgPipeLine);
- result = "true";
- msg = "编辑成功";
+ pgPipeLineManager.save(pgPipeLine);
+ result = "true";
+ msg = "编辑成功";
//}
} catch (Exception e) {
result = "false";
@@ -258,4 +262,28 @@
return resultMap;
}
+ /**
+ * 根据管线类型获取管线长度
+ */
+ @POST
+ @Path("getPipeLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeLengthByName(@FormParam("lineType") String lineType)throws Exception{
+ Map resultMap = new HashMap();
+ String result = "";
+ String msg = "";
+ try {
+ result = pgPipeLineManager.getPipeLengthByName(lineType);
+ msg="管线长度获取成功";
+ }catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="管线长度统计失败";
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
index 42f7d40..bb41cbd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
@@ -50,6 +50,7 @@
@Path("addPipeGallery")
@Produces(MediaType.APPLICATION_JSON)
public Map addPipeGallery(@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
String result = "";
@@ -67,6 +68,7 @@
msg = "已存在相同管廊";
} else {
pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Double.valueOf(parLength));
pipeGallery.setPgPartitionId(pgPartition);
pipeGallery.setActive(1);
logger.info("成功保存");
@@ -119,6 +121,7 @@
@Produces(MediaType.APPLICATION_JSON)
public Map editPipeGallery(@FormParam("id") String id,
@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
@@ -138,15 +141,16 @@
msg = "已存在相同管廊";
} else {
*/
- pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
+ pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
- pipeGallery.setPgName(pgName);
- pipeGallery.setPgPartitionId(pgPartition);
- pipeGallery.setActive(1);
+ pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Long.valueOf(parLength));
+ pipeGallery.setPgPartitionId(pgPartition);
+ pipeGallery.setActive(1);
- pipeGalleryManager.save(pipeGallery);
- result = "true";
- msg = "编辑成功";
+ pipeGalleryManager.save(pipeGallery);
+ result = "true";
+ msg = "编辑成功";
//}
}
} catch (Exception e) {
@@ -194,4 +198,31 @@
return resultMap;
}
+ /**
+ * 获取管廊仓体的长度
+ */
+ @POST
+ @Path("getPgLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPgLengthByName(@FormParam("pgName") String pgName)
+ {
+ Map resultMap=new HashMap();
+ String result="";
+ String msg="";
+
+ try{
+ result=pipeGalleryManager.getPgLengthByName(pgName);
+ msg="仓体长度获取成功";
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="仓体长度获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
\ No newline at end of file
diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index 92792df..8086802 100644
--- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8ce1d20..1191417 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,18 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,15 +57,6 @@
-
-
-
-
-
-
-
-
-
@@ -77,8 +78,6 @@
-
-
@@ -93,11 +92,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,7 +169,6 @@
-
@@ -191,20 +200,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -259,128 +254,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -818,7 +707,12 @@
-
+
+
+
+
+
+
1510219102698
@@ -968,13 +862,17 @@
1523436516632
1523436516632
-
+
+ 1523494952341
+ 1523494952341
+
+
-
+
-
+
@@ -995,7 +893,7 @@
-
+
@@ -1008,7 +906,7 @@
-
+
@@ -1021,7 +919,7 @@
-
+
@@ -1034,18 +932,18 @@
-
+
-
+
-
+
-
+
@@ -1065,8 +963,8 @@
-
+
@@ -1114,7 +1012,7 @@
-
+
@@ -1122,119 +1020,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1249,13 +1034,6 @@
-
-
-
-
-
-
-
@@ -1263,33 +1041,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1304,7 +1059,6 @@
-
@@ -1312,11 +1066,6 @@
-
-
-
-
-
@@ -1324,7 +1073,6 @@
-
@@ -1332,7 +1080,6 @@
-
@@ -1340,7 +1087,6 @@
-
@@ -1356,10 +1102,6 @@
-
-
-
-
@@ -1367,7 +1109,6 @@
-
@@ -1375,15 +1116,6 @@
-
-
-
-
-
-
-
-
-
@@ -1391,10 +1123,6 @@
-
-
-
-
@@ -1402,7 +1130,6 @@
-
@@ -1410,10 +1137,6 @@
-
-
-
-
@@ -1421,7 +1144,6 @@
-
@@ -1429,7 +1151,6 @@
-
@@ -1437,7 +1158,6 @@
-
@@ -1445,23 +1165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1469,9 +1172,6 @@
-
-
-
@@ -1479,7 +1179,6 @@
-
@@ -1487,7 +1186,6 @@
-
@@ -1495,9 +1193,6 @@
-
-
-
@@ -1505,9 +1200,6 @@
-
-
-
@@ -1515,7 +1207,6 @@
-
@@ -1523,7 +1214,6 @@
-
@@ -1531,12 +1221,6 @@
-
-
-
-
-
-
@@ -1544,9 +1228,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
index 57246ce..f2d4f6e 100644
--- a/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
+++ b/src/main/java/com/casic/PgInterface/construction/manager/PgCsDocumentManager.java
@@ -4,6 +4,9 @@
import com.casic.PgInterface.construction.domain.PgCsDocument;
import com.casic.PgInterface.construction.dto.PgCsDocumentDto;
import com.casic.PgInterface.core.hibernate.HibernateEntityDao;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +14,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.ArrayList;
import java.util.List;
@@ -58,21 +60,31 @@
}
}
- /*下载*/
- public boolean downFile(PgCsDocument pgCsDocument){
- try {
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- String strDirPath = request.getSession().getServletContext().getRealPath("");
+ /*下载文件*/
+ public ResponseEntity downloadFile(PgCsDocument pgCsDocument) throws Exception {
+ try {
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+ String path = request.getSession().getServletContext().getRealPath("");
+ String filePath = path + "\\"+pgCsDocument.getConstruct_doc();
+ File file = new File(filePath);//找到具体的文件
+ byte[] body = null;
+ InputStream inputStream = new FileInputStream(file);
+ body = new byte[inputStream.available()];
+ inputStream.read(body);
+ HttpHeaders headers = new HttpHeaders();
+ /*MediaType mediaType = new MediaType("text", "html", Charset.forName("UTF-8"));*/
+ headers.add("Content-Disposition",file.getName());
+ /*headers.set("contentType","text/html;charset=utf-8");
+ headers.setContentType(mediaType);*/
+ HttpStatus status = HttpStatus.OK;
+ ResponseEntity entity = new ResponseEntity(body, headers, status);
- String image_toDir = strDirPath + "\\"+pgCsDocument.getConstruct_doc();//存储路径
-
-
- return true;
+ return entity;
+ //inputStream.close();
}
- catch (Exception e)
- {
- e.printStackTrace();
- return false;
+ catch (IOException e) {
+ e.printStackTrace();
+ return null;
}
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
index e5ff9b3..03fb35b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PgPipeLine.java
@@ -22,6 +22,7 @@
private Date enterDate;//入廊时间
private String layerNum;//所在层数
private String diameter;//管径
+ private double pipeLength;//管线长度
private PipeGallery pipeGalleryId;//所在管廊信息
private int active;//状态位
@@ -89,6 +90,15 @@
this.diameter = diameter;
}
+ @Column(name = "PIPE_LENGTH")
+ public double getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(double pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
index 93ed145..da9622e 100644
--- a/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
+++ b/src/main/java/com/casic/PgInterface/devTable/domain/PipeGallery.java
@@ -18,6 +18,7 @@
private static final long serialVersionUID = 1L;
private long id;
private String pgName;//管廊名称
+ private double pgLength;//仓体长度
private int active;//状态位
private PgPartition pgPartitionId;//
private List pgPipeLineList;
@@ -41,6 +42,15 @@
this.pgName = pgName;
}
+ @Column(name = "PAR_LENGTH")
+ public double getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(double pgLength) {
+ this.pgLength = pgLength;
+ }
+
@Column(name = "ACTIVE")
public int getActive() {
return active;
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
index 8b430dc..e7685ed 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PgPipeLineDto.java
@@ -18,6 +18,7 @@
private String layerNum;//所在层数
private String diameter;//管径
private String pipeGallery;//仓位
+ private String pipeLength;//管线长度
private String partition;//分区
private String active;//状态位
@@ -85,6 +86,14 @@
this.pipeGallery = pipeGallery;
}
+ public String getPipeLength() {
+ return pipeLength;
+ }
+
+ public void setPipeLength(String pipeLength) {
+ this.pipeLength = pipeLength;
+ }
+
public String getPartition() {
return partition;
}
@@ -113,6 +122,7 @@
this.setLayerNum(pgPipeLine.getLayerNum());
this.setDiameter(pgPipeLine.getDiameter());
this.setPipeGallery(pgPipeLine.getPipeGalleryId().getPgName());
+ this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
this.setPartition(pgPipeLine.getPipeGalleryId().getPgPartitionId().getParName());
this.setActive(String.valueOf(pgPipeLine.getActive()));
}
diff --git a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
index 319cf21..ffd3a13 100644
--- a/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
+++ b/src/main/java/com/casic/PgInterface/devTable/dto/PipeGalleryDto.java
@@ -11,6 +11,7 @@
private String id;
private String pgName;//管廊名称
+ private String pgLength;//仓体长度
private String pgPartition;//分区名称
private String active;//状态位
@@ -30,6 +31,14 @@
this.pgName = pgName;
}
+ public String getPgLength() {
+ return pgLength;
+ }
+
+ public void setPgLength(String pgLength) {
+ this.pgLength = pgLength;
+ }
+
public String getActive() {
return active;
}
@@ -50,6 +59,7 @@
{
this.setId(String.valueOf(pipeGallery.getId()));
this.setPgName(pipeGallery.getPgName());
+ this.setPgLength(String.valueOf(pipeGallery.getPgLength()));
this.setPgPartition(pipeGallery.getPgPartitionId().getParName());
this.setActive(String.valueOf(pipeGallery.getActive()));
}
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 6ae2308..bf66e8b 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PgPipeLineManager.java
@@ -39,5 +39,13 @@
return pgPipeLineDtoList;
}
+ public String getPipeLengthByName(String lineType) {
+ String sql = "select SUM(PIPE_LENGTH) from PG_PIPELINE where lineType = '" + lineType + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
}
+
diff --git a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
index 9bce32b..82803b3 100644
--- a/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
+++ b/src/main/java/com/casic/PgInterface/devTable/manager/PipeGalleryManager.java
@@ -58,4 +58,13 @@
return pipeGalleryDtoList;
}
+ public String getPgLengthByName(String pgName) {
+
+ String sql = "select SUM(PAR_LENGTH) from PG_PIPE_GALLERY where pgName = '" + pgName + "'";
+
+ String sumLength = String.valueOf(this.getSession().createSQLQuery(sql).uniqueResult());
+
+ return sumLength;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
index dbffae0..103ba36 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgCsDocumentRs.java
@@ -8,9 +8,8 @@
import com.casic.PgInterface.core.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.ws.rs.FormParam;
@@ -93,8 +92,9 @@
}
//编辑施工文档
- @RequestMapping("editConstructDoc")
- @ResponseBody
+ @POST
+ @Path("editConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map editReservePlan(@FormParam("id") String id,
@FormParam("doc_name") String doc_name,
@FormParam("cs_name") String cs_name) throws Exception {
@@ -131,8 +131,9 @@
}
//删除预案文档
- @RequestMapping("delConstructDoc")
- @ResponseBody
+ @POST
+ @Path("delConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map deleteReservePlan(@FormParam("id") String id)throws Exception{
Map resultMap = new HashMap();
String msg="";
@@ -169,8 +170,9 @@
/*
按工程名称、工程类别、施工时间查询
*/
- @RequestMapping("queryConstructDoc")
- @ResponseBody
+ @POST
+ @Path("queryConstructDoc")
+ @Produces(MediaType.APPLICATION_JSON)
public Map queryConstructDoc(@FormParam("cs_name")String cs_name,
@FormParam("cs_type")String cs_type,
@FormParam("startTime")String startTime,
@@ -206,35 +208,26 @@
return resultMap;
}
-
@POST
- @Path("downLoadConstructDoc")
+ @Path("fileDownload")
@Produces(MediaType.APPLICATION_JSON)
- public Map downLoadConstructDoc(@FormParam("id")String id)throws Exception {
+ public Map downloadFile(@FormParam("id") String id)throws Exception
+ {
Map resultMap = new HashMap();
- String result = "";
String msg = "";
+ ResponseEntity path = null;
+ try{
+ PgCsDocument pgCsDocument = pgCsDocumentManager.get(Long.valueOf(id));
+ path = pgCsDocumentManager.downloadFile(pgCsDocument);
+ msg = "下载成功";
- try {
- PgCsDocument pgCsDocument =pgCsDocumentManager.get(Long.valueOf(id));
- boolean bl=pgCsDocumentManager.downFile(pgCsDocument);
- if(bl==true) {
- result = "true";
- msg = "下载成功";
- }
- else {
- result = "false";
- msg = "下载失败";
- }
-
- } catch (Exception ex) {
- result = "false";
+ }catch (Exception e){
+ e.printStackTrace();
msg = "下载失败";
- ex.printStackTrace();
}
- resultMap.put("result", result);
+ resultMap.put("result", path);
resultMap.put("msg", msg);
return resultMap;
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
index 16bb660..23693f4 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgLogRs.java
@@ -107,4 +107,5 @@
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 57b8ec8..8b14a87 100644
--- a/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PgPipeLineRs.java
@@ -65,6 +65,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName)
throws Exception {
@@ -97,6 +98,7 @@
pgPipeLine.setLayerNum(layerNum);
pgPipeLine.setEnterDate(sdf.parse(enterDate));
pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
pgPipeLine.setPipeGalleryId(pipeGallery);
pgPipeLine.setActive(1);
@@ -128,6 +130,7 @@
@FormParam("enterDate") String enterDate,
@FormParam("layerNum") String layerNum,
@FormParam("diameter") String diameter,
+ @FormParam("pipeLength") String pipeLength,
@FormParam("pgName") String pgName,
@FormParam("parName") String parName) throws Exception {
@@ -152,20 +155,21 @@
}
else {
*/
- PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
+ PgPipeLine pgPipeLine = pgPipeLineManager.get(Long.valueOf(id));
- pgPipeLine.setLineName(lineName);
- pgPipeLine.setLineType(lineType);
- pgPipeLine.setOwnerUnit(ownerUnit);
- pgPipeLine.setEnterDate(sdf.parse(enterDate));
- pgPipeLine.setLayerNum(layerNum);
- pgPipeLine.setDiameter(diameter);
- pgPipeLine.setPipeGalleryId(pipeGallery);
- pgPipeLine.setActive(1);
+ pgPipeLine.setLineName(lineName);
+ pgPipeLine.setLineType(lineType);
+ pgPipeLine.setOwnerUnit(ownerUnit);
+ pgPipeLine.setEnterDate(sdf.parse(enterDate));
+ pgPipeLine.setLayerNum(layerNum);
+ pgPipeLine.setDiameter(diameter);
+ pgPipeLine.setPipeLength(Double.valueOf(pipeLength));
+ pgPipeLine.setPipeGalleryId(pipeGallery);
+ pgPipeLine.setActive(1);
- pgPipeLineManager.save(pgPipeLine);
- result = "true";
- msg = "编辑成功";
+ pgPipeLineManager.save(pgPipeLine);
+ result = "true";
+ msg = "编辑成功";
//}
} catch (Exception e) {
result = "false";
@@ -258,4 +262,28 @@
return resultMap;
}
+ /**
+ * 根据管线类型获取管线长度
+ */
+ @POST
+ @Path("getPipeLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPipeLengthByName(@FormParam("lineType") String lineType)throws Exception{
+ Map resultMap = new HashMap();
+ String result = "";
+ String msg = "";
+ try {
+ result = pgPipeLineManager.getPipeLengthByName(lineType);
+ msg="管线长度获取成功";
+ }catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="管线长度统计失败";
+ }
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
+
}
diff --git a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
index 42f7d40..bb41cbd 100644
--- a/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
+++ b/src/main/java/com/casic/PgInterface/rs/PipeGalleryRs.java
@@ -50,6 +50,7 @@
@Path("addPipeGallery")
@Produces(MediaType.APPLICATION_JSON)
public Map addPipeGallery(@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
String result = "";
@@ -67,6 +68,7 @@
msg = "已存在相同管廊";
} else {
pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Double.valueOf(parLength));
pipeGallery.setPgPartitionId(pgPartition);
pipeGallery.setActive(1);
logger.info("成功保存");
@@ -119,6 +121,7 @@
@Produces(MediaType.APPLICATION_JSON)
public Map editPipeGallery(@FormParam("id") String id,
@FormParam("pgName") String pgName,
+ @FormParam("parLength") String parLength,
@FormParam("parName") String parName) throws Exception {
Map resultMap = new HashMap();
@@ -138,15 +141,16 @@
msg = "已存在相同管廊";
} else {
*/
- pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
+ pipeGallery = pipeGalleryManager.get(Long.valueOf(id));
- pipeGallery.setPgName(pgName);
- pipeGallery.setPgPartitionId(pgPartition);
- pipeGallery.setActive(1);
+ pipeGallery.setPgName(pgName);
+ pipeGallery.setPgLength(Long.valueOf(parLength));
+ pipeGallery.setPgPartitionId(pgPartition);
+ pipeGallery.setActive(1);
- pipeGalleryManager.save(pipeGallery);
- result = "true";
- msg = "编辑成功";
+ pipeGalleryManager.save(pipeGallery);
+ result = "true";
+ msg = "编辑成功";
//}
}
} catch (Exception e) {
@@ -194,4 +198,31 @@
return resultMap;
}
+ /**
+ * 获取管廊仓体的长度
+ */
+ @POST
+ @Path("getPgLengthByName")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Map getPgLengthByName(@FormParam("pgName") String pgName)
+ {
+ Map resultMap=new HashMap();
+ String result="";
+ String msg="";
+
+ try{
+ result=pipeGalleryManager.getPgLengthByName(pgName);
+ msg="仓体长度获取成功";
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ msg="仓体长度获取失败";
+ }
+
+ resultMap.put("msg",msg);
+ resultMap.put("result",result);
+
+ return resultMap;
+ }
}
\ No newline at end of file
diff --git "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index 92792df..8086802 100644
--- "a/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\346\216\245\345\217\243\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ
diff --git "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx" "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
index 11ce103..2d2e8b9 100644
--- "a/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
+++ "b/\347\256\241\345\273\212\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241\350\257\264\346\230\216\346\226\260\351\234\200\346\261\202.docx"
Binary files differ