Commit ed242c1e authored by 5359's avatar 5359

平安银行子账户绑定时增加账号保存逻辑

parent 2180edc4
......@@ -100,6 +100,10 @@ public class PingAnServiceImpl implements PingAnService {
requestBody.put("CnsmrSeqNo", today + temp);
requestBody.putAll(params);
if ("bedl/DetailReportQueryNew".equalsIgnoreCase(interfaceName)) {
requestBody.remove("MainAccount");
}
/*插入接口日志表*/
HlsWsRequests hlsWsRequests = createRequestLog(pro.getProperty("baseUrl") + "/V1.0/" + interfaceName, requestBody.toJSONString(), 1L);
logger.info("发送接口:" + interfaceName + "请求,请求参数: {}", requestBody.toString());
......@@ -130,6 +134,9 @@ public class PingAnServiceImpl implements PingAnService {
if ("bedl/DetailReportQueryNew".equals(interfaceName)) {
dowloadDetailFile(res);
}
if ("bedl/SubAcctMaintenance".equals(interfaceName)) {
saveAccount(iRequest, res);
}
hlsWsRequests.setReturnStatus("S");
responseData.put(Constants.RESP_CODE, "0000");
responseData.put("respMsg", "请求成功");
......@@ -146,9 +153,8 @@ public class PingAnServiceImpl implements PingAnService {
} else {
//请求失败
hlsWsRequests.setReturnStatus("E");
JSONObject errRes = JSONObject.parseObject(result.getData());
responseData.put(Constants.RESP_CODE, result.getCode());
responseData.put(Constants.RESP_MSG, "请求失败");
responseData.put(Constants.RESP_MSG, "请求失败,网络异常");
}
hlsWsRequests.setResponseJson(result.getData());
hlsWsRequests.setResponsedDate(new Date());
......@@ -183,12 +189,16 @@ public class PingAnServiceImpl implements PingAnService {
transactionStatus.flush();
//事务提交
transactionManager.commit(transactionStatus);
// 调用系统的接口服务,推送通知数据
JSONObject ldo16 = new JSONObject();
ldo16.put("transaction_id", hlsEbankCcbTransaction.getTransactionId());
postNotify(ldo16.toString());
if ("C".equalsIgnoreCase(hlsEbankCcbTransaction.getTranType())) {
JSONObject ldo16 = new JSONObject();
ldo16.put("transaction_id", hlsEbankCcbTransaction.getTransactionId());
postNotify(ldo16.toString());
}
} catch (Exception e) {
e.printStackTrace();
logger.info("处理交易推送信息结果异常,异常原因:" + e.getMessage());
}
// responseData.put("TxnReturnCode ","000000");
// responseData.put("TxnReturnMsg ","接收成功");
......@@ -297,7 +307,7 @@ public class PingAnServiceImpl implements PingAnService {
//转换成orderFile对象
if (Objects.nonNull(arr)) {
//手动转换,因为返回字段首字母均为大写,与实体类不对应。
for (int i = 0; i < arr.size() ; i++) {
for (int i = 0; i < arr.size(); i++) {
JSONObject item = arr.getJSONObject(i);
OrderFile orderFile = new OrderFile();
orderFile.setDocId(item.getString("DocId"));
......@@ -341,7 +351,7 @@ public class PingAnServiceImpl implements PingAnService {
batchSaveTransactionByC00602(iRequest, arr);
}
} else {
responseData.put(Constants.RESP_CODE, "1111");
responseData.put(Constants.RESP_CODE, "0001");
responseData.put("respMsg", "查询出错");
break;
}
......@@ -444,6 +454,25 @@ public class PingAnServiceImpl implements PingAnService {
}
}
private void saveAccount(IRequest iRequest, JSONObject data) {
HlsEbankCcbAccount hlsEbankCcbAccount = new HlsEbankCcbAccount();
hlsEbankCcbAccount.setAccountNo(data.getString("SubAccountNo"));
Long recordId = hlsEbankCcbAccountMapper.queryByAccountNo(hlsEbankCcbAccount);
hlsEbankCcbAccount.setSubAccNum(data.getLong("SubAccNum"));
hlsEbankCcbAccount.setStt(data.getString("SubStt"));
hlsEbankCcbAccount.setAccBalance(data.getDouble("SubAccBalance"));
if (Objects.nonNull(recordId)) {
hlsEbankCcbAccount.setRecordId(recordId);
hlsEbankCcbAccountService.updateByPrimaryKeySelective(iRequest, hlsEbankCcbAccount);
} else {
hlsEbankCcbAccount.setMainFlag("N");
hlsEbankCcbAccount.setMainAccount(data.getString("MainAccount"));
hlsEbankCcbAccount.setCorId(data.getString("CorId"));
hlsEbankCcbAccount.setAccName(data.getString("SubAccName"));
hlsEbankCcbAccountService.insertSelective(iRequest, hlsEbankCcbAccount);
}
}
private void batchSaveAccount(IRequest iRequest, JSONObject data) {
JSONArray list = data.getJSONArray("list");
if (Objects.nonNull(list)) {
......
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