[R] 开发工具 查询报关情况

master
liuxinxin 5 years ago
parent 2d47d888b3
commit 947609278d

@ -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.19</version> <version>1.3.20</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>

@ -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();

@ -27,5 +27,6 @@ public interface CommonSubMerchantIdMapper {
void update(JSONObject record); void update(JSONObject record);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1")
JSONObject find(@Param("sub_merchant_id") String subMerchantId); JSONObject find(@Param("sub_merchant_id") String subMerchantId);
} }

@ -71,6 +71,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/registerAlipayOnlineMerchant', url: '/registerAlipayOnlineMerchant',
templateUrl: '/static/config/devtools/templates/registerAlipayOnlineMerchant.html', templateUrl: '/static/config/devtools/templates/registerAlipayOnlineMerchant.html',
controller: 'registerAlipayOnlineMerchantCtrl' controller: 'registerAlipayOnlineMerchantCtrl'
}).state('devtools.custom_declare_check', {
url: '/custom_declare_check',
templateUrl: '/static/config/devtools/templates/custom_declare_check.html',
controller: 'devCustomDeclareCheckCtrl'
}) })
}]); }]);
app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
@ -408,6 +412,22 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('devCustomDeclareCheckCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.search = {};
$scope.check = function () {
$scope.errmsg = null;
$scope.xmlStr = null;
if (!$scope.search.report_id) {
return;
}
$http.get('/dev/custom_declare_check/' + $scope.search.report_id + '/detail').then(function (resp) {
$scope.xmlStr = resp.data.xml;
}, function (resp) {
$scope.errmsg = resp.data.message;
})
};
}]);
app.controller('registerAlipayOnlineMerchantCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) { app.controller('registerAlipayOnlineMerchantCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) {
$scope.selecttotal = true; $scope.selecttotal = true;
@ -489,4 +509,4 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
return app; return app;
}); });

@ -0,0 +1,28 @@
<section class="content-header">
<h1>Custom Declare Check</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-cog"></i> Basic Config
</li>
<li><a ui-sref="^">Dev Tools</a></li>
<li class="active">Custom Declare Check</li>
</ol>
</section>
<section class="content">
<div class="box">
<div class="box-body">
<div class="input-group input-group-lg">
<input class="form-control" ng-model="search.report_id">
<div class="input-group-btn">
<button class="btn btn-lg btn-info" type="button" ng-click="check()">Check Report Status</button>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<pre class="well" ng-if="xmlStr" ng-bind="xmlStr"></pre>
</div>
</div>
</section>

@ -91,8 +91,12 @@
<i class="fa fa-credit-card-alt"></i> <i class="fa fa-credit-card-alt"></i>
批量报备支付宝线上商户 批量报备支付宝线上商户
</a> </a>
<a class="btn btn-app" role="button" ui-sref=".custom_declare_check">
<i class="fa fa-check-square"></i>
Customs Declare Check
</a>
</div> </div>
</div> </div>
</section> </section>
</div> </div>

Loading…
Cancel
Save