Merge branch 'master' into production

master
Yixian 3 years ago
commit d0835cb3c4

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.3.5</version> <version>2.3.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.4.8</version> <version>2.4.9</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -399,10 +399,10 @@ public class XPlanFundProcessorImpl implements XPlanFundProcesor {
private JSONObject getClient(String clientMoniker) { private JSONObject getClient(String clientMoniker) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
return client; return client;
} }

@ -322,6 +322,8 @@ public interface ClientManager {
void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund); void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund);
void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet);
void changeGatewayVersion(JSONObject account, boolean enableV2); void changeGatewayVersion(JSONObject account, boolean enableV2);
void changeVerifyIp(JSONObject account, boolean enableV2); void changeVerifyIp(JSONObject account, boolean enableV2);

@ -32,9 +32,7 @@ import au.com.royalpay.payment.core.beans.MerchantApplicationResult;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
import au.com.royalpay.payment.core.mappers.MchChannelContractDAO; import au.com.royalpay.payment.core.mappers.*;
import au.com.royalpay.payment.core.mappers.MchChannelContractMapper;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -338,6 +336,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private MchChannelContractMapper mchChannelContractMapper; private MchChannelContractMapper mchChannelContractMapper;
@Resource
public AlipayApsOverseasConfigMapper overseaSwitchConfigMapper;
@Resource @Resource
private SmsSender smsSender; private SmsSender smsSender;
private static final String SOURCE_AGREE_FILE = "source_agree_file"; private static final String SOURCE_AGREE_FILE = "source_agree_file";
@ -602,6 +603,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("aps_config_id", apsConfig.getId()); client.put("aps_config_id", apsConfig.getId());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch()); client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
} }
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getInteger("client_id"));
if(overseaSwitch==null||overseaSwitch){
client.put("oversea_wallet_switch", true);
}else{
client.put("oversea_wallet_switch", false);
}
return client; return client;
} }
@ -4973,6 +4980,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
/**
* aps
* @param manager
* @param clientMoniker
* @param enableOverseaWallet
*/
@Override
public void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getIntValue("client_id"));
logger.info("======>overseaSwitch:{}",overseaSwitch);
if(overseaSwitch==null){
ApsOverseasConfigData data = ApsOverseasConfigData.saveData(manager.getString("manager_id"),client.getString("client_id"),enableOverseaWallet);
logger.info("=======>data:OverseasSwitch:{}",data.getOverseasSwitch());
overseaSwitchConfigMapper.save(data);
}else{
JSONObject config=new JSONObject();
config.put("clientId", client.getString("client_id"));
config.put("modifier", manager.getString("manager_id"));
config.put("overseas_switch", enableOverseaWallet);
overseaSwitchConfigMapper.updateApsOverseasConfigByClientId(config);
}
}
@Override @Override
public void changePaymentPage(JSONObject account, String paypadVersion) { public void changePaymentPage(JSONObject account, String paypadVersion) {
int clientId = account.getIntValue("client_id"); int clientId = account.getIntValue("client_id");

@ -343,6 +343,10 @@ public class PartnerManageController {
public void switchChildEachRefund(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchChildEachRefund(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchChildEachRefund(manager, clientMoniker, pass.getBooleanValue("allow")); clientManager.switchChildEachRefund(manager, clientMoniker, pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/switch_oversea_wallet", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void switchOverseaWallet(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchOverseaWallet(manager, clientMoniker, pass.getBooleanValue("allow"));
}
@ManagerMapping(value = "/{clientMoniker}/channels/{channel}/permission", method = RequestMethod.PUT, role = {ManagerRole.SERVANT, ManagerRole.DEVELOPER}) @ManagerMapping(value = "/{clientMoniker}/channels/{channel}/permission", method = RequestMethod.PUT, role = {ManagerRole.SERVANT, ManagerRole.DEVELOPER})
public void switchChannelPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchChannelPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {

@ -4,6 +4,7 @@ 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.cancelorder.service.impl.CancelOrderServiceImpl;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.kyc.core.KycService; import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
@ -11,6 +12,7 @@ import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner; import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
@ -25,12 +27,14 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.util.Assert;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -68,6 +72,9 @@ public class PartnerViewController {
@Resource @Resource
private CancelOrderService cancelOrderService; private CancelOrderService cancelOrderService;
@Resource
private OrderMapper orderMapper;
@RequestMapping(method = RequestMethod.GET) @RequestMapping(method = RequestMethod.GET)
@RequirePartner @RequirePartner
@ResponseBody @ResponseBody
@ -683,8 +690,20 @@ public class PartnerViewController {
} }
@PartnerMapping(value = "/cancel_order", method = RequestMethod.POST) @PartnerMapping(value = "/cancel_order", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT})
@RequirePartner
public JSONObject cancel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject order, Errors errors) { public JSONObject cancel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject order, Errors errors) {
System.out.println("=====>cancel_order"); System.out.println("=====>cancel_order");
return cancelOrderService.cancelOrderOrNot(order.getString("orderId")); order = orderMapper.getOrderDetail(order.getString("orderId"));
Assert.notNull(order, "Order Not Exists!");
int clientId = order.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(clientId);
int accountClientId = account.getIntValue("client_id");
Assert.isTrue(accountClientId == client.getIntValue("client_id") || accountClientId == client.getIntValue("parent_client_id")
|| clientManager.listLevel3Client(accountClientId).contains(client.getIntValue("parent_client_id")),
"This order is not belong to current merchant");
//暂时未给运营端使用,仅商户端使用
return cancelOrderService.cancelOrderOrNot(order.getString("order_id"));
} }
} }

@ -25,6 +25,8 @@ public interface RefundService {
boolean reviewNewRefundOrder(String orderId, BigDecimal fee, String remark, JSONObject account, JSONObject manager); boolean reviewNewRefundOrder(String orderId, BigDecimal fee, String remark, JSONObject account, JSONObject manager);
JSONObject cancelOrder(JSONObject partnerAccount, String orderId);
JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager); JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager);
@Transactional @Transactional

@ -181,6 +181,11 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
} }
} }
@Override
public JSONObject cancelOrder(JSONObject partnerAccount, String orderId) {
return null;
}
@Override @Override
public JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager) { public JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager) {
JSONObject order = orderMapper.getOrderDetail(orderId); JSONObject order = orderMapper.getOrderDetail(orderId);

@ -2810,6 +2810,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
) )
} }
$scope.toggleOverseaWallet = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/switch_oversea_wallet', {allow: $scope.paymentInfo.oversea_wallet_switch}).then(
function () {
$scope.loadPartnerPaymentInfo()
},
function (resp) {
commonDialog.alert({
title: 'failed to switch oversea wallet',
content: resp.data.message,
type: 'error',
})
}
)
}
$scope.switchInternationalCard = function () { $scope.switchInternationalCard = function () {
if (!$scope.paymentInfo) { if (!$scope.paymentInfo) {

@ -570,6 +570,21 @@
</div> </div>
</div> </div>
<!--Alipayplus(aps)是否支持海外钱包-->
<div class="panel panel-default" ng-if="(('111'|withRole)) && paymentInfo.aps_config_id">
<div class="panel-heading">AlipayPlus(aps) oversea wallet Configuration</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Enable oversea wallet</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.oversea_wallet_switch" bs-switch
switch-change="toggleOverseaWallet()">
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-if="('111'|withRole) || ('retail_surcharge'|withFunc)"> <div class="panel panel-default" ng-if="('111'|withRole) || ('retail_surcharge'|withFunc)">
<div class="panel-heading">Retail In Store Payment(App, WePayLite, Albert)</div> <div class="panel-heading">Retail In Store Payment(App, WePayLite, Albert)</div>
<div class="panel-body"> <div class="panel-body">

@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
controller: 'partnerSettlementLogCtrl' controller: 'partnerSettlementLogCtrl'
}) })
}]); }]);
app.controller('partnerSettlementLogCtrl', ['$scope', 'clearingDetailService', '$http', '$filter', '$sce', function ($scope, clearingDetailService, $http, $filter, $sce) { app.controller('partnerSettlementLogCtrl', ['$scope', 'clearingDetailService', '$http', '$filter', '$sce', 'commonDialog', function ($scope, clearingDetailService, $http, $filter, $sce, commonDialog) {
$scope.params = {}; $scope.params = {};
$scope.pagination = {}; $scope.pagination = {};
$scope.htmlTooltip = $sce.trustAsHtml('<div style="text-align: left;width:350px">' + $scope.htmlTooltip = $sce.trustAsHtml('<div style="text-align: left;width:350px">' +
@ -89,6 +89,11 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}; };
$scope.loadSettlementLogs = function (page) { $scope.loadSettlementLogs = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
var day = (params.dateto - params.datefrom) / 86400000
if (day > 365) {
commonDialog.alert({title: 'Error', content: '时间范围不超过一年', type: 'error'})
return
}
if (params.datefrom) { if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
} }

@ -779,7 +779,7 @@
<i class="fa fa-undo"></i> <i class="fa fa-undo"></i>
</a> </a>
<a role="button" <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" ng-if="trade.is_today&&(trade.channel=='ApsInStore'||trade.channel=='ApsCashier') && trade.status==5 && trade.confirm_time!=null && trade.clearing_status<2 && currentUser.client.enable_refund"
class="text-bold text-danger" ng-click="cancelOrder(trade.order_id)" class="text-bold text-danger" ng-click="cancelOrder(trade.order_id)"
title="Cancel"> title="Cancel">
<i class="fa fa-close"></i> <i class="fa fa-close"></i>

@ -473,7 +473,7 @@ $(function () {
} }
function callAlipayAps(order) { function callAlipayAps(order) {
if(order.jsapi){ if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url] let try_sequence = [order.jsapi.normal_url,order.jsapi.scheme_url, order.jsapi.applink_url]
try_sequence = try_sequence.filter(v => v != null) try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => { callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success') alert('redirect success')

@ -517,7 +517,7 @@ $(function () {
} }
function callAlipayAps(order) { function callAlipayAps(order) {
if(order.jsapi){ if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url] let try_sequence = [order.jsapi.normal_url,order.jsapi.scheme_url, order.jsapi.applink_url]
try_sequence = try_sequence.filter(v => v != null) try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => { callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success') alert('redirect success')

@ -457,6 +457,8 @@ $(function () {
let timer, start = new Date().getTime() let timer, start = new Date().getTime()
let promise = new Promise(((resolve, reject) => { let promise = new Promise(((resolve, reject) => {
location.href = scheme_seq[index] location.href = scheme_seq[index]
// alert("====>scheme_seq[index]:"+scheme_seq[index]);
window.addEventListener('visibilitychange', () => { window.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') { if (document.visibilityState === 'hidden') {
clearTimeout(timer); clearTimeout(timer);
@ -481,7 +483,7 @@ $(function () {
} }
function callAlipayAps(order) { function callAlipayAps(order) {
if(order.jsapi){ if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url] let try_sequence = [order.jsapi.normal_url,order.jsapi.scheme_url, order.jsapi.applink_url]
try_sequence = try_sequence.filter(v => v != null) try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => { callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success') alert('redirect success')

Loading…
Cancel
Save