|
|
|
@ -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,6 +23,9 @@ 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);
|
|
|
|
@ -28,6 +33,18 @@ public class PartnerInvoiceController {
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
tradeLogService.exportTransFlow(query,getPartnerParams(partner,query.getClient_ids()[0]),httpResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private JSONObject getPartnerParams(JSONObject partner,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",partner.getIntValue("client_id"));
|
|
|
|
|
params.put("client",client);
|
|
|
|
|
params.put("client_moniker",client.getString("client_moniker"));
|
|
|
|
|
return params;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|