|
@@ -1,33 +1,15 @@
|
|
|
package com.zskk.service;
|
|
|
|
|
|
-import java.io.BufferedReader;
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
-import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.InputStreamReader;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
-import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
|
-
|
|
|
-import javax.xml.parsers.DocumentBuilder;
|
|
|
-import javax.xml.parsers.DocumentBuilderFactory;
|
|
|
import javax.xml.parsers.ParserConfigurationException;
|
|
|
-
|
|
|
-import org.w3c.dom.Document;
|
|
|
-import org.w3c.dom.Element;
|
|
|
-import org.w3c.dom.NamedNodeMap;
|
|
|
-import org.w3c.dom.Node;
|
|
|
-import org.w3c.dom.NodeList;
|
|
|
-
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
-import com.zskk.tools.XmlHelper;
|
|
|
-
|
|
|
import okhttp3.FormBody;
|
|
|
import okhttp3.OkHttpClient;
|
|
|
import okhttp3.Request;
|
|
@@ -97,63 +79,7 @@ public class DataService {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws IOException, ParserConfigurationException {
|
|
|
- File fin_floder = new File("/Users/liutao/Desktop/test/test111.xml");
|
|
|
-
|
|
|
- //创建从文件读取数据的FileInputStream流
|
|
|
- FileInputStream fin;
|
|
|
- try {
|
|
|
- fin = new FileInputStream(fin_floder);
|
|
|
- InputStreamReader isr = null;
|
|
|
-
|
|
|
- isr = new InputStreamReader(fin);
|
|
|
-
|
|
|
- BufferedReader raf = null;
|
|
|
-
|
|
|
- raf = new BufferedReader(isr);
|
|
|
-
|
|
|
- String s = null;
|
|
|
-
|
|
|
- // 读取文件内容,并将其打印
|
|
|
-// while((s = raf.readLine()) != null) {
|
|
|
-// System.out.println(s);
|
|
|
-//
|
|
|
-// }
|
|
|
- s = raf.readLine();
|
|
|
- s = s.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "");
|
|
|
- s = "<a>" + s + "</a>";
|
|
|
- System.out.println(s);
|
|
|
- XmlHelper xmlHelper = XmlHelper.of(s);
|
|
|
-
|
|
|
- NodeList nodeList = xmlHelper.getNodeList("/a/NativeDicomModel");
|
|
|
- for (int i = 0; i < nodeList.getLength(); i++) {
|
|
|
- String qString="";
|
|
|
- NodeList nodeList2 =xmlHelper.getNodeList(nodeList.item(i),"DicomAttribute");
|
|
|
- for (int k = 0; k < nodeList2.getLength(); k++) {
|
|
|
-// System.out.println(k);
|
|
|
- NamedNodeMap as = nodeList2.item(k).getAttributes();
|
|
|
- if (as != null && as.getLength() > 0) {
|
|
|
- for (int j = 0; j < as.getLength(); j++) {
|
|
|
- if (as.item(j).getNodeName().equals("tag")) {
|
|
|
- if (as.item(j).getNodeValue().equals("0020000D")) {
|
|
|
- String b =xmlHelper.getString("/a/NativeDicomModel["+i+"]/DicomAttribute["+j+"]/Value");
|
|
|
-// System.out.println(xmlHelper.getString(nodeList2.item(k), "Value"));
|
|
|
- qString =qString+"*"+xmlHelper.getString(nodeList2.item(k), "Value")+"**";
|
|
|
- }
|
|
|
- }
|
|
|
- if (as.item(j).getNodeName().equals("tag")) {
|
|
|
- if (as.item(j).getNodeValue().equals("00080061")) {
|
|
|
- String b =xmlHelper.getString("/a/NativeDicomModel["+i+"]/DicomAttribute["+j+"]/Value");
|
|
|
-// System.out.println(xmlHelper.getString(nodeList2.item(k), "Value"));
|
|
|
- qString =qString+"*"+xmlHelper.getString(nodeList2.item(k), "Value")+"**";
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- System.out.println(qString);
|
|
|
- }
|
|
|
+
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
Date date = new Date();
|
|
|
long dInteger = date.getTime() - 86400000;
|
|
@@ -162,10 +88,6 @@ public class DataService {
|
|
|
Date ddDate =new Date();
|
|
|
System.out.println(ddDate.toString());
|
|
|
|
|
|
- } catch (FileNotFoundException e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
}
|