|
|
@@ -9,6 +9,7 @@ import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
|
import com.poteviohealth.ym.ipos.model.payment.PayRefundQuery;
|
|
|
import com.poteviohealth.ym.ipos.model.split.*;
|
|
|
+import com.poteviohealth.ym.ipos.model.split.back.AccountBalanceBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.back.PayConfirmBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.back.PayConfirmQueryBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.back.SettlementQueryBack;
|
|
|
@@ -181,4 +182,31 @@ public class SplitServiceImpl implements ISplitService {
|
|
|
|
|
|
return VaultsResponse.failed(back.getResult().getComment());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public VaultsResponse<AccountBalanceBack> accountBalanceQuery(String merchantId) {
|
|
|
+ AccountBalance accountBalance = new AccountBalance();
|
|
|
+ accountBalance.setMerchant_id(merchantId);
|
|
|
+ AccountBalanceBack back = null;
|
|
|
+
|
|
|
+ try {
|
|
|
+ String val = (String) YmUtil.resultBack(accountBalance,new AccountBalanceBack());
|
|
|
+ JSONObject jsonObject = new JSONObject(JSON.parseObject(val));
|
|
|
+ if(val.contains("list")){
|
|
|
+ List<AccountBalanceList> list = jsonObject.getJSONArray("list").stream().map(item -> JSON.parseObject(item.toString(), new TypeReference<AccountBalanceList>() {})).collect(Collectors.toList());
|
|
|
+ jsonObject.put("list",list);
|
|
|
+ }
|
|
|
+ back = JSONObject.toJavaObject(jsonObject, AccountBalanceBack.class);
|
|
|
+
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return VaultsResponse.failed(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(YmUtil.SUCCESS.equals(back.getResult().getId())){
|
|
|
+ return VaultsResponse.success(back);
|
|
|
+ }
|
|
|
+
|
|
|
+ return VaultsResponse.failed(back.getResult().getComment());
|
|
|
+ }
|
|
|
}
|