Merge remote-tracking branch 'origin/production' into production

master
Yixian 3 years ago
commit 4ebf4ed49e

@ -21,6 +21,8 @@ public interface TradeLogService {
JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager);
JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager);
List<JSONObject> listOrderRefunds(String orderId, String timezone);
void getOrderDetail(Model model, String clientMoniker, String orderId, String openid);

@ -268,8 +268,32 @@ public class TradeLogServiceImpl implements TradeLogService {
add(query.getGatewayChild());
}});
}
PageList<JSONObject> logs = orderMapper.listIncrementalOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
PageList<JSONObject> logs = orderMapper.listIncrementalOrdersNew(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
logs.stream().forEach(log->{
JSONObject client= clientManager.getClientInfo(log.getInteger("client_id"));
if(client!=null){
log.put("short_name",client.getString("short_name"));
log.put("client_moniker",client.getString("client_moniker"));
};
});
JSONObject result = PageListUtils.buildPageListResult(logs);
// JSONObject analysis = orderMapper.analysisOrders(params);
// result.put("analysis", analysis);
return result;
}
@Override
public JSONObject incrementalAnalysisOrders(TradeLogQuery query, JSONObject manager) {
JSONObject params = query.toParams(null);
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", manager.getString("manager_id"));
}
orgManager.checkOrgIds(manager, params);
if (query.getGatewayChild() != null) {
params.put("trade_type", new ArrayList<Integer>() {{
add(query.getGatewayChild());
}});
}
JSONObject result = new JSONObject();
JSONObject analysis = orderMapper.analysisOrders(params);
result.put("analysis", analysis);
return result;

@ -41,6 +41,12 @@ public class ManageTradelogController {
public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.listAllIncrementalTradeLogs(query, manager);
}
@RequestMapping(value = "/incremental/analysis", method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
public JSONObject incrementalAnalysisOrders(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.incrementalAnalysisOrders(query, manager);
}
@ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
@ReadOnlyConnection

@ -144,6 +144,7 @@
</sql>
<sql id="gateway_keys_2">
SELECT
o.client_id,
o.order_id order_id,
format(o.total_amount * 100, 0) total_fee,
format(o.customer_payment_amount * 100, 0) real_fee,

@ -150,7 +150,13 @@
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='RP跨境商城'}"
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>
ng-click="params.source='RP跨境商城';loadTradeLogs(1)">RP跨境商城</a>|
<a role="button" ng-class="{'bg-primary':params.source=='Shopify'}"
ng-click="params.source='Shopify';loadTradeLogs(1)">Shopify</a>|
<a role="button" ng-class="{'bg-primary':params.source=='商服拼团'}"
ng-click="params.source='商服拼团';loadTradeLogs(1)">商服拼团</a>|
<a role="button" ng-class="{'bg-primary':params.source=='商服接龙'}"
ng-click="params.source='商服接龙';loadTradeLogs(1)">商服接龙</a>
</p>
</div>
</div>

@ -436,6 +436,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$http.get('/sys/trade_logs/incremental', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
});
$http.get('/sys/trade_logs/incremental/analysis', {params: params}).then(function (resp) {
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});

@ -264,6 +264,10 @@ $(function () {
contentType: 'application/json',
dataType: 'json',
success: function (pay) {
if (pay.jsapi) {
callAlipayAps(pay);
return;
}
if (pay.direct_paid) {
location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return;
@ -441,4 +445,43 @@ $(function () {
}
}
function callApp(scheme_seq, index, timeout) {
let timer, start = new Date().getTime()
let promise = new Promise(((resolve, reject) => {
location.href = scheme_seq[index]
window.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
clearTimeout(timer);
resolve()
}
});
timer = setTimeout(() => {
let end = new Date().getTime()
if (end - start > timeout + 1000) {
clearTimeout(timer)
resolve()
} else {
if (index + 1 < scheme_seq.length) {
callApp(scheme_seq, index + 1, timeout).then(resolve, reject)
} else {
reject()
}
}
}, timeout)
}))
return promise
}
function callAlipayAps(order) {
if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url]
try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success')
}, () => {
alert('redirect failure')
})
}else {
location.href = order.web_url
}
}
});

@ -309,6 +309,10 @@ $(function () {
contentType: 'application/json',
dataType: 'json',
success: function (pay) {
if (pay.jsapi) {
callAlipayAps(pay);
return;
}
if (pay.direct_paid) {
location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return;
@ -485,4 +489,44 @@ $(function () {
}
}
function callApp(scheme_seq, index, timeout) {
let timer, start = new Date().getTime()
let promise = new Promise(((resolve, reject) => {
location.href = scheme_seq[index]
window.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
clearTimeout(timer);
resolve()
}
});
timer = setTimeout(() => {
let end = new Date().getTime()
if (end - start > timeout + 1000) {
clearTimeout(timer)
resolve()
} else {
if (index + 1 < scheme_seq.length) {
callApp(scheme_seq, index + 1, timeout).then(resolve, reject)
} else {
reject()
}
}
}, timeout)
}))
return promise
}
function callAlipayAps(order) {
if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url]
try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success')
}, () => {
alert('redirect failure')
})
}else {
location.href = order.web_url
}
}
});

@ -272,6 +272,10 @@ $(function () {
contentType: 'application/json',
dataType: 'json',
success: function (pay) {
if (pay.jsapi) {
callAlipayAps(pay);
return;
}
if (pay.direct_paid) {
location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return;
@ -449,4 +453,43 @@ $(function () {
}
}
function callApp(scheme_seq, index, timeout) {
let timer, start = new Date().getTime()
let promise = new Promise(((resolve, reject) => {
location.href = scheme_seq[index]
window.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
clearTimeout(timer);
resolve()
}
});
timer = setTimeout(() => {
let end = new Date().getTime()
if (end - start > timeout + 1000) {
clearTimeout(timer)
resolve()
} else {
if (index + 1 < scheme_seq.length) {
callApp(scheme_seq, index + 1, timeout).then(resolve, reject)
} else {
reject()
}
}
}, timeout)
}))
return promise
}
function callAlipayAps(order) {
if(order.jsapi){
let try_sequence = [order.jsapi.scheme_url, order.jsapi.applink_url, order.jsapi.normal_url]
try_sequence = try_sequence.filter(v => v != null)
callApp(try_sequence, 0, 5000).then(() => {
alert('redirect success')
}, () => {
alert('redirect failure')
})
}else {
location.href = order.web_url
}
}
});

Loading…
Cancel
Save