Commit 1c7a39e8 authored by 胡建龙's avatar 胡建龙

[fix]账户查询接口维护主账户信息

parent 14566827
......@@ -336,12 +336,33 @@ public class PingAnServiceImpl implements PingAnService {
JSONObject responseData = new JSONObject();
int pageNo = 0;
String isEnd = "N";
boolean mainFlag = true;
while ("N".equalsIgnoreCase(isEnd)) {
params.put("PageNo", ++pageNo);
JSONObject res = invoke(iRequest, interfaceName, params);
// 对当前查询到的数据进行存表
JSONObject data = res.getJSONObject("data");
if (Objects.nonNull(data)){
if (mainFlag){
// 处理主账户,每次查询只处理一次
HlsEbankCcbAccount hlsEbankCcbAccount = new HlsEbankCcbAccount();
hlsEbankCcbAccount.setAccountNo(data.getString("ShadowAcctNo"));
Long recordId = hlsEbankCcbAccountMapper.queryByAccountNo(hlsEbankCcbAccount);
hlsEbankCcbAccount.setSubAccNum(data.getLong("SubAccNum"));
hlsEbankCcbAccount.setStt(data.getString("Stt"));
if (Objects.nonNull(recordId)){
hlsEbankCcbAccount.setRecordId(recordId);
hlsEbankCcbAccountService.updateByPrimaryKeySelective(iRequest,hlsEbankCcbAccount);
}else{
hlsEbankCcbAccount.setMainFlag("Y");
hlsEbankCcbAccount.setMainAccount(data.getString("MainAccount"));
hlsEbankCcbAccount.setCorId(data.getString("CorId"));
hlsEbankCcbAccount.setAccName(data.getString("AccountName"));
hlsEbankCcbAccountService.insertSelective(iRequest,hlsEbankCcbAccount);
}
mainFlag = false;
}
isEnd = data.getString("isEnd");
batchSaveAccount(iRequest, data);
}else{
......@@ -418,12 +439,12 @@ public class PingAnServiceImpl implements PingAnService {
hlsEbankCcbAccount.setRecordId(recordId);
hlsEbankCcbAccountService.updateByPrimaryKeySelective(iRequest,hlsEbankCcbAccount);
}else{
hlsEbankCcbAccount.setMainFlag("N");
hlsEbankCcbAccount.setMainAccount(data.getString("MainAccount"));
hlsEbankCcbAccount.setCorId(data.getString("CorId"));
hlsEbankCcbAccount.setAccName(item.getString("SubAccName"));
hlsEbankCcbAccountService.insertSelective(iRequest,hlsEbankCcbAccount);
}
}
}
}
......
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