wangning 7 years ago
parent 0567dc9b0a
commit c0fc073271

@ -9,4 +9,6 @@ public interface ClientConfigService {
void update(JSONObject record,JSONObject account);
JSONObject find(int client_id);
}

@ -14,4 +14,9 @@ public class ClientConfigServiceImpl implements ClientConfigService {
public void update(JSONObject record, JSONObject account) {
}
@Override
public JSONObject find(int client_id) {
return clientConfigMapper.find(client_id);
}
}

@ -148,7 +148,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientMapper clientMapper;
@Resource
private ClientConfigMapper clientConfigMapper;
private ClientConfigServiceImpl clientConfigService;
@Resource
private ClientDeviceMapper clientDeviceMapper;
@Resource
@ -2253,12 +2253,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
record.put("client_id",client.getIntValue("client_id"));
record.put("refund_pwd", pwdHash);
record.put("refund_pwd_salt", salt);
clientConfigMapper.update(record);
clientConfigService.update(record);
}
@Override
public void validRefundPwd(JSONObject account, String pwd) {
JSONObject clientConfig = clientConfigMapper.find(account.getIntValue("client_id"));
JSONObject clientConfig = clientConfigService.find(account.getIntValue("client_id"));
String salt = clientConfig.getString("refund_pwd_salt");
String pwdHash = PasswordUtils.hashPwd(pwd, salt);
if (!clientConfig.getString("refund_pwd").equals(pwdHash)) {
@ -2271,7 +2271,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject record = new JSONObject();
record.put("client_id", clientId);
record.put("weekend_delay", delay);
clientConfigMapper.update(record);
clientConfigService.update(record);
}
@Override
@ -2664,7 +2664,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("paypad_version", paypad_version);
clientConfigMapper.update(updateObj);
clientConfigService.update(updateObj);
}
@Override
@ -2677,7 +2677,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject record = new JSONObject();
record.put("client_id", client_id);
record.put("manual_settle", manual_settle);
clientConfigMapper.update(record);
clientConfigService.update(record);
JSONObject actClientLog = new JSONObject();
actClientLog.put("client_id", client_id);
@ -2699,7 +2699,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("qrcode_surcharge", paySurcharge);
clientConfigMapper.update(updateObj);
clientConfigService.update(updateObj);
}
@Override
@ -2712,7 +2712,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("api_surcharge", enableApiSurcharge);
clientConfigMapper.update(updateObj);
clientConfigService.update(updateObj);
}
@Override
@ -2729,7 +2729,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject updateObj = new JSONObject();
updateObj.put("client_id", client.getIntValue("client_id"));
updateObj.put("retail_surcharge", paySurcharge);
clientConfigMapper.update(updateObj);
clientConfigService.update(updateObj);
}
@Override

@ -11,6 +11,7 @@ import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundReviewMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.tradelog.refund.RefundService;
import au.com.royalpay.payment.manage.tradelog.refund.events.NewRefundReviewEvent;
@ -22,22 +23,24 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
/**
* Created by yixian on 2016-07-04.
*/
@ -62,6 +65,8 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
private SysConfigMapper sysConfigMapper;
@Resource
private CouponAccuessLogMapper couponAccuessLogMapper;
@Resource
private ClientConfigService clientConfigService;
@Resource
private PaymentApi paymentApi;
@ -141,8 +146,9 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
//增加角色审核
JSONObject client = clientManager.getClientInfo(clientId);
Assert.notNull(client, "client not exists");
JSONObject clientConfig = clientConfigService.find(clientId);
OperatorType type = account != null ? OperatorType.PARTNER : OperatorType.MANAGER;
boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER && client.getBooleanValue("enable_refund_auth");
boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER && clientConfig.getBooleanValue("enable_refund_auth");
logger.debug("applyer type=" + type + "; require audit=" + requireAudit);
paymentApi.clientRefundBalanceCheck(clientId, orderId, currency, feeAmount);
@ -200,6 +206,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
private JSONObject executeRefund(String orderId, BigDecimal amount, String remark, JSONObject partnerAccount, JSONObject manager, JSONObject order, JSONObject client) {
checkOrderUseCustomerCoupon(order, amount);
JSONObject clientConfig = clientConfigService.find(client.getIntValue("client_id"));
OperatorType type = partnerAccount != null ? OperatorType.PARTNER : OperatorType.MANAGER;
JSONObject operator = new JSONObject();
if (type == OperatorType.PARTNER) {
@ -213,7 +220,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
operator.put("operator_id", manager.getIntValue("manager_id"));
operator.put("operator", manager.getString("display_name"));
}
boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(partnerAccount.getIntValue("role")) == PartnerRole.CASHIER && client.getBooleanValue("enable_refund_auth");
boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(partnerAccount.getIntValue("role")) == PartnerRole.CASHIER && clientConfig.getBooleanValue("enable_refund_auth");
logger.debug("applyer type=" + type + "; require audit=" + requireAudit);
return paymentApi.refundOrder(orderId, null, amount, remark, operator, type, requireAudit);
}

Loading…
Cancel
Save