r+service 流水查询优化

master
dalong306 3 years ago
parent b204b90473
commit 4499d9dca7

@ -21,6 +21,8 @@ public interface TradeLogService {
JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager);
JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager);
List<JSONObject> listOrderRefunds(String orderId, String timezone);
void getOrderDetail(Model model, String clientMoniker, String orderId, String openid);

@ -277,6 +277,23 @@ public class TradeLogServiceImpl implements TradeLogService {
};
});
JSONObject result = PageListUtils.buildPageListResult(logs);
// JSONObject analysis = orderMapper.analysisOrders(params);
// result.put("analysis", analysis);
return result;
}
@Override
public JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager) {
JSONObject params = query.toParams(null);
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", manager.getString("manager_id"));
}
orgManager.checkOrgIds(manager, params);
if (query.getGatewayChild() != null) {
params.put("trade_type", new ArrayList<Integer>() {{
add(query.getGatewayChild());
}});
}
JSONObject result = new JSONObject();
JSONObject analysis = orderMapper.analysisOrders(params);
result.put("analysis", analysis);
return result;

@ -41,6 +41,12 @@ public class ManageTradelogController {
public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.listAllIncrementalTradeLogs(query, manager);
}
@RequestMapping(value = "/incremental/analysis", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
public JSONObject incrementalAnalysisOrders(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.incrementalAnalysisOrders(query, manager);
}
@ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
@ReadOnlyConnection

@ -436,6 +436,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$http.get('/sys/trade_logs/incremental', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
});
$http.get('/sys/trade_logs/incremental/analysis', {params: params}).then(function (resp) {
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});

Loading…
Cancel
Save