|
|
@ -122,29 +122,30 @@ public class CaResidentServiceImpl extends BaseServiceImpl<CaResidentDao, CaResi |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void preserResidentVation(PreserVationFormDTO dto) { |
|
|
|
baseDao.deleteAll(); |
|
|
|
|
|
|
|
dto.setPageNo(NumConstant.ONE); |
|
|
|
dto.setPageSize(NumConstant.FIFTY); |
|
|
|
dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); |
|
|
|
dto.setTableName(CaWghDataConstant.UNICOM_RESIDENT); |
|
|
|
|
|
|
|
dto.setWhereCase("delete_flag = 'normal'"); |
|
|
|
dto.setOrderBy("grid_id,update_date,resident_id desc"); |
|
|
|
|
|
|
|
int pageNo = 1; |
|
|
|
|
|
|
|
int total = 0; |
|
|
|
|
|
|
|
do { |
|
|
|
try { |
|
|
|
total = listResident(dto); |
|
|
|
pageNo++; |
|
|
|
dto.setPageNo(pageNo); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} while (total > (pageNo * NumConstant.FIFTY)); |
|
|
|
int i = baseDao.deleteAll(); |
|
|
|
if (i >= 0) { |
|
|
|
dto.setPageNo(NumConstant.ONE); |
|
|
|
dto.setPageSize(NumConstant.FIFTY); |
|
|
|
dto.setTableSchema(CaWghDataConstant.TABLESCHEMA_UNICOM); |
|
|
|
dto.setTableName(CaWghDataConstant.UNICOM_RESIDENT); |
|
|
|
|
|
|
|
dto.setWhereCase("delete_flag = 'normal'"); |
|
|
|
dto.setOrderBy("grid_id,update_date,resident_id desc"); |
|
|
|
|
|
|
|
int pageNo = 1; |
|
|
|
|
|
|
|
int total = 0; |
|
|
|
|
|
|
|
do { |
|
|
|
try { |
|
|
|
total = listResident(dto); |
|
|
|
pageNo++; |
|
|
|
dto.setPageNo(pageNo); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} while (total > (pageNo * NumConstant.FIFTY)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -157,7 +158,7 @@ public class CaResidentServiceImpl extends BaseServiceImpl<CaResidentDao, CaResi |
|
|
|
private int listResident(PreserVationFormDTO dto) throws Exception { |
|
|
|
String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); |
|
|
|
JSONObject obj = new JSONObject(); |
|
|
|
obj.put(CaWghDataConstant.UNICOM_CONDITION,aes); |
|
|
|
obj.put(CaWghDataConstant.UNICOM_CONDITION, aes); |
|
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(CaWghDataConstant.DATA_URL_UNICON, obj.toJSONString()).getData(); |
|
|
|
JSONObject toResult = JSON.parseObject(data); |
|
|
|
Result result = ConvertUtils.mapToEntity(toResult, Result.class); |
|
|
|