From 39a6658b155a1104aa1cd3d3151c896414652e6e Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 11 Sep 2018 13:57:48 +0800 Subject: [PATCH 01/27] app style --- .../payment/manage/appclient/core/RetailAppService.java | 2 ++ .../manage/appclient/core/impls/RetailAppServiceImp.java | 5 +++++ .../payment/manage/appclient/web/RetailAppController.java | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index b0138c63c..1706ade3a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -163,4 +163,6 @@ public interface RetailAppService { JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean); void saveCouponAccuessLog(int client_id, String coupon_id); + + JSONObject getStyle(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index f8f3a01a9..c441fcd24 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -498,6 +498,11 @@ public class RetailAppServiceImp implements RetailAppService { couponAccuessLogMapper.save(couponAccuessLog); } + @Override + public JSONObject getStyle() { + return royalPayCMSSupport.getStyle(); + } + @Override public void updateClient(JSONObject device, AppClientBean appClientBean) { String clientType = device.getString("client_type"); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index 003e7b8ca..00f5b7ce9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -574,4 +574,9 @@ public class RetailAppController { retailAppService.saveCouponAccuessLog(client_id, coupon_id); } + @RequestMapping(value = "/style", method = RequestMethod.GET) + public JSONObject getStyle() { + return retailAppService.getStyle(); + } + } From efd2185622c6c27d67569e01112504468c5d738c Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Sep 2018 18:44:06 +0800 Subject: [PATCH 02/27] add asd --- .../core/impls/RetailAppServiceImp.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index f8f3a01a9..4227c5cdc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1771,8 +1771,22 @@ public class RetailAppServiceImp implements RetailAppService { JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); JSONArray acts = res.getJSONArray("data"); if (acts.size() > 0) { + int selectNo = RandomUtils.nextInt(0, acts.size()); - return acts.getJSONObject(selectNo); + JSONObject getActs = acts.getJSONObject(selectNo); + getActs.put("ad_cover", getActs.getString("page_desc")); + getActs.put("ad_mode", getActs.getString("page_keywords")); + getActs.put("ad_link", getActs.getString("summery")); + getActs.put("publish_date", getActs.getString("publish_time")); + getActs.put("ad_type", (getActs.getJSONObject("reference")).getString("ad_type")); + getActs.put("expire_date", (getActs.getJSONObject("reference")).getString("expire_date")); + getActs.put("duration_time", (getActs.getJSONObject("reference")).getString("duration_time")); + getActs.remove("reference"); + getActs.remove("page_desc"); + getActs.remove("page_keywords"); + getActs.remove("summery"); + getActs.remove("publish_time"); + return getActs; } return null; From 94c1d0649733adc0eaabae3fe19942026362898a Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Sep 2018 20:11:12 +0800 Subject: [PATCH 03/27] fix asd --- .../manage/appclient/core/RetailAppService.java | 4 ++-- .../core/impls/RetailAppServiceImp.java | 9 ++------- .../appclient/web/RetailAppController.java | 13 ------------- .../web/RetailValidationController.java | 17 +++++++++++++++++ 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index b0138c63c..4a76e15e6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -120,9 +120,9 @@ public interface RetailAppService { void useCoupon(JSONObject device, String coupon_log_id); - JSONObject getAd(JSONObject device); + JSONObject getAd(); - JSONObject getAdDetail(JSONObject device, String article_id); + JSONObject getAdDetail(String article_id); JSONObject getCheckClientInfo(JSONObject device); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 4227c5cdc..2fdb163d8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1765,13 +1765,10 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public JSONObject getAd(JSONObject device) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); + public JSONObject getAd() { JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); JSONArray acts = res.getJSONArray("data"); if (acts.size() > 0) { - int selectNo = RandomUtils.nextInt(0, acts.size()); JSONObject getActs = acts.getJSONObject(selectNo); getActs.put("ad_cover", getActs.getString("page_desc")); @@ -1793,9 +1790,7 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public JSONObject getAdDetail(JSONObject device, String article_id) { - String clientType = device.getString("client_type"); - deviceSupport.findRegister(clientType); + public JSONObject getAdDetail(String article_id) { JSONObject res = royalPayCMSSupport.getArticle("app_ad", article_id); Document doc = Jsoup.parse(res.getString("content")); String father = "
"; diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index 003e7b8ca..ac2e2f325 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -395,19 +395,6 @@ public class RetailAppController { } /* 优惠券End */ - /** - * 广告位 - */ - @RequestMapping(value = "/ads", method = RequestMethod.GET) - public JSONObject getAd(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getAd(device); - } - - @RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET) - public JSONObject getAdDetail(@PathVariable String article_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getAdDetail(device, article_id); - } - @RequestMapping(value = "/bills/{bill_id}", method = RequestMethod.GET) public JSONObject getBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { return billService.getBillDetail(bill_id, device.getIntValue("client_id")); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index d00114502..5194f557a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -1,7 +1,9 @@ package au.com.royalpay.payment.manage.appclient.web; import au.com.royalpay.payment.manage.appclient.beans.RetailLoginInfo; +import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; +import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.http.HttpUtils; @@ -32,6 +34,8 @@ public class RetailValidationController { private SignInStatusManager signInStatusManager; @Resource private DeviceSupport deviceSupport; + @Resource + private RetailAppService retailAppService; @RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST) public JSONObject register(@RequestBody String registeration, @PathVariable String devType) { @@ -91,4 +95,17 @@ public class RetailValidationController { } return res; } + + /** + * 广告位 + */ + @RequestMapping(value = "/ads", method = RequestMethod.GET) + public JSONObject getAd() { + return retailAppService.getAd(); + } + + @RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET) + public JSONObject getAdDetail(@PathVariable String article_id) { + return retailAppService.getAdDetail( article_id); + } } From 9d05bcd948402bf2c0d2c3ac3a45a84874085ff1 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Sep 2018 20:26:23 +0800 Subject: [PATCH 04/27] fix asd --- .../manage/appclient/core/impls/RetailAppServiceImp.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 2fdb163d8..a2511d5df 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1767,6 +1767,9 @@ public class RetailAppServiceImp implements RetailAppService { @Override public JSONObject getAd() { JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); + logger.debug("ddddddddddddddddasda " + res.toJSONString()); + System.out.println("ddddddddddddddddasda " + res.toJSONString()); + JSONArray acts = res.getJSONArray("data"); if (acts.size() > 0) { int selectNo = RandomUtils.nextInt(0, acts.size()); From 01dcc58ccb6ad65ad430a75fbc3c7a2b5f0b2e27 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 11 Sep 2018 20:58:41 +0800 Subject: [PATCH 05/27] fix asd --- .../appclient/core/impls/RetailAppServiceImp.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index a2511d5df..904b60c3a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1767,9 +1767,6 @@ public class RetailAppServiceImp implements RetailAppService { @Override public JSONObject getAd() { JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); - logger.debug("ddddddddddddddddasda " + res.toJSONString()); - System.out.println("ddddddddddddddddasda " + res.toJSONString()); - JSONArray acts = res.getJSONArray("data"); if (acts.size() > 0) { int selectNo = RandomUtils.nextInt(0, acts.size()); @@ -1778,9 +1775,11 @@ public class RetailAppServiceImp implements RetailAppService { getActs.put("ad_mode", getActs.getString("page_keywords")); getActs.put("ad_link", getActs.getString("summery")); getActs.put("publish_date", getActs.getString("publish_time")); - getActs.put("ad_type", (getActs.getJSONObject("reference")).getString("ad_type")); - getActs.put("expire_date", (getActs.getJSONObject("reference")).getString("expire_date")); - getActs.put("duration_time", (getActs.getJSONObject("reference")).getString("duration_time")); + String reference = getActs.getString("reference"); + JSONObject referenceObj = JSONObject.parseObject(reference); + getActs.put("ad_type", referenceObj.getString("ad_type")); + getActs.put("expire_date", referenceObj.getString("expire_date")); + getActs.put("duration_time", referenceObj.getString("duration_time")); getActs.remove("reference"); getActs.remove("page_desc"); getActs.remove("page_keywords"); From 823fe881a8c59917da28877fcef41c919bd66e8c Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 12 Sep 2018 09:41:15 +0800 Subject: [PATCH 06/27] fix asd --- .../manage/appclient/core/impls/RetailAppServiceImp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 904b60c3a..8245ab78b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1774,7 +1774,7 @@ public class RetailAppServiceImp implements RetailAppService { getActs.put("ad_cover", getActs.getString("page_desc")); getActs.put("ad_mode", getActs.getString("page_keywords")); getActs.put("ad_link", getActs.getString("summery")); - getActs.put("publish_date", getActs.getString("publish_time")); + getActs.put("publish_date", DateFormatUtils.format(getActs.getDate("publish_time"),"yyyy/MM/dd HH:mm:ss")); String reference = getActs.getString("reference"); JSONObject referenceObj = JSONObject.parseObject(reference); getActs.put("ad_type", referenceObj.getString("ad_type")); From 1af0a9890ee2b30ac14f234e56f6aa898bbd8543 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 12 Sep 2018 13:57:07 +0800 Subject: [PATCH 07/27] add cms reference --- src/main/ui/static/cms/cms.js | 4 ++++ .../static/cms/templates/article_editor.html | 24 +++++++++++++++++-- .../ui/static/cms/templates/articles.html | 6 ++--- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index 2c6363284..09a9e5eae 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -109,6 +109,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', function ($scope, $http, $state, $stateParams, commonDialog) { $scope.saveArticle = function () { + $scope.article.reference =$scope.reference; $http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) { $state.go('^.article_view', {articleId: resp.data.article_id}); }, function (resp) { @@ -119,7 +120,10 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) { $scope.article = article.data; + $scope.reference = JSON.parse($scope.article.reference); + $scope.saveArticle = function () { + $scope.article.reference =$scope.reference; $http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) { $state.go('^.article_view', {articleId: $stateParams.articleId}); }, function (resp) { diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 0ead12acb..7c9cd1bf5 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -20,7 +20,7 @@
-

(重要!!!0:不允许跳转 1:跳转编辑内容 2:跳转到外链)

+

(重要!!!0:不允许跳转 1:跳转到外链)

@@ -40,7 +40,27 @@

(若有外链,则填,否则留空)

- +
+ +
+ +

(广告封面 type=0时 为图片地址 type=1时 为视频地址)

+
+
+
+ +
+ +

(广告过期时间 格式为: 2018/10/01 00:00:00)

+
+
+
+ +
+ +

(广告展示时间(s))

+
+
diff --git a/src/main/ui/static/cms/templates/articles.html b/src/main/ui/static/cms/templates/articles.html index bb4489ce7..046393f0a 100644 --- a/src/main/ui/static/cms/templates/articles.html +++ b/src/main/ui/static/cms/templates/articles.html @@ -31,7 +31,7 @@ Title Add Time Published - Recommended + Operation @@ -44,11 +44,11 @@ - + From 14e130316ecbfc1a7d8d54ee186659f3cc1e2ee0 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 14:22:39 +0800 Subject: [PATCH 08/27] update --- src/main/ui/static/lib/rpay/app_pay_2.js | 394 ++++++++++++++++++++++ src/main/ui/static/lib/rpay/rpay_jssdk.js | 58 ++++ 2 files changed, 452 insertions(+) create mode 100644 src/main/ui/static/lib/rpay/app_pay_2.js create mode 100644 src/main/ui/static/lib/rpay/rpay_jssdk.js diff --git a/src/main/ui/static/lib/rpay/app_pay_2.js b/src/main/ui/static/lib/rpay/app_pay_2.js new file mode 100644 index 000000000..076527393 --- /dev/null +++ b/src/main/ui/static/lib/rpay/app_pay_2.js @@ -0,0 +1,394 @@ +/** + * Created by yixian on 2017-05-08 + */ + +$(function () { + 'use strict'; + var dataCache = {price: '0', coupons: [], coupon_groups:{}}; + var exchangeRate = parseFloat(window.exchange_rate); + + dataCache.paying = false; + var ctrl = {}; + + $('.weui_grid.key').bind('touchstart', function () { + if (dataCache.paying) { + return; + } + var char = $(this).attr('data-char'); + appendChar(char); + }); + + $('.coupons .use-check').click(function () { + if ($(this).hasClass('disabled')) { + return; + } + var couponId = $(this).attr('data-coupon-id'); + var couponGroup = $(this).attr('data-coupon-group'); + if (couponGroup) { + var prevCouponId = dataCache.coupon_groups[couponGroup]; + if (prevCouponId) { + var prevIdx = dataCache.coupons.indexOf(prevCouponId); + if (prevIdx >= 0) { + dataCache.coupons.splice(prevIdx, 1); + } + if (prevCouponId!=couponId) { + $('.coupons .use-check[data-coupon-id="' + prevCouponId + '"]').removeClass('checked').addClass('unchecked'); + dataCache.coupon_groups[couponGroup] = couponId; + }else { + dataCache.coupon_groups[couponGroup]= null; + } + }else { + dataCache.coupon_groups[couponGroup] = couponId; + } + + } + + if ($(this).is('.checked')) { + $(this).removeClass('checked').addClass('unchecked'); + } else { + $(this).removeClass('unchecked').addClass('checked'); + } + var checked = $(this).is('.checked'); + if (checked) { + dataCache.coupons.push(couponId); + updatePrice(); + } else { + var idx = dataCache.coupons.indexOf(couponId); + dataCache.coupons.splice(idx, 1); + updatePrice(); + } + }); + + $('#key_B').bind('touchstart', function () { + backspace(); + }); + + function updatePoundage(price) { + if (window.extensions.indexOf('customerrate') >= 0 && window.rateValue != null) { + if (window.use_customised_rate) { + var rate = new Decimal(100).plus(window.rateValue).div(100); + var poundageValue = new Decimal(dataCache.price).mul(rate).sub(dataCache.price); + } else { + var rateRemain = new Decimal(100).sub(window.rateValue).div(100); + poundageValue = new Decimal(dataCache.price).div(rateRemain).sub(dataCache.price); + } + dataCache.poundageValue = poundageValue.toFixed(2, Decimal.ROUND_HALF_UP); + return poundageValue.plus(price).toFixed(2, Decimal.ROUND_HALF_UP); + } + return price; + } + + function updatePrice() { + $('#audVal').html(dataCache.price); + var realPrice = dataCache.price; + $('#audValReal').html(realPrice); + var surchargeData = calculateSurcharge(realPrice); + + dataCache.tax = surchargeData.tax; + dataCache.surcharge = surchargeData.surcharge; + var price = surchargeData.newPrice || realPrice; + var priceBeforeDiscount = price; + dataCache.discounts = []; + $(window.coupons).each(function () { + price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); + }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); + dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); + var rate = 'CNY' == window.currency ? 1 : exchangeRate; + var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); + $('#cnyVal').html(cnyVal); + dataCache.currencyPrice = 'CNY' == window.currency ? Decimal.div(priceBeforeDiscount, exchangeRate).toFixed(2, Decimal.ROUND_FLOOR) : priceBeforeDiscount; + } + + function updatePoundageStatus() { + $(window.coupons).each(function () { + var coupon = this; + var couponId = coupon.couponId(); + if (coupon.isEnable(dataCache.currencyPrice||0)) { + $('.coupons .use-check[data-coupon-id=' + couponId + ']').removeClass('disabled'); + } else { + var dom = $('.coupons .use-check[data-coupon-id=' + couponId + ']').addClass('disabled'); + var couponGroup = dom.attr('data-coupon-group'); + if (couponGroup) { + if (dataCache.coupon_groups[couponGroup] == couponId) { + dataCache.coupon_groups[couponGroup] = null; + } + } + var idx = dataCache.coupons.indexOf(couponId); + if (idx >= 0) { + dataCache.coupons.splice(idx, 1); + } + dom.removeClass('checked').addClass('unchecked'); + } + }) + } + updatePoundageStatus(); + + function backspace() { + dataCache.price = dataCache.price.substring(0, dataCache.price.length - 1); + if (dataCache.price.length == 0) { + dataCache.price = '0'; + } + updatePrice(); + updatePoundageStatus(); + } + + function appendChar(char) { + var pointLocation = dataCache.price.indexOf('.'); + if (pointLocation >= 0 || char == '.' || dataCache.price.length < 5) { + if (pointLocation >= 0 && char == '.') { + return; + } + if (pointLocation >= 0 && pointLocation <= dataCache.price.length - 3) { + return; + } + if (dataCache.price == '0' && char != '.') { + dataCache.price = ''; + } + dataCache.price += char; + updatePrice(); + updatePoundageStatus(); + } + } + + $('#coupon-box-toggle').click(function () { + $('.coupons-container').addClass('show') + }); + $('.coupons-container>.coupons-mask,.coupons-container #close-coupon-box').click(function () { + $(this).parents('.coupons-container').removeClass('show'); + }); + + + + $('.remark-btn').click(function () { + var cfg = { + title: '备注 Remark', + template: '', + initialize: function (dialog) { + $('').addClass('remark-input').attr('name', 'remark').val(dataCache.remark || '').appendTo($('.weui_dialog_bd', dialog)); + }, + confirm: function (dialog, chosen) { + if (chosen) { + var remark = $('textarea[name="remark"]', dialog).val(); + if (remark) { + $('#remark-box').text('备注:' + remark).show() + } else { + $('#remark-box').text('').hide(); + } + dataCache.remark = remark; + } + + } + }; + showWeuiDialog(cfg); + }); + + $('.paydetail').click(function () { + var config = { + title: 'Payment Detail', + template: '', + initialize: function (dialog) { + var bd = $('.weui_dialog_bd', dialog); + var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; + $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd); + } + $(dataCache.discounts).each(function () { + $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); + }); + $('

').addClass('final').html('Final 支付金额:' + currencySymbol + (dataCache.finalPrice || 0)).appendTo(bd); + } + }; + showWeuiDialog(config); + }); + + $('#key_P').bind('touchstart', function () { + + pay(); + + // $('#key_P').addClass('hidden'); + // $('#key_Loading').removeClass('hidden'); + // if (dataCache.paying) { + // return; + // } + // dataCache.paying = true; + // var data = {price: dataCache.price + '', original_number: true, currency: window.currency}; + // if (dataCache.remark) { + // data.description = dataCache.remark; + // } + // if (window.extensions.indexOf('preauthorize') >= 0) { + // data.preauthorize = true; + // } + // if (window.extensions.indexOf('qrcodemode') >= 0) { + // data.qrmode = true; + // } + // if (window.extensions.indexOf('customerrate') >= 0) { + // data.customerrate = true; + // } + // data.coupons = dataCache.coupons; + // dataCache.remark = ''; + // data.account_id = User.getProduct(); + // data.qrcodeVersion = window.qrcodeVersion; + // $.ajax({ + // url: '/api/v1.0/bestpay/partners/' + window.client_moniker + '/app_order', + // method: 'POST', + // data: JSON.stringify(data), + // dataType: 'json', + // contentType: 'application/json', + // success: function (pay) { + // if (pay.direct_paid) { + // window.location = '/api/v1.0/bestpay/partners/' + window.client_moniker + '/orders/' + pay.order_id; + // return; + // } + // var paydata = pay.params; + // try { + // Payment.onPay(paydata, function () { + // window.location = '/api/v1.0/bestpay/partners/' + window.client_moniker + '/orders/' + pay.order_id; + // dataCache.paying = false; + // $('#key_P').removeClass('hidden'); + // $('#key_Loading').addClass('hidden'); + // }, function (rescode) { + // dataCache.paying = false; + // if (rescode === "cancel") { + // Dialog.alert("支付取消" + rescode) + // } else { + // Dialog.alert("支付失败" + rescode) + // } + // $('#key_P').removeClass('hidden'); + // $('#key_Loading').addClass('hidden'); + // }) + // } catch (e) { + // Dialog.alert(e); + // dataCache.paying = false; + // $('#key_P').removeClass('hidden'); + // $('#key_Loading').addClass('hidden'); + // } + // Dialog.dismissDialog(dataCache.process); + // }, + // error: function (jqXhr) { + // Dialog.alert(jqXhr.responseJSON.message); + // Dialog.dismissDialog(dataCache.process); + // dataCache.paying = false; + // $('#key_P').removeClass('hidden'); + // $('#key_Loading').addClass('hidden'); + // } + // }); + }); + + function showWeuiDialog(config) { + if (config.templateUrl) { + $.ajax({ + url: config.templateUrl, + dataType: 'html', + success: function (template) { + buildDialog(template); + } + }); + } else { + buildDialog(config.template); + } + + + function buildDialog(template) { + var defaultConfig = {backdrop: true}; + config = $.extend({}, defaultConfig, config); + var dialog = $("
", {class: 'weui_dialog_confirm'}); + var mask = $('
', {class: 'weui_mask'}).appendTo(dialog); + if (config.backdrop) { + mask.click(function () { + dialog.remove(); + if ($.isFunction(config.dismiss)) { + config.dismiss(); + } + }) + } + var dialogBox = $("
", {class: 'weui_dialog'}).appendTo(dialog); + if (config.title) { + $('
', {class: 'weui_dialog_hd'}).append($('', {class: 'weui_dialog_title'}).html(config.title)).appendTo(dialogBox); + } + var dialogBody = $("
", {class: 'weui_dialog_bd'}).appendTo(dialogBox); + if (template) { + dialogBody.append(template); + } + if ($.isFunction(config.initialize)) { + config.initialize(dialog); + } + var ft = $('
').appendTo(dialogBox); + if ($.isFunction(config.confirm)) { + var yes = $('', {class: 'weui_btn_dialog primary', text: 'OK'}).appendTo(ft); + yes.click(function () { + config.confirm(dialog, true); + dialog.remove(); + }); + var no = $('', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft); + no.click(function () { + config.confirm(dialog, false); + dialog.remove(); + }) + } else { + var ok = $('', {class: 'weui_btn_dialog primary', text: 'OK'}).appendTo(ft); + ok.click(function () { + dialog.remove(); + }) + } + dialog.appendTo($('body')); + } + + } + + + function getUserId(){ + window.RPayPlus.send("getUserId", null, function(data){ + alert(data); + }); + } + + function pay(){ + var order={ + orderId:'00002', + amount:'$100.07', + title:'Gift card purchase' + }; + window.RPayPlus.send('pay', order, function(data){ + alert('this is callback from native and data='+JSON.stringify(data)); + }); + } + + function back(){ + window.RPayPlus.send("back", null, null); + } + + function jsInvoke(){ + window.RPayPlus.send("jsInvoke", 'Native Test', null); + } + + function createOrder(msg){ + alert('create order information='+JSON.stringify(msg)); + } + + function queryOrder(msg){ + alert('query order information='+JSON.stringify(msg)); + + var order={ + orderId:'00001', + amount:'$10.98', + title:'Balance Top-UP' + }; + setTimeout("window.RPayPlus.onResult("+JSON.stringify(order)+");", 1500); + } + + function registerJs(){ + window.RPayPlus.register('createOrder', function(data){ + createOrder(data); + }); + window.RPayPlus.register('queryOrder', function(data){ + queryOrder(data); + }); + } + + function init() { + registerJs(); + getUserId(); + } +}); \ No newline at end of file diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js new file mode 100644 index 000000000..39aa6afe9 --- /dev/null +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -0,0 +1,58 @@ +(function (){ + var callbacks = {}; + var functions = {}; + + window.RPayPlus = { + // 向Native端发送消息,用于实现:JS->Native + send: function(methodName, param, callback) { + var thisId = 0; + if(callback){ + thisId = new Date().getTime();; // 获取唯一id + callbacks[thisId] = callback; // 存储Callback + } + var json = { + method: methodName, + data: param || {}, + callbackId: thisId // 传到 Native 端 + }; + var msg = JSON.stringify(json); + + var u = navigator.userAgent; + var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); + if(isiOS){ + window.webkit.messageHandlers.rpayplus.postMessage(msg); + } else{ + rpayplus.send(msg); + } + }, + + // 接收来自Native发送的消息,用于实现Native->JS + receive: function(msg) { + var method = msg.methodName, + data = msg.data || {}, + callbackId = msg.callbackId; // JS->Native的回调函数ID + + // 具体逻辑 bridgeName 和 callbackId 不会同时存在; + // callbackId有效,表示此接收信息源自JS->Native的回调 + // callbackId无效,且method有效,表示是Native->JS的直接调用 + if (callbackId && callbacks[callbackId]) { + callbacks[callbackId](msg.data); // 执行调用 + return; + } + if (method && functions[method]) { + functions[method](msg); + } + }, + // 注册JS方法,供Native调用,未被注册的方法,Native无法调用 + register: function(methodName, callback) { + if (!functions[methodName]) { + functions[methodName] = callback; + } + }, + + // JS端逻辑处理完成后,回调给Native的数据 + onResult: function(data){ + window.RPayPlus.send("jsCallback", data, null); + } + }; + })(); \ No newline at end of file From 32aad0f13c6af1b0ef2e1645d0fb62640fda2e7b Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 14:32:02 +0800 Subject: [PATCH 09/27] update --- src/main/ui/static/lib/rpay/app_pay_2.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/lib/rpay/app_pay_2.js b/src/main/ui/static/lib/rpay/app_pay_2.js index 076527393..c9b29ed8a 100644 --- a/src/main/ui/static/lib/rpay/app_pay_2.js +++ b/src/main/ui/static/lib/rpay/app_pay_2.js @@ -386,9 +386,6 @@ $(function () { queryOrder(data); }); } - - function init() { - registerJs(); - getUserId(); - } + registerJs(); + getUserId(); }); \ No newline at end of file From 9ba1500808718b8571ae5a8c0d85572c167ae8b4 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 14:46:24 +0800 Subject: [PATCH 10/27] update --- src/main/ui/static/lib/rpay/app_pay_2.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/ui/static/lib/rpay/app_pay_2.js b/src/main/ui/static/lib/rpay/app_pay_2.js index c9b29ed8a..5126e7f98 100644 --- a/src/main/ui/static/lib/rpay/app_pay_2.js +++ b/src/main/ui/static/lib/rpay/app_pay_2.js @@ -386,6 +386,5 @@ $(function () { queryOrder(data); }); } - registerJs(); getUserId(); }); \ No newline at end of file From 999df149c05dee556a30bef7a9e28e3dc1f118da Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 14:57:38 +0800 Subject: [PATCH 11/27] fixbug parent client invalid --- src/main/ui/static/lib/rpay/rrlogo.png | Bin 0 -> 2719 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/ui/static/lib/rpay/rrlogo.png diff --git a/src/main/ui/static/lib/rpay/rrlogo.png b/src/main/ui/static/lib/rpay/rrlogo.png new file mode 100644 index 0000000000000000000000000000000000000000..bd87d97d2710e80eec1a217f9943a03736e9ebb6 GIT binary patch literal 2719 zcmV;Q3Sjk#P)Px)}R25~A@tVABWn?%GwcJDo3f9LMr zC94z>#eaHc&OP7x&Ue1^_@3u7p+tUKI8tKjRT4T`_mgE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 +0800 Subject: [PATCH 12/27] add act 10-31 --- .../core/impls/RetailAppServiceImp.java | 16 +++++++++++++--- .../manage/mappers/act/ActChairtyMapper.xml | 6 +++--- src/main/ui/static/cms/cms.js | 6 +++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 8245ab78b..b7d41a676 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1777,9 +1777,19 @@ public class RetailAppServiceImp implements RetailAppService { getActs.put("publish_date", DateFormatUtils.format(getActs.getDate("publish_time"),"yyyy/MM/dd HH:mm:ss")); String reference = getActs.getString("reference"); JSONObject referenceObj = JSONObject.parseObject(reference); - getActs.put("ad_type", referenceObj.getString("ad_type")); - getActs.put("expire_date", referenceObj.getString("expire_date")); - getActs.put("duration_time", referenceObj.getString("duration_time")); + if (reference != null) { + if (referenceObj.getString("ad_type") != null) { + getActs.put("ad_type", referenceObj.getString("ad_type")); + } + if (referenceObj.getString("expire_date") != null) { + getActs.put("expire_date", referenceObj.getString("expire_date")); + } + if (referenceObj.getString("duration_time") != null) { + getActs.put("duration_time", referenceObj.getString("duration_time")); + } + }else { + getActs.put("message", "mess : (ad_type && expire_date && duration_time) not set"); + } getActs.remove("reference"); getActs.remove("page_desc"); getActs.remove("page_keywords"); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml index addc41843..26ec3bbbf 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml @@ -6,7 +6,7 @@ from act_charity left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time - and pmt_transactions.transaction_time<'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09' + and pmt_transactions.transaction_time<'2018-10-31' and pmt_transactions.transaction_time>='2018-07-09' and pmt_transactions.channel != 'Settlement' GROUP BY act_charity.client_id order by count_ordernum desc @@ -14,7 +14,7 @@ select count(DISTINCT order_id) as count_ordernum,date_format(pmt_transactions.transaction_time,'%Y-%m-%d') as orderdate,client_moniker,ifnull(sum(pmt_transactions.clearing_amount),0) as sum_ordernum from act_charity inner JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end} and pmt_transactions.transaction_time>=act_charity.active_time and pmt_transactions.channel != 'Settlement' - and pmt_transactions.transaction_time<'2018-09-01' and pmt_transactions.transaction_time>='2018-07-09' + and pmt_transactions.transaction_time<'2018-10-31' and pmt_transactions.transaction_time>='2018-07-09' group by date_format(pmt_transactions.transaction_time,'%Y-%m-%d') @@ -22,7 +22,7 @@ \ No newline at end of file diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index 09a9e5eae..3ab730034 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -120,7 +120,11 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) { $scope.article = article.data; - $scope.reference = JSON.parse($scope.article.reference); + if ($scope.article.reference) { + $scope.reference = JSON.parse($scope.article.reference); + }else { + $scope.reference = {}; + } $scope.saveArticle = function () { $scope.article.reference =$scope.reference; From eddcef50db9ec3b1c11db7bf8d2bb86a18200102 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 12 Sep 2018 16:00:57 +0800 Subject: [PATCH 13/27] fix risk --- .../mappers/risk/RiskAttentionMerchantsMapper.java | 10 +++++----- .../manage/merchants/core/impls/ClientManagerImpl.java | 9 +++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java index 3cd1d943f..b97ddb822 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java @@ -34,11 +34,11 @@ public interface RiskAttentionMerchantsMapper { PageList query(JSONObject params, PageBounds pagination); @Select("SELECT client_moniker FROM risk_attention_merchants " + - "WHERE (abn LIKE CONCAT('%',#{abn},'%') ) OR (acn LIKE CONCAT('%',#{acn},'%') ) " + - " OR (contact_phone LIKE CONCAT('%',#{contact_phone},'%') ) " + - " OR (contact_person LIKE CONCAT('%',#{contact_person},'%') ) " + - " OR (client_moniker LIKE CONCAT('%',#{client_moniker},'%') ) " + - " OR (bank_account_no LIKE CONCAT('%',#{bank_account_no},'%') ) AND is_valid=1") + "WHERE (abn = #{abn} ) OR (acn = #{acn} ) " + + " OR (contact_phone = #{contact_phone} ) " + + " OR (contact_person = #{contact_person} ) " + + " OR (client_moniker = #{client_moniker} ) " + + " OR (bank_account_no = #{bank_account_no} ) AND is_valid=1") List listRiskySimilarMerchants(JSONObject params); } 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 96e4b9fac..9b4699dc3 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 @@ -591,8 +591,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) { throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); } - //检查商户是否进入系统黑名单 - isRiskyMerchant(partner, null); + //2018-09-10,新建商户不检查是否在系统黑名单 + //isRiskyMerchant(partner, null); try { @@ -1184,6 +1184,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_hf_email_notice", allow)); } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); + + if (channel.equals("Wehcat") || channel.equals("Alipay")) { + + isRiskyMerchant(client,null); + } logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + channel + " to " + allow); return; From 89cbea2602115439e241a64d80c546ab5cd3ca9f Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:07:04 +0800 Subject: [PATCH 14/27] update --- src/main/ui/static/lib/rpay/rpay_jssdk.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index 39aa6afe9..30652a804 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -1,10 +1,11 @@ -(function (){ +$(function (){ var callbacks = {}; var functions = {}; window.RPayPlus = { // 向Native端发送消息,用于实现:JS->Native send: function(methodName, param, callback) { + alert(2); var thisId = 0; if(callback){ thisId = new Date().getTime();; // 获取唯一id @@ -16,7 +17,7 @@ callbackId: thisId // 传到 Native 端 }; var msg = JSON.stringify(json); - + alert(msg); var u = navigator.userAgent; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); if(isiOS){ @@ -55,4 +56,4 @@ window.RPayPlus.send("jsCallback", data, null); } }; - })(); \ No newline at end of file + }); \ No newline at end of file From d85f1c80df116802a8a98c2e4f05a9392f98c284 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:08:02 +0800 Subject: [PATCH 15/27] remove alert --- src/main/ui/static/lib/rpay/rpay_jssdk.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index 30652a804..e3f48ea99 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -5,7 +5,6 @@ $(function (){ window.RPayPlus = { // 向Native端发送消息,用于实现:JS->Native send: function(methodName, param, callback) { - alert(2); var thisId = 0; if(callback){ thisId = new Date().getTime();; // 获取唯一id @@ -17,7 +16,6 @@ $(function (){ callbackId: thisId // 传到 Native 端 }; var msg = JSON.stringify(json); - alert(msg); var u = navigator.userAgent; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); if(isiOS){ From 4afa869493c7d2a6ce0f96856f1e56ccc67b0ac0 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:22:23 +0800 Subject: [PATCH 16/27] update --- src/main/ui/static/lib/rpay/rpay_jssdk.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index e3f48ea99..72f374696 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -5,6 +5,7 @@ $(function (){ window.RPayPlus = { // 向Native端发送消息,用于实现:JS->Native send: function(methodName, param, callback) { + alert(1); var thisId = 0; if(callback){ thisId = new Date().getTime();; // 获取唯一id From e41a373fc800a3cbed8fba790f9124bf6e66f4d4 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:24:33 +0800 Subject: [PATCH 17/27] tmp --- src/main/ui/static/lib/rpay/app_pay_2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/lib/rpay/app_pay_2.js b/src/main/ui/static/lib/rpay/app_pay_2.js index 5126e7f98..7db103b93 100644 --- a/src/main/ui/static/lib/rpay/app_pay_2.js +++ b/src/main/ui/static/lib/rpay/app_pay_2.js @@ -339,6 +339,7 @@ $(function () { function getUserId(){ + alert(12); window.RPayPlus.send("getUserId", null, function(data){ alert(data); }); From d8b8a1bc81f45d186935984baa3845cce7de83df Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 12 Sep 2018 16:30:35 +0800 Subject: [PATCH 18/27] fix risk --- .../payment/manage/merchants/core/impls/ClientManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9b4699dc3..6e3121e91 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 @@ -1185,7 +1185,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); - if (channel.equals("Wehcat") || channel.equals("Alipay")) { + if (channel.equals("wechat") || channel.equals("alipay")) { isRiskyMerchant(client,null); } From 8bf48d053e644bb11125deef45a56c1bf3650014 Mon Sep 17 00:00:00 2001 From: yangkai Date: Wed, 12 Sep 2018 16:30:36 +0800 Subject: [PATCH 19/27] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=90=8E=E6=B7=BB=E5=8A=A0=E6=8A=BD=E5=A5=96=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerLotteryCountServiceImpl.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java new file mode 100644 index 000000000..dff151e40 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java @@ -0,0 +1,85 @@ +package au.com.royalpay.payment.manage.customers.core.impls; + +import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; +import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; +import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; +import cn.yixblog.platform.http.HttpRequestGenerator; +import cn.yixblog.platform.http.HttpRequestResult; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.codec.digest.DigestUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.util.UriComponentsBuilder; + +import javax.annotation.Resource; +import java.math.BigDecimal; + +@Service +public class CustomerLotteryCountServiceImpl implements ApplicationListener { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Value("${app.customer.host}") + private String CUSTOMER_HOST; + + @Value("${customer.app.appid}") + private String CUSTOMER_APP_ID; + + @Value("${customer.app.auth-code}") + private String CUSTOMER_AUTH_CODE; + + @Resource + private RoyalThreadPoolExecutor royalThreadPoolExecutor; + @Resource + private CustomerMapper customerMapper; + + @Override + public void onApplicationEvent(AfterPaymentFinishEvent event) { + final JSONObject order = event.getFinishedEvent().getOrder(); + BigDecimal clearAmount = event.getFinishedEvent().getAudFee(); + String channel = order.getString("channel"); + if ("Wechat".equals(channel)) { + JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id")); + if (customerRelation.getString("kanga_openid") == null) { + return; + } + royalThreadPoolExecutor.execute(() -> afterPaymentAddLotteryCount(customerRelation.getString("kanga_openid"), + order.getString("order_id"), channel, clearAmount)); + } + if ("Alipay".equals(channel)) { + royalThreadPoolExecutor.execute(() -> afterPaymentAddLotteryCount(order.getString("customer_id"), + order.getString("order_id"), channel, clearAmount)); + } + } + + private void afterPaymentAddLotteryCount(String id, String orderId, String channel, BigDecimal clearAmount) { + String timestamp = System.currentTimeMillis() + ""; + String base = CUSTOMER_APP_ID + timestamp + CUSTOMER_AUTH_CODE; + String sign = DigestUtils.sha256Hex(base).toLowerCase(); + String uri = UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "activity/luck_draw/payment/lottery/count") + .queryParam("appid", CUSTOMER_APP_ID) + .queryParam("timestamp", timestamp) + .queryParam("sign", sign) + .queryParam("id", id) + .queryParam("orderId", orderId) + .queryParam("channel", channel) + .queryParam("amount", clearAmount) + .toUriString(); + HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.POST); + try { + HttpRequestResult result = gen.execute(); + if (result.isSuccess()) { + int statusCode = result.getStatusCode(); + if (statusCode == 200) { + logger.info("抽奖次数添加成功"); + } + } + + } catch (Exception ignored) { + ignored.printStackTrace(); + } + } +} From 7d7931ceffff7770a0d878aa42c04e31ab04ac0e Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:37:48 +0800 Subject: [PATCH 20/27] update --- src/main/ui/static/lib/rpay/app_pay_2.js | 1 - src/main/ui/static/lib/rpay/rpay_jssdk.js | 1 - 2 files changed, 2 deletions(-) diff --git a/src/main/ui/static/lib/rpay/app_pay_2.js b/src/main/ui/static/lib/rpay/app_pay_2.js index 7db103b93..5126e7f98 100644 --- a/src/main/ui/static/lib/rpay/app_pay_2.js +++ b/src/main/ui/static/lib/rpay/app_pay_2.js @@ -339,7 +339,6 @@ $(function () { function getUserId(){ - alert(12); window.RPayPlus.send("getUserId", null, function(data){ alert(data); }); diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index 72f374696..e3f48ea99 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -5,7 +5,6 @@ $(function (){ window.RPayPlus = { // 向Native端发送消息,用于实现:JS->Native send: function(methodName, param, callback) { - alert(1); var thisId = 0; if(callback){ thisId = new Date().getTime();; // 获取唯一id From d6c7705e7ed3500b39a50d5c88bd7a32f1bb9556 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Wed, 12 Sep 2018 16:42:11 +0800 Subject: [PATCH 21/27] update --- src/main/ui/static/lib/rpay/rrlogo.png | Bin 2719 -> 8157 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/ui/static/lib/rpay/rrlogo.png b/src/main/ui/static/lib/rpay/rrlogo.png index bd87d97d2710e80eec1a217f9943a03736e9ebb6..3af67712923a52c8039bb022ce9b96218990f5a2 100644 GIT binary patch literal 8157 zcmV<3A0pt1P)003YJ1^@s6duco200001b5ch_0Itp) z=>Py9mq|oHRCodHT?v>J)wMpSdS(C-6)>(b&tODcm>ERe;)3XN*E}%;xI~F@OX3m} zVl>e_j7f|!ntY#ei7!tLYkbIneOVU zTh&WV-}`+%Q+4k>=brml)w$EeN_}@lC+lUjJs1I$RlMdX(lPB9=_?tWi0fT@+ zpwI{uL{UoJIR}!RIE`3FLjfL*N^I}1BHRMnSD;j1pepNWUOwwJfAr;@TN)Z_=q+m> zYNw$@G6cV!9E_N^!~Ygw_Bra0AHPQyuOVy4b-e7pt>s;-@T8MduIxh}{A*v}vL7++ zO}6X+90rh0+mS_E@qaVoKSPP{kjPpZ+M7hb{rz0o$~7K}F-B|XSbQ1BG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re2* zymmS+@+!}%bQ&_!%PGqMJ z2YA}dhQ*Z)GAJHX>MclQv(HQ>C<7TK;r!*T@Ab?aKhCzD+o9|eaE_hey8!SV7Mc6g zr!e*;@8;#_u1&{(#vUV5wXE6gagkufG$`#n+>I9QKRi6L>%9YikfiWO0Jt?2J_0%& z_2TdQrKs-`gvQzK0Lx#~3DSF(Wf*11uBRhbHKh;f0A?<9#OXH-{Z|EBPyB6K2~gKW zS)LHEn?Z}c65=g}mwG;b>1*3P60Z#`Z(jpgSFe1>1CTf^2CSW=$s0Q%tw}HI^aw_9$qC`_F&(e}j!8lW%&WM)`LIHH zGy_^oyF&DD9e_)Lxs9#wpffXtI0|4f4Mt{j76kkfl;Y;2kbYr9h9N`XFmu>2oBX~k zB$A(FVd{lKzn{jj^qfvwyR8fH@@y!Uekbd=*-Ms_2u*3kpP?gk5VKza?}y>OfA>k8 Z{tG~iZ)UX-1w#M;002ovPDHLkV1g Date: Wed, 12 Sep 2018 17:29:33 +0800 Subject: [PATCH 22/27] =?UTF-8?q?=E5=8F=AA=E5=85=81=E8=AE=B8pine=E5=95=86?= =?UTF-8?q?=E6=88=B7=E5=8F=82=E4=B8=8E=E6=94=AF=E4=BB=98=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customers/core/impls/CustomerLotteryCountServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java index dff151e40..f93ba3211 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java @@ -39,6 +39,10 @@ public class CustomerLotteryCountServiceImpl implements ApplicationListener Date: Wed, 12 Sep 2018 17:48:05 +0800 Subject: [PATCH 23/27] update --- .../core/impls/CustomerLotteryCountServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java index f93ba3211..4a20c7247 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerLotteryCountServiceImpl.java @@ -47,15 +47,16 @@ public class CustomerLotteryCountServiceImpl implements ApplicationListener afterPaymentAddLotteryCount(customerRelation.getString("kanga_openid"), - order.getString("order_id"), channel, clearAmount)); + afterPaymentAddLotteryCount(customerRelation.getString("kanga_openid"), order.getString("order_id"), channel, clearAmount); } if ("Alipay".equals(channel)) { - royalThreadPoolExecutor.execute(() -> afterPaymentAddLotteryCount(order.getString("customer_id"), - order.getString("order_id"), channel, clearAmount)); + afterPaymentAddLotteryCount(order.getString("customer_id"), order.getString("order_id"), channel, clearAmount); } } From f509f81377f2e3017abea231b2f82b19fbc75882 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 13 Sep 2018 09:55:19 +0800 Subject: [PATCH 24/27] fix risk --- .../core/impls/ClientManagerImpl.java | 25 ++++++++++++++++--- 1 file changed, 21 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 6e3121e91..f456698da 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 @@ -1185,10 +1185,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); - if (channel.equals("wechat") || channel.equals("alipay")) { + if (allow == true) { + if (channel.equals("wechat") || channel.equals("alipay")) { + int clientId = client.getIntValue("client_id"); + List clientBankAccounts = clientBankAccountMapper.clientBankAccounts(clientId); - isRiskyMerchant(client,null); + if (clientBankAccounts.size() > 0 ) { + isRiskyMerchant(client,clientBankAccounts.get(0)); + }else { + isRiskyMerchant(client,null); + } + + } } + logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + channel + " to " + allow); return; @@ -3844,9 +3854,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid List listRiskySimilarMerchants = riskAttentionMerchantsMapper.listRiskySimilarMerchants(needCheckParams); if (listRiskySimilarMerchants.size() > 0) { StringBuilder appendStr = new StringBuilder(); - listRiskySimilarMerchants.forEach(json -> appendStr.append(json.getString("client_moniker")).append(",")); + StringBuilder infoStr = new StringBuilder(); + + listRiskySimilarMerchants.forEach(json -> { + appendStr.append(json.getString("client_moniker")).append(","); + JSONObject riskInfo = riskAttentionMerchantsMapper.findByClientMoniker(json.getString("client_moniker")); + infoStr.append("ABN = " + riskInfo.getString("abn") + ",ACN = " + riskInfo.getString("acn") + ",contact_phone = " + riskInfo.getString("contact_phone") + ",contact_person = " + riskInfo.getString("contact_person") + ",bank_account_no = " + riskInfo.getString("bank_account_no")); + }); + appendStr.deleteCharAt(appendStr.length() - 1); - throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr + "】"); + throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr.toString().toUpperCase() + "】【" + infoStr + "】"); } } From 49cf2a4b9b8c32eab6ab83ab6b0d799a818a1ebb Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 13 Sep 2018 10:40:23 +0800 Subject: [PATCH 25/27] fix risk --- .../manage/merchants/core/impls/ClientManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 f456698da..c4ae3ac90 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 @@ -1185,6 +1185,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow)); + logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + + channel + " to " + allow); + if (allow == true) { if (channel.equals("wechat") || channel.equals("alipay")) { int clientId = client.getIntValue("client_id"); @@ -1198,9 +1201,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - - logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " - + channel + " to " + allow); return; } } From 0cdbe2add47b43944f80d4a6cacdcdd1ab1d4752 Mon Sep 17 00:00:00 2001 From: yangkai Date: Thu, 13 Sep 2018 13:31:40 +0800 Subject: [PATCH 26/27] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=90=8E=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=8A=BD=E5=A5=96=E8=B7=B3=E8=BD=AC=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/TransactionAnalysisMapper.java | 2 ++ .../customers/core/CustomerPointsService.java | 4 ++++ .../core/impls/CustomerPointsServiceImp.java | 13 ++++++++++++ .../web/CustomerPointsController.java | 12 +++++++---- .../mappers/TransactionAnalysisMapper.xml | 8 ++++++++ .../ui/static/templates/payment/success.js | 20 +++++++++++++++++++ 6 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java index a60d93f7e..c28d1b8b2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java @@ -76,4 +76,6 @@ public interface TransactionAnalysisMapper { PageList getAreaMerchantAmountAnalysis(JSONObject params,PageBounds pagination); List getAreaMerchantAmountByCycle(JSONObject params); + + JSONObject getOrderClearAmount(@Param("order_id") String order_id); } diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java index 80b89a490..f47965685 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/CustomerPointsService.java @@ -3,6 +3,8 @@ package au.com.royalpay.payment.manage.customers.core; import au.com.royalpay.payment.manage.customers.beans.GatewayParams; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; + /** * Created by yishuqian on 24/04/2017. */ @@ -19,4 +21,6 @@ public interface CustomerPointsService { int getOldPoints(String customer_id, String channel); int checkPointsAfterPay(String order_id); + + BigDecimal checkLotteryAfterPay(String order_id); } diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java index a4408b2b1..3cd2e8dad 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CustomerPointsServiceImp.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.customers.core.impls; import au.com.royalpay.payment.core.exceptions.SignInvalidException; import au.com.royalpay.payment.core.exceptions.SignTimeoutException; +import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.customers.beans.GatewayParams; import au.com.royalpay.payment.manage.customers.core.CustomerPointsService; import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper; @@ -21,6 +22,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; @@ -49,6 +51,8 @@ public class CustomerPointsServiceImp implements CustomerPointsService { private CustomerPointsMapper customerPointsMapper; @Resource private CustomerMembershipMapper customerMembershipMapper; + @Resource + private TransactionAnalysisMapper transactionAnalysisMapper; private String auth_code = "w2DgCF2cvlNHo3R6"; @@ -276,6 +280,15 @@ public class CustomerPointsServiceImp implements CustomerPointsService { } } + @Override + public BigDecimal checkLotteryAfterPay(String order_id) { + JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id); + if (order.getIntValue("client_id") != 9) { + return BigDecimal.valueOf(0); + } + return order.getBigDecimal("clearing_amount"); + } + /** * 获取过期积分 * diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java index 6652324b1..3163086d7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/web/CustomerPointsController.java @@ -2,12 +2,10 @@ package au.com.royalpay.payment.manage.customers.web; import au.com.royalpay.payment.manage.customers.core.CustomerPointsService; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; @Controller @RequestMapping(value = "/customers/points") @@ -21,4 +19,10 @@ public class CustomerPointsController { public int checkPointsAfterPay(@PathVariable String order_id) { return customerPointsService.checkPointsAfterPay(order_id); } + + @RequestMapping(value = "/lottery/{order_id}/check",method = RequestMethod.GET) + @ResponseBody + public BigDecimal checkLotteryAfterPay(@PathVariable String order_id) { + return customerPointsService.checkLotteryAfterPay(order_id); + } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 6809568a6..c54de2dab 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -863,4 +863,12 @@ GROUP BY c.client_id order by old_total desc + + \ No newline at end of file diff --git a/src/main/ui/static/templates/payment/success.js b/src/main/ui/static/templates/payment/success.js index 526e2751d..c48322bd2 100644 --- a/src/main/ui/static/templates/payment/success.js +++ b/src/main/ui/static/templates/payment/success.js @@ -69,6 +69,26 @@ $(function () { loadPoints(); + function loadLottery() { + $.ajax({ + url: '/customers/points/lottery/' + window.order_id + '/check', + method: 'GET', + dataType: 'text', + success: function (data) { + if (data >= 1.99) { + $('.points-title').html('恭喜您!获得抽奖奖励'); + $('.points-desc').html('使用RoyalPay任意消费满1.99澳币,获取1次抽奖机会'); + $('.points-dialog .points-value').html('+ ' + 1); + $('.points-dialog a').html('进入抽奖页面'); + $('.points-dialog a').attr("href","https://customer.royalpay.com.au/activity/luck_draw"); + $('.points-dialog').removeClass('hide'); + } + + }, error: function () { + } + }); + } + loadLottery(); $('.encourage-dialog .close-circle').click(function () { $('.encourage-dialog').addClass('hide'); }); From c8bdb1dd103e590d39f2d0aa18fc76356806f7e9 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Thu, 13 Sep 2018 14:55:25 +0800 Subject: [PATCH 27/27] fix --- .../core/impls/ClientManagerImpl.java | 25 ++++++++----------- .../redpack/ActPrizeTypeCustomerMapper.xml | 2 +- 2 files changed, 12 insertions(+), 15 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 c4ae3ac90..7364f74c3 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 @@ -6,6 +6,7 @@ import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient; import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; import au.com.royalpay.payment.core.PaymentChannelApi; +import au.com.royalpay.payment.core.beans.PayChannel; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; @@ -1187,19 +1188,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid logger.info(manager.getString("display_name") + "(" + manager.getString("manager_id") + ") switched client " + clientMoniker + " channel " + channel + " to " + allow); - - if (allow == true) { - if (channel.equals("wechat") || channel.equals("alipay")) { - int clientId = client.getIntValue("client_id"); - List clientBankAccounts = clientBankAccountMapper.clientBankAccounts(clientId); - - if (clientBankAccounts.size() > 0 ) { - isRiskyMerchant(client,clientBankAccounts.get(0)); - }else { - isRiskyMerchant(client,null); - } - + if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) { + int clientId = client.getIntValue("client_id"); + List clientBankAccounts = clientBankAccountMapper.clientBankAccounts(clientId); + + if (clientBankAccounts.size() > 0) { + isRiskyMerchant(client, clientBankAccounts.get(0)); + } else { + isRiskyMerchant(client, null); } + } return; } @@ -3861,9 +3859,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject riskInfo = riskAttentionMerchantsMapper.findByClientMoniker(json.getString("client_moniker")); infoStr.append("ABN = " + riskInfo.getString("abn") + ",ACN = " + riskInfo.getString("acn") + ",contact_phone = " + riskInfo.getString("contact_phone") + ",contact_person = " + riskInfo.getString("contact_person") + ",bank_account_no = " + riskInfo.getString("bank_account_no")); }); - appendStr.deleteCharAt(appendStr.length() - 1); - throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr.toString().toUpperCase() + "】【" + infoStr + "】"); + throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr.toString().toUpperCase() + "】【" + infoStr.toString() + "】"); } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml index 9c9c36919..d0e07513d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPrizeTypeCustomerMapper.xml @@ -18,7 +18,7 @@ SELECT t.*, count(p.red_packet_customer_order_id) total_counts, - sum(if(p.open_id IS NULL, 1, 0)) unsend_counts + SUM(ISNULL(p.open_id) AND p.red_pack_type_id IS NOT NULL) unsend_counts FROM act_prize_type_customer t LEFT JOIN act_red_packets_customer_orders p ON p.red_pack_type_id = t.type_id AND date(p.create_time) <= curdate()