Commit 8e4a12ac authored by chenyuxi's avatar chenyuxi

feat: 校验是否有流水的账户

parent f507b2e9
......@@ -223,57 +223,62 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
// 重新过滤已存入【入账记录】的流水信息
for (String account : accountRecordListMap.keySet()) {
// 获取当前账号下的流水
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> flowRecordList = accountRecordListMap.get(account);
// 获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if (!flowRecordList.isEmpty()) {
// 获取当前账户下的入账记录:账号为key,账户下入账记录列表作为value
List<String> serioListByAccount = serioMapByAccount.get(account);
if(serioListByAccount == null || serioListByAccount.isEmpty()){
serioListByAccount = new ArrayList<>();
}
if(accountRecordListMap.keySet().size()>0){
for (String account : accountRecordListMap.keySet()) {
// 获取当前账号下的流水
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> flowRecordList = accountRecordListMap.get(account);
// 获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if (!flowRecordList.isEmpty()) {
// 获取当前账户下的入账记录:账号为key,账户下入账记录列表作为value
List<String> serioListByAccount = serioMapByAccount.get(account);
if(serioListByAccount == null || serioListByAccount.isEmpty()){
serioListByAccount = new ArrayList<>();
}
// 过滤出需要新增流水的数据
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> insertList = new ArrayList<>();
// 过滤出需要新增流水的数据
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> insertList = new ArrayList<>();
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 flowRecord : flowRecordList) {
if("2".equals(flowRecord.getDrcrf()) && !serioListByAccount.contains(flowRecord.getOnlySequence())){
insertList.add(flowRecord);
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 flowRecord : flowRecordList) {
if("2".equals(flowRecord.getDrcrf()) && !serioListByAccount.contains(flowRecord.getOnlySequence())){
insertList.add(flowRecord);
}
}
}
// 重新存入账号流水Map里
accountRecordListMap.put(account, insertList);
// 重新存入账号流水Map里
accountRecordListMap.put(account, insertList);
}
}
}
// 存入过滤后的流水信息到【入账记录】
for (String account : accountRecordListMap.keySet()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> saveList = accountRecordListMap.get(account);
// 封装数据
if (saveList != null && !saveList.isEmpty()) {
String bankName = accountInfoMap.get(account);
log.info("需要存的流水到账--银行名称:" + bankName);
log.info("需要存的流水到账--明细条数:" + saveList.size());
try {
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry : saveList) {
EKPEntryPushParam pushParam = new EKPEntryPushParam();
initValue(entry, pushParam, bankName, account);
String body = sendToEkp(pushParam);
// 重试一次
if (StringUtils.isBlank(body)) {
sendToEkp(pushParam);
// 存入过滤后的流水信息到【入账记录】
for (String account : accountRecordListMap.keySet()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> saveList = accountRecordListMap.get(account);
// 封装数据
if (saveList != null && !saveList.isEmpty()) {
String bankName = accountInfoMap.get(account);
log.info("需要存的流水到账--银行名称:" + bankName);
log.info("需要存的流水到账--明细条数:" + saveList.size());
try {
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry : saveList) {
EKPEntryPushParam pushParam = new EKPEntryPushParam();
initValue(entry, pushParam, bankName, account);
String body = sendToEkp(pushParam);
// 重试一次
if (StringUtils.isBlank(body)) {
sendToEkp(pushParam);
}
}
}catch (Exception e) {
log.error("到账明细数据推送失败",e);
}
}catch (Exception e) {
log.error("到账明细数据推送失败",e);
}
}
}
return R.ok();
}
......
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