diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java index 1ace7eb97..e7b38ef44 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java @@ -75,17 +75,14 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish @Override public JSONObject checkOrderRefundAmount(String orderId, JSONObject account) { JSONObject order = orderMapper.getOrderDetail(orderId); - if (account != null) { + if (account != null && (account.getIntValue("client_id") != order.getIntValue("client_id"))) { JSONObject client = clientMapper.findClient(account.getIntValue("client_id")); ////父商户全局管理子商户时候,跳过 - if (account.getIntValue("client_id") != order.getIntValue("client_id")) { - JSONObject clientOrder = clientMapper.findClient(order.getIntValue("client_id")); - if(!(client.getBoolean("sub_manage") && - clientOrder.containsKey("parent_client_id")?clientOrder.getIntValue("parent_client_id")==client.getIntValue("client_id"):false)){ - throw new ForbiddenException("Order is not belong to your shop/merchant"); - } - - + JSONObject orderTargetClient = clientMapper.findClient(order.getIntValue("client_id")); + if (orderTargetClient.getIntValue("parent_client_id") != account.getIntValue("client_id")) { + throw new ForbiddenException("Order is not belong to your shop/merchant"); + } else if (!client.getBooleanValue("sub_manage")) { + throw new ForbiddenException("Order is not belong to your shop/merchant"); } } Assert.notNull(order, "Order Not Exists");