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

master
liuxinxin 5 years ago
parent 2d47d888b3
commit 947609278d

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.19</version>
<version>1.3.20</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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.exceptions.InvalidShortIdException;
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.DashboardService;
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.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
@ -148,6 +150,8 @@ public class TestController implements ApplicationEventPublisherAware {
private DashboardService dashboardService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Resource
private PmtCustomReportMapper pmtCustomReportsMapper;
@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 {
@ -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")
public ModelAndView redirectClientCustomer() {
JSONObject result = new JSONObject();

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

@ -71,6 +71,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/registerAlipayOnlineMerchant',
templateUrl: '/static/config/devtools/templates/registerAlipayOnlineMerchant.html',
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) {
@ -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) {
$scope.selecttotal = true;
@ -489,4 +509,4 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
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>
批量报备支付宝线上商户
</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>
</section>
</div>
</div>

Loading…
Cancel
Save