diff --git a/src/document/tpl/img/microapp_cn.png b/src/document/tpl/img/microapp_cn.png index b134aefde..fe30a4e5e 100644 Binary files a/src/document/tpl/img/microapp_cn.png and b/src/document/tpl/img/microapp_cn.png differ diff --git a/src/document/tpl/img/microapp_en.png b/src/document/tpl/img/microapp_en.png index 42884ad56..aabba0a10 100644 Binary files a/src/document/tpl/img/microapp_en.png and b/src/document/tpl/img/microapp_en.png differ diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index 836108a49..b64b4e256 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -65,7 +65,7 @@ public interface RetailAppService { JSONObject getClientCurrentRateNew(JSONObject device); - JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device); + JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device,String app_client_ids); JSONObject getActivities(JSONObject device, String activity_page, int page, int limit); 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 3eb7b419d..13b3aefc4 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 @@ -1034,7 +1034,7 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device) { + public JSONObject listDailyTransactions(String dateStr, String timezone, boolean thisDevOnly, JSONObject device,String app_client_ids) { try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); dateFormat.setTimeZone(TimeZone.getTimeZone(timezone)); @@ -1066,7 +1066,19 @@ public class RetailAppServiceImp implements RetailAppService { } JSONObject res = new JSONObject(); res.put("transactions", transactions); - JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id")); + String [] param_client_ids = null; + if(StringUtils.isEmpty(app_client_ids)) { + JSONArray client_ids = clientManager.getAllClientIds(device.getIntValue("client_id")); + if (client_ids.size() > 1) { + param_client_ids = new String[client_ids.size()]; + client_ids.toArray(param_client_ids); + } + }else { + param_client_ids = app_client_ids.split(","); + } + + + JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"),param_client_ids); analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone)); analysis.put("display_amount",display_amount); analysis.put("cny_display_amount",cny_display_amount); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index 037f89f45..b7978a17f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -245,9 +245,9 @@ public class RetailAppController { } @RequestMapping(value = "/daily_transactions/date/{dateStr}", method = RequestMethod.GET) - public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone, + public JSONObject listDailyTransactions(@PathVariable String dateStr, @RequestParam(defaultValue = "Australia/Melbourne") String timezone,@RequestParam(required = false) String app_client_ids, @RequestParam(defaultValue = "false") boolean thisdevice, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device); + return retailAppService.listDailyTransactions(dateStr, timezone, thisdevice, device,app_client_ids); } @RequestMapping(value = "/modify/retail_surcharge", method = RequestMethod.PUT) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index a254f2fd3..b7d43de47 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -108,7 +108,7 @@ public interface TransactionMapper { List listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId); - JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId); + JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId,@Param("client_ids")String [] client_ids); @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "system_generate=1") diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index b75e0e4b7..56983a97d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -675,9 +675,20 @@ sum(if(t.transaction_type='Credit',t.tax_amount,-t.tax_amount)) tax_amount FROM pmt_transactions t - WHERE t.transaction_time>=#{from} and t.transaction_time<#{to} and (t.transaction_type='Credit' or t.refund_id is not null) - and t.client_id=#{client_id} + WHERE + t.transaction_time>=#{from} and t.transaction_time<#{to} and (t.transaction_type='Credit' or t.refund_id is not null) + ]]> + + AND t.client_id IN + + #{client_id} + + + + and t.client_id=#{client_id} + + and t.device_id=#{dev_id}