Merge branch 'master' into production

master
Yixian 3 years ago
commit d0835cb3c4

@ -5,11 +5,11 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>2.3.5</version>
<version>2.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>2.4.8</version>
<version>2.4.9</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
if (client == null) {
throw new InvalidShortIdException();
}
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
return client;
}

@ -322,6 +322,8 @@ public interface ClientManager {
void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund);
void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet);
void changeGatewayVersion(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.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
import au.com.royalpay.payment.core.mappers.MchChannelContractDAO;
import au.com.royalpay.payment.core.mappers.MchChannelContractMapper;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.core.mappers.*;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -338,6 +336,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private MchChannelContractMapper mchChannelContractMapper;
@Resource
public AlipayApsOverseasConfigMapper overseaSwitchConfigMapper;
@Resource
private SmsSender smsSender;
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("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;
}
@ -4973,6 +4980,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
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
public void changePaymentPage(JSONObject account, String paypadVersion) {
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) {
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})
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.exceptions.ParamInvalidException;
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.merchants.beans.ClientAuthFilesInfo;
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.ClientSignEventSupport;
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.pos.datasource.ReadOnlyConnection;
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.http.HttpUtils;
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.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.Assert;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -68,6 +72,9 @@ public class PartnerViewController {
@Resource
private CancelOrderService cancelOrderService;
@Resource
private OrderMapper orderMapper;
@RequestMapping(method = RequestMethod.GET)
@RequirePartner
@ResponseBody
@ -683,8 +690,20 @@ public class PartnerViewController {
}
@PartnerMapping(value = "/cancel_order", method = RequestMethod.POST)
@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) {
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);
JSONObject cancelOrder(JSONObject partnerAccount, String orderId);
JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager);
@Transactional

@ -181,6 +181,11 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
}
}
@Override
public JSONObject cancelOrder(JSONObject partnerAccount, String orderId) {
return null;
}
@Override
public JSONObject newRefundOrder(String orderId, BigDecimal fee, boolean original, String remark, JSONObject partnerAccount, JSONObject manager) {
JSONObject order = orderMapper.getOrderDetail(orderId);
@ -230,7 +235,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
}
boolean requireAudit = type == OperatorType.PARTNER && PartnerRole.getRole(partnerAccount.getIntValue("role")) == PartnerRole.CASHIER
&& clientConfig.getBooleanValue("enable_refund_auth");
logger.debug("applyer type={}; require audit={}",type, requireAudit);
logger.debug("applyer type={}; require audit={}", type, requireAudit);
return paymentApi.refundOrder(null, orderId, null, amount, remark, operator, type, requireAudit);
}
@ -440,7 +445,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
@Override
public JSONObject listUnionAllApply(JSONObject params, PageBounds pagination) {
if(params.get("client_id")==null && params.get("client_ids")==null){
if (params.get("client_id") == null && params.get("client_ids") == null) {
return null;
}
return PageListUtils.buildPageListResult(refundMapper.listUnionAllApply(params, pagination));

@ -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 () {
if (!$scope.paymentInfo) {

@ -570,6 +570,21 @@
</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-heading">Retail In Store Payment(App, WePayLite, Albert)</div>
<div class="panel-body">

@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
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.pagination = {};
$scope.htmlTooltip = $sce.trustAsHtml('<div style="text-align: left;width:350px">' +
@ -29,7 +29,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.subClientTable2 = [];
$scope.choseSubClientNow = 'More';
$scope.subSearchText = '';
$scope.searchSubClients = function (subSearchText,page) {
$scope.searchSubClients = function (subSearchText, page) {
$scope.subClientTable1 = [$scope.currentUser.client];
$scope.subClientTable2 = [];
@ -39,13 +39,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.subSearchText = subSearchText;
params.searchText = subSearchText;
}
$http.get('/client/partner_info/sub_partners/page',{params: params}).then(function (resp) {
$http.get('/client/partner_info/sub_partners/page', {params: params}).then(function (resp) {
var clientList = resp.data.data;
$scope.subClientPagination = resp.data.pagination;
clientList.forEach(function (client) {
if ($scope.subClientTable1.length < 11) {
$scope.subClientTable1.push(client);
}else {
} else {
$scope.subClientTable2.push(client);
}
$scope.clients.push(client);
@ -89,6 +89,11 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
$scope.loadSettlementLogs = function (page) {
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) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
@ -192,13 +197,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
};
if ($scope.currentUser.client.has_children && !$scope.currentUser.client.hide_sub_mch) {
$scope.searchSubClients('',1);
$scope.searchSubClients('', 1);
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.chooseClient('all');
}else {
} else {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);

@ -779,7 +779,7 @@
<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"
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)"
title="Cancel">
<i class="fa fa-close"></i>

@ -473,7 +473,7 @@ $(function () {
}
function callAlipayAps(order) {
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)
callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success')

@ -517,7 +517,7 @@ $(function () {
}
function callAlipayAps(order) {
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)
callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success')

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

Loading…
Cancel
Save