master
kira 6 years ago
parent 981459d0bb
commit 5fc1275493

@ -15,6 +15,7 @@ public class QueryCustomVo {
private String date;
private String channel;
private String report_status;
private int page = 1;
private int limit = 10;
@ -31,6 +32,9 @@ public class QueryCustomVo {
if (StringUtils.isNotEmpty(channel)) {
result.put("channel", channel);
}
if(StringUtils.isNotEmpty(report_status)){
result.put("report_status", report_status);
}
return result;
}
@ -66,4 +70,11 @@ public class QueryCustomVo {
this.channel = channel;
}
public String getReport_status() {
return report_status;
}
public void setReport_status(String report_status) {
this.report_status = report_status;
}
}

@ -18,4 +18,6 @@ public interface CustomService {
JSONObject query(JSONObject param, int page, int limit);
List<JSONObject> channelCustomConfigs(String channel);
}

@ -6,6 +6,7 @@ import au.com.royalpay.payment.core.beans.OrderStatus;
import au.com.royalpay.payment.manage.custom.core.CustomService;
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.payment.OrderMapper;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
@ -30,6 +31,8 @@ public class CustomServiceImpl implements CustomService {
private CustomReportsMapper customReportsMapper;
@Resource
private CustomReportDetailsMapper customReportDetailsMapper;
@Resource
private OrderMapper orderMapper;
@Override
public JSONObject findOneWithDetail(String report_id) {
@ -43,7 +46,7 @@ public class CustomServiceImpl implements CustomService {
CustomReport customReport = new CustomReport(orderId, mchCustomId, custom);
if (!CollectionUtils.isEmpty(subOrders)) {
subOrders.forEach(p -> {
customReport.addSubOrder(p.getBigDecimal("sub_order_fee"), p.getBigDecimal("sub_order_fee").subtract(p.getBigDecimal("transport_fee")));
customReport.addSubOrder(p.getBigDecimal("order_fee"), p.getBigDecimal("order_fee").subtract(p.getBigDecimal("transport_fee")));
});
}
JSONObject result = customSupport.saveCustom(customReport);
@ -69,4 +72,9 @@ public class CustomServiceImpl implements CustomService {
return PageListUtils.buildPageListResult(customReportsMapper.queryWithTrans(param, new PageBounds(page, limit)));
}
@Override
public List<JSONObject> channelCustomConfigs(String channel) {
return customSupport.channelCustomConfigs(channel);
}
}

@ -13,9 +13,12 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import javax.annotation.Resource;
@RestController
@ -42,4 +45,9 @@ public class CustomController {
public void add(@RequestBody AddCustomVO addCustomVO) {
customService.add(addCustomVO.getOrder_id(),addCustomVO.getMch_custom_no(),addCustomVO.getCustom(),addCustomVO.getSubOrders());
}
@RequestMapping(value = "/channelCustom",method = RequestMethod.GET)
public List<JSONObject> channelCustomConfigs(@RequestParam String channel) {
return customService.channelCustomConfigs(channel);
}
}

@ -18,6 +18,6 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
@AutoMapper(tablename = "pmt_custom_report_details", pkName = "sub_order_no")
public interface CustomReportDetailsMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findByReportId(@Param("report_id") String report_id);
List<JSONObject> findByReportId(@Param("report_id") String report_id);
}

@ -3,7 +3,9 @@
<mapper namespace="au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper">
<select id="queryWithTrans" resultType="com.alibaba.fastjson.JSONObject">
select o.order_id order_id, t.transaction_time transaction_time, t.transaction_amount transaction_amount,t.cny_amount cny_amount ,r.report_status report_status
select
o.order_id order_id, t.transaction_time transaction_time, t.transaction_amount transaction_amount,
t.cny_amount cny_amount ,r.report_status report_status,r.report_id report_id,o.channel channel
from
pmt_orders o
left join
@ -26,7 +28,11 @@
<if test="date!=null">
and DATE(t.transaction_time) = #{date}
</if>
<if test="report_status!=null">
and r.report_status = #{report_status}
</if>
</where>
order by transaction_time desc
</select>
</mapper>

@ -11,14 +11,16 @@
app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) {
$scope.pagination = {};
$scope.customOrders = {};
$scope.params = {channel:'ALL'};
$scope.params = {channel:'ALL',report_status:'ALL'};
$scope.loadList = function () {
var params = angular.copy($scope.params);
if (params.channel =='ALL'){
delete params.channel;
}
if (params.report_status =='ALL'){
delete params.report_status;
}
params.page = $scope.pagination.page || 1;
console.log(params);
$http.get('/custom/query',{params: params}).then(function (resp) {
$scope.customOrders = resp.data.data;
$scope.pagination = resp.data.pagination;
@ -26,24 +28,62 @@
};
$scope.loadList(1);
$scope.add = function (order_id) {
$scope.add = function (order) {
$uibModal.open({
templateUrl: '/static/payment/custom/templates/custom_add.html',
controller: 'customAddCtrl',
size: 'lg',
resolve: {
order_id: function () {
return order_id;
}
return order.order_id;
},
channelCustom:['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/custom/channelCustom?channel='+order.channel);
}]
}
})
};
$scope.edit = function (order) {
$uibModal.open({
templateUrl: '/static/payment/custom/templates/custom_add.html',
controller: 'customEditCtrl',
size: 'lg',
resolve: {
customOrder: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/custom/'+order.report_id);
}],
order_id: function () {
return order.order_id;
},
channelCustom:['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/custom/channelCustom?channel='+order.channel);
}]
}
})
}
$scope.detail = function (order) {
$uibModal.open({
templateUrl: '/static/payment/custom/templates/custom_detail.html',
controller: 'customDetailCtrl',
size: 'lg',
resolve: {
customOrder: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/custom/'+order.report_id);
}]
}
})
}
}]);
app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id', function ($scope, $http,commonDialog,order_id) {
$scope.custom = {has_sub:false,order_id:order_id};
app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id','channelCustom', function ($scope, $http,commonDialog,order_id,channelCustom) {
$scope.custom = {has_sub:false,order_id:order_id,isSubmit:true};
$scope.subOrders = new Array();
$scope.subOrder = {};
$scope.channelCustom = channelCustom.data;
$scope.addSubOrders = function () {
var subOrder = angular.copy($scope.subOrder);
subOrder.idNum = $scope.subOrders.length+1;
@ -73,15 +113,69 @@
}
}
}]);
app.controller('customEditCtrl', ['$scope', '$http','commonDialog','order_id','customOrder','channelCustom', function ($scope, $http,commonDialog,order_id,customOrder,channelCustom) {
$scope.custom =customOrder.data;
$scope.custom.has_sub = false;
$scope.custom.order_id = order_id;
$scope.custom.isSubmit = false;
$scope.subOrders = customOrder.data.sub_orders;
$scope.subOrder = {};
$scope.channelCustom = channelCustom.data;
if($scope.subOrders.length>0) {
for (var i = 0; i < $scope.subOrders.length; i++) {
var idNum = i;
$scope.subOrders[i].idNum = idNum;
}
$scope.custom.has_sub = true;
}else{
$scope.custom.has_sub = false;
}
$scope.addSubOrders = function () {
var subOrder = angular.copy($scope.subOrder);
subOrder.idNum = $scope.subOrders.length+1;
$scope.subOrders.push(subOrder);
};
}]);
$scope.submit=function () {
if($scope.custom.custom==''){
alert('请输入海关名称');
}
if($scope.custom.mchCustomId==''){
alert('请输入备案号');
}
$scope.custom.subOrders = $scope.subOrders;
var param = angular.copy($scope.custom);
$http.post('/custom', param).then(function (resp) {
$scope.$close();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
$scope.removeSubOrders = function (order) {
for(var i= 0 ;i<$scope.subOrders.length;i++){
if($scope.subOrders[i].idNum == order.idNum){
$scope.subOrders.splice(i,1);
return;
}
}
}
app.controller('customDetailCtrl', ['$scope', '$http','commonDialog', function ($scope, $http,commonDialog) {
$scope.subOrders = {};
}]);
app.controller('customDetailCtrl', ['$scope', '$http','commonDialog','customOrder', function ($scope, $http,commonDialog,customOrder) {
$scope.custom = customOrder.data;
if(customOrder.data.sub_orders.length>0){
$scope.custom.has_sub = true;
$scope.subOrders = $scope.custom.sub_orders;
}else {
$scope.custom.has_sub = false;
}
}]);

@ -34,6 +34,23 @@
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-3">Report Status</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> |
<a role="button" ng-class="{'bg-primary':params.report_status=='0'}"
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()">提交</a> |
<a role="button" ng-class="{'bg-primary':params.report_status=='2'}"
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()">提交成功</a> |
</p>
</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">
@ -74,8 +91,16 @@
<th ng-bind="order.cny_amount"></th>
<th ng-bind="order.report_status|reportStatus"></th>
<td>
<a class="text-primary" role="button" title="Detail"
ng-click="add(order.order_id)">
<a ng-if="order.report_status==null" class="text-primary" role="button" title="Edit"
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"
ng-click="detail(order)">
<i class="fa fa-search"></i>
</a>
</td>

@ -1,5 +1,6 @@
<div class="modal-header">
<h4>Add Declare Custom</h4>
<h4 ng-if="custom.isSubmit">Submit Declare Custom</h4>
<h4 ng-if="!custom.isSubmit">Edit Declare Custom</h4>
</div>
<div class="modal-body">
<div class="row">
@ -7,9 +8,13 @@
<form class="form-horizontal" novalidate name="rate_form">
<div class="form-group">
<label class="control-label col-sm-4" for="custom">海关</label>
<label class="control-label col-sm-4">海关</label>
<div class="col-sm-6">
<input class="form-control" ng-model="custom.custom" id="custom" type="text">
<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>
</select>
</div>
</div>
@ -28,35 +33,39 @@
</div>
<div class="form-group" ng-if="custom.has_sub">
<div class="col-sm-1"></div>
<div class="col-sm-10">
<table class="table table-striped">
<thead>
<tr>
<th>海关金额</th>
<th>运费金额</th>
<th>消费者名称</th>
<th>消费者ID</th>
<!--<th>消费者名称</th>-->
<!--<th>消费者ID</th>-->
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subOrder in subOrders">
<td ng-bind="subOrder.sub_order_fee | currency:'AUD '"></td>
<td ng-bind="subOrder.order_fee"></td>
<td ng-bind="subOrder.transport_fee"></td>
<td ng-bind="subOrder.buyer_name"></td>
<td ng-bind="subOrder.cert_id"></td>
<!--<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>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div ng-if="custom.has_sub">
<div class="form-group">
<label class="control-label col-sm-4" for="sub_order_fee">订单金额</label>
<label class="control-label col-sm-4" for="order_fee">订单金额</label>
<div class="col-sm-6">
<input class="form-control" ng-model="subOrder.sub_order_fee" id="sub_order_fee" type="text">
<input class="form-control" ng-model="subOrder.order_fee" id="order_fee" type="text">
</div>
</div>

@ -1,6 +1,5 @@
<div class="modal-header">
<h4 ng-if="isAdd">Add Declare Custom</h4>
<h4 ng-if="!isAdd">Custom Order Detail</h4>
<h4>Add Declare Custom</h4>
</div>
<div class="modal-body">
<div class="row">
@ -15,9 +14,9 @@
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="mchCustomId">备案号</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.mchCustomId" id="mchCustomId" type="text">
<input class="form-control" ng-model="custom.mch_custom_no" id="mch_custom_no" type="text">
</div>
</div>
@ -29,55 +28,30 @@
</div>
<div class="form-group" ng-if="custom.has_sub">
<div class="col-sm-1"></div>
<div class="col-sm-10">
<table class="table table-striped">
<thead>
<tr>
<th>海关金额</th>
<th>运费金额</th>
<th>消费者名称</th>
<th>消费者ID</th>
<th>操作</th>
<!--<th>消费者名称</th>-->
<!--<th>消费者ID</th>-->
</tr>
</thead>
<tbody>
<tr ng-repeat="subOrder in subOrders">
<td ng-bind="subOrder.subOrderFee | currency:'AUD '"></td>
<td ng-bind="subOrder.transportFee"></td>
<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>
</td>
<td ng-bind="subOrder.order_fee"></td>
<td ng-bind="subOrder.transport_fee"></td>
<!--<td ng-bind="subOrder.buyer_name"></td>-->
<!--<td ng-bind="subOrder.cert_id"></td>-->
</tr>
</tbody>
</table>
</div>
<div ng-if="custom.has_sub">
<div class="form-group">
<label class="control-label col-sm-4" for="subOrderFee">订单金额</label>
<div class="col-sm-6">
<input class="form-control" ng-model="subOrder.subOrderFee" id="subOrderFee" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="transportFee">运费金额</label>
<div class="col-sm-6">
<input class="form-control" ng-model="subOrder.transportFee" id="transportFee" type="text">
</div>
</div>
<div class="form-group" ng-click="addSubOrders()">
add
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="saveRate(rate_form)" ng-disabled="ctrl.sending">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>
Loading…
Cancel
Save