| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.dataformat.xml.XmlMapper; |
| | | import com.itstyle.mdm.entity.HttpClientResult; |
| | | import com.itstyle.mdm.utils.model.SoapEnvelopeProduct; |
| | | import org.apache.http.HttpStatus; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.config.RequestConfig; |
| | |
| | | } |
| | | } |
| | | |
| | | public static String getMesResponseJson(String xml){ |
| | | return SoapEnvelopeProduct.getResJson(xml); |
| | | } |
| | | public static String getMesJson(String json){ |
| | | JSONObject mesResJson=new JSONObject(); |
| | | JSONObject jsonobj=JSONObject.parseObject(json); |
| | |
| | | JSONObject rowObject = jsonArray.getJSONObject(i); |
| | | JSONObject tmp1=new JSONObject(); |
| | | tmp1.put("Tgcoriginalcode",rowObject.getString("tgctwoclasscode")); |
| | | JSONObject tmp2=new JSONObject(); |
| | | tmp2.put("Code",rowObject.getString("code")); |
| | | JSONObject tmp3=new JSONObject(); |
| | | tmp3.put("Name",rowObject.getString("name")); |
| | | JSONObject tmp4=new JSONObject(); |
| | | tmp4.put("Specification",rowObject.getString("specification")); |
| | | JSONObject tmp5=new JSONObject(); |
| | | tmp5.put("UnitName",rowObject.getString("unitName")); |
| | | JSONObject tmp6=new JSONObject(); |
| | | tmp6.put("TypeCode",rowObject.getString("typeCode")); |
| | | JSONObject tmp7=new JSONObject(); |
| | | tmp7.put("SpecificationDisplayName",rowObject.getString("specificationDisplayName")); |
| | | JSONObject tmp8=new JSONObject(); |
| | | tmp8.put("SupplierName",rowObject.getString("supplierName")); |
| | | |
| | | tmp1.put("Code",rowObject.getString("code")); |
| | | |
| | | tmp1.put("Name",rowObject.getString("name")); |
| | | |
| | | tmp1.put("Specification",rowObject.getString("specification")); |
| | | |
| | | tmp1.put("UnitName",rowObject.getString("unitName")); |
| | | |
| | | tmp1.put("TypeCode",rowObject.getString("typeCode")); |
| | | |
| | | tmp1.put("SpecificationDisplayName",rowObject.getString("specificationDisplayName")); |
| | | |
| | | tmp1.put("SupplierName",rowObject.getString("supplierName")); |
| | | mesResDetail.add(tmp1); |
| | | mesResDetail.add(tmp2); |
| | | mesResDetail.add(tmp3); |
| | | mesResDetail.add(tmp4); |
| | | mesResDetail.add(tmp5); |
| | | mesResDetail.add(tmp6); |
| | | mesResDetail.add(tmp7); |
| | | mesResDetail.add(tmp8); |
| | | } |
| | | mesResJson.put("Records",mesResDetail); |
| | | return mesResJson.toJSONString(); |