[fix]修复通用号调单商户不存在的情况

master
lujian 6 years ago
parent 05c5d7207a
commit 58e3183d40

@ -149,7 +149,10 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
String orderIds = riskEvent.getString("order_ids");
JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker"));
List<JSONObject> tradeLogs = new ArrayList<>();
if (StringUtils.isNotBlank(orderIds)) {
/**
* client
*/
if (client != null && StringUtils.isNotBlank(orderIds)) {
String[] orderIdArray = orderIds.trim().split(",");
JSONObject orderInfo = new JSONObject();
String realOrderId = "";
@ -192,19 +195,26 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
params.put("order_ids", orderIds);
String[] orderIdArray = orderIds.split(",");
List<String> orderAmountList = new ArrayList<>();
for (int i = 0; i < orderIdArray.length; i++) {
JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id"));
// 判断该笔订单是否存在,是否属于该商户
if (orderInfo == null)
throw new OrderNotExistsException();
else {
if (!clientMoniker.equals(orderInfo.getString("partner_code"))) {
throw new OrderNotMatchException();
/**
* client_monikerclient_id
* clientorder_amounts
*
*/
if (client != null) {
for (int i = 0; i < orderIdArray.length; i++) {
JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id"));
// 判断该笔订单是否存在,是否属于该商户
if (orderInfo == null)
throw new OrderNotExistsException();
else {
if (!clientMoniker.equals(orderInfo.getString("partner_code"))) {
throw new OrderNotMatchException();
}
orderAmountList.add(orderInfo.getString("total_amount"));
}
orderAmountList.add(orderInfo.getString("total_amount"));
}
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
}
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
}
riskEventMapper.save(params);
}

@ -578,7 +578,21 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.partnerParam.sub_merchant_id = $scope.riskEvent.sub_merchant_id;
$http.get('/risk/business/partners', {params: $scope.partnerParam}).then(function (resp) {
$scope.partners = resp.data;
$scope.riskEvent.client_moniker = $scope.partners[0].client_moniker;
if ($scope.partners != null && $scope.partners.length > 0) {
$scope.riskEvent.client_moniker = $scope.partners[0].client_moniker;
}
else {
commonDialog.confirm({
title: 'Warning',
content: '该微信子商户号下暂时没有商户或者商户被禁用,是否继续?'
}).then(function () {
// 点击确定
$scope.riskEvent.client_moniker = null;
}, function () {
// 点击取消
$scope.riskEvent.sub_merchant_id = '';
});
}
if ($scope.partners != null && $scope.partners.length > 1 && $scope.riskEvent.order_type != 5)
commonDialog.confirm({
title: 'Warning',

@ -101,7 +101,7 @@
</div>
</div>
<div class="form-group" ng-if="partners != null">
<div class="form-group" ng-if="(partners != null) && (partners.length > 0) && riskEvent.order_type == 1">
<label class="control-label col-sm-2"
for="order-type-input">Company Name
</label>

@ -192,7 +192,9 @@
<tbody>
<tr ng-repeat="riskEvent in riskEvents">
<td>
<a role="button" ui-sref="partners.detail({clientMoniker: riskEvent.client_moniker})">
<a role="button"
ng-if="riskEvent.client_moniker != null"
ui-sref="partners.detail({clientMoniker: riskEvent.client_moniker})">
{{riskEvent.short_name}}({{riskEvent.client_moniker}})
</a>
</td>

Loading…
Cancel
Save