|
|
@ -1046,7 +1046,17 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
devId = device.getString("dev_id");
|
|
|
|
devId = device.getString("dev_id");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Date to = DateUtils.addDays(date, 1);
|
|
|
|
Date to = DateUtils.addDays(date, 1);
|
|
|
|
List<JSONObject> transactions = transactionMapper.listDailyTransactions(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(",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<JSONObject> transactions = transactionMapper.listDailyTransactions(date, to, devId, device.getIntValue("client_id"),param_client_ids);
|
|
|
|
if (transactions.isEmpty()) {
|
|
|
|
if (transactions.isEmpty()) {
|
|
|
|
throw new BadRequestException("No Transactions in date " + dateStr + " at " + timezone);
|
|
|
|
throw new BadRequestException("No Transactions in date " + dateStr + " at " + timezone);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1066,16 +1076,7 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
res.put("transactions", transactions);
|
|
|
|
res.put("transactions", transactions);
|
|
|
|
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);
|
|
|
|
JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id"),param_client_ids);
|
|
|
|