Merge branch 'invoice_fix' into develop

master
yuan 6 years ago
commit ff68ca6b20

@ -1,9 +1,11 @@
package au.com.royalpay.payment.manage.partnerinvoice.web;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
@ -21,13 +23,28 @@ public class PartnerInvoiceController {
@Resource
private TradeLogService tradeLogService;
@Resource
private ClientManager clientManager;
@PartnerMapping(value = "/trans_flow",method = RequestMethod.GET,roles = PartnerRole.ADMIN)
public JSONObject listTransFlow(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) throws Exception {
return tradeLogService.listPartnerTransFlowPage(query,partner);
}
@PartnerMapping(value = "/trans_flow/pdf", method = RequestMethod.GET,roles = PartnerRole.ADMIN)
public void exportTransFlowPDF(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransFlow(query,partner,httpResponse);
public void exportTransFlowPDF(TradeLogQuery query,HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransFlow(query,getPartnerParams(query.getClient_ids()[0]),httpResponse);
}
private JSONObject getPartnerParams(String client_id){
JSONObject client = clientManager.getClientInfo(Integer.parseInt(client_id));
if(client==null){
throw new NotFoundException("Client Not Exists");
}
JSONObject params = new JSONObject();
params.put("client_id",client.getIntValue("client_id"));
params.put("client",client);
params.put("client_moniker",client.getString("client_moniker"));
return params;
}
}

@ -12,13 +12,12 @@ define(['angular','decimal'], function (angular,decimal) {
})
}]);
app.controller('partnerInvoiceApp', ['$scope', '$http','$filter', 'commonDialog', function ($scope, $http,$filter, commonDialog) {
$scope.params = {channel:'ALL',clearing_status:-1};
$scope.params = {channel:'ALL',clearing_status:-1,client_ids:[$scope.currentUser.client.client_id]};
$scope.today = new Date();
$scope.pagination = {};
$scope.today = new Date();
$scope.clients = [$scope.currentUser.client];
if ($scope.currentUser.client.has_children) {
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
@ -126,6 +125,9 @@ define(['angular','decimal'], function (angular,decimal) {
params.page = page || $scope.pagination.page || 1;
url += connectSymbol + 'page=' + params.page;
url+="&channel=ALL&clearing_status=-1";
if(params.client_ids){
url+=connectSymbol +'client_ids='+params.client_ids;
}
return url;
}

Loading…
Cancel
Save