From 37c6cff864ab86438ee3d3485f687be1d14ef330 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 23 Mar 2021 17:30:30 +0800 Subject: [PATCH 01/10] retail support alipay+ --- .../ui/static/templates/alipay/v1/bill_retail_jsapi.js | 5 +++++ src/main/ui/static/templates/alipay/v1/retail_jsapi.js | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js index 7e7290d52..b27552646 100644 --- a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js @@ -32,6 +32,11 @@ $(document).ready(function () { location.href = window.redirect; return; } + if (pay.web_from) { + $('#alipay_plus').html(pay.web_from) + startCheckOrder(window.order_id, window.redirect); + return; + } if (window.AlipayJSBridge) { callPayment(); } else { diff --git a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js index 6b74c75cf..136b3523a 100644 --- a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js @@ -24,7 +24,7 @@ $(document).ready(function () { dataCache.paying = true; $.ajax({ - url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/'+window.order_id+'/order_params', + url: './order_params', method: 'GET', dataType: 'json', success: function (pay) { @@ -32,6 +32,11 @@ $(document).ready(function () { location.href = window.redirect; return; } + if (pay.web_from) { + $('#alipay_plus').html(pay.web_from) + startCheckOrder(window.order_id, window.redirect); + return; + } if (window.AlipayJSBridge) { callPayment(); } else { From 8fe1b1256f51f175d4c32d535b7b9ca10c8144b4 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 23 Mar 2021 17:31:46 +0800 Subject: [PATCH 02/10] retail support alipay+ --- src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js index b27552646..2d955756a 100644 --- a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js @@ -34,7 +34,7 @@ $(document).ready(function () { } if (pay.web_from) { $('#alipay_plus').html(pay.web_from) - startCheckOrder(window.order_id, window.redirect); + location.href = window.redirect; return; } if (window.AlipayJSBridge) { From f1cf3179431c11a6165e1e35c1b91072899add8e Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 23 Mar 2021 17:48:48 +0800 Subject: [PATCH 03/10] compile error fix --- .../beans/DefaultClientProfile.java | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java b/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java index 08a049156..e6fa261f3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java +++ b/src/main/java/au/com/royalpay/payment/manage/organizations/beans/DefaultClientProfile.java @@ -10,13 +10,18 @@ import com.yixsoft.support.mybatis.utils.FieldDescription; import org.apache.commons.lang3.ClassUtils; import org.apache.commons.lang3.ObjectUtils; import org.hibernate.validator.constraints.Range; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.core.annotation.AnnotatedElementUtils; +import java.lang.reflect.InvocationTargetException; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; @JSONType(naming = PropertyNamingStrategy.SnakeCase) public class DefaultClientProfile { + private final Logger logger = LoggerFactory.getLogger(getClass()); @ProfileDesc(value = "周末延迟清算", detail = "周末交易延迟到周二清算") private boolean weekendDelay = true; @ProfileDesc("手续费包含GST") @@ -35,40 +40,46 @@ public class DefaultClientProfile { return new ClassFieldsDescription<>(getClass()).getFields().stream() .filter(field -> !"class".equalsIgnoreCase(field.getFieldName())) .map(this::convertFieldInfo) + .filter(Objects::nonNull) .collect(Collectors.toList()); } private JSONObject convertFieldInfo(FieldDescription field) { - Object value = field.readField(this); - String fieldName = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.LOWER_UNDERSCORE).convert(field.getFieldName()); - JSONObject info = new JSONObject(); - info.put("field", fieldName); - info.put("value", value); - Class fieldType = field.getMethod().getReturnType(); - if (ClassUtils.isPrimitiveOrWrapper(fieldType)) { - if (ClassUtils.isPrimitiveWrapper(fieldType)) { - fieldType = ClassUtils.wrapperToPrimitive(fieldType); - } - if (fieldType.equals(boolean.class)) { - info.put("type", "checkbox"); + try { + Object value = field.readField(this); + String fieldName = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.LOWER_UNDERSCORE).convert(field.getFieldName()); + JSONObject info = new JSONObject(); + info.put("field", fieldName); + info.put("value", value); + Class fieldType = field.getMethod().getReturnType(); + if (ClassUtils.isPrimitiveOrWrapper(fieldType)) { + if (ClassUtils.isPrimitiveWrapper(fieldType)) { + fieldType = ClassUtils.wrapperToPrimitive(fieldType); + } + if (fieldType.equals(boolean.class)) { + info.put("type", "checkbox"); + } else { + info.put("type", "number"); + } } else { - info.put("type", "number"); + info.put("type", "text"); } - } else { - info.put("type", "text"); - } - ProfileDesc getterDesc = AnnotatedElementUtils.findMergedAnnotation(field.getMethod(), ProfileDesc.class); - try { - ProfileDesc fieldDesc = AnnotatedElementUtils.findMergedAnnotation(getClass().getDeclaredField(field.getFieldName()), ProfileDesc.class); - ProfileDesc desc = ObjectUtils.defaultIfNull(getterDesc, fieldDesc); - if (desc != null) { - info.put("title", desc.value()); - info.put("detail", desc.detail()); + ProfileDesc getterDesc = AnnotatedElementUtils.findMergedAnnotation(field.getMethod(), ProfileDesc.class); + try { + ProfileDesc fieldDesc = AnnotatedElementUtils.findMergedAnnotation(getClass().getDeclaredField(field.getFieldName()), ProfileDesc.class); + ProfileDesc desc = ObjectUtils.defaultIfNull(getterDesc, fieldDesc); + if (desc != null) { + info.put("title", desc.value()); + info.put("detail", desc.detail()); + } + } catch (NoSuchFieldException e) { } - } catch (NoSuchFieldException e) { + return info; + } catch (IllegalAccessException | InvocationTargetException e) { + logger.error("failed to access getter of field {}", field.getFieldName(), e); + return null; } - return info; } public void applyToClientConfig(JSONObject client) { From 80cc8b48ef72a1509fea5fc3642498c3b55cd855 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 23 Mar 2021 18:39:20 +0800 Subject: [PATCH 04/10] ui update --- src/main/ui/static/templates/alipay/v1/retail_jsapi.js | 3 +++ src/main/ui/static/templates/payment/v1/gateway_jsapi.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js index 136b3523a..6e1145907 100644 --- a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js @@ -93,6 +93,9 @@ $(document).ready(function () { } else { setTimeout(checkOrderStd, 500); } + }, + error:function (){ + setTimeout(checkOrderStd, 500); } }) } diff --git a/src/main/ui/static/templates/payment/v1/gateway_jsapi.js b/src/main/ui/static/templates/payment/v1/gateway_jsapi.js index 6b76458a1..9b50c79b5 100644 --- a/src/main/ui/static/templates/payment/v1/gateway_jsapi.js +++ b/src/main/ui/static/templates/payment/v1/gateway_jsapi.js @@ -113,6 +113,9 @@ $(document).ready(function () { } else { setTimeout(checkOrderStd, 500); } + }, + error:function (){ + setTimeout(checkOrderStd, 500); } }) } From 3443b288da4dbc7f9c38fa840f28f4455fac7edf Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 23 Mar 2021 19:49:09 +0800 Subject: [PATCH 05/10] ui update --- src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js index 2d955756a..4afadc43b 100644 --- a/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/bill_retail_jsapi.js @@ -24,7 +24,7 @@ $(document).ready(function () { dataCache.paying = true; $.ajax({ - url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/'+window.order_id+'/order_params', + url: '../order_params', method: 'GET', dataType: 'json', success: function (pay) { From 81ad02acac3c3780bb979645500d44e6068b7e33 Mon Sep 17 00:00:00 2001 From: Todking Date: Wed, 24 Mar 2021 10:50:23 +0800 Subject: [PATCH 06/10] =?UTF-8?q?update=20=E9=92=88=E5=AF=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=A1=A8=E9=85=8D=E7=BD=AE=E7=9A=84=E5=95=86=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E5=8F=91=E9=80=81=E5=BC=80=E9=80=9A=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchants/core/impls/ClientManagerImpl.java | 9 +++++++++ src/main/resources/application-dev.yml | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) 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 3ad05d758..bd519bf5c 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 @@ -1371,6 +1371,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid public void sendInitEmail(final JSONObject client, String username, String pwd, boolean isUpayAuditPass) { logger.debug("sending email after comply"); + // 配置了部分组织不发送邮件 + JSONObject sysConfig = sysConfigManager.getSysConfig(); + String[] orgs = sysConfig.getString("no_send_email_org").split(","); + for (String org : orgs) { + if (client.getString("org_id").equals(org)) { + logger.info("Merchant of organization does not send email.(org_id:" + org + ")"); + return; + } + } List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); Context ctx = new Context(); ctx.setVariable("bds", bds); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 8be115e3d..35d4a6129 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -7,11 +7,11 @@ spring: schema-name: royalpay_payment username: rpaydev slave: - host: 192.168.0.84:3306 + host: 192.168.0.92:3306 jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: rpayplus123 - schema-name: royalpay - username: root + password: SuTUUxyvzS0cLETi6Rzm + schema-name: royalpay_payment + username: rpaydev type: com.zaxxer.hikari.HikariDataSource redis: database: 1 @@ -23,10 +23,10 @@ spring: app: run-tasks: false host: - main: http://192.168.0.38:5000/ + main: http://192.168.0.24:9008/ regions: - au: http://192.168.0.38:5000/ - cn: http://192.168.0.38:5000/ + au: http://192.168.0.24:9008/ + cn: http://192.168.0.24:9008/ mail: appid: 1 host: https://dev.mailsupport.hcqtech.com From ba1597789a89f9209f85d124e01d1baf20df4cc8 Mon Sep 17 00:00:00 2001 From: Todking Date: Wed, 24 Mar 2021 10:52:02 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=81=A2=E5=A4=8Ddev.yml=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=8F=90=E4=BA=A4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 35d4a6129..8be115e3d 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -7,11 +7,11 @@ spring: schema-name: royalpay_payment username: rpaydev slave: - host: 192.168.0.92:3306 + host: 192.168.0.84:3306 jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false - password: SuTUUxyvzS0cLETi6Rzm - schema-name: royalpay_payment - username: rpaydev + password: rpayplus123 + schema-name: royalpay + username: root type: com.zaxxer.hikari.HikariDataSource redis: database: 1 @@ -23,10 +23,10 @@ spring: app: run-tasks: false host: - main: http://192.168.0.24:9008/ + main: http://192.168.0.38:5000/ regions: - au: http://192.168.0.24:9008/ - cn: http://192.168.0.24:9008/ + au: http://192.168.0.38:5000/ + cn: http://192.168.0.38:5000/ mail: appid: 1 host: https://dev.mailsupport.hcqtech.com From 236d2c6a14b9ca1fa16228e11d16cbdb54d7c59f Mon Sep 17 00:00:00 2001 From: "xiao.tang" Date: Mon, 29 Mar 2021 09:52:19 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E2=9C=A8feat(RoyalPay):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0AlipayPlus=E8=B4=B9=E7=8E=87=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/payment/partner/partner-manage.js | 91 +++++ .../templates/partner_bankaccounts.html | 335 +++++++++++------- .../partner_new_alipayplus_rate.html | 150 ++++++++ 3 files changed, 440 insertions(+), 136 deletions(-) create mode 100644 src/main/ui/static/payment/partner/templates/partner_new_alipayplus_rate.html diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index fe48aea7a..da97ebea7 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3404,6 +3404,97 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } $scope.complianceChangeCheck() + + // 是否为alipayplus + $scope.isAlipayCN = true + // 修改渠道 + $scope.changeAlipayPlusRateState = function (flag) { + $scope.isAlipayCN = flag + } + // 过滤渠道 + $scope.isAlipayPlus = function (item) { + if ($scope.isAlipayCN) { + return item.rate_name === 'AlipayPlus' && (item.pay_type === 'alipay_cn_retail' || item.pay_type === 'alipay_cn_online') + } else { + return item.rate_name === 'AlipayPlus' && item.pay_type === 'alipay_other' + } + } + // 新增alipay+费率 + $scope.newAlipayPlusRate = function () { + $uibModal + .open({ + templateUrl: '/static/payment/partner/templates/partner_new_alipayplus_rate.html', + resolve: { + rate: function () { + return { + rate_name: 'AlipayPlus', + clean_days: '3', + } + }, + sys_common_rate: function () { + return $http.get('/sys/partners/sys_rates') + }, + clientMoniker: function () { + return $scope.partner.client_moniker + }, + }, + controller: [ + '$scope', + '$http', + 'rate', + 'sys_common_rate', + 'clientMoniker', + function ($scope, $http, rate, sys_common_rate, clientMoniker) { + $scope.rate = angular.copy(rate) + $scope.sysRateConfig = angular.copy(sys_common_rate.data) + $scope.ctrl = { sending: false } + $scope.saveRate = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true + } + }) + return + } + $scope.errmsg = null + $scope.ctrl.sending = true + $http.post('/sys/partners/' + clientMoniker + '/rates', $scope.rate).then( + function () { + $scope.ctrl.sending = false + $scope.$close() + }, + function (resp) { + $scope.ctrl.sending = false + $scope.errmsg = resp.data.message + } + ) + } + $scope.changeDays = function () { + // if ($scope.rate.clean_days) { + // switch ($scope.rate.clean_days) { + // case '1': { + // $scope.rate.alipayplus = parseFloat($scope.sysRateConfig.t1.AlipayPlus) + // break + // } + // case '2': { + // $scope.rate.alipayplus = parseFloat($scope.sysRateConfig.t2.AlipayPlus) + // break + // } + // case '3': { + // $scope.rate.alipayplus = parseFloat($scope.sysRateConfig.t3.AlipayPlus) + // break + // } + // } + // } + } + }, + ], + }) + .result.then(function () { + $scope.getRates() + }) + } }, ]) app.controller('surchargeAccountDetailCtrl', [ diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index edc8f9da8..f15c83f7c 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -8,7 +8,7 @@

Bank Account + ng-if="!bankCtrl.edit && (('11'|withRole)||((!partner.approve_result||partner.approve_result>4) && ('111'|withRole)))">

@@ -18,15 +18,15 @@

{{surcharge.balance|currency:'AUD'}}

+ style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px" + ng-click="surchargeAccountDetail()">

+ switch-change="allowSurchargeCredit(partner.allow_surcharge_credit)">
@@ -34,12 +34,12 @@

balance - + distributed - +

启用到收支分离(distributed)模式,将使消费者支付手续费模式失效
@@ -52,28 +52,28 @@

+ switch-change="taxInSurcharge(partner.tax_in_surcharge)">
+ switch-change="customerTaxFree(partner.customer_tax_free)">
+ switch-change="skipClearing(partner.skip_clearing)">
+ switch-change="switchPreSettle(partner.enable_presettle)">
@@ -86,7 +86,7 @@ -
-
+
+

Rates - + ng-if="partner.rate_editable && (('11'|withRole)||((!partner.approve_result||partner.approve_result>4) && ('111'|withRole)))" + ng-click="newRate()"> +

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rate NameRate ValueDomestic Rate ValueInternational Rate ValueTransaction FeeActive TimeExpire Time - Clean Days - Update TimeOperatorRemarkOperation
- T+{{rate.clean_days}} - - - - (Promotional Offer) - - -
-
- check +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rate NameRate ValueDomestic Rate ValueInternational Rate ValueTransaction FeeActive TimeExpire Time + Clean Days + Update TimeOperatorRemarkOperation
+ + T+{{rate.clean_days}} + + + + (Promotional Offer) + + +
+
+
+
+ +
+
+

AlipayPlus Rates + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rate NameRate ValueTransaction FeeActive TimeExpire TimeClean DaysUpdate TimeOperatorRemarkOperation
T+{{rate.clean_days}} + + + (Promotional Offer) + + +
+
-
-
+
\ No newline at end of file diff --git a/src/main/ui/static/payment/partner/templates/partner_new_alipayplus_rate.html b/src/main/ui/static/payment/partner/templates/partner_new_alipayplus_rate.html new file mode 100644 index 000000000..996cba8c1 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/partner_new_alipayplus_rate.html @@ -0,0 +1,150 @@ + + + \ No newline at end of file From db21bdac4444922738e4e74ee53902a7b94487a3 Mon Sep 17 00:00:00 2001 From: zhangtao <1316069495@qq.com> Date: Mon, 29 Mar 2021 13:54:46 +0800 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20=20=E6=B7=BB=E5=8A=A0AlipayPlus?= =?UTF-8?q?=E8=B4=B9=E7=8E=87=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impls/ClientManagerImpl.java | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) 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 bd519bf5c..d4bfadbc0 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 @@ -2013,14 +2013,33 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid configNewClientRate(config, clientId, "AlipayOnline", "alipayonline_rate_value", org, "min_alipayonline_rate"); configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); configNewClientRate(config, clientId, "CB_BankPay", "cb_bankpay_rate_value", org, "min_cb_bankpay_rate"); + addAlipayPlusRateConfig(config,clientId,PayChannel.ALIPAY_PLUS.getChannelCode()); } + private void addAlipayPlusRateConfig(JSONObject config,int clientId, String channel){ + if (config.getString("alipay_cn_retail") != null){ + config.put("pay_type","alipay_cn_retail"); + configNewClientRate(config, clientId, channel, "alipay_cn_retail", null, null); + } + if (config.getString("alipay_cn_online")!= null){ + config.put("pay_type","alipay_cn_online"); + configNewClientRate(config, clientId, channel, "alipay_cn_online", null,null); + } + if (config.getString("alipay_other")!= null){ + config.put("pay_type","alipay_other"); + configNewClientRate(config, clientId, channel, "alipay_other", null,null); + } + config.remove("pay_type"); + } + + private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) { if (config.containsKey(rateKey)) { JSONObject newConfig = new JSONObject(); newConfig.putAll(config); newConfig.put("rate_value", config.getBigDecimal(rateKey)); newConfig.put("rate_name", channel); + newConfig.put("pay_type",config.getString("pay_type")); if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) { return; } @@ -2033,10 +2052,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid newConfig.put("ext_rates", extRateParams.toJSONString()); } else { List existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel); - for (JSONObject rateLog : existRate) { - rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1)); - clientRateMapper.updateConfig(rateLog); - } + existRate.stream().filter(existConfig->{ + if(existConfig.getDate("active_time").equals(config.getDate("active_time")) && existConfig.getDate("expiry_time").equals(config.getDate("expiry_time")) ){ + return false; + } + return true; + } + ) + .forEach((rateLog)->{ + rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1)); + clientRateMapper.updateConfig(rateLog); + }); } if ("cb_bankpay".equalsIgnoreCase(channel)) { if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) { From 632eb6624f10334123a783d50330939e1eaf9bec Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 29 Mar 2021 17:48:52 +0800 Subject: [PATCH 10/10] version upgrade --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3dae2efc..ee1192967 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.3.78 + 2.3.79-SNAPSHOT UTF-8 2.4.0