Merge branch 'develop'

master
taylor.dang 6 years ago
commit fec38a1b07

@ -1170,7 +1170,19 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
String defaultBank = config.getRemainsTo();
clearingDetailMapper.updateAllBanks(defaultBank, clearingId);
List<JSONObject> details = clearingDetailMapper.listReportsOfSettlement(clearingId);
details.sort((log1, log2) -> log2.getBigDecimal("clearing_amount").compareTo(log1.getBigDecimal("clearing_amount")));
details.sort((log1, log2) -> {
if (StringUtils.equals(defaultBank, log1.getString("account_bank")) ==
StringUtils.equals(defaultBank, log2.getString("account_bank"))) {
//两个银行都是defaultBank或者都不是defaultBank, all true or all false比较清算金额金额大的在前
return log2.getBigDecimal("clearing_amount").compareTo(log1.getBigDecimal("clearing_amount"));
}
//有一个是defaultBankdefaultBank在后
if (defaultBank.equals(log1.getString("account_bank"))) {
return -1;
} else {
return 1;
}
});
bankDistribution.remove(defaultBank);
for (String bank : bankDistribution.keySet()) {
List<String> detailIds = new ArrayList<>();

@ -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