解决梅州标签问题

master
lzy 3 years ago
parent b335b041a3
commit 8853e83e8b

@ -1,56 +1,58 @@
{ {
//----------------------- //-----------------------
//, //,
"ResHead":"Response,RetInfo", "ResHead":"Response,Result",
// //
"ResCode":"RetCode", "ResCode":"Code",
// //
"ResMsg":"RetCon", "ResMsg":"Msg",
// //
"successCode":"0", "successCode":"1",
// //
"errorCode":"1", "errorCode":"0",
//, //,
"directory":["Msg"], "directory":[],
// //
"indexFlag":"PatInfo,INHOSP_NO", "indexFlag":"VISITING_SERIAL_NUMBER",
// //
"serialnum":"ReportInfo,UPDATE_REPORT_NO", "serialnum":"UNIQUE_ID",
// //
"filetitle":"ExamInfo,EXAM_SUBCLASS", "filetitle":"DOCUMENT_TITLE",
//,& //,&
"downurl":"ReportInfo,REPORT_URL", "downurl":"BASE64&ORIGINAL_URL",
//id //id
"assortid":"63E20FC9AAB74C5FB6446083EBA5607D", "assortid":"",
//id //id
"collectorid":"12", "collectorid":"2",
//id
"assortidParamKey":"DOCUMENT_TOPIC",
//( 1:2) //( 1:2)
"filesource":1, "filesource":1,
//(1:2ftp3) //(1:2ftp3)
"filestoragetype":1, "filestoragetype":1,
// //
"uploadConnector":"http://192.9.100.171:9291/api/downplatform/report", "uploadConnector":"http://127.0.0.1:9291/api/downplatform/report",
//doubleBasic //doubleBasic
"basicDirectory":["Msg","ReportInfo"], "basicDirectory":[""],
// //
"doubleBasic":["TestItemInfo","BioTestInfo"], "doubleBasic":["TestItemInfo","BioTestInfo"],
//--------------/--------------- //--------------/---------------
/// 01 /// 01
"isJudge":"1", "isJudge":"0",
// //
"judgeDirectory":["Msg","ReportInfo"], "judgeDirectory":[""],
//,0-1-2- //,0-1-2-
"judgeIndex":"REPORT_STATUS_FLAG", "judgeIndex":"",
//-------------------- //--------------------
//, //,
"repealDirectory":["Msg","ReportInfo"], "repealDirectory":["DOCUMENT"],
// //
"repealSerialnum":"REPORT_STATUS_FLAG", "repealSerialnum":"UNIQUE_ID",
// //
"repoalConnector":"http://192.9.100.171:9291/api/down/cancel" "repoalConnector":"http://127.0.0.1:9291/api/down/cancel"
} }

@ -12,7 +12,7 @@
"errorCode":"0", "errorCode":"0",
//, //,
"directory":[""], "directory":[],
// //
"indexFlag":"VISITING_SERIAL_NUMBER", "indexFlag":"VISITING_SERIAL_NUMBER",
// //

@ -190,6 +190,19 @@ public class TBasicWebService implements ITBasicWebService {
*/ */
private String handleDownUrl(String downurl) { private String handleDownUrl(String downurl) {
String url = ""; String url = "";
try {
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(downurl.getBytes("UTF-8")));
if (null != xmlUtils) {
url=downurl;
url = downurl.replaceAll("<REST>", "");
url = url.replaceAll("</REST>", "");
url = url.replaceAll("<SQW>", "");
url = url.replaceAll("</SQW>", "");
}
} catch (Exception e) {
}
int pdfIndex = -1; int pdfIndex = -1;
int httpIndex = downurl.indexOf("http"); int httpIndex = downurl.indexOf("http");
if (httpIndex == -1) { if (httpIndex == -1) {
@ -261,7 +274,12 @@ public class TBasicWebService implements ITBasicWebService {
* @return * @return
*/ */
private CanlcelDto getCanlCelDtoByXml(String xml) throws UnsupportedEncodingException { private CanlcelDto getCanlCelDtoByXml(String xml) throws UnsupportedEncodingException {
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8"))); XmlUtils xmlUtils = null;
try {
xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
} catch (Exception e) {
e.printStackTrace();
}
//采集流水号所在位置目录 //采集流水号所在位置目录
List<String> repealDirectory = (List<String>) FileUtils.getJsonByName("repealDirectory"); List<String> repealDirectory = (List<String>) FileUtils.getJsonByName("repealDirectory");
Element element = xmlUtils.getElement(repealDirectory); Element element = xmlUtils.getElement(repealDirectory);

@ -12,12 +12,16 @@ import com.docus.bgts.mapper.AfInterfaceCollectMapper;
import com.docus.bgts.mapper.AfInterfaceCollectSubMapper; import com.docus.bgts.mapper.AfInterfaceCollectSubMapper;
import com.docus.bgts.utils.FileUtils; import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils; import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.XmlUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

@ -19,6 +19,10 @@ public class XmlUtils {
private SAXReader saxReader; private SAXReader saxReader;
private Document document; private Document document;
public Document getDocument() {
return document;
}
public XmlUtils(String path) { public XmlUtils(String path) {
//获取解析器 //获取解析器
saxReader = new SAXReader(); saxReader = new SAXReader();
@ -31,16 +35,12 @@ public class XmlUtils {
} }
} }
public XmlUtils(InputStream path) { public XmlUtils(InputStream path) throws Exception{
//获取解析器 //获取解析器
saxReader = new SAXReader(); saxReader = new SAXReader();
try {
//获取文档对象 //获取文档对象
document = saxReader.read(path); document = saxReader.read(path);
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }
/** /**

@ -1,5 +1,5 @@
server: server:
port: 9403 port: 9701
# http # http
mybatis-plus: mybatis-plus:
@ -15,8 +15,8 @@ beat:
url: http://localhost:9399/beat url: http://localhost:9399/beat
system: system:
code: "204_P_WS_BLBGTS" code: "EmrDocAr"
prop: 9203 prop: 9801
# web service # web service

Loading…
Cancel
Save