From 91e9574eb9f9ef8143d76f9081d2246930678fde Mon Sep 17 00:00:00 2001 From: hellolujian <1370256381@qq.com> Date: Thu, 18 Oct 2018 20:09:05 +0800 Subject: [PATCH] [fix] --- .../manage/mappers/system/ClientMapper.java | 4 + .../manage/merchants/core/ClientManager.java | 2 + .../core/impls/ClientManagerImpl.java | 8 ++ .../riskbusiness/bean/RiskEventQuery.java | 28 +++++++ .../core/impl/RiskBusinessServiceImpl.java | 7 ++ .../web/RiskBusinessController.java | 7 ++ .../mappers/riskbusiness/RiskEventMapper.xml | 67 ++++++++++------ src/main/ui/static/analysis/risk_business.js | 34 ++++++++ .../analysis/templates/new_riskEvent.html | 77 ++++++++++++------- .../analysis/templates/riskEvent_detail.html | 24 ++++-- .../analysis/templates/risk_business.html | 8 +- 11 files changed, 205 insertions(+), 61 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index a1b6d4cb9..cd7b67160 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -36,6 +36,10 @@ public interface ClientMapper { @AutoSql(type = SqlType.SELECT) JSONObject findClientByMonikerAll(@Param("client_moniker") String clientMoniker); + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") + List getClientBySubMerchantId(@Param("sub_merchant_id") String subMerchantId); + PageList listPartners(JSONObject params, PageBounds pagination); List listClientsIdAndMoniker(); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 8bcca2a11..147fcb0f9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -342,4 +342,6 @@ public interface ClientManager { void updateAllPartnerPassword(String clientMoniker, List emails); void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client); + + List getClientBySimpleQuery(JSONObject param); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 120dc8340..4e4b98916 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -4027,6 +4027,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid }); } + @Override + public List 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) { diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java index d985cd22c..29b3bb14f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/bean/RiskEventQuery.java @@ -43,6 +43,26 @@ public class RiskEventQuery { 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() { return orderType; } @@ -168,6 +188,14 @@ public class RiskEventQuery { params.put("page", page); } + if (StringUtils.isNotBlank(startAmount)) { + params.put("start_amount", startAmount); + } + + if (StringUtils.isNotBlank(endAmount)) { + params.put("end_amount", endAmount); + } + return params; } } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index 3563398a2..a84fca14d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -141,6 +141,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { if (StringUtils.isNotBlank(orderIds)) { orderIds = orderIds.trim().replace(",", ","); params.put("order_ids", orderIds); + String[] orderIdArray = orderIds.split(","); + List 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); } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java index 63eb3cd31..3ebc945a5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java @@ -1,5 +1,6 @@ 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.permission.manager.ManagerMapping; 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 { riskBusinessService.sendUrgeEmail(risk_id); } + + @GetMapping(value = "/partners") + public List getPartners(PartnerQuery partnerQuery) { + JSONObject param = partnerQuery.toJsonParam(); + return clientManager.getClientBySimpleQuery(param); + } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml index dab194f4f..b1d3109a3 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml @@ -3,32 +3,53 @@ +
+

required field +

+
+ + + +
+ +
+ + +
+

required field +

+
+
+
+
-
- -
- -
-

required field -

-
-
-
-
@@ -175,11 +200,11 @@ for="description-input">Description
- +
diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 5217373e6..bda8cddc8 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -110,7 +110,9 @@
- +

{{riskEvent.receive_email_date | limitTo:10}} @@ -263,6 +265,10 @@ ng-click="resendUploadEmail()">Send Warning Email + 返回 +

@@ -379,7 +385,8 @@
@@ -389,7 +396,7 @@ ng-model="riskEventEdit.receive_email_date" uib-datepicker-popup size="10" - placeholder="Receive Date" + placeholder="{{(riskEvent.order_type == 1 || riskEvent.order_type ==2) ? 'Receive Date' : 'Create Date'}}" is-open="receiveDate.open" ng-click="receiveDate.open=true" datepicker-options="{maxDate:today}"> @@ -421,11 +428,12 @@ for="description-input">Description
- +
diff --git a/src/main/ui/static/analysis/templates/risk_business.html b/src/main/ui/static/analysis/templates/risk_business.html index 6e145e0b6..0c14be900 100644 --- a/src/main/ui/static/analysis/templates/risk_business.html +++ b/src/main/ui/static/analysis/templates/risk_business.html @@ -168,14 +168,14 @@
-
+ for="payment-select">Amount Section
-