Commit d5f804df by 焦荣

修改参数格式

parent 94644c67
...@@ -128,11 +128,13 @@ public class RyfkController { ...@@ -128,11 +128,13 @@ public class RyfkController {
} }
System.out.println("rowlist=dataResult===" + rowlist); System.out.println("rowlist=dataResult===" + rowlist);
System.out.println("rowlist=size===" + rowlist.size()); System.out.println("rowlist=size===" + rowlist.size());
List ajxxlist = new ArrayList(); List ajxxlist = new ArrayList();
for (int i = 0; i < rowlist.size(); i++) { //查询人员对应的案件 存在一人多案 for (int i = 0; i < rowlist.size(); i++) { //查询人员对应的案件 存在一人多案
String dataResult = rowlist.get(i).toString(); String dataResult = rowlist.get(i).toString();
System.out.println("rowlist=i===" + dataResult); System.out.println("dataResult=ddddddd===" + dataResult);
Map maps = (Map) JSON.parse(dataResult.replace("=",":")); // Map maps = (Map) JSON.parse(dataResult.replace("=",":"));
Map maps = strtomap(dataResult);
String asjbh = maps.get("ASJBH").toString(); String asjbh = maps.get("ASJBH").toString();
System.out.println("asjbh= 根据人员查询案件编号==" + asjbh); System.out.println("asjbh= 根据人员查询案件编号==" + asjbh);
//获取案件信息 //获取案件信息
...@@ -144,8 +146,9 @@ public class RyfkController { ...@@ -144,8 +146,9 @@ public class RyfkController {
System.out.println("asjbh= 返回案件信息==" + asjlist); System.out.println("asjbh= 返回案件信息==" + asjlist);
//案件map //案件map
System.out.println("asjmaps=i===" + rowlist.get(0).toString()); System.out.println("asjmaps=i===" + rowlist.get(0).toString());
Map asjmaps = (Map) JSON.parse(rowlist.get(0).toString().replace("=",":")); Map asjmaps = strtomap(rowlist.get(0).toString());
TbStAsj asj = new TbStAsj(); TbStAsj asj = new TbStAsj();
System.out.println("asj= === " + asj.getASJBH());
Maputil.mapToObject(asj, asjmaps); Maputil.mapToObject(asj, asjmaps);
ajxxlist.add(asj); ajxxlist.add(asj);
} }
...@@ -273,14 +276,49 @@ public class RyfkController { ...@@ -273,14 +276,49 @@ public class RyfkController {
return tbZwbzxx; return tbZwbzxx;
} }
public Map strtomap(String dataResult){
System.out.println("rowlist=i===" + dataResult);
// Map maps = (Map) JSON.parse(dataResult.replace("=",":"));
dataResult = dataResult.replace("<","");
dataResult = dataResult.replace(">","");
String[] strs = dataResult.split(",");
Map<String, String> m = new HashMap<String, String>();
for(String s:strs){
String[] ms = s.split("=");
if(ms.length==2){
m.put(ms[0], ms[1]);
}else{
m.put(ms[0], "");
}
}
return m;
}
public static void main(String[] args){ public static void main(String[] args){
/* RyfkController ryfkController = new RyfkController(); String data = "<A=,B=2,C=5,D=>";
String rwbh = ""; /*data = data.replace("<","");
ryfkController.getZwbzxx(rwbh);*/ data = data.replace(">","");
/* PropertiesUtil p = new PropertiesUtil("application.properties"); //Map maps = (Map) JSON.parse(data.replace("=",":"));
String url = p.getValue("zwbzurl"); Map maps = (Map) JSON.parse(data);
System.out.println("url===" + url);*/ System.out.println(maps.get("B"));*/
data = data.replace("<","");
data = data.replace(">","");
String[] strs = data.split(",");
Map<String, String> m = new HashMap<String, String>();
for(String s:strs){
String[] ms = s.split("=");
if(ms.length==2){
m.put(ms[0], ms[1]);
}else{
m.put(ms[0], "");
}
}
System.out.println("a===" + m.get("A"));
System.out.println(m.get("B"));
System.out.println("D===" + m.get("D"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment