|
@@ -8,6 +8,7 @@ import com.kexun.constant.XmlNodeConsts;
|
|
|
import com.kexun.entity.FieldDefineEntity;
|
|
|
import com.kexun.entity.FieldParamEntity;
|
|
|
import com.kexun.entity.IBaseEntity;
|
|
|
+import com.kexun.entity.ReportInfo;
|
|
|
import com.kexun.factory.HandleXmlFactory;
|
|
|
import com.kexun.factory.HandleXmlFactoryBean;
|
|
|
import com.kexun.model.dto.CommonParam;
|
|
@@ -52,9 +53,9 @@ public class ParseHandleService {
|
|
|
/**
|
|
|
* 解析处理xml的内容
|
|
|
*
|
|
|
- * @param xmlContent xml报文
|
|
|
+ * @param xmlContent xml报文的内容
|
|
|
*/
|
|
|
- public ReportParseDTO parseHandle(String xmlContent) throws Exception {
|
|
|
+ public ReportParseDTO parseHandle(ReportInfo reportInfo,String xmlContent) throws Exception {
|
|
|
//把xml转成Json格式,和XML保持一致的格式
|
|
|
JSONObject jsonObject = ParseXmlUtils.xmlToJson(xmlContent);
|
|
|
//定义Map 存放JSON
|
|
@@ -111,7 +112,7 @@ public class ParseHandleService {
|
|
|
factoryBean.getService().save(iBaseEntity);
|
|
|
//构建json
|
|
|
if (factoryBean.getBaseFieldPackageJsonService() != null) {
|
|
|
- factoryBean.getBaseFieldPackageJsonService().packageJson(jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
+ factoryBean.getBaseFieldPackageJsonService().packageJson(reportInfo,jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
}
|
|
|
} else if (BaseConsts.NODE_TYPE_COMPOSE.equals(factoryBean.getNodeType())) {
|
|
|
//处理复杂类型
|
|
@@ -120,7 +121,7 @@ public class ParseHandleService {
|
|
|
reportXmlBaseService.handleXmlSgmt(commonParam, jsonBean);
|
|
|
//构建json
|
|
|
if (factoryBean.getBaseFieldPackageJsonService() != null) {
|
|
|
- factoryBean.getBaseFieldPackageJsonService().packageJson(jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
+ factoryBean.getBaseFieldPackageJsonService().packageJson(reportInfo,jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
}
|
|
|
} else if (BaseConsts.NODE_TYPE_LIST.equals(factoryBean.getNodeType())) {
|
|
|
Map<String, String> paramMap = factoryBean.getParamMap();
|
|
@@ -149,7 +150,7 @@ public class ParseHandleService {
|
|
|
}
|
|
|
factoryBean.getService().saveBatch(iBaseEntities);
|
|
|
if (factoryBean.getBaseFieldPackageJsonService() != null) {
|
|
|
- factoryBean.getBaseFieldPackageJsonService().packageJson(jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
+ factoryBean.getBaseFieldPackageJsonService().packageJson(reportInfo,jsonMap, json, factoryBean.getXmlNodeName(), factoryBean.getNodeType());
|
|
|
}
|
|
|
}
|
|
|
}
|