private void request() {
int pageNum = 1;
int pageSize = 100;
Object o = resourceFile("3307", null, null, null, null, pageNum, pageSize);
Map<String, String> map =
JSONObject.parseObject(JSON.toJSONString(o), new TypeReference<Map<String, String>>() {
});
String total = map.get("total");
String rows = map.get("rows");
int totalNum = Integer.valueOf(total);
List<PolicyVo> policyVos = JSONArray.parseArray(rows, PolicyVo.class);
save(policyVos);
if (totalNum > pageSize) {
int num = totalNum / pageSize + 1;
for (int i = 2; i <= num; i++) {
Object object = resourceFile("3307", null, null, null, null, i, pageSize);
Map<String, String> respMap =
JSONObject.parseObject(JSON.toJSONString(object), new TypeReference<Map<String, String>>() {
});
String str = respMap.get("rows");
List<PolicyVo> policyVo = JSONArray.parseArray(str, PolicyVo.class);
save(policyVo);
}
}
}