|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|