|
|
|
@ -25,6 +25,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by yishuqian on 20/02/2017.
|
|
|
|
@ -51,8 +52,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
private PaymentApi paymentApi;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getCommonAnalysis(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public JSONObject getCommonAnalysis(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
|
|
|
|
|
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id"));
|
|
|
|
|
Date data = new Date();
|
|
|
|
@ -76,8 +77,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getTransactionAnalysis(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public JSONObject getTransactionAnalysis(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("client_id", client.getIntValue("client_id"));
|
|
|
|
@ -85,8 +86,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<JSONObject> getOrderCustomerChartAnalysis(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public List<JSONObject> getOrderCustomerChartAnalysis(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("client_id", client.getIntValue("client_id"));
|
|
|
|
@ -94,8 +95,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<JSONObject> getTransTypesAnalysis(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public List<JSONObject> getTransTypesAnalysis(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("client_id", client.getIntValue("client_id"));
|
|
|
|
@ -103,8 +104,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getOrderAndCustomerPerDay(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public JSONObject getOrderAndCustomerPerDay(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("client_id", client.getIntValue("client_id"));
|
|
|
|
@ -112,8 +113,8 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<JSONObject> getTradeAnalysisInHours(String client_moniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
public List<JSONObject> getTradeAnalysisInHours(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client.getIntValue("client_id"));
|
|
|
|
|
String timezone = client.getString("timezone");
|
|
|
|
@ -128,18 +129,17 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getSettlementLog(String client_moniker, TradeLogQuery query) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
int client_id = client.getIntValue("client_id");
|
|
|
|
|
String timezone = client.getString("timezone");
|
|
|
|
|
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(client_id);
|
|
|
|
|
public JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client,"client not found:"+clientMoniker);
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
JSONObject earlistOrder = transactionAnalysisMapper.getEarliestOrder(clientId);
|
|
|
|
|
if (earlistOrder != null) {
|
|
|
|
|
query.setDatefrom(DateFormatUtils.format(earlistOrder.getDate("transaction_time"), "yyyyMMdd"));
|
|
|
|
|
}
|
|
|
|
|
query.setDateto(DateFormatUtils.format(new Date(), "yyyyMMdd"));
|
|
|
|
|
JSONObject params = query.toParams(timezone);
|
|
|
|
|
params.put("client_id", client_id);
|
|
|
|
|
JSONObject params = query.toParams(TimeZone.getDefault().getID());
|
|
|
|
|
params.put("client_id", clientId);
|
|
|
|
|
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
|
|
|
|
|
JSONObject result = PageListUtils.buildPageListResult(logs);
|
|
|
|
|
if (query.getPage() == 1) {
|
|
|
|
|