|
|
@ -10,6 +10,7 @@ import au.com.royalpay.payment.channels.yeepay.runtime.YeePayClient;
|
|
|
|
import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotExistsException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotExistsException;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.mappers.PmtCustomReportMapper;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.ATOReportService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.ATOReportService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
|
|
|
@ -61,6 +62,7 @@ import org.springframework.util.Assert;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
@ -148,6 +150,8 @@ public class TestController implements ApplicationEventPublisherAware {
|
|
|
|
private DashboardService dashboardService;
|
|
|
|
private DashboardService dashboardService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private SynchronizedScheduler synchronizedScheduler;
|
|
|
|
private SynchronizedScheduler synchronizedScheduler;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private PmtCustomReportMapper pmtCustomReportsMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
|
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
@ -560,6 +564,28 @@ public class TestController implements ApplicationEventPublisherAware {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
|
|
|
|
public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) {
|
|
|
|
|
|
|
|
JSONObject report = pmtCustomReportsMapper.findCustomReport(reportId);
|
|
|
|
|
|
|
|
if (report == null || report.isEmpty()) {
|
|
|
|
|
|
|
|
throw new NotFoundException("Report Not Exists");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject order = orderMapper.find(report.getString("order_id"));
|
|
|
|
|
|
|
|
String declareResp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals("Wechat", report.getString("channel"))) {
|
|
|
|
|
|
|
|
declareResp = XmlFormatUtils.formatXml(wxPayClient.declareCustomQuery(order.getString("merchant_id"), report,null,false));
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("Alipay", report.getString("channel"))) {
|
|
|
|
|
|
|
|
declareResp = XmlFormatUtils.formatXml(alipayClient.queryCustomStatus(order.getString("merchant_id"), report,null,false));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new BadRequestException("Invalid Channel:" + report.getString("channel"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
|
|
|
res.put("xml", declareResp);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/client/customer")
|
|
|
|
@GetMapping("/client/customer")
|
|
|
|
public ModelAndView redirectClientCustomer() {
|
|
|
|
public ModelAndView redirectClientCustomer() {
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|