Merge branch 'develop'

master
james.zhao 6 years ago
commit f7560131a4

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

@ -17,6 +17,9 @@
/**
* @apiDefine JSON JSON字段
*/
/**
* @apiDefine SUB_JSON JSON子字段
*/
/**
* @apiDefine ERROR_CODE 错误码
*/
@ -874,6 +877,75 @@
* @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() {
}

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

@ -17,6 +17,9 @@
/**
* @apiDefine JSON JSON keys
*/
/**
* @apiDefine SUB_JSON JSON child keys
*/
/**
* @apiDefine ERROR_CODE Error Code
*/
@ -891,6 +894,75 @@
* @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() {
}

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

@ -19,7 +19,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
@ -55,7 +57,7 @@ public class CustomServiceImpl implements CustomService {
if (report != null) {
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());
customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_custom_name());
if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) {
@ -83,7 +85,11 @@ public class CustomServiceImpl implements CustomService {
@Override
public JSONObject query(JSONObject param, int page, int limit) {
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);
if (!StringUtils.isEmpty(param.getString("channel"))) {
channels.clear();

@ -15,7 +15,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
/**
* 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 {
@AutoSql(type = SqlType.SELECT)
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.
*/
@AutoMapper(tablename = "pmt_custom_reports", pkName = "report_id")
@AutoMapper(tablename = "pmt_custom_report", pkName = "report_id")
public interface CustomReportsMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findOne(@Param("report_id") String report_id);

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

@ -11,7 +11,41 @@
app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) {
$scope.pagination = {};
$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 () {
var params = angular.copy($scope.params);
if (params.channel =='ALL'){
@ -20,6 +54,16 @@
if (params.report_status =='ALL'){
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;
$http.get('/custom/query',{params: params}).then(function (resp) {
$scope.customOrders = resp.data.data;
@ -109,13 +153,25 @@
}
$scope.custom.subOrders = $scope.subOrders;
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();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
$scope.$close();
})
}
}
$scope.removeSubOrders = function (order) {
for(var i= 0 ;i<$scope.subOrders.length;i++){
if($scope.subOrders[i].idNum == order.idNum){
@ -195,13 +251,13 @@
return function (status) {
switch (status + '') {
case '0':
return 'Saved';
return '暂存';
case '1':
return 'Submitted';
return '已提交';
case '2':
return 'Failed';
return '失败';
case '3':
return 'Success';
return '成功';
}
}
});

@ -5,12 +5,12 @@
</style>
<div ui-view>
<section class="content-header">
<h1>Custom</h1>
<h1>海关</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Custom
<i class="fa fa-sitemap"></i> 海关
</li>
<li class="active">Report Custom </li>
<li class="active">海关申报</li>
</ol>
</section>
@ -35,52 +35,114 @@
</div>
</div>-->
<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">
<p class="form-control-static">
<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'}"
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'}"
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'}"
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'}"
ng-click="params.report_status='3';loadList()">Success</a> |
ng-click="params.report_status='3';loadList()">成功</a> |
</p>
</div>
</div>
<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">
<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>
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="params.channel='ALL';loadList(1)">全部</a> |
<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>
<button class="btn btn-primary" type="button" ng-click="loadList(1)"><i
class="fa fa-search"></i></button>
</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 class="box">
<div class="box-header">
<h3 class="box-title">
Custom Order List
<h3 class="box-title" style="display: inherit">
报关订单列表
<a style="float: right;padding-right: 40px" href="https://mpay.royalpay.com.au/docs/en/#api-CustomsDeclare-declare_report">商户报关API</a>
</h3>
</div>
<div class="box-body table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Order Id</th>
<th>Time</th>
<th>Order Amount</th>
<th>CNY Amount</th>
<th>Report Status</th>
<th>Operation</th>
<th>订单号</th>
<th>时间</th>
<th>金额</th>
<th>金额CNY</th>
<th>报关状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@ -116,20 +178,20 @@
<th ng-bind="order.cny_amount"></th>
<th ng-bind="order.report_status|reportStatus"></th>
<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)">
Submit
提交
</a>
<!--<a class="text-primary" role="button" title="Edit"-->
<!--ng-click="edit(order)">-->
<!--Edit-->
<!--</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)">
<i class="fa fa-search"></i>
</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)">
<i class="fa fa-refresh"></i>
</a>
@ -153,8 +215,7 @@
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
Pages:{{pagination.totalPages}}
<div class="col-xs-12">总单数:{{pagination.totalCount}};总页数:{{pagination.totalPages}}
</div>
</div>
</div>

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

@ -1,5 +1,5 @@
<div class="modal-header">
<h4>Add Declare Custom</h4>
<h4>报关详情</h4>
</div>
<div class="modal-body">
<div class="row">
@ -7,28 +7,28 @@
<form class="form-horizontal" novalidate name="rate_form">
<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">
<input class="form-control" ng-model="custom.custom" id="custom" type="text">
</div>
</div>
<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">
<input class="form-control" ng-model="custom.mch_custom_no" id="mch_custom_no" type="text">
</div>
</div>
<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">
<input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text">
</div>
</div>
<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">
<input ng-model="custom.has_sub" id="has_sub" type="checkbox">
</div>
@ -41,8 +41,8 @@
<table class="table table-striped">
<thead>
<tr>
<th>Order Amount</th>
<th>Transport Fee</th>
<th>金额</th>
<th>手续费</th>
<!--<th>消费者名称</th>-->
<!--<th>消费者ID</th>-->
</tr>

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

Loading…
Cancel
Save