This commit is contained in:
linfso 2025-03-21 10:14:35 +08:00
parent fb37150beb
commit 1bc637aa40

View File

@ -3677,19 +3677,28 @@ public class EmisBaseService {
// String txt="NO.7,Chun Hong Industrial Park, National Road No.4, Svay Chrum Village Beckchan Commune ,Angsnoul District,Kandal provinve, Cambodia."; // String txt="NO.7,Chun Hong Industrial Park, National Road No.4, Svay Chrum Village Beckchan Commune ,Angsnoul District,Kandal provinve, Cambodia.";
String txt="江苏省南京市建邺区云龙山路68号苏美达国际大厦21楼"; // String txt="江苏省南京市建邺区云龙山路68号苏美达国际大厦21楼";
List mlist=splitTextToLines(txt,40); // List mlist=splitTextToLines(txt,40);
System.out.println(JSON.toJSONString(mlist)); // System.out.println(JSON.toJSONString(mlist));
//
// String s1=WordUtils.wrap(txt,40);
// String[] sAddrArr=s1.split("\n");
// System.out.println(JSON.toJSONString(sAddrArr));
// for(int i=0;i<4;i++) {
// try {
// System.out.println(sAddrArr[i]);
// } catch (Exception ex) {
// }
// }
String s1=WordUtils.wrap(txt,40); String kdQueryChannelJsonStr="{\n" +
String[] sAddrArr=s1.split("\n"); "\"doora\":{\"chId\":\"17track\",\"comId\":\"100702\"},\n" +
System.out.println(JSON.toJSONString(sAddrArr)); "\"Vietelpost\":{\"chId\":\"17track\",\"comId\":\"100611\"}\n" +
for(int i=0;i<4;i++) { "}";
try { JSONObject jobjKdQ = JSONObject.parseObject(kdQueryChannelJsonStr);
System.out.println(sAddrArr[i]);
} catch (Exception ex) { JSONObject kdQObj = jobjKdQ.getJSONObject("Vietelpost");
} System.out.println(kdQObj);
}
} }