diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 2295275b3..ca220dbaf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -320,8 +320,6 @@ public class RetailAppServiceImp implements RetailAppService { String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); int client_id = device.getIntValue("client_id"); - JSONObject client = clientManager.getClientInfo(client_id); - device.put("client_moniker", client.getString("client_moniker")); TradeLogQuery tradeLogQuery = new TradeLogQuery(); tradeLogQuery.setDatefrom(appQueryBean.getBegin()); tradeLogQuery.setDateto(appQueryBean.getEnd()); @@ -329,6 +327,12 @@ public class RetailAppServiceImp implements RetailAppService { appQueryBean.setApp_client_ids(String.valueOf(client_id)); } tradeLogQuery.setClient_ids(appQueryBean.getApp_client_ids().split(",")); + JSONObject client = clientManager.getClientInfo(Integer.parseInt(tradeLogQuery.getClient_ids()[0])); + if(client==null){ + throw new NotFoundException("Client Not Exists"); + } + device.put("client_moniker", client.getString("client_moniker")); + device.put("client",client); tradeLogService.exportTransFlow(tradeLogQuery, device, httpResponse); }