fix dev controller class

master
luoyang 5 years ago
parent 934ae97579
commit ac20d64c6a

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.3.25</version> <version>1.3.26</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -11,6 +11,7 @@ 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.core.mappers.PmtCustomReportMapper;
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;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
@ -27,6 +28,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.SysClientLegalPersonMapper; import au.com.royalpay.payment.manage.mappers.system.SysClientLegalPersonMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.system.core.TradeSecureService; import au.com.royalpay.payment.manage.system.core.TradeSecureService;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
@ -58,6 +60,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.MimeTypeUtils;
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;
@ -69,8 +72,10 @@ import javax.validation.Valid;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -90,6 +95,8 @@ public class TestController implements ApplicationEventPublisherAware {
@Resource @Resource
private ClientMapper clientMapper; private ClientMapper clientMapper;
@Resource @Resource
private ATOReportService atoReportService;
@Resource
private NotifyErrorLogMapper notifyErrorLogMapper; private NotifyErrorLogMapper notifyErrorLogMapper;
@Value("${app.agreetemplate.classic.path}") @Value("${app.agreetemplate.classic.path}")
private String pdfPath; private String pdfPath;
@ -562,6 +569,19 @@ public class TestController implements ApplicationEventPublisherAware {
}); });
} }
@ManagerMapping(value = "/reports/ato_reports/royalpay_ato_report_{year}.bttps", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
@ReadOnlyConnection
public void downloadATOReport(@PathVariable String year, HttpServletResponse resp) throws IOException {
DateTime from = DateTime.parse(year + "-07-01");
DateTime to = from.plusYears(1).plusDays(-1);
String atoReport = atoReportService.exportBTTPSFile(from.toDate(), to.toDate());
resp.setContentType(MimeTypeUtils.APPLICATION_OCTET_STREAM_VALUE);
try (OutputStream out = resp.getOutputStream()) {
out.write(atoReport.getBytes(StandardCharsets.UTF_8));
out.flush();
}
}
@ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) @ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) { public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) {
JSONObject report = pmtCustomReportsMapper.findCustomReport(reportId); JSONObject report = pmtCustomReportsMapper.findCustomReport(reportId);
@ -583,7 +603,6 @@ public class TestController implements ApplicationEventPublisherAware {
return res; return res;
} }
@GetMapping("/client/customer") @GetMapping("/client/customer")
public ModelAndView redirectClientCustomer() { public ModelAndView redirectClientCustomer() {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();

@ -131,8 +131,7 @@ public class Gtw2SignAspect {
if (!signInfo.containsKey("mch_public_key")) { if (!signInfo.containsKey("mch_public_key")) {
throw new ServerErrorException("error.payment.valid.invalid.mch_public_key"); throw new ServerErrorException("error.payment.valid.invalid.mch_public_key");
} }
// return checkSign(JSONObject.toJSONBytes(requestData, SerializerFeature.MapSortField), requestSign, signInfo.getString("mch_public_key")); return checkSign(JSONObject.toJSONBytes(requestData, SerializerFeature.MapSortField), requestSign, signInfo.getString("mch_public_key"));
return true;
} }
public String sign(byte[] source, String privateKey) { public String sign(byte[] source, String privateKey) {

Loading…
Cancel
Save