修复:商户清算查询查不到当天清算记录

master
yixian 4 years ago
parent 062852a3cf
commit cf20ef1ff6

@ -8,17 +8,17 @@ import java.util.List;
* Created by yishuqian on 20/02/2017.
*/
public interface PartnerCardDashboardService {
JSONObject getCommonAnalysis(String client_moniker);
JSONObject getCommonAnalysis(String clientMoniker);
JSONObject getTransactionAnalysis(String client_moniker);
JSONObject getTransactionAnalysis(String clientMoniker);
List<JSONObject> getOrderCustomerChartAnalysis(String client_moniker);
List<JSONObject> getOrderCustomerChartAnalysis(String clientMoniker);
List<JSONObject> getTransTypesAnalysis(String client_moniker);
List<JSONObject> getTransTypesAnalysis(String clientMoniker);
JSONObject getOrderAndCustomerPerDay(String client_moniker);
JSONObject getOrderAndCustomerPerDay(String clientMoniker);
List<JSONObject> getTradeAnalysisInHours(String client_moniker);
List<JSONObject> getTradeAnalysisInHours(String clientMoniker);
JSONObject getSettlementLog(String client_moniker, TradeLogQuery query);
JSONObject getSettlementLog(String clientMoniker, TradeLogQuery query);
}

@ -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) {

@ -842,15 +842,11 @@ public class RetailAppServiceImp implements RetailAppService {
public JSONObject getClientSettlementLog(JSONObject device, AppQueryBean appQueryBean) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(client_id);
String timezone = client.getString("timezone");
if (timezone != null && !timezone.isEmpty()) {
appQueryBean.setTimezone(timezone);
}
int clientId = device.getIntValue("client_id");
appQueryBean.setTimezone(TimeZone.getDefault().getID());
JSONObject params = appQueryBean.toParams();
setAllClientIds(params, client_id);
params.put("client_id", client_id);
setAllClientIds(params, clientId);
params.put("client_id", clientId);
PageList<JSONObject> logs = clearingDetailMapper.listClientSettlementLog(params,
new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc")));
logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount"))));

@ -1375,8 +1375,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
PageList<JSONObject> logs = clearingDetailMapper.listReportsOfSettlementLogs(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("report_date.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
return result;
return PageListUtils.buildPageListResult(logs);
}
@Override

@ -1413,8 +1413,7 @@ public class TradeLogServiceImpl implements TradeLogService {
public JSONObject listSettlementLog(TradeLogQuery query, JSONObject partner) {
JSONObject client = clientManager.getClientInfoByMoniker(partner.getString("client_moniker"));
int clientId = partner.getIntValue("client_id");
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.toParams(timezone);
JSONObject params = query.toParams(TimeZone.getDefault().getID());
params.put("client_id", clientId);
clientManager.queryModifyClientIds(clientId, params);
JSONObject result = new JSONObject();

Loading…
Cancel
Save