From cbe23f90129a2606d51fa9e27df0a9e08d1e9b5f Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 30 Aug 2018 18:46:27 +0800 Subject: [PATCH 01/12] fix hf_gateway.js add #bankCard-li hide --- src/main/ui/static/templates/hf/gateway_payment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/templates/hf/gateway_payment.js b/src/main/ui/static/templates/hf/gateway_payment.js index f18730df8..cc692c065 100644 --- a/src/main/ui/static/templates/hf/gateway_payment.js +++ b/src/main/ui/static/templates/hf/gateway_payment.js @@ -2,6 +2,7 @@ $("#bank-li").hide(); $("#bankCard-li").hide(); var currentIndex = 0; $(".main .main-left ul li.tab-item").click(function () { + $("#qrode").hide(); var selectedIndex = $(this).index(); $(this).addClass("change-color").siblings().removeClass("change-color"); $(this).children(".s1").addClass("s1-change-color"); From dc103d5fd2966a150169e088f3a3a4a46c76521f Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Thu, 30 Aug 2018 18:59:39 +0800 Subject: [PATCH 02/12] update --- src/main/ui/static/templates/hf/gateway_payment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/templates/hf/gateway_payment.js b/src/main/ui/static/templates/hf/gateway_payment.js index cc692c065..1bfefa9a1 100644 --- a/src/main/ui/static/templates/hf/gateway_payment.js +++ b/src/main/ui/static/templates/hf/gateway_payment.js @@ -3,6 +3,7 @@ $("#bankCard-li").hide(); var currentIndex = 0; $(".main .main-left ul li.tab-item").click(function () { $("#qrode").hide(); + $("#payment-form").show(); var selectedIndex = $(this).index(); $(this).addClass("change-color").siblings().removeClass("change-color"); $(this).children(".s1").addClass("s1-change-color"); From 495bf22196e2c1e07e3acb8c7fb2a5496841b5e2 Mon Sep 17 00:00:00 2001 From: yangkai Date: Fri, 31 Aug 2018 10:47:47 +0800 Subject: [PATCH 03/12] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=8D=A1=E5=88=B8?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=202.=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?(client=5Fmoniker)=20=E3=80=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appclient/core/RetailAppService.java | 3 ++ .../core/impls/RetailAppServiceImp.java | 32 +++++++++++++++++++ .../appclient/web/RetailAppController.java | 10 ++++++ .../mappers/log/CouponAccuessLogMapper.java | 5 +++ 4 files changed, 50 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 b59deeae7..b0138c63c 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 @@ -160,4 +160,7 @@ public interface RetailAppService { JSONObject ctripCouponInfo(JSONObject device,String coupon_id); + JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean); + + void saveCouponAccuessLog(int client_id, String coupon_id); } 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 90341fb31..1efb6cd7c 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 @@ -172,6 +172,8 @@ public class RetailAppServiceImp implements RetailAppService { private ClearingLogMapper clearingLogMapper; @Resource private CustomerServiceService customerServiceService; + @Resource + private CouponAccuessLogMapper couponAccuessLogMapper; private Map senderMap = new HashMap<>(); private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" }; @@ -451,6 +453,36 @@ public class RetailAppServiceImp implements RetailAppService { } + @Override + public JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean) { + JSONObject client = clientMapper.findClientByMoniker(client_moniker); + if (client == null) { + throw new BadRequestException("Partner not exists"); + } + PageList cusCouponLog = couponAccuessLogMapper.getCouponAccuessLog( + client.getIntValue("client_id"), new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc"))); + return PageListUtils.buildPageListResult(cusCouponLog); + } + + @Override + public void saveCouponAccuessLog(int client_id, String coupon_id) { + JSONObject client = clientMapper.findClient(client_id); + if (client == null) { + throw new BadRequestException("Partner not exists"); + } + JSONObject couponAccuessLog = new JSONObject(); + couponAccuessLog.put("client_id", client_id); + couponAccuessLog.put("order_id", "非平台订单"); + couponAccuessLog.put("coupon_id", coupon_id); + couponAccuessLog.put("customer_openid", "非平台订单"); + couponAccuessLog.put("coupon_deal_amount", 0); + couponAccuessLog.put("currency", "AUD"); + couponAccuessLog.put("creation_date", new Date()); + couponAccuessLog.put("last_update_date", new Date()); + couponAccuessLog.put("is_valid", 1); + couponAccuessLogMapper.save(couponAccuessLog); + } + @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 56bd28d16..524fcb020 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 @@ -564,4 +564,14 @@ public class RetailAppController { return retailAppService.ctripCouponInfo(device,couponId); } + @RequestMapping(value = "/cus/coupon_accuess_log/{client_moniker}", method = RequestMethod.GET) + public JSONObject getCouponLogByClientMoniker(@PathVariable String client_moniker, AppQueryBean appQueryBean) { + return retailAppService.getCouponCusCouponLog(client_moniker, appQueryBean); + } + + @RequestMapping(value = "/cus/coupon_accuess_log/{client_id}/save", method = RequestMethod.POST) + public void saveCouponAccuessLog(@PathVariable int client_id, @RequestParam String coupon_id) { + retailAppService.saveCouponAccuessLog(client_id, coupon_id); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java index e4e593ccc..6aa29ddaa 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/log/CouponAccuessLogMapper.java @@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.mappers.log; import java.util.List; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; import com.alibaba.fastjson.JSONObject; @@ -26,4 +28,7 @@ public interface CouponAccuessLogMapper { @AutoSql(type = SqlType.SELECT) List findCouponByOrderId(@Param("order_id") String order_id); + + @AutoSql(type = SqlType.SELECT) + PageList getCouponAccuessLog(@Param("client_id")int client_id, PageBounds pageBounds); } From dd23545bae38367df9518f61892e62a12bf873b0 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 31 Aug 2018 10:55:01 +0800 Subject: [PATCH 04/12] fix hf_gateway.js add banklist && productlist --- .../ui/static/templates/hf/gateway_payment.js | 82 +++++++++++++++++-- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/src/main/ui/static/templates/hf/gateway_payment.js b/src/main/ui/static/templates/hf/gateway_payment.js index 1bfefa9a1..044c28dfb 100644 --- a/src/main/ui/static/templates/hf/gateway_payment.js +++ b/src/main/ui/static/templates/hf/gateway_payment.js @@ -1,5 +1,4 @@ $("#bank-li").hide(); -$("#bankCard-li").hide(); var currentIndex = 0; $(".main .main-left ul li.tab-item").click(function () { $("#qrode").hide(); @@ -10,10 +9,8 @@ $(".main .main-left ul li.tab-item").click(function () { $(this).siblings().children(".s1").removeClass("s1-change-color"); if (selectedIndex == 2) { $("#bank-li").show(); - $("#bankCard-li").show(); } else { $("#bank-li").hide(); - $("#bankCard-li").hide(); } }); @@ -25,8 +22,81 @@ $("#modal-close").click(function () { var select = $("select#bank-select,#product-category-select"); if (select.val() != "") select.prev().hide(); -select.bind("change", function() { - if($(this).val() != "") { +select.bind("change", function () { + if ($(this).val() != "") { $(this).prev().hide(); } -}) +}); +var bankList = [ + {label:'招商银行',value:'CMB'}, + {label:'中国工商银行',value:'ICBC'}, + {label:'中国农业银行',value:'ABC'}, + {label:'中国建设银行',value:'CCB'}, + {label:'中国银行',value:'BOC'}, + {label:'浦发银行',value:'SPDB'}, + {label:'中国交通银行',value:'BCOM'}, + {label:'中国民生银行',value:'CMBC'}, + {label:'广东发展银行',value:'GDB'}, + {label:'中信银行',value:'CITIC'}, + {label:'华夏银行',value:'HXB'}, + {label:'上海农村商业银行',value:'SRCB'}, + {label:'中国邮政储蓄银行',value:'PSBC'}, + {label:'北京银行',value:'BOB'}, + {label:'渤海银行',value:'CBHB'}, + {label:'北京农商银行',value:'BJRCB'}, + {label:'南京银行',value:'NJCB'}, + {label:'中国光大银行',value:'CEB'}, + {label:'浙商银行',value:'CZB'}, + {label:'兴业银行',value:'CIB'}, + {label:'杭州银行',value:'HZB'}, + {label:'平安银行',value:'PAB'}, + {label:'上海银行',value:'SHB'}, +]; +var productList = [ + {label:'护肤品',value:'100003'}, + {label:'洗发护发',value:'100004'}, + {label:'身体护理',value:'100005'}, + {label:'口腔护理',value:'100006'}, + {label:'包包',value:'100007'}, + {label:'女装',value:'100008'}, + {label:'男装',value:'100009'}, + {label:'童装',value:'100010'}, + {label:'内衣',value:'100011'}, + {label:'睡衣',value:'100012'}, + {label:'袜品',value:'100013'}, + {label:'配饰',value:'100014'}, + {label:'香水',value:'100015'}, + {label:'彩妆',value:'100016'}, + {label:'奶粉',value:'100017'}, + {label:'母婴营养保健',value:'100018'}, + {label:'婴儿辅食',value:'100019'}, + {label:'尿裤纸巾',value:'100020'}, + {label:'男鞋',value:'100021'}, + {label:'女鞋',value:'100022'}, + {label:'运动鞋',value:'100023'}, + {label:'户外鞋',value:'100024'}, + {label:'运动服',value:'100025'}, + {label:'休闲服装',value:'100026'}, + {label:'家纺/床品',value:'100027'}, + {label:'生活日用',value:'100028'}, + {label:'厨房电器',value:'100029'}, + {label:'家装软饰',value:'100030'}, + {label:'生活电器',value:'100031'}, + {label:'手机',value:'100032'}, + {label:'手机配件',value:'100033'}, + {label:'数码相机',value:'100034'}, + {label:'单反相机',value:'100035'}, + {label:'摄像机',value:'100036'}, + {label:'镜头',value:'100037'}, + {label:'耳机/耳麦',value:'100038'}, + {label:'音箱/音响',value:'100039'}, + {label:'数码配件',value:'100040'}, + {label:'智能手环',value:'100041'}, + {label:'影音娱乐',value:'100042'}, + {label:'笔记本',value:'100043'}, + {label:'进口食品',value:'100044'}, + {label:'休闲食品',value:'100045'}, + {label:'营养品',value:'100046'}, + {label:'地方特产',value:'100047'} +]; + From 28eab9a41a0508022072308179fcf3ce0e2be5f1 Mon Sep 17 00:00:00 2001 From: yangkai Date: Fri, 31 Aug 2018 11:27:29 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=B1=87=E4=BB=98=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=82=AE=E4=BB=B6=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listeners/AfterPaymentFinishListener.java | 5 ++- .../manage/merchants/core/ClientManager.java | 2 + .../core/impls/ClientManagerImpl.java | 38 +++++++++++++++--- .../web/PartnerManageController.java | 5 +++ .../templates/mail/hf_email_notice.html | 31 ++++++++++++++ src/main/ui/static/images/royalpay_logo.png | Bin 0 -> 2873 bytes .../static/payment/partner/partner-manage.js | 21 +++++++++- .../templates/partner_payment_info.html | 6 +++ 8 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/templates/mail/hf_email_notice.html create mode 100644 src/main/ui/static/images/royalpay_logo.png diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java index 1d498a083..9d53312e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java +++ b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java @@ -4,6 +4,7 @@ import au.com.royalpay.payment.core.events.AfterPaymentFinishEvent; import au.com.royalpay.payment.manage.customers.core.CustomerPaymentInfoService; import au.com.royalpay.payment.manage.mappers.system.SysCustomerPaymentInfoMapper; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -21,6 +22,8 @@ public class AfterPaymentFinishListener implements ApplicationListener { + try { + mailService.sendEmail("你刚刚有一笔到账信息", client.getString("contact_email"), "", content); + } catch (Exception ignored) { + logger.error("邮件发送失败", ignored); + } + }).start(); + } + @Override public String getShortLink(String clientMoniker) { String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump"); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 5958044d2..d676a3328 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -546,4 +546,9 @@ public class PartnerManageController { clientManager.switchHfLink(manager, clientMoniker, pass.getBooleanValue("allow")); } + @ManagerMapping(value = "/{clientMoniker}/hf/email_notice", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow")); + } + } diff --git a/src/main/resources/templates/mail/hf_email_notice.html b/src/main/resources/templates/mail/hf_email_notice.html new file mode 100644 index 000000000..f0059fbf0 --- /dev/null +++ b/src/main/resources/templates/mail/hf_email_notice.html @@ -0,0 +1,31 @@ + + + + + + +
+
+
+ +
+
+

您好,

+

您有一笔收款信息如下:

+
+

RoyalPay到账提醒:

+
    +
  • 订单编号:
  • +
  • 收款金额:
  • +
  • 到账时间:
  • +
+
+ 此致
+ RoyalPay +
+
+ +
+ + + \ No newline at end of file diff --git a/src/main/ui/static/images/royalpay_logo.png b/src/main/ui/static/images/royalpay_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..aad8a6873b1dd3ee610fbf5a1e3d9bb2b4cf0f6b GIT binary patch literal 2873 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 X{B_mN$uh3N00000NkvXXu0mjf(+Z+| literal 0 HcmV?d00001 diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 664a4ad15..51dcb649d 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1373,7 +1373,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; - $scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false,hf_Link:false}; + $scope.init = {jsapi: false, gateway: false, offline: false, refund: false,common_sub_merchant_id:false, channel: {},gateway_alipay_online:false,hf_Link:false,enable_hf_email_notice:false}; $scope.switchCommonSubMerchantId = function () { if (!$scope.paymentInfo) { return; @@ -1478,6 +1478,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }; + $scope.toggleHfEmailNotice = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.init.enable_hf_email_notice) { + $scope.init.enable_hf_email_notice = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/hf/email_notice', {allow: $scope.paymentInfo.enable_hf_email_notice}).then(function () { + $scope.loadPartnerPaymentInfo(); + }, function (resp) { + commonDialog.alert({ + title: 'Failed to change enable_hf_email_notice permission status', + content: resp.data.message, + type: 'error' + }); + }) + }; + $scope.toggleJsApi = function () { if (!$scope.paymentInfo) { return; diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index 2ec731a81..b795ed76b 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -331,6 +331,12 @@   {{paymentInfo.hf_pay_url}} +
+ +
+ +
+
From a1a54931a3ab5fdb9fb42340eab647610c04a60a Mon Sep 17 00:00:00 2001 From: yangkai Date: Fri, 31 Aug 2018 12:04:51 +0800 Subject: [PATCH 06/12] =?UTF-8?q?Ctrip=E5=8D=A1=E5=88=B8=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/appclient/core/impls/RetailAppServiceImp.java | 5 +++-- .../payment/manage/appclient/web/RetailAppController.java | 4 ++-- 2 files changed, 5 insertions(+), 4 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 1efb6cd7c..77e6022e6 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 @@ -471,14 +471,15 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Partner not exists"); } JSONObject couponAccuessLog = new JSONObject(); + Date date = new Date(); couponAccuessLog.put("client_id", client_id); couponAccuessLog.put("order_id", "非平台订单"); couponAccuessLog.put("coupon_id", coupon_id); couponAccuessLog.put("customer_openid", "非平台订单"); couponAccuessLog.put("coupon_deal_amount", 0); couponAccuessLog.put("currency", "AUD"); - couponAccuessLog.put("creation_date", new Date()); - couponAccuessLog.put("last_update_date", new Date()); + couponAccuessLog.put("creation_date", date); + couponAccuessLog.put("last_update_date", date); couponAccuessLog.put("is_valid", 1); couponAccuessLogMapper.save(couponAccuessLog); } 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 524fcb020..003e7b8ca 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 @@ -569,8 +569,8 @@ public class RetailAppController { return retailAppService.getCouponCusCouponLog(client_moniker, appQueryBean); } - @RequestMapping(value = "/cus/coupon_accuess_log/{client_id}/save", method = RequestMethod.POST) - public void saveCouponAccuessLog(@PathVariable int client_id, @RequestParam String coupon_id) { + @RequestMapping(value = "/cus/coupon_accuess_log/{coupon_id}", method = RequestMethod.POST) + public void saveCouponAccuessLog(@PathVariable String coupon_id, @RequestParam int client_id) { retailAppService.saveCouponAccuessLog(client_id, coupon_id); } From 2a688ae378d7d797e467ba361d746854a7adbd2b Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Fri, 31 Aug 2018 16:40:49 +0800 Subject: [PATCH 07/12] update --- .../apps/events/listeners/AfterPaymentFinishListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java index 9d53312e8..5aecb73bf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java +++ b/src/main/java/au/com/royalpay/payment/manage/apps/events/listeners/AfterPaymentFinishListener.java @@ -44,7 +44,7 @@ public class AfterPaymentFinishListener implements ApplicationListener Date: Mon, 3 Sep 2018 13:32:31 +0800 Subject: [PATCH 08/12] =?UTF-8?q?Ctrip=E5=8D=A1=E5=88=B8=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impls/RetailAppServiceImp.java | 19 ++++++++++++++++--- .../customers/core/CouponValidateService.java | 2 +- .../core/impls/CouponValidateServiceImpl.java | 5 ++++- 3 files changed, 21 insertions(+), 5 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 77e6022e6..371db155a 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 @@ -174,6 +174,8 @@ public class RetailAppServiceImp implements RetailAppService { private CustomerServiceService customerServiceService; @Resource private CouponAccuessLogMapper couponAccuessLogMapper; + @Resource + private CouponValidateService couponValidateService; private Map senderMap = new HashMap<>(); private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" }; @@ -449,7 +451,7 @@ public class RetailAppServiceImp implements RetailAppService { @Override public JSONObject ctripCouponInfo(JSONObject device, String coupon_id) { - return couponVerificationService.ctripCouponInfo(coupon_id,device.getIntValue("client_id")); + return couponVerificationService.ctripCouponInfo(coupon_id,device.getIntValue("client_id"), true); } @@ -459,9 +461,20 @@ public class RetailAppServiceImp implements RetailAppService { if (client == null) { throw new BadRequestException("Partner not exists"); } - PageList cusCouponLog = couponAccuessLogMapper.getCouponAccuessLog( + PageList cusCouponLogs = couponAccuessLogMapper.getCouponAccuessLog( client.getIntValue("client_id"), new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc"))); - return PageListUtils.buildPageListResult(cusCouponLog); + HashMap couponMap = new HashMap<>(); + for(JSONObject cusCouponLog : cusCouponLogs) { + cusCouponLog.put("client_moniker", client_moniker); + if (couponMap.containsKey(cusCouponLog.getString("coupon_id"))) { + cusCouponLog.put("coupon", couponMap.get(cusCouponLog.getString("coupon_id"))); + continue; + } + JSONObject coupon = couponValidateService.ctripCouponInfo(cusCouponLog.getString("coupon_id"), cusCouponLog.getIntValue("client_id"), false); + couponMap.put(cusCouponLog.getString("coupon_id"), coupon); + cusCouponLog.put("coupon", coupon); + } + return PageListUtils.buildPageListResult(cusCouponLogs); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java index aa4c83f1f..12daea020 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java @@ -18,7 +18,7 @@ public interface CouponValidateService { JSONObject ctripCheck(int client_id); - JSONObject ctripCouponInfo(String coupon_log_id,int client_id); + JSONObject ctripCouponInfo(String coupon_log_id,int client_id,boolean is_expiry); JSONObject ctripCouponLogNotice(String coupon_log_id,String order_id,String open_id,String status); } diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java index bca4104db..4de0054a5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java @@ -177,7 +177,7 @@ public class CouponValidateServiceImpl implements CouponValidateService { } @Override - public JSONObject ctripCouponInfo(String coupon_id, int client_id) { + public JSONObject ctripCouponInfo(String coupon_id, int client_id, boolean is_expiry) { JSONObject client = clientManager.getClientInfo(client_id); if(client==null){ throw new NotFoundException("Merchant Not Found"); @@ -185,6 +185,9 @@ public class CouponValidateServiceImpl implements CouponValidateService { String uri = signUrl(UriComponentsBuilder.fromHttpUrl(CUSTOMER_HOST + "/coupon/"+coupon_id+"/couponLogInfo")); HttpRequestGenerator gen = new HttpRequestGenerator(uri, RequestMethod.GET); gen.addQueryString("client_moniker",client.getString("client_moniker")); + if (!is_expiry) { + gen.addQueryString("is_expiry", "0"); + } try { HttpRequestResult reqResult = gen.execute(); if (reqResult.isSuccess()) { From cda8c017ad01212d3c052380982c088ded07e318 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 3 Sep 2018 17:49:37 +0800 Subject: [PATCH 09/12] add HF Qrocde & change HF shortURL --- .../manage/merchants/core/impls/ClientManagerImpl.java | 7 ++++++- .../payment/partner/templates/partner_payment_info.html | 7 +++++++ 2 files changed, 13 insertions(+), 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 e02809dac..97a9ed3da 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 @@ -411,6 +411,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (audit_logs != null && !audit_logs.isEmpty()) { client.put("audit_logs", audit_logs); } + + //HF支付链接二维码 + if (client.getString("hf_pay_url") != null) { + client.put("hfQrcodeUrl", QRCodeUtils.qrcodeImageCode(client.getString("hf_pay_url"), 200, false)); + } return client; } @@ -3782,7 +3787,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public String getShortLink(String clientMoniker) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump"); + String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump/pc"); MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); return api.registerShortUrl(longUrl); } diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index b795ed76b..80558c3a0 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -331,6 +331,13 @@   {{paymentInfo.hf_pay_url}} +
+ + +
+   仅支持微信客户端扫描 +
+
From 839033b7f7cee6c0b3db2b778fc36ca33c81fa88 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 3 Sep 2018 18:16:44 +0800 Subject: [PATCH 10/12] add partner HF Qrocde --- .../payment/partner/templates/client_payment_info.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/ui/static/payment/partner/templates/client_payment_info.html b/src/main/ui/static/payment/partner/templates/client_payment_info.html index 962b2c7ad..b9c7901af 100644 --- a/src/main/ui/static/payment/partner/templates/client_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/client_payment_info.html @@ -119,6 +119,13 @@

+
+ + +
+   仅支持微信客户端扫描 +
+
From bd5b1541af8cd28e0aa891fd869ae69c49ee5643 Mon Sep 17 00:00:00 2001 From: yangkai Date: Mon, 3 Sep 2018 18:46:59 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/system/ClientAccountMapper.java | 2 + .../manage/mappers/system/ManagerMapper.java | 4 ++ .../manage/merchants/core/ClientManager.java | 2 + .../core/impls/ClientManagerImpl.java | 54 ++++++++++++++++--- .../web/PartnerManageController.java | 4 +- .../task/UpdatePartnerPasswordTask.java | 43 +++++++++++++++ .../mappers/system/ClientAccountMapper.xml | 6 +++ .../mail/test_merchant_password.html | 49 +++++++++++++++++ src/main/ui/index.html | 2 +- .../partner/templates/partner_accounts.html | 4 +- 10 files changed, 159 insertions(+), 11 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java create mode 100644 src/main/resources/templates/mail/test_merchant_password.html diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java index f8e8db188..60542974a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java @@ -76,4 +76,6 @@ public interface ClientAccountMapper { List listNullUnionIdAccounts(); List query(JSONObject params); + + List partnerAndSubPartnerAccounts(@Param("client_id") int clientId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java index 8881b2a62..5f3af081a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerMapper.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; @@ -63,4 +64,7 @@ public interface ManagerMapper { List listOpenIdByRole(@Param("mask") int mask); List listServants(@Param("mask") int mask); + + @Select("select email from sys_managers where is_valid=1 AND role & 256 > 0 AND email IS NOT NULL") + List listDevManager(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index b3ae0f094..368785663 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -328,4 +328,6 @@ public interface ClientManager { void switchHfLink(JSONObject manager, String clientMoniker,boolean allow); void sendHfEmailNotice(JSONObject order); + + void updateAllPartnerPassword(String clientMoniker, List emails); } 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 97a9ed3da..e0b1a47da 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 @@ -886,7 +886,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (StringUtils.isEmpty(client.getString("sub_merchant_id"))) { throw new BadRequestException("Sub Merchant ID Can't be null "); } - String username = clientMoniker + client.getString("sub_merchant_id"); + String username = clientMoniker; boolean duplicated = true; String pwd = RandomStringUtils.random(8, true, true); while (duplicated) { @@ -899,7 +899,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid newAccount(clientMoniker, account, manager, 1); duplicated = false; } catch (Exception e) { - username += "1"; + username += "0"; } } sendInitEmail(client, username, pwd); @@ -959,9 +959,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid ctx.setVariable("client_moniker", client.getString("client_moniker")); ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("credential_code", client.getString("credential_code")); + final String content = thymeleaf.process("mail/new_client_notice", ctx); // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", // "utf-8", model); + ctx.setVariable("password", "*****"); + final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); final String mailTo = client.getString("contact_email"); if (StringUtils.isEmpty(mailTo)) { throw new EmailException("Client Contact Email is invalid"); @@ -977,8 +980,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public void run() { try { - String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, - emails.isEmpty() ? "" : StringUtils.join(emails, ","), content); + String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo, "", content); + mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","), + "", contentBd); JSONObject clientUpdate = new JSONObject(); clientUpdate.put("client_id", client.getIntValue("client_id")); clientUpdate.put("approve_email_send", 3); @@ -3775,16 +3779,41 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid ctx.setVariable("amount", order.getString("total_amount")); ctx.setVariable("time", order.getString("create_time")); final String content = thymeleaf.process( "mail/hf_email_notice", ctx); - + final String mailTo = client.getString("contact_email"); + if (StringUtils.isEmpty(mailTo)) { + throw new EmailException("Client Contact Email is invalid"); + } new Thread(() -> { try { - mailService.sendEmail("你刚刚有一笔到账信息", client.getString("contact_email"), "", content); + mailService.sendEmail("你刚刚有一笔到账信息", mailTo, "", content); } catch (Exception ignored) { logger.error("邮件发送失败", ignored); } }).start(); } + @Override + public void updateAllPartnerPassword(String clientMoniker, List emails) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + List partners = clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id")); + partners.stream().forEach(partner -> { + String pwd = RandomStringUtils.random(8, true, true); + String salt = PasswordUtils.newSalt(); + String pwdHash = PasswordUtils.hashPwd(pwd, salt); + partner.put("salt", salt); + partner.put("password_hash", pwdHash); + partner.put("password_aes", PasswordUtils.encryptAESPwd(pwd)); + deviceManager.deviceOffline(partner.getString("account_id")); + clientAccountMapper.update(partner); + signInAccountService.clearAccountCache(partner.getString("account_id")); + partner.put("password", pwd); + }); + sendTestMerchantPassword(partners, emails); + } + @Override public String getShortLink(String clientMoniker) { String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump/pc"); @@ -3813,4 +3842,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } + private void sendTestMerchantPassword(List accounts, List emails) { + Context ctx = new Context(); + ctx.setVariable("accounts", accounts); + final String content = thymeleaf.process( "mail/test_merchant_password", ctx); + new Thread(() -> { + try { + mailService.sendEmail("测试商户账户已更新", emails.isEmpty() ? "" : StringUtils.join(emails, ","), "", content); + } catch (Exception ignored) { + logger.error("邮件发送失败", ignored); + } + }).start(); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index d676a3328..66a0af5a9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -284,12 +284,12 @@ public class PartnerManageController { return tradeLogService.listOrderRefunds(orderId, null); } - @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) + @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR,ManagerRole.DEVELOPER}) public List partnerAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return clientManager.listAccounts(manager, clientMoniker); } - @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) + @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.DEVELOPER}) public JSONObject addPartnerAccount(@RequestBody @Valid NewAccountBean account, Errors errors, @PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { HttpUtils.handleValidErrors(errors); diff --git a/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java b/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java new file mode 100644 index 000000000..88a81a0d1 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java @@ -0,0 +1,43 @@ +package au.com.royalpay.payment.manage.task; + +import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; + +@Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "false") +public class UpdatePartnerPasswordTask { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Resource + private ClientManager clientManager; + @Resource + private SynchronizedScheduler synchronizedScheduler; + @Resource + private ManagerMapper managerMapper; + + private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au," + + "astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au"; + + @Scheduled(cron = "0 0 9 28 * ?") + public void resetPartnerPassword() { + synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> { + final List emails = managerMapper.listDevManager(); + List emailList = Arrays.asList(EMAIL.split(",")); + emailList.stream().forEach(email -> { + if (!emails.contains(email)) { + emails.add(email); + } + }); + clientManager.updateAllPartnerPassword("PINE", emails); + }); + } +} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml index 5e5ccbac1..c35be4b34 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml @@ -17,4 +17,10 @@ + \ No newline at end of file diff --git a/src/main/resources/templates/mail/test_merchant_password.html b/src/main/resources/templates/mail/test_merchant_password.html new file mode 100644 index 000000000..361f20a22 --- /dev/null +++ b/src/main/resources/templates/mail/test_merchant_password.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
序号商户角色用户名密码
adminManagerCashier
+ \ No newline at end of file diff --git a/src/main/ui/index.html b/src/main/ui/index.html index 60ad4e993..fe2384d8e 100644 --- a/src/main/ui/index.html +++ b/src/main/ui/index.html @@ -994,7 +994,7 @@ margin-bottom: 10%;"/> Marketing Materials -
  • +
  • Accounts diff --git a/src/main/ui/static/payment/partner/templates/partner_accounts.html b/src/main/ui/static/payment/partner/templates/partner_accounts.html index 0e357f12d..d41819a94 100644 --- a/src/main/ui/static/payment/partner/templates/partner_accounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_accounts.html @@ -1,7 +1,7 @@
    -
    @@ -9,7 +9,7 @@
    -

    There is no accounts for this partner, Create One

    +

    There is no accounts for this partner, Create One

    From a4a16fbaba6e326cfb41d2b3a22d981413e98a39 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 3 Sep 2018 18:52:54 +0800 Subject: [PATCH 12/12] add Hf shortURL update --- .../manage/dev/core/HfUpdateService.java | 9 ++++ .../manage/dev/core/impl/HfUpdateImpl.java | 40 ++++++++++++++++ .../manage/dev/web/TestController.java | 14 ++++-- .../manage/mappers/system/ClientMapper.java | 3 ++ .../manage/mappers/system/ClientMapper.xml | 47 ++++++++++++------- .../ui/static/config/devtools/devtools.js | 23 ++++++++- .../config/devtools/templates/hfupdate.html | 15 ++++++ .../config/devtools/templates/root.html | 4 ++ 8 files changed, 132 insertions(+), 23 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/dev/core/HfUpdateService.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/dev/core/impl/HfUpdateImpl.java create mode 100644 src/main/ui/static/config/devtools/templates/hfupdate.html diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/HfUpdateService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/HfUpdateService.java new file mode 100644 index 000000000..bc5cf8b27 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/HfUpdateService.java @@ -0,0 +1,9 @@ +package au.com.royalpay.payment.manage.dev.core; + +import com.alibaba.fastjson.JSONObject; + +public interface HfUpdateService { + + String updateStatus(); + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/HfUpdateImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/HfUpdateImpl.java new file mode 100644 index 000000000..67c1a0bfa --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/HfUpdateImpl.java @@ -0,0 +1,40 @@ +package au.com.royalpay.payment.manage.dev.core.impl; + +import au.com.royalpay.payment.manage.dev.core.HfClearAmountService; +import au.com.royalpay.payment.manage.dev.core.HfUpdateService; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.JsonArray; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.List; + +@Service +public class HfUpdateImpl implements HfUpdateService { + @Resource + private ClientMapper clientMapper; + @Resource + private MpWechatApiProvider mpWechatApiProvider; + + @Override + public String updateStatus() { + List clientIds = clientMapper.findByhfPayUrlNotNull(); + clientIds.forEach(dbResult -> { + String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + dbResult.getString("client_moniker") + "/jump/pc"); + MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); + dbResult.put("hf_pay_url", api.registerShortUrl(longUrl)); + clientMapper.update(dbResult); + }); + return "ok"; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 49f0e0b42..dfbeebe28 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -13,10 +13,7 @@ import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.dev.bean.AliExcel; import au.com.royalpay.payment.manage.dev.bean.Message; import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage; -import au.com.royalpay.payment.manage.dev.core.AliforexcelService; -import au.com.royalpay.payment.manage.dev.core.HfClearAmountService; -import au.com.royalpay.payment.manage.dev.core.NewpartnerService; -import au.com.royalpay.payment.manage.dev.core.WechatMessageService; +import au.com.royalpay.payment.manage.dev.core.*; import au.com.royalpay.payment.manage.mappers.customers.CustomerEncourageMoneyUseLogMapper; import au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; @@ -110,6 +107,8 @@ public class TestController implements ApplicationEventPublisherAware { private AliforexcelService aliforexcelService; @Resource private HfClearAmountService hfClearAmountService; + @Resource + private HfUpdateService hfUpdateService; @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { @@ -394,7 +393,12 @@ public class TestController implements ApplicationEventPublisherAware { } @ManagerMapping(value = "/hfClearAmount", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) - public JSONObject hfClearAmount(@RequestParam String datefrom, @RequestParam String dateto) { + public JSONObject hfUpdate(@RequestParam String datefrom, @RequestParam String dateto) { return hfClearAmountService.hfjsonobject(dateto,datefrom); } + + @ManagerMapping(value = "/hfUpdate", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) + public String hfClearAmount() { + return hfUpdateService.updateStatus(); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index a99bd852c..281ef65c3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -4,6 +4,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -94,4 +95,6 @@ public interface ClientMapper { @AutoSql(type = SqlType.SELECT) JSONObject findByWechatInstitutionMerchantId(@Param("wechat_institution_merchant_id") String wechat_institution_merchant_id); + List findByhfPayUrlNotNull(); + } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 24bfc3a90..64cf17945 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -6,23 +6,24 @@ WHERE is_valid=1 and (approve_result = 1 or approve_result = 2) + + \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 2f445e62d..e5dd667ed 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -59,7 +59,11 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { url: '/hfClearAmount', templateUrl: '/static/config/devtools/templates/hfClearAmount.html', controller: 'hfClearAmountCtrl' - }) + }).state('devtools.hfupdate', { + url: '/hfupdate', + templateUrl: '/static/config/devtools/templates/hfupdate.html', + controller: 'hfupdateCtrl' + }) }]); app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { $scope.sendRefund = function () { @@ -363,6 +367,23 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }]); + app.controller('hfupdateCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) { + $scope.selecttotal = true; + $scope.select = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + + $http.get('/dev/hfUpdate').then(function (resp) { + alert(resp.data); + $scope.totalhide = false; + $scope.selecttotal = true; + }, function (resp) { + alert(resp.data.message); + }) + } + + }]); + return app; }); \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/templates/hfupdate.html b/src/main/ui/static/config/devtools/templates/hfupdate.html new file mode 100644 index 000000000..aa428f774 --- /dev/null +++ b/src/main/ui/static/config/devtools/templates/hfupdate.html @@ -0,0 +1,15 @@ +
    +

    更新HF短链接

    + +
    +
    +
    + +
    +
    \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/templates/root.html b/src/main/ui/static/config/devtools/templates/root.html index 8c51fb095..3c004dad3 100644 --- a/src/main/ui/static/config/devtools/templates/root.html +++ b/src/main/ui/static/config/devtools/templates/root.html @@ -79,6 +79,10 @@ HF清算金额统计 + + + 更新HF短连接 +