alipay aps 订单取消

master
dalong306 4 years ago
parent 63aff73d57
commit bca008196e

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.cancelorder.service.CancelOrderService;
import au.com.royalpay.payment.core.cancelorder.service.impl.CancelOrderServiceImpl;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
@ -63,6 +65,9 @@ public class PartnerViewController {
@Resource
private KycService kycService;
@Resource
private CancelOrderService cancelOrderService;
@RequestMapping(method = RequestMethod.GET)
@RequirePartner
@ResponseBody
@ -676,4 +681,10 @@ public class PartnerViewController {
public void updateApsKycClient(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject item) {
clientManager.updateApsKycClient(account, item);
}
@PartnerMapping(value = "/cancel_order", method = RequestMethod.POST)
@ResponseBody
public JSONObject cancel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject order, Errors errors) {
System.out.println("=====>cancel_order");
return cancelOrderService.cancelOrderOrNot(order.getString("orderId"));
}
}

@ -181,6 +181,9 @@ public class TradeLogServiceImpl implements TradeLogService {
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
PageList<JSONObject> logs = orderMapper.listOrdersByClients(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
logs.stream().forEach(log->{
log.put("is_today",DateUtils.isSameDay(Optional.ofNullable(log.getDate("transaction_time")).orElse(new Date()),new Date())) ;
});
if (timezone != null) {
TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time");
}

@ -104,7 +104,8 @@
p.short_name partner_name,
format(o.refund_amount * 100, 0) refund_fee,
t.clearing_status,
t.settle_amount
t.settle_amount,
t.transaction_time
</sql>
<update id="updateRefundAmount">

@ -780,6 +780,12 @@
title="Refund">
<i class="fa fa-undo"></i>
</a>
<a role="button"
ng-if="trade.is_today&&(trade.channel=='ApsInStore'||trade.channel=='ApsCashier') && trade.status==5 && trade.confirm_time!=null && trade.clearing_status<2 && trade.client_id==currentUser.client_id && currentUser.client.enable_refund"
class="text-bold text-danger" ng-click="cancelOrder(trade.order_id)"
title="Cancel">
<i class="fa fa-close"></i>
</a>
</td>
</tr>
</tbody>

@ -110,6 +110,29 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
//取消订单
$scope.cancelOrder = function (orderId) {
commonDialog
.confirm({
title: 'Cancel order',
content: 'Are you sure you want to cancel this order?',
})
.then(function () {
$http.post('/client/partner_info/cancel_order',{orderId: orderId}).then(
function (resp) {
commonDialog.alert({
title: "Success",
content: "Cancel successfully",
type: "success",
})
$scope.loadTradeLogs()
},
function (resp) {
commonDialog.alert({ title: 'Error!', content: resp.data.message, type: 'error' })
}
)
})
}
/*$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
@ -445,6 +468,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.loadTradeLogs();
});
};
$scope.releasePreAuth = function (orderId) {
commonDialog.confirm({
title: 'Pre Authorization Completion',

Loading…
Cancel
Save