Merge branch 'develop'

master
james.zhao 6 years ago
commit f7560131a4

@ -27,8 +27,8 @@
"JD_Online_Payment", "JD_Online_Payment",
"Alipay_Online_Payment", "Alipay_Online_Payment",
"HF_Online_Payment", "HF_Online_Payment",
"CB_BankPay",
"SDKPayment", "SDKPayment",
"CustomsDeclare",
"CommonApi", "CommonApi",
"GetExchange", "GetExchange",
"OrderStatus", "OrderStatus",

@ -17,6 +17,9 @@
/** /**
* @apiDefine JSON JSON字段 * @apiDefine JSON JSON字段
*/ */
/**
* @apiDefine SUB_JSON JSON子字段
*/
/** /**
* @apiDefine ERROR_CODE 错误码 * @apiDefine ERROR_CODE 错误码
*/ */
@ -874,6 +877,75 @@
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付 * @apiError (ERROR_CODE) ORDER_PAID 订单已支付
* *
*/ */
/**
* @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{client_report_id} 创建报关单
* @apiName declare_report
* @apiDescription
* 用于商户提交海关需要的订单附件信息仅支持微信和支付宝微信只支持一个月内的支付订单进行报关申请
*
* @apiVersion 1.0.0
* @apiGroup CustomsDeclare
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} client_report_id 必填商户申请报关单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiParam (JSON) {String} custom 必填海关编号 * <a href="https://www.royalpay.com.au/downloads/CustomsNO.xlsx">渠道海关编号</a>
* @apiParam (JSON) {String} mch_custom_id 必填商户在海关备案的编号
* @apiParam (JSON) {String} mch_custom_name 必填商户海关备案名称
* @apiParam (JSON) {JSONArray} sub_order 子订单(拆单)
*
* @apiParam (SUB_JSON) {String} sub_order_no 商户子订单号
* @apiParam (SUB_JSON) {String=CNY} fee_type=CNY 币种代码
* @apiParam (SUB_JSON) {Double} order_fee 子订单金额
* @apiParam (SUB_JSON) {Double} transport_fee 子订单物流金额
*
* @apiSuccess {String} report_id RoyalPay海关单号
* @apiSuccess {String} client_report_id 商户申请报关单号
* @apiSuccess {int} report_status 0:暂存,1:提交,2:提交失败,3:提交成功
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} custom 海关编号
* @apiSuccess {String} mch_custom_no 商户在海关备案的编号
* @apiSuccess {String} mch_custom_name 商户海关备案名称
* @apiSuccess {String} order_id Royalpay订单号
* @apiSuccess {String} transaction_id 支付渠道订单号
* @apiSuccess {String} order_currency 币种
* @apiSuccess {Double} order_amount 订单金额
* @apiSuccess {String} report_time 报关时间
* @apiSuccess {String} creation_date 报关单创建时间
* @apiSuccess {String} last_update_date 更新时间
* @apiSuccess {String} error_code 错误代码
* @apiSuccess {String} error_msg 错误返回的信息描述
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*
*/
/**
* @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{report_id} 查询报关单
* @apiName declare_query
* @apiDescription
* 用于商户查询报关单号的状态
*
* @apiVersion 1.0.0
* @apiGroup CustomsDeclare
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} report_id 必填RoyalPay海关单号
* @apiUse Sign
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} report_status 报关单状态
* @apiSuccess {String} report_id 商户申请报关单号
* @apiSuccess {String} return_msg 错误描述仅在执行结果不为SUCCESS情况下出现
* @apiSuccess {String} order_id RoyalPay订单号
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*
*/
function apis() { function apis() {
} }

@ -29,6 +29,7 @@
"HF_Online_Payment", "HF_Online_Payment",
"CB_BankPay", "CB_BankPay",
"SDKPayment", "SDKPayment",
"CustomsDeclare",
"CommonApi", "CommonApi",
"GetExchange", "GetExchange",
"OrderStatus", "OrderStatus",

@ -17,6 +17,9 @@
/** /**
* @apiDefine JSON JSON keys * @apiDefine JSON JSON keys
*/ */
/**
* @apiDefine SUB_JSON JSON child keys
*/
/** /**
* @apiDefine ERROR_CODE Error Code * @apiDefine ERROR_CODE Error Code
*/ */
@ -891,6 +894,75 @@
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
* *
*/ */
/**
* @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{client_report_id} Create Declare No.
* @apiName declare_report
* @apiDescription
* Used to submit the attachment information of the order required by the merchant. WeChat and Alipay are only supported. WeChat only supports payment orders within one month for customs declaration.
*
* @apiVersion 1.0.0
* @apiGroup CustomsDeclare
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} client_report_id Required, Client declare ID
* @apiUse Sign
* @apiParam (JSON) {String} order_id Required, Partner order id
* @apiParam (JSON) {String} custom Required, Customs No. * <a href="https://www.royalpay.com.au/downloads/CustomsNO.xlsx">Customs No.</a>
* @apiParam (JSON) {String} mch_custom_id Required, Customs record id
* @apiParam (JSON) {String} mch_custom_name Required, Customs record name
* @apiParam (JSON) {JSONArray} sub_order Child orders
*
* @apiParam (SUB_JSON) {String} sub_order_no Child order ID
* @apiParam (SUB_JSON) {String=CNY} fee_type=CNY Currency
* @apiParam (SUB_JSON) {Double} order_fee Child Order Amount
* @apiParam (SUB_JSON) {Double} transport_fee Child Order Logistics Amount
*
* @apiSuccess {String} report_id RoyalPay declare ID
* @apiSuccess {String} client_report_id Client declare ID
* @apiSuccess {int} report_status 0:PROCCESSING,1:SUBMITED,2:FAIL,3:SUCCESS
* @apiSuccess {String} channel Channel
* @apiSuccess {String} custom Customs No.
* @apiSuccess {String} mch_custom_no Customs record ID
* @apiSuccess {String} mch_custom_name Customs record name
* @apiSuccess {String} order_id Royalpay Order ID
* @apiSuccess {String} transaction_id Channel Order ID
* @apiSuccess {String} order_currency Currency
* @apiSuccess {Double} order_amount Order Amount
* @apiSuccess {String} report_time Declare Time
* @apiSuccess {String} creation_date Create Time
* @apiSuccess {String} last_update_date Update Time
* @apiSuccess {String} error_code Error Code
* @apiSuccess {String} error_msg Error Description
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*
*/
/**
* @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{report_id} Query Declare ID
* @apiName declare_query
* @apiDescription
* Used by the merchant to check the status of the customs declaration number.
*
* @apiVersion 1.0.0
* @apiGroup CustomsDeclare
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} report_id RequiredRoyalPay Declare ID
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} report_status Result status
* @apiSuccess {String} report_id Client declare ID
* @apiSuccess {String} return_msg Error Description
* @apiSuccess {String} order_id RoyalPay Order
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*
*/
function apis() { function apis() {
} }

@ -1,9 +1,12 @@
package au.com.royalpay.payment.manage.custom.beans; package au.com.royalpay.payment.manage.custom.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -12,8 +15,9 @@ import java.text.SimpleDateFormat;
* @date 2018/7/27 * @date 2018/7/27
*/ */
public class QueryCustomVo { public class QueryCustomVo {
private final DateFormat format = new SimpleDateFormat("yyyyMMdd");
private String date; private String datefrom;
private String dateto;
private String channel; private String channel;
private String report_status; private String report_status;
private int page = 1; private int page = 1;
@ -21,12 +25,18 @@ public class QueryCustomVo {
public JSONObject toParam() { public JSONObject toParam() {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
if (StringUtils.isNotEmpty(date)) { if (datefrom != null) {
date = date.replace("Z", " UTC"); try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); result.put("from", format.parse(datefrom));
} catch (ParseException e) {
throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format");
}
}
if (dateto != null) {
try { try {
result.put("date", format.parse(date)); result.put("to", DateUtils.addDays(format.parse(dateto), 1));
} catch (ParseException e) { } catch (ParseException e) {
throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format");
} }
} }
if (StringUtils.isNotEmpty(channel)) { if (StringUtils.isNotEmpty(channel)) {
@ -54,12 +64,20 @@ public class QueryCustomVo {
this.limit = limit; this.limit = limit;
} }
public String getDate() { public String getDatefrom() {
return date; return datefrom;
}
public void setDatefrom(String datefrom) {
this.datefrom = datefrom;
}
public String getDateto() {
return dateto;
} }
public void setDate(String date) { public void setDateto(String dateto) {
this.date = date; this.dateto = dateto;
} }
public String getChannel() { public String getChannel() {

@ -19,7 +19,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -55,7 +57,7 @@ public class CustomServiceImpl implements CustomService {
if (report != null) { if (report != null) {
throw new BadRequestException("report record exist"); throw new BadRequestException("report record exist");
} }
CustomReport customReport = new CustomReport(addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(), CustomReport customReport = new CustomReport(UUID.randomUUID().toString(),addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(),
addCustomVO.getCustom()); addCustomVO.getCustom());
customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_custom_name()); customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_custom_name());
if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) { if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) {
@ -83,7 +85,11 @@ public class CustomServiceImpl implements CustomService {
@Override @Override
public JSONObject query(JSONObject param, int page, int limit) { public JSONObject query(JSONObject param, int page, int limit) {
param.put("orderStatus", OrderStatus.SUCCESS.getStatus()); param.put("orderStatus", OrderStatus.SUCCESS.getStatus());
List<String> channels = customSupport.customSupportedChannels(param.getIntValue("client_id")); // List<String> channels = customSupport.customSupportedChannels(param.getIntValue("client_id"));
List<String> channels = new ArrayList<>();
channels.add("Wechat");
channels.add("Alipay");
channels.add("AlipayOnline");
param.put("channels", channels); param.put("channels", channels);
if (!StringUtils.isEmpty(param.getString("channel"))) { if (!StringUtils.isEmpty(param.getString("channel"))) {
channels.clear(); channels.clear();

@ -15,7 +15,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/** /**
* Created by yishuqian on 9/1/16. * Created by yishuqian on 9/1/16.
*/ */
@AutoMapper(tablename = "pmt_custom_report_details", pkName = "sub_order_no") @AutoMapper(tablename = "pmt_custom_report_detail", pkName = "sub_order_no")
public interface CustomReportDetailsMapper { public interface CustomReportDetailsMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> findByReportId(@Param("report_id") String report_id); List<JSONObject> findByReportId(@Param("report_id") String report_id);

@ -15,7 +15,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/** /**
* Created by yishuqian on 9/1/16. * Created by yishuqian on 9/1/16.
*/ */
@AutoMapper(tablename = "pmt_custom_reports", pkName = "report_id") @AutoMapper(tablename = "pmt_custom_report", pkName = "report_id")
public interface CustomReportsMapper { public interface CustomReportsMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject findOne(@Param("report_id") String report_id); JSONObject findOne(@Param("report_id") String report_id);

@ -12,7 +12,7 @@
pmt_transactions t pmt_transactions t
on o.order_id = t.order_id on o.order_id = t.order_id
left join left join
pmt_custom_reports r pmt_custom_report r
on r.order_id = o.order_id on r.order_id = o.order_id
where where
o.channel in ( o.channel in (
@ -33,9 +33,8 @@
<!--<if test="channel!=null">--> <!--<if test="channel!=null">-->
<!--and o.channel = #{channel}--> <!--and o.channel = #{channel}-->
<!--</if>--> <!--</if>-->
<if test="date!=null"> <if test="from!=null">and t.transaction_time &gt;= #{from}</if>
and DATE(t.transaction_time) = #{date} <if test="to!=null">and t.transaction_time &lt; #{to}</if>
</if>
<if test="report_status!=null"> <if test="report_status!=null">
and r.report_status = #{report_status} and r.report_status = #{report_status}
</if> </if>

@ -11,7 +11,41 @@
app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) { app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) {
$scope.pagination = {}; $scope.pagination = {};
$scope.customOrders = {}; $scope.customOrders = {};
$scope.params = {channel:'ALL',report_status:'ALL'}; $scope.params = {channel :'ALL' ,report_status:'ALL',datefrom: new Date(), dateto: new Date()};
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
$scope.loadList(1);
};
$scope.chooseYesterday = function () {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
$scope.params.datefrom = $scope.params.dateto = yesterday;
$scope.loadList(1);
};
$scope.chooseLast7Days = function () {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.loadList(1);
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
var monthBegin = new Date();
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadList(1);
};
$scope.lastMonth = function () {
var monthFinish = new Date();
monthFinish.setDate(0);
$scope.params.dateto = monthFinish;
var monthBegin = new Date();
monthBegin.setDate(0);
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadList(1);
};
$scope.loadList = function () { $scope.loadList = function () {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
if (params.channel =='ALL'){ if (params.channel =='ALL'){
@ -20,6 +54,16 @@
if (params.report_status =='ALL'){ if (params.report_status =='ALL'){
delete params.report_status; delete params.report_status;
} }
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
} else {
params.datefrom = $filter('date')(new Date(), 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
} else {
params.dateto = $filter('date')(new Date(), 'yyyyMMdd');
}
params.page = $scope.pagination.page || 1; params.page = $scope.pagination.page || 1;
$http.get('/custom/query',{params: params}).then(function (resp) { $http.get('/custom/query',{params: params}).then(function (resp) {
$scope.customOrders = resp.data.data; $scope.customOrders = resp.data.data;
@ -109,13 +153,25 @@
} }
$scope.custom.subOrders = $scope.subOrders; $scope.custom.subOrders = $scope.subOrders;
var param = angular.copy($scope.custom); var param = angular.copy($scope.custom);
$http.post('/custom', param).then(function (resp) { param.custom = $scope.custom.ext_custom_info[0];
$http.post('/custom',param).then(function (resp) {
$scope.$close();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
$scope.$close();
});
if($scope.custom.ext_custom_info[1]){
var infos = angular.copy($scope.custom);
infos.custom = $scope.custom.ext_custom_info[1];
$http.post('/custom', infos).then(function (resp) {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
$scope.$close(); $scope.$close();
}) })
} }
}
$scope.removeSubOrders = function (order) { $scope.removeSubOrders = function (order) {
for(var i= 0 ;i<$scope.subOrders.length;i++){ for(var i= 0 ;i<$scope.subOrders.length;i++){
if($scope.subOrders[i].idNum == order.idNum){ if($scope.subOrders[i].idNum == order.idNum){
@ -195,13 +251,13 @@
return function (status) { return function (status) {
switch (status + '') { switch (status + '') {
case '0': case '0':
return 'Saved'; return '暂存';
case '1': case '1':
return 'Submitted'; return '已提交';
case '2': case '2':
return 'Failed'; return '失败';
case '3': case '3':
return 'Success'; return '成功';
} }
} }
}); });

@ -5,12 +5,12 @@
</style> </style>
<div ui-view> <div ui-view>
<section class="content-header"> <section class="content-header">
<h1>Custom</h1> <h1>海关</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li> <li>
<i class="fa fa-sitemap"></i> Custom <i class="fa fa-sitemap"></i> 海关
</li> </li>
<li class="active">Report Custom </li> <li class="active">海关申报</li>
</ol> </ol>
</section> </section>
@ -35,52 +35,114 @@
</div> </div>
</div>--> </div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-4 col-sm-3">Report Status</label> <label class="control-label col-xs-4 col-sm-3">报关状态</label>
<div class="col-xs-8 col-sm-6"> <div class="col-xs-8 col-sm-6">
<p class="form-control-static"> <p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.report_status=='ALL'}" <a role="button" ng-class="{'bg-primary':params.report_status=='ALL'}"
ng-click="params.report_status='ALL';loadList()">All</a> | ng-click="params.report_status='ALL';loadList()">全部</a> |
<a role="button" ng-class="{'bg-primary':params.report_status=='0'}" <a role="button" ng-class="{'bg-primary':params.report_status=='0'}"
ng-click="params.report_status='0';loadList()">Saved</a> | ng-click="params.report_status='0';loadList()">暂存</a> |
<a role="button" ng-class="{'bg-primary':params.report_status=='1'}" <a role="button" ng-class="{'bg-primary':params.report_status=='1'}"
ng-click="params.report_status='1';loadList()">Submitted</a> | ng-click="params.report_status='1';loadList()">已提交</a> |
<a role="button" ng-class="{'bg-primary':params.report_status=='2'}" <a role="button" ng-class="{'bg-primary':params.report_status=='2'}"
ng-click="params.report_status='2';loadList()">Failed</a> | ng-click="params.report_status='2';loadList()">失败</a> |
<a role="button" ng-class="{'bg-primary':params.report_status=='3'}" <a role="button" ng-class="{'bg-primary':params.report_status=='3'}"
ng-click="params.report_status='3';loadList()">Success</a> | ng-click="params.report_status='3';loadList()">成功</a> |
</p> </p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-4 col-sm-3">Date</label> <label class="control-label col-xs-4 col-sm-3">渠道</label>
<div class="col-xs-8 col-sm-6"> <div class="col-xs-8 col-sm-6">
<input class="form-control" ng-model="params.date" <p class="form-control-static">
uib-datepicker-popup size="10" is-open="ctrl.dateInput" <a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="ctrl.dateInput=true" ng-click="params.channel='ALL';loadList(1)">全部</a> |
datepicker-options="{minDate:minDate,maxDate:maxDate}" name="date" required> <a role="button" ng-class="{'bg-primary':params.channel=='WECHAT'}"
ng-click="params.channel='WECHAT';loadList(1)">微信</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAY'}"
ng-click="params.channel='ALIPAY';loadList(1)">支付宝</a>|
<a role="button" ng-class="{'bg-primary':params.channel=='AlipayOnline'}"
ng-click="params.channel='AlipayOnline';doAnalysis(1)">支付宝线上</a>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-3">时间区间</label>
<div style="display: inline-block">
<input class="form-control" id="date-from-input"
ng-model="params.datefrom"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.dateto||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input"
ng-model="params.dateto"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.datefrom,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">今日</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">昨日</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">过去7日</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisMonth()">本月</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">上月</a>
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-8 col-sm-6">
<button class="btn btn-success" type="button" ng-click="loadList(1)">
<i class="fa fa-search"></i> 查找
</button>
</div> </div>
<button class="btn btn-primary" type="button" ng-click="loadList(1)"><i
class="fa fa-search"></i></button>
</div> </div>
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-4 col-sm-3">Date</label>-->
<!--<div class="col-xs-8 col-sm-6">-->
<!--<input class="form-control" ng-model="params.date"-->
<!--uib-datepicker-popup size="10" is-open="ctrl.dateInput"-->
<!--ng-click="ctrl.dateInput=true"-->
<!--datepicker-options="{minDate:minDate,maxDate:maxDate}" name="date" required>-->
<!--</div>-->
<!--<button class="btn btn-primary" type="button" ng-click="loadList(1)"><i-->
<!--class="fa fa-search"></i></button>-->
<!--</div>-->
</div> </div>
</div> </div>
</div> </div>
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"> <h3 class="box-title" style="display: inherit">
Custom Order List 报关订单列表
<a style="float: right;padding-right: 40px" href="https://mpay.royalpay.com.au/docs/en/#api-CustomsDeclare-declare_report">商户报关API</a>
</h3> </h3>
</div> </div>
<div class="box-body table-responsive"> <div class="box-body table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Order Id</th> <th>订单号</th>
<th>Time</th> <th>时间</th>
<th>Order Amount</th> <th>金额</th>
<th>CNY Amount</th> <th>金额CNY</th>
<th>Report Status</th> <th>报关状态</th>
<th>Operation</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -116,20 +178,20 @@
<th ng-bind="order.cny_amount"></th> <th ng-bind="order.cny_amount"></th>
<th ng-bind="order.report_status|reportStatus"></th> <th ng-bind="order.report_status|reportStatus"></th>
<td> <td>
<a ng-if="order.report_status==null" class="text-primary" role="button" title="Edit" <a ng-if="order.report_status==null" class="text-primary" role="button" title="提交"
ng-click="add(order)"> ng-click="add(order)">
Submit 提交
</a> </a>
<!--<a class="text-primary" role="button" title="Edit"--> <!--<a class="text-primary" role="button" title="Edit"-->
<!--ng-click="edit(order)">--> <!--ng-click="edit(order)">-->
<!--Edit--> <!--Edit-->
<!--</a>--> <!--</a>-->
<a ng-if="order.report_status!=null" class="text-primary" role="button" title="Detail" <a ng-if="order.report_status!=null" class="text-primary" role="button" title="详情"
ng-click="detail(order)"> ng-click="detail(order)">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</a> </a>
<a ng-if="order.report_status==2" class="text-primary" role="button" title="Detail" <a ng-if="order.report_status==2" class="text-primary" role="button" title="重新提交"
ng-click="resend(order)"> ng-click="resend(order)">
<i class="fa fa-refresh"></i> <i class="fa fa-refresh"></i>
</a> </a>
@ -153,8 +215,7 @@
first-text="&laquo;" first-text="&laquo;"
last-text="&raquo;"></uib-pagination> last-text="&raquo;"></uib-pagination>
<div class="row"> <div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total <div class="col-xs-12">总单数:{{pagination.totalCount}};总页数:{{pagination.totalPages}}
Pages:{{pagination.totalPages}}
</div> </div>
</div> </div>
</div> </div>

@ -1,6 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<h4 ng-if="custom.isSubmit">Submit Declare Custom</h4> <h4 ng-if="custom.isSubmit">海关申报</h4>
<h4 ng-if="!custom.isSubmit">Edit Declare Custom</h4> <h4 ng-if="!custom.isSubmit">海关申报编辑</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
@ -8,48 +8,48 @@
<form class="form-horizontal" novalidate name="rate_form"> <form class="form-horizontal" novalidate name="rate_form">
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4">Customs</label> <label class="control-label col-sm-4">海关</label>
<div class="col-sm-6"> <div class="col-sm-6">
<select class="form-control" name="industry" <select class="form-control" name="industry"
ng-model="custom.custom" ng-model="custom.ext_custom_info"
ng-options="custom.code as custom.name for custom in channelCustom"> ng-options="custom.ext_custom_info as custom.name for custom in channelCustom">
<option value="">Please Choose</option> <option value="">请选择</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_id">Local Customs No</label> <label class="control-label col-sm-4" for="mch_custom_id">商户海关编号</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_id" id="mch_custom_id" type="text"> <input class="form-control" ng-model="custom.mch_custom_id" id="mch_custom_id" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_name">Local Merchant Custom Record Name</label> <label class="control-label col-sm-4" for="mch_custom_name">商户海关名称</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text"> <input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-4" for="mch_ext_custom_id">General Customs No</label> <!--<label class="control-label col-sm-4" for="mch_ext_custom_id">General Customs No</label>-->
<div class="col-sm-6"> <!--<div class="col-sm-6">-->
<input class="form-control" ng-model="custom.mch_ext_custom_id" id="mch_ext_custom_id" type="text"> <!--<input class="form-control" ng-model="custom.mch_ext_custom_id" id="mch_ext_custom_id" type="text">-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-4" for="mch_ext_custom_name">General Merchant Custom Record Name</label> <!--<label class="control-label col-sm-4" for="mch_ext_custom_name">General Merchant Custom Record Name</label>-->
<div class="col-sm-6"> <!--<div class="col-sm-6">-->
<input class="form-control" ng-model="custom.mch_ext_custom_name" id="mch_ext_custom_name" type="text"> <!--<input class="form-control" ng-model="custom.mch_ext_custom_name" id="mch_ext_custom_name" type="text">-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="has_sub">Split</label> <label class="control-label col-sm-4" for="has_sub">拆单</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input ng-model="custom.has_sub" id="has_sub" type="checkbox"> <input ng-model="custom.has_sub" id="has_sub" type="checkbox">
</div> </div>
@ -62,11 +62,11 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Order Amount</th> <th>金额</th>
<th>Transport Fee</th> <th>手续费</th>
<!--<th>消费者名称</th>--> <!--<th>消费者名称</th>-->
<!--<th>消费者ID</th>--> <!--<th>消费者ID</th>-->
<th>Operation</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -76,7 +76,7 @@
<!--<td ng-bind="subOrder.buyer_name"></td>--> <!--<td ng-bind="subOrder.buyer_name"></td>-->
<!--<td ng-bind="subOrder.cert_id"></td>--> <!--<td ng-bind="subOrder.cert_id"></td>-->
<td> <td>
<a role="button" class="text-danger text-bold ng-scope" ng-click="removeSubOrders(subOrder)">remove</a> <a role="button" class="text-danger text-bold ng-scope" ng-click="removeSubOrders(subOrder)">移除</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -86,20 +86,20 @@
<div ng-if="custom.has_sub"> <div ng-if="custom.has_sub">
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="order_fee">Order Amount</label> <label class="control-label col-sm-4" for="order_fee">金额</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="subOrder.order_fee" id="order_fee" type="text"> <input class="form-control" ng-model="subOrder.order_fee" id="order_fee" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="transport_fee">Transport Fee</label> <label class="control-label col-sm-4" for="transport_fee">手续费</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="subOrder.transport_fee" id="transport_fee" type="text"> <input class="form-control" ng-model="subOrder.transport_fee" id="transport_fee" type="text">
</div> </div>
</div> </div>
<div class="form-group" style="text-align: right;margin-right: 17%;" ng-click="addSubOrders()"> <div class="form-group" style="text-align: right;margin-right: 17%;" ng-click="addSubOrders()">
<button class="btn btn-success" type="button"> add</button> <button class="btn btn-success" type="button"> 添加</button>
</div> </div>
</div> </div>
</form> </form>
@ -107,6 +107,6 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="submit()" ng-disabled="ctrl.sending">Submit</button> <button class="btn btn-success" type="button" ng-click="submit()" ng-disabled="ctrl.sending">提交</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button> <button class="btn btn-danger" type="button" ng-click="$dismiss()">取消</button>
</div> </div>

@ -1,5 +1,5 @@
<div class="modal-header"> <div class="modal-header">
<h4>Add Declare Custom</h4> <h4>报关详情</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
@ -7,28 +7,28 @@
<form class="form-horizontal" novalidate name="rate_form"> <form class="form-horizontal" novalidate name="rate_form">
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="custom">Customs</label> <label class="control-label col-sm-4" for="custom">海关</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.custom" id="custom" type="text"> <input class="form-control" ng-model="custom.custom" id="custom" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_no">Customs No</label> <label class="control-label col-sm-4" for="mch_custom_no">商户海关编号</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_no" id="mch_custom_no" type="text"> <input class="form-control" ng-model="custom.mch_custom_no" id="mch_custom_no" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_name">Merchant Custom Record Name</label> <label class="control-label col-sm-4" for="mch_custom_name">商户海关名称</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text"> <input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="has_sub">Split</label> <label class="control-label col-sm-4" for="has_sub">拆单</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input ng-model="custom.has_sub" id="has_sub" type="checkbox"> <input ng-model="custom.has_sub" id="has_sub" type="checkbox">
</div> </div>
@ -41,8 +41,8 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Order Amount</th> <th>金额</th>
<th>Transport Fee</th> <th>手续费</th>
<!--<th>消费者名称</th>--> <!--<th>消费者名称</th>-->
<!--<th>消费者ID</th>--> <!--<th>消费者ID</th>-->
</tr> </tr>

@ -1,8 +1,8 @@
package au.com.royalpay.payment.manage.process.custom; package au.com.royalpay.payment.manage.process.custom;
import au.com.royalpay.payment.channels.alipay.runtime.impls.AlipayCustomDeclaringTaskProcessor; import au.com.royalpay.payment.channels.alipay.runtime.impls.AlipayCustomDeclaringTaskProcessor;
import au.com.royalpay.payment.core.mappers.PmtCustomReportsDetailMapper; //import au.com.royalpay.payment.core.mappers.PmtCustomReportsDetailMapper;
import au.com.royalpay.payment.core.mappers.PmtCustomReportsMapper; //import au.com.royalpay.payment.core.mappers.PmtCustomReportsMapper;
import au.com.royalpay.payment.core.mappers.PmtOrderMapper; import au.com.royalpay.payment.core.mappers.PmtOrderMapper;
import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper; import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper;
import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper; import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper;
@ -27,28 +27,28 @@ import java.util.List;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class ManualReportCustom { public class ManualReportCustom {
@Autowired // @Autowired
private AlipayCustomDeclaringTaskProcessor processor; // private AlipayCustomDeclaringTaskProcessor processor;
@Resource // @Resource
private PmtCustomReportsMapper pmtCustomReportsMapper; // private PmtCustomReportsMapper pmtCustomReportsMapper;
@Resource // @Resource
private PmtOrderMapper pmtOrderMapper; // private PmtOrderMapper pmtOrderMapper;
@Resource // @Resource
private PmtCustomReportsDetailMapper pmtCustomReportsDetailMapper; // private PmtCustomReportsDetailMapper pmtCustomReportsDetailMapper;
//
@Test // @Test
public void test() { // public void test() {
String reportId = "05482201808142036430702208"; // String reportId = "05482201808142036430702208";
List<JSONObject> customs = pmtCustomReportsMapper.findReport(reportId); // List<JSONObject> customs = pmtCustomReportsMapper.findReport(reportId);
List<JSONObject> sub = pmtCustomReportsDetailMapper.listSubReports(reportId); // List<JSONObject> sub = pmtCustomReportsDetailMapper.listSubReports(reportId);
JSONObject order = pmtOrderMapper.find(reportId); // JSONObject order = pmtOrderMapper.find(reportId);
//
JSONObject task = new JSONObject(); // JSONObject task = new JSONObject();
task.put("channel", order.getString("channel")); // task.put("channel", order.getString("channel"));
task.put("merchant_id", order.getString("merchant_id")); // task.put("merchant_id", order.getString("merchant_id"));
task.put("sub_orders", sub); // task.put("sub_orders", sub);
task.put("report", customs.stream().filter(rep -> rep.getIntValue("report_status") == 2) // task.put("report", customs.stream().filter(rep -> rep.getIntValue("report_status") == 2)
.findFirst().orElseThrow(() -> new RuntimeException("No Failure Reports"))); // .findFirst().orElseThrow(() -> new RuntimeException("No Failure Reports")));
processor.process(task); // processor.process(task);
} // }
} }

Loading…
Cancel
Save