master
hellolujian 6 years ago
parent bf5467a5ad
commit 91e9574eb9

@ -36,6 +36,10 @@ public interface ClientMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject findClientByMonikerAll(@Param("client_moniker") String clientMoniker); JSONObject findClientByMonikerAll(@Param("client_moniker") String clientMoniker);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
List<JSONObject> getClientBySubMerchantId(@Param("sub_merchant_id") String subMerchantId);
PageList<JSONObject> listPartners(JSONObject params, PageBounds pagination); PageList<JSONObject> listPartners(JSONObject params, PageBounds pagination);
List<JSONObject> listClientsIdAndMoniker(); List<JSONObject> listClientsIdAndMoniker();

@ -342,4 +342,6 @@ public interface ClientManager {
void updateAllPartnerPassword(String clientMoniker, List<String> emails); void updateAllPartnerPassword(String clientMoniker, List<String> emails);
void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client); void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client);
List<JSONObject> getClientBySimpleQuery(JSONObject param);
} }

@ -4027,6 +4027,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}); });
} }
@Override
public List<JSONObject> getClientBySimpleQuery(JSONObject param) {
String subMerchantId = param.getString("sub_merchant_id");
if (StringUtils.isNotBlank(subMerchantId)) {
return clientMapper.getClientBySubMerchantId(subMerchantId);
}
return null;
}
private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) { private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) {

@ -43,6 +43,26 @@ public class RiskEventQuery {
private Integer page = 1; private Integer page = 1;
// 金额区间
private String startAmount;
private String endAmount;
public String getStartAmount() {
return startAmount;
}
public void setStartAmount(String startAmount) {
this.startAmount = startAmount;
}
public String getEndAmount() {
return endAmount;
}
public void setEndAmount(String endAmount) {
this.endAmount = endAmount;
}
public Integer getOrderType() { public Integer getOrderType() {
return orderType; return orderType;
} }
@ -168,6 +188,14 @@ public class RiskEventQuery {
params.put("page", page); params.put("page", page);
} }
if (StringUtils.isNotBlank(startAmount)) {
params.put("start_amount", startAmount);
}
if (StringUtils.isNotBlank(endAmount)) {
params.put("end_amount", endAmount);
}
return params; return params;
} }
} }

@ -141,6 +141,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService {
if (StringUtils.isNotBlank(orderIds)) { if (StringUtils.isNotBlank(orderIds)) {
orderIds = orderIds.trim().replace("", ","); orderIds = orderIds.trim().replace("", ",");
params.put("order_ids", orderIds); 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]);
orderAmountList.add(orderInfo.getString("total_amount"));
}
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
} }
riskEventMapper.save(params); riskEventMapper.save(params);
} }

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.riskbusiness.web; package au.com.royalpay.payment.manage.riskbusiness.web;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery; import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery;
@ -122,5 +123,11 @@ public class RiskBusinessController {
public void urgeEmail(@PathVariable String risk_id) throws IOException { public void urgeEmail(@PathVariable String risk_id) throws IOException {
riskBusinessService.sendUrgeEmail(risk_id); riskBusinessService.sendUrgeEmail(risk_id);
} }
@GetMapping(value = "/partners")
public List<JSONObject> getPartners(PartnerQuery partnerQuery) {
JSONObject param = partnerQuery.toJsonParam();
return clientManager.getClientBySimpleQuery(param);
}
} }

@ -29,6 +29,27 @@
FROM risk_event re FROM risk_event re
LEFT JOIN sys_clients sc LEFT JOIN sys_clients sc
ON re.client_moniker = sc.client_moniker ON re.client_moniker = sc.client_moniker
<if test="start_amount != null || end_amount != null">
RIGHT JOIN(
SELECT distinct re.risk_id
FROM
risk_event re,
risk_event_help reh
<where>
reh.risk_event_help_id &lt; (LENGTH(re.order_amounts) - LENGTH(REPLACE(re.order_amounts, ',' , ''))) + 1
<if test="start_amount != null">
AND cast(SUBSTRING_INDEX(SUBSTRING_INDEX(order_amounts,',',reh.risk_event_help_id + 1),',',-1) as signed) &gt;= #{start_amount}
</if>
<if test="end_amount != null">
AND cast(SUBSTRING_INDEX(SUBSTRING_INDEX(order_amounts,',',reh.risk_event_help_id + 1),',',-1) as signed) &lt;= #{end_amount}
</if>
</where>
) temp
on re.risk_id = temp.risk_id
</if>
<where> <where>
<if test="risk_id != null"> <if test="risk_id != null">
AND re.risk_id = #{risk_id} AND re.risk_id = #{risk_id}

@ -47,6 +47,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
"3": "已发送催促邮件" "3": "已发送催促邮件"
}; };
var amountSectionMap = {
"0-500": "0-500",
"500-1000": "500-1000",
"1000-1500": "1000-1500",
"1500-2000": "1500-2000",
"2000-2500": "2000-2500",
"2500-3000": "2500-3000",
"3000-3500": "3000-3500",
"3500-4000": "3500-4000",
"4000-4500": "4000-4500"
};
var app = angular.module('riskBusinessApp', ['ui.router']); var app = angular.module('riskBusinessApp', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('analysis_monitoring.risk_business', { $stateProvider.state('analysis_monitoring.risk_business', {
@ -80,6 +92,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.orderTypes = orderTypesMap; $scope.orderTypes = orderTypesMap;
$scope.resultTypes = resultTypeSearchMap; $scope.resultTypes = resultTypeSearchMap;
$scope.industries = industryMap.configs(); $scope.industries = industryMap.configs();
$scope.amountSection = amountSectionMap;
$scope.pagination = {}; $scope.pagination = {};
$scope.params = {}; $scope.params = {};
@ -89,6 +102,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
params.page = page || $scope.pagination.page || 1; params.page = page || $scope.pagination.page || 1;
params.replyEmailDate = $filter('date')(params.replyEmailDate, 'yyyy-MM-dd'); params.replyEmailDate = $filter('date')(params.replyEmailDate, 'yyyy-MM-dd');
params.receiveEmailDate = $filter('date')(params.receiveEmailDate, 'yyyy-MM-dd'); params.receiveEmailDate = $filter('date')(params.receiveEmailDate, 'yyyy-MM-dd');
if (params.section != null) {
var sectionArray = params.section.split('-');
params.startAmount = sectionArray[0];
params.endAmount = sectionArray[1];
}
$http.get('/risk/business/events', {params: params}).then(function (resp) { $http.get('/risk/business/events', {params: params}).then(function (resp) {
$scope.riskEvents = resp.data.data; $scope.riskEvents = resp.data.data;
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
@ -323,6 +341,22 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
type: 'error' type: 'error'
}); });
}); });
};
$scope.partnerParam = {};
$scope.loadParnters = function() {
$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 > 1 && $scope.riskEvent.order_type != 5)
commonDialog.confirm({
title: 'Warning',
content: '该微信子商户号下有多个商户,是否将调单类型改为通用号调单?'
}).then(function () {
$scope.riskEvent.order_type = 5 + "";
});
});
} }
} }
]); ]);

@ -78,11 +78,56 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"
ng-if="riskEvent.order_type == 5 || riskEvent.order_type == 1"
ng-class="{'has-error':riskEventForm.sub_merchant_id.$invalid && riskEventForm.sub_merchant_id.$dirty}">
<label class="control-label col-sm-2"
for="sub-merchant-id-input">Sub Merchant ID</label>
<div class="col-sm-8">
<input class="form-control"
ng-model="riskEvent.sub_merchant_id"
type="text"
name="sub_merchant_id"
id="sub-merchant-id-input"
ng-blur="loadParnters()"
required>
<div ng-messages="riskEventForm.order_ids.$error"
ng-if="riskEventForm.sub_merchant_id.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
<div class="form-group" ng-if="partners != null">
<label class="control-label col-sm-2"
for="order-type-input">Company Name
</label>
<div class="col-sm-8">
<select class="form-control"
name="company_name"
ng-model="riskEvent.client_moniker"
id="company-name-input"
ng-options="partner.client_moniker as partner.company_name for partner in partners">
<option value="Please Choose"></option>
</select>
<div ng-messages="riskEventForm.order_type.$error"
ng-if="riskEventForm.order_type.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
<div class="form-group" <div class="form-group"
ng-if="riskEvent.order_type != 5" ng-if="riskEvent.order_type != 5"
ng-class="{'has-error':riskEventForm.client_moniker.$invalid && riskEventForm.client_moniker.$dirty}"> ng-class="{'has-error':riskEventForm.client_moniker.$invalid && riskEventForm.client_moniker.$dirty}">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
for="short-id-input">* Partner Code for="short-id-input">Partner Code
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" <input class="form-control"
@ -131,30 +176,10 @@
</div> </div>
</div> </div>
<div class="form-group"
ng-if="riskEvent.order_type == 5"
ng-class="{'has-error':riskEventForm.sub_merchant_id.$invalid && riskEventForm.sub_merchant_id.$dirty}">
<label class="control-label col-sm-2"
for="sub-merchant-id-input">Sub Merchant ID</label>
<div class="col-sm-8">
<input class="form-control"
ng-model="riskEvent.sub_merchant_id"
type="text"
name="sub_merchant_id"
id="sub-merchant-id-input"
required>
<div ng-messages="riskEventForm.order_ids.$error"
ng-if="riskEventForm.sub_merchant_id.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
for="receive-date-input">Receive Date for="receive-date-input">
{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}
</label> </label>
<div class="col-xs-2"> <div class="col-xs-2">
<input class="form-control" <input class="form-control"
@ -163,7 +188,7 @@
ng-model="riskEvent.receive_email_date" ng-model="riskEvent.receive_email_date"
uib-datepicker-popup uib-datepicker-popup
size="10" size="10"
placeholder="Receive Email Date" placeholder="{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}"
datepicker-options="{maxDate:today}" datepicker-options="{maxDate:today}"
is-open="ReceiveDate.open" is-open="ReceiveDate.open"
ng-click="ReceiveDate.open=true"> ng-click="ReceiveDate.open=true">
@ -175,11 +200,11 @@
for="description-input">Description for="description-input">Description
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" <textarea class="form-control"
ng-model="riskEvent.description" ng-model="riskEvent.description"
type="text"
name="description" name="description"
id="description-input"> id="description-input">
</textarea>
</div> </div>
</div> </div>
</div> </div>

@ -110,7 +110,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Receive Date</label> <label class="control-label col-sm-2">
{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}
</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static"> <p class="form-control-static">
{{riskEvent.receive_email_date | limitTo:10}} {{riskEvent.receive_email_date | limitTo:10}}
@ -263,6 +265,10 @@
ng-click="resendUploadEmail()">Send Warning Email ng-click="resendUploadEmail()">Send Warning Email
</a> </a>
<a role="button"
ui-sref="analysis_monitoring.risk_business"
class="btn btn-info pull-right">返回
</a>
</div> </div>
</div> </div>
@ -379,7 +385,8 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
for="receive-email-input">Receive Date for="receive-email-input">
{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<div style="display: inline-block"> <div style="display: inline-block">
@ -389,7 +396,7 @@
ng-model="riskEventEdit.receive_email_date" ng-model="riskEventEdit.receive_email_date"
uib-datepicker-popup uib-datepicker-popup
size="10" size="10"
placeholder="Receive Date" placeholder="{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}"
is-open="receiveDate.open" is-open="receiveDate.open"
ng-click="receiveDate.open=true" ng-click="receiveDate.open=true"
datepicker-options="{maxDate:today}"> datepicker-options="{maxDate:today}">
@ -421,11 +428,12 @@
for="description-input">Description for="description-input">Description
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" <textarea class="form-control"
maxlength="5000"
ng-model="riskEventEdit.description" ng-model="riskEventEdit.description"
type="text"
name="description" name="description"
id="description-input"> id="description-input">
</textarea>
</div> </div>
</div> </div>

@ -168,14 +168,14 @@
</div> </div>
</div> </div>
<!--支付金额,待定-->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<label class="control-label col-xs-4 col-sm-4" <label class="control-label col-xs-4 col-sm-4"
for="payment-select">payment</label> for="payment-select">Amount Section</label>
<div class="col-xs-6"> <div class="col-xs-6">
<select ng-model="params.payment" <select ng-model="params.section"
id="payment-select" id="payment-select"
class="form-control"> class="form-control"
ng-options="key as value for (key, value) in amountSection">
<option value="">All</option> <option value="">All</option>
</select> </select>
</div> </div>

Loading…
Cancel
Save