From dc02604db2c2552d6da420a6a98972068fb33a50 Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 8 May 2019 14:34:07 +0800 Subject: [PATCH 01/74] =?UTF-8?q?sql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/TransactionAnalysisMapper.xml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) 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 a4c461eeb..32ef0c8cf 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 @@ -377,11 +377,10 @@ - \ No newline at end of file + + diff --git a/src/main/resources/templates/reports/daily_report.html b/src/main/resources/templates/reports/daily_report.html index bc05c2037..713c403be 100644 --- a/src/main/resources/templates/reports/daily_report.html +++ b/src/main/resources/templates/reports/daily_report.html @@ -31,6 +31,7 @@
收入 支出 + KPI
@@ -132,9 +133,77 @@
+ + + - \ No newline at end of file + From bab6df82c38a918e4f3f337ec3dc9754d5d51e05 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Thu, 16 May 2019 12:11:29 +0800 Subject: [PATCH 12/74] revert --- .../payment/manage/task/DailyReportGenerationTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java index fcc013732..692be43b4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/DailyReportGenerationTask.java @@ -25,11 +25,11 @@ public class DailyReportGenerationTask { @Resource private SynchronizedScheduler synchronizedScheduler; - @Scheduled(cron = "30 55 11 * * ?") + @Scheduled(cron = "0 0 10 * * ?") public void dailyReportAutoGenerateReport() { synchronizedScheduler.executeProcess("manage_task:dailyReportAutoGenerateReport", 120_000, () -> { Date yesterday = DateUtils.addDays(new Date(), -1); - dailyReport.generateReport("2019-03-19", false); + dailyReport.generateReport(DateFormatUtils.format(yesterday, "yyyy-MM-dd"), true); }); } } From 503447d08b4e41226477e612396e00a6e1abbb24 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Thu, 16 May 2019 14:41:18 +0800 Subject: [PATCH 13/74] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/document/cn/apidoc.json | 1 + src/document/cn/apis.js | 39 ++++++++++++++++++++++++++++++++++++ src/document/en/apidoc.json | 1 + src/document/en/apis.js | 40 +++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) diff --git a/src/document/cn/apidoc.json b/src/document/cn/apidoc.json index 3509ecd0a..3bfca5fe1 100644 --- a/src/document/cn/apidoc.json +++ b/src/document/cn/apidoc.json @@ -12,6 +12,7 @@ "Overview", "QRCode", "NewQRCode", + "NativeQRCode", "QRCodePay", "JSApi", "NewJSAPI", diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index ea8976109..ca1b28f52 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -93,6 +93,45 @@ * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 * */ +/** + * @api {PUT} /api/v1.0/gateway/partners/{partner_code}/native_orders/{order_id} 创建Native QRCode支付单 + * @apiName NativeQRCode + * @apiGroup QRCode + * @apiVersion 1.0.0 + * @apiDescription + * QRCode支付单适用于PC端网页/应用进行支付,用户使用微信/支付宝客户端扫描下单后生成的二维码完成支付。
+ *
+ * 返回值包括二维码字符串,二维码图片,支付地址,商户可以自行决定直接展示二维码或跳转支付页,跳转支付页需要带上签名信息。 + * 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误 + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4-6位大写字母或数字构成 + * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiUse Sign + * @apiParam (JSON) {String} description 必填,订单标题(最大长度128字符,超出自动截取) + * @apiParam (JSON) {int} price 必填,金额,单位为货币最小单位,例如使用100表示1.00 AUD + * @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码 + * @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道,大小写敏感 + * @apiParam (JSON) {String} notify_url 支付通知url,详见支付通知api,不填则不会推送支付通知 + * @apiParam (JSON) {String} operator 操作人员标识 + * + * @apiSuccess {String} return_code 执行结果 + * @apiSuccess {String} result_code SUCCESS表示创建订单成功,EXISTS表示订单已存在 + * @apiSuccess {String} channel 支付渠道 + * @apiSuccess {String} partner_code 商户编码 + * @apiSuccess {String} full_name 商户注册全名 + * @apiSuccess {String} partner_name 商户名称 + * @apiSuccess {String} order_id GlobalFreePay订单ID,同时也是微信订单ID,最终支付成功的订单ID可能不同 + * @apiSuccess {String} partner_order_id 商户订单ID + * @apiSuccess {String} code_url 支付码字符串,商户可以据此自行生产二维码 + * @apiSuccess {String} qrcode_img Base64封装的二维码图片,可直接作为img的src属性 + * @apiSuccess {String} pay_url 跳转URL + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 + * + */ /** * @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QRCode支付跳转页 * @apiName QRCodePay diff --git a/src/document/en/apidoc.json b/src/document/en/apidoc.json index 3ae8f4594..b8c3e6bc4 100644 --- a/src/document/en/apidoc.json +++ b/src/document/en/apidoc.json @@ -12,6 +12,7 @@ "Overview", "QRCode", "NewQRCode", + "NativeQRCode", "QRCodePay", "JSApi", "NewJSAPI", diff --git a/src/document/en/apis.js b/src/document/en/apis.js index b759a76ea..8400f7aa3 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -95,6 +95,46 @@ * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid * */ +/** + * @api {PUT} /api/v1.0/gateway/partners/{partner_code}/native_orders/{order_id} Create QR Code Payment + * @apiName NativeQRCode + * @apiGroup QRCode + * @apiVersion 1.0.0 + * @apiDescription + * QR Code Payment is used for webpage/application on PC. Customers use WeChat or Alipay app to scan QR Code generated when creating order and finish the payment.
+ *
+ * Return value contains QR Code string, QR Ccode image and payment page address. Partners can decide how to finish the payment. + * If the currency is CNY, equivalent AUD amount shall never less than 0.01 AUD, + * otherwise user will get Invalid Amount Error from WeChat when making the payment. + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner Code + * @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existing order. + * @apiUse Sign + * @apiParam (JSON) {String} description Required, Description of an order. + * @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency. + * @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency + * @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive + * @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds + * @apiParam (JSON) {String} operator Note for the operator who created this order. + * + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed. + * @apiSuccess {String} channel Payment channel + * @apiSuccess {String} partner_code Partner code + * @apiSuccess {String} full_name Partner's full company name when registered + * @apiSuccess {String} partner_name Partner's name + * @apiSuccess {String} order_id Order id in GlobalFreePay, which is also WeChat order id. The final order id which is paid may be different from this one. + * @apiSuccess {String} partner_order_id Partner order id + * @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value. + * @apiSuccess {String} qrcode_img QR Code image formatted in Base64. Can be used as the src attribute on img element + * @apiSuccess {String} pay_url Payment page in GlobalFreePay + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner. + * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid + * + */ /** * @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QR Code Payment Page in RoyalPay * @apiName QRCodePay From 28f43ef26c3ba90b0a2c00234bd17d7bf5447387 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Thu, 16 May 2019 14:42:24 +0800 Subject: [PATCH 14/74] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/document/cn/apidoc.json | 1 + src/document/cn/apis.js | 39 ++++++++++++++++++++++++++++++++++++ src/document/en/apidoc.json | 1 + src/document/en/apis.js | 40 +++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) diff --git a/src/document/cn/apidoc.json b/src/document/cn/apidoc.json index 3509ecd0a..3bfca5fe1 100644 --- a/src/document/cn/apidoc.json +++ b/src/document/cn/apidoc.json @@ -12,6 +12,7 @@ "Overview", "QRCode", "NewQRCode", + "NativeQRCode", "QRCodePay", "JSApi", "NewJSAPI", diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index ea8976109..ca1b28f52 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -93,6 +93,45 @@ * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 * */ +/** + * @api {PUT} /api/v1.0/gateway/partners/{partner_code}/native_orders/{order_id} 创建Native QRCode支付单 + * @apiName NativeQRCode + * @apiGroup QRCode + * @apiVersion 1.0.0 + * @apiDescription + * QRCode支付单适用于PC端网页/应用进行支付,用户使用微信/支付宝客户端扫描下单后生成的二维码完成支付。
+ *
+ * 返回值包括二维码字符串,二维码图片,支付地址,商户可以自行决定直接展示二维码或跳转支付页,跳转支付页需要带上签名信息。 + * 货币类型如果是CNY,注意通过汇率转换后不得低于0.01AUD,否则订单可以创建成功,但支付时会报金额不合法错误 + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4-6位大写字母或数字构成 + * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiUse Sign + * @apiParam (JSON) {String} description 必填,订单标题(最大长度128字符,超出自动截取) + * @apiParam (JSON) {int} price 必填,金额,单位为货币最小单位,例如使用100表示1.00 AUD + * @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码 + * @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道,大小写敏感 + * @apiParam (JSON) {String} notify_url 支付通知url,详见支付通知api,不填则不会推送支付通知 + * @apiParam (JSON) {String} operator 操作人员标识 + * + * @apiSuccess {String} return_code 执行结果 + * @apiSuccess {String} result_code SUCCESS表示创建订单成功,EXISTS表示订单已存在 + * @apiSuccess {String} channel 支付渠道 + * @apiSuccess {String} partner_code 商户编码 + * @apiSuccess {String} full_name 商户注册全名 + * @apiSuccess {String} partner_name 商户名称 + * @apiSuccess {String} order_id GlobalFreePay订单ID,同时也是微信订单ID,最终支付成功的订单ID可能不同 + * @apiSuccess {String} partner_order_id 商户订单ID + * @apiSuccess {String} code_url 支付码字符串,商户可以据此自行生产二维码 + * @apiSuccess {String} qrcode_img Base64封装的二维码图片,可直接作为img的src属性 + * @apiSuccess {String} pay_url 跳转URL + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 + * + */ /** * @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QRCode支付跳转页 * @apiName QRCodePay diff --git a/src/document/en/apidoc.json b/src/document/en/apidoc.json index 3ae8f4594..b8c3e6bc4 100644 --- a/src/document/en/apidoc.json +++ b/src/document/en/apidoc.json @@ -12,6 +12,7 @@ "Overview", "QRCode", "NewQRCode", + "NativeQRCode", "QRCodePay", "JSApi", "NewJSAPI", diff --git a/src/document/en/apis.js b/src/document/en/apis.js index b759a76ea..8400f7aa3 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -95,6 +95,46 @@ * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid * */ +/** + * @api {PUT} /api/v1.0/gateway/partners/{partner_code}/native_orders/{order_id} Create QR Code Payment + * @apiName NativeQRCode + * @apiGroup QRCode + * @apiVersion 1.0.0 + * @apiDescription + * QR Code Payment is used for webpage/application on PC. Customers use WeChat or Alipay app to scan QR Code generated when creating order and finish the payment.
+ *
+ * Return value contains QR Code string, QR Ccode image and payment page address. Partners can decide how to finish the payment. + * If the currency is CNY, equivalent AUD amount shall never less than 0.01 AUD, + * otherwise user will get Invalid Amount Error from WeChat when making the payment. + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner Code + * @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existing order. + * @apiUse Sign + * @apiParam (JSON) {String} description Required, Description of an order. + * @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency. + * @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency + * @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive + * @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds + * @apiParam (JSON) {String} operator Note for the operator who created this order. + * + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed. + * @apiSuccess {String} channel Payment channel + * @apiSuccess {String} partner_code Partner code + * @apiSuccess {String} full_name Partner's full company name when registered + * @apiSuccess {String} partner_name Partner's name + * @apiSuccess {String} order_id Order id in GlobalFreePay, which is also WeChat order id. The final order id which is paid may be different from this one. + * @apiSuccess {String} partner_order_id Partner order id + * @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value. + * @apiSuccess {String} qrcode_img QR Code image formatted in Base64. Can be used as the src attribute on img element + * @apiSuccess {String} pay_url Payment page in GlobalFreePay + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner. + * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid + * + */ /** * @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QR Code Payment Page in RoyalPay * @apiName QRCodePay From ece97e2e4203d2637338adf14b2f24c5a15d65c8 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Thu, 16 May 2019 14:51:13 +0800 Subject: [PATCH 15/74] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E6=8A=A5=E8=A1=A8KPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ba5ed1bc4..c50d815bf 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.5 + 1.0.6 From 683a52e209b2fe4e54a595cfed95f50ac01c9b5b Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 21 May 2019 15:32:56 +0800 Subject: [PATCH 16/74] fix redirect on qrpay page --- .../ui/static/templates/payment/v1/qrpay.js | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/main/ui/static/templates/payment/v1/qrpay.js b/src/main/ui/static/templates/payment/v1/qrpay.js index 3f7c94daa..d1c2fbef8 100644 --- a/src/main/ui/static/templates/payment/v1/qrpay.js +++ b/src/main/ui/static/templates/payment/v1/qrpay.js @@ -17,25 +17,7 @@ $(function () { if (window.disable_ws) { setTimeout(checkStatus, 3000); - function checkStatus() { - $.ajax({ - url: 'status', - method: 'get', - cache: false, - dataType: 'json', - success: function (status) { - if (status.result_code == 'PAY_SUCCESS') { - var concat = '?'; - if (window.redirect.indexOf('?') > 0) { - concat = '&'; - } - location.href = window.redirect + concat + 'time=' + status.time + '&nonce_str=' + status.nonce_str + '&sign=' + status.sign; - } else { - setTimeout(checkStatus, 3000); - } - } - }) - } + } else { var sock = new SockJS('/register'); @@ -49,6 +31,27 @@ $(function () { } location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign; }) + },function () { + setTimeout(checkStatus, 3000); + }) + } + function checkStatus() { + $.ajax({ + url: 'status', + method: 'get', + cache: false, + dataType: 'json', + success: function (status) { + if (status.result_code == 'PAY_SUCCESS') { + var concat = '?'; + if (window.redirect.indexOf('?') > 0) { + concat = '&'; + } + location.href = window.redirect + concat + 'time=' + status.time + '&nonce_str=' + status.nonce_str + '&sign=' + status.sign; + } else { + setTimeout(checkStatus, 3000); + } + } }) } }); \ No newline at end of file From 4c4354f8868e0f18cdac984fd915ee7707e1d07a Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 21 May 2019 15:38:25 +0800 Subject: [PATCH 17/74] alipay online --- src/document/cn/apis.js | 2 +- src/document/en/apis.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index ca1b28f52..054b5e052 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -682,7 +682,7 @@ * @apiParam (JSON) {int} real_fee 支付金额,单位是最小货币单位 * @apiParam (JSON) {Double} rate 交易时使用的汇率,1AUD=?CNY * @apiParam (JSON) {String} currency 币种,AUD - * @apiParam (JSON) {String} channel 支付渠道 Alipay|支付宝、Wechat|微信、Bestpay|翼支付 + * @apiParam (JSON) {String} channel 支付渠道 Alipay|支付宝、AlipayOnline|支付宝线上、Wechat|微信、Bestpay|翼支付 * @apiParam (JSON) {String} create_time 订单创建时间,格式为'yyyy-MM-dd HH:mm:ss',GMT+10 * @apiParam (JSON) {String} pay_time 订单支付时间,格式为'yyyy-MM-dd HH:mm:ss',GMT+10 * diff --git a/src/document/en/apis.js b/src/document/en/apis.js index 8400f7aa3..36248f307 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -693,7 +693,7 @@ * @apiParam (JSON) {int} real_fee Actual paid amount * @apiParam (JSON) {Double} rate Exchange Rate used while trading. 1AUD=?CNY * @apiParam (JSON) {String} currency Currency,AUD - * @apiParam (JSON) {String} channel Payment Channel Alipay、Wechat、Bestpay + * @apiParam (JSON) {String} channel Payment Channel Alipay、AlipayOnline、Wechat、Bestpay * @apiParam (JSON) {String} create_time Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10 * @apiParam (JSON) {String} pay_time Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10. * From 46e6bc651719f004933ac0c3a7fd5f18964a01c4 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 21 May 2019 15:40:41 +0800 Subject: [PATCH 18/74] documents update --- src/document/cn/apis.js | 4 ++-- src/document/en/apis.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index 054b5e052..e3dfb03d8 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -580,7 +580,7 @@ *
  • 7: RoyalPay 商户静态码(已停用)
  • *
  • 8: H5网关
  • * - * @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝、Wechat|微信、Bestpay|翼支付 + * @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝、AlipayOnline|支付宝线上、Wechat|微信、Bestpay|翼支付 * @apiSuccess (transactions) {String} type 流水类型 *
      *
    • Credit: 入账
    • @@ -642,7 +642,7 @@ *
    • 7: RoyalPay 商户静态码(已停用)
    • *
    • 8: H5网关
    • *
    - * @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝、Wechat|微信、Bestpay|翼支付 + * @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝、AlipayOnline|支付宝线上、Wechat|微信、Bestpay|翼支付 * @apiSuccess (transactions) {String} type 流水类型 *
      *
    • Credit: 入账
    • diff --git a/src/document/en/apis.js b/src/document/en/apis.js index 36248f307..0f370f2df 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -590,7 +590,7 @@ *
    • 7: RoyalPay Static Merchant QRCode(deprecated)
    • *
    • 8: H5 Payment Gateway
    • *
    - * @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay) + * @apiSuccess (transactions) {String} channel Payment Channel (Alipay, AlipayOnline, Wechat, Bestpay) * @apiSuccess (transactions) {String} type Trade Direction *
      *
    • Credit: Income
    • @@ -653,7 +653,7 @@ *
    • 7: RoyalPay Static Merchant QRCode(deprecated)
    • *
    • 8: H5 Payment Gateway
    • *
    - * @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay) + * @apiSuccess (transactions) {String} channel Payment Channel (Alipay, AlipayOnline, Wechat, Bestpay) * @apiSuccess (transactions) {String} type Trade Direction *
      *
    • Credit: Income
    • From ac00e9052ae3e934b7e42b3dd564798c72652f36 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 21 May 2019 16:45:26 +0800 Subject: [PATCH 19/74] =?UTF-8?q?add=20=E5=90=8E=E6=B8=85=E7=AE=97invoice?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../ClearingDistributedSurchargeMapper.java | 3 + .../core/SurchargeAccountService.java | 2 + .../impl/SurchargeAccountServiceImpl.java | 87 ++++++++++++++++++- .../web/SurchargeAccountController.java | 7 ++ .../static/payment/partner/partner-manage.js | 5 +- .../templates/client_partner_detail.html | 2 +- .../partner/templates/partner_detail.html | 2 +- .../partner_surcharge_account_dialog.html | 2 +- ...artner_surcharge_account_month_dialog.html | 2 +- 10 files changed, 102 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 08118d1cf..5ab2a115a 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.4 + 1.0.5 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java index e04890a4a..11f8b00e6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java @@ -22,6 +22,9 @@ public interface ClearingDistributedSurchargeMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject transactions); + @AutoSql(type = SqlType.SELECT) + JSONObject findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); + List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); List findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId); diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java index a5250a2be..ba97930ce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.surchargeAccount.core; import com.alibaba.fastjson.JSONObject; +import javax.servlet.http.HttpServletResponse; import java.util.List; public interface SurchargeAccountService { @@ -12,4 +13,5 @@ public interface SurchargeAccountService { void fillMothsSurcharge(JSONObject manager, String detailId); + void exportInvoicePDF(int clientId, String clearingDetailIdJSONObject,JSONObject manager, HttpServletResponse httpResponse); } diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index ddd70edac..df89a5844 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -1,6 +1,9 @@ package au.com.royalpay.payment.manage.surchargeAccount.core.impl; +import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; +import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper; import au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientsSurchargeAccountsMapper; import au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper; import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; @@ -10,7 +13,9 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.lock.Locker; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import au.com.royalpay.payment.tools.utils.PdfUtils; import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.time.DateFormatUtils; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,11 +23,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; import java.math.BigDecimal; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.math.RoundingMode; +import java.util.*; import java.util.stream.Collectors; @Service @@ -33,6 +41,10 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { @Resource private FinancialSurchargeAccountDetailMapper financialSurchargeAccountDetailMapper; @Resource + private ClientMapper clientMapper; + @Resource + private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper; + @Resource private Locker locker; @Resource private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; @@ -129,4 +141,71 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill"); } } + + @Override + public void exportInvoicePDF(int clientId, String clearingDetailId,JSONObject manager, HttpServletResponse httpResponse) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); + String date = DateFormatUtils.format(distributedDetail.getDate("settle_date"), "dd MMM yyyy", Locale.US); + httpResponse.setContentType("application/pdf"); + httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); + ServletOutputStream sos = null; + JSONObject pdfInfo = new JSONObject(); + + try { + sos = httpResponse.getOutputStream(); + List clearingAnalysis = clearingDetailAnalysisMapper.listReportChannels(clearingDetailId); + invoiceChannelAmount(clearingAnalysis, pdfInfo); + httpResponse.getOutputStream(); + pdfInfo.put("date", date); + pdfInfo.put("company_name", client.getString("company_name")); + pdfInfo.put("address", client.getString("address")); + pdfInfo.put("suburb", client.getString("suburb") +" " + client.getString("state") +" " +client.getString("postcode")); + pdfInfo.put("country", client.getString("country")); + PdfUtils pdu = new PdfUtils(); + pdu.setTemplatePdfPath("https://file.royalpay.com.au/open/2019/05/21/1558428021205_9pyF7U1rEloxVOXx2k7bTeRxzJaXi0.pdf"); + pdu.setPdfTemplate(pdfInfo); + File file = new File(client.getString("client_moniker") + "_Invoice_"+ date + ".pdf"); + ByteArrayOutputStream bos = pdu.templetPdfBos(file); + sos.write(bos.toByteArray()); + sos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void invoiceChannelAmount(List analysis,JSONObject pdfInfo) { + BigDecimal wechatSurcharge = BigDecimal.ZERO; + BigDecimal wechatTaxAmount = BigDecimal.ZERO; + BigDecimal wechatAmount = BigDecimal.ZERO; + BigDecimal alipaySurcharge = BigDecimal.ZERO; + BigDecimal alipayTaxAmount = BigDecimal.ZERO; + BigDecimal alipayAmount = BigDecimal.ZERO; + for (JSONObject detail : analysis) { + switch (detail.getString("channel")) { + case "Wechat": + wechatSurcharge = detail.getBigDecimal("total_charge"); + wechatTaxAmount = detail.getBigDecimal("tax_amount"); + wechatAmount = detail.getBigDecimal("distributed_surcharge"); + break; + case "Alipay": + alipaySurcharge = detail.getBigDecimal("total_charge"); + alipayTaxAmount = detail.getBigDecimal("tax_amount"); + alipayAmount = detail.getBigDecimal("distributed_surcharge"); + break; + default: + break; + } + } + pdfInfo.put("surcharge_wechat", wechatSurcharge); + pdfInfo.put("amount_wechat", wechatSurcharge); + pdfInfo.put("surcharge_alipay", alipaySurcharge); + pdfInfo.put("amount_alipay", alipaySurcharge); + pdfInfo.put("amount", wechatSurcharge.add(alipaySurcharge)); + pdfInfo.put("gst", wechatTaxAmount.add(alipayTaxAmount)); + pdfInfo.put("total_amount", (wechatAmount.add(alipayAmount)).setScale(2, RoundingMode.DOWN)); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java index bd021e8a6..6c7a893fa 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import java.util.List; @RequestMapping("/sys/surcharge_account") @@ -26,4 +27,10 @@ public class SurchargeAccountController { public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) { surchargeAccountService.fillMothsSurcharge(manager, detailId); } + + @ManagerMapping(value = "/{clientId}/settlement_logs/{clearingDetailId}/export", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.GET) + public void exportInvoicePDF(@PathVariable int clientId, @PathVariable String clearingDetailId, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { + surchargeAccountService.exportInvoicePDF(clientId, clearingDetailId, manager, httpResponse); + } } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 53c85d1e3..0eb1c26be 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2404,13 +2404,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); app.controller('surchargeAccountDetailCtrl', ['$scope', '$http', 'balance', 'partner', 'transactions', 'commonDialog', function ($scope, $http, balance, partner, transactions, commonDialog) { $scope.surcharge = angular.copy(balance); - $scope.transactions = angular.copy(transactions.data); + $scope.surchargeDetailData = angular.copy(transactions.data); $scope.partner = angular.copy(partner); $scope.canAddDetail = false; $scope.params = {}; $scope.getBalance = function () { - if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) { $scope.surcharge = resp.data; @@ -2421,7 +2420,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.getTransactions = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/account/transactions').then(function (resp) { - $scope.transactions = resp.data; + $scope.surchargeDetailData = resp.data; }); } diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 0e1ccad1a..6ebd7bb0e 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -315,7 +315,7 @@
      - +

      diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index e1e775dd4..fbc94df1f 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -708,7 +708,7 @@
      - +

      diff --git a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html index 10729bd43..87e709b28 100644 --- a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html +++ b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html @@ -49,7 +49,7 @@ {{surcharge.remark}} - diff --git a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html index 4c2f98838..1e41d32d6 100644 --- a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html +++ b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html @@ -51,7 +51,7 @@ - From 16d2138bae09e582f0aac561dd2d98dd99370d07 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 21 May 2019 16:48:43 +0800 Subject: [PATCH 20/74] =?UTF-8?q?add=20=E5=90=8E=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E6=89=8B=E7=BB=AD=E8=B4=B9Invoice=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../ClearingDistributedSurchargeMapper.java | 3 + .../core/SurchargeAccountService.java | 2 + .../impl/SurchargeAccountServiceImpl.java | 87 +++++++++++++++++-- .../web/SurchargeAccountController.java | 7 ++ .../static/payment/partner/partner-manage.js | 5 +- .../templates/client_partner_detail.html | 2 +- .../partner/templates/partner_detail.html | 2 +- .../partner_surcharge_account_dialog.html | 2 +- ...artner_surcharge_account_month_dialog.html | 2 +- 10 files changed, 101 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index c50d815bf..1d0124e04 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.6 + 1.0.7 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java index e04890a4a..11f8b00e6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java @@ -22,6 +22,9 @@ public interface ClearingDistributedSurchargeMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject transactions); + @AutoSql(type = SqlType.SELECT) + JSONObject findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); + List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); List findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId); diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java index a5250a2be..ba97930ce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/SurchargeAccountService.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.surchargeAccount.core; import com.alibaba.fastjson.JSONObject; +import javax.servlet.http.HttpServletResponse; import java.util.List; public interface SurchargeAccountService { @@ -12,4 +13,5 @@ public interface SurchargeAccountService { void fillMothsSurcharge(JSONObject manager, String detailId); + void exportInvoicePDF(int clientId, String clearingDetailIdJSONObject,JSONObject manager, HttpServletResponse httpResponse); } diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index dda91bf5e..df89a5844 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -1,6 +1,9 @@ package au.com.royalpay.payment.manage.surchargeAccount.core.impl; +import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; +import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper; import au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientsSurchargeAccountsMapper; import au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper; import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; @@ -10,7 +13,9 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.lock.Locker; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import au.com.royalpay.payment.tools.utils.PdfUtils; import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.time.DateFormatUtils; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,11 +23,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; import java.math.BigDecimal; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.math.RoundingMode; +import java.util.*; import java.util.stream.Collectors; @Service @@ -33,6 +41,10 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { @Resource private FinancialSurchargeAccountDetailMapper financialSurchargeAccountDetailMapper; @Resource + private ClientMapper clientMapper; + @Resource + private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper; + @Resource private Locker locker; @Resource private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; @@ -129,6 +141,71 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill"); } } -} + @Override + public void exportInvoicePDF(int clientId, String clearingDetailId,JSONObject manager, HttpServletResponse httpResponse) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); + String date = DateFormatUtils.format(distributedDetail.getDate("settle_date"), "dd MMM yyyy", Locale.US); + httpResponse.setContentType("application/pdf"); + httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); + ServletOutputStream sos = null; + JSONObject pdfInfo = new JSONObject(); + try { + sos = httpResponse.getOutputStream(); + List clearingAnalysis = clearingDetailAnalysisMapper.listReportChannels(clearingDetailId); + invoiceChannelAmount(clearingAnalysis, pdfInfo); + httpResponse.getOutputStream(); + pdfInfo.put("date", date); + pdfInfo.put("company_name", client.getString("company_name")); + pdfInfo.put("address", client.getString("address")); + pdfInfo.put("suburb", client.getString("suburb") +" " + client.getString("state") +" " +client.getString("postcode")); + pdfInfo.put("country", client.getString("country")); + PdfUtils pdu = new PdfUtils(); + pdu.setTemplatePdfPath("https://file.royalpay.com.au/open/2019/05/21/1558428021205_9pyF7U1rEloxVOXx2k7bTeRxzJaXi0.pdf"); + pdu.setPdfTemplate(pdfInfo); + File file = new File(client.getString("client_moniker") + "_Invoice_"+ date + ".pdf"); + ByteArrayOutputStream bos = pdu.templetPdfBos(file); + sos.write(bos.toByteArray()); + sos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void invoiceChannelAmount(List analysis,JSONObject pdfInfo) { + BigDecimal wechatSurcharge = BigDecimal.ZERO; + BigDecimal wechatTaxAmount = BigDecimal.ZERO; + BigDecimal wechatAmount = BigDecimal.ZERO; + BigDecimal alipaySurcharge = BigDecimal.ZERO; + BigDecimal alipayTaxAmount = BigDecimal.ZERO; + BigDecimal alipayAmount = BigDecimal.ZERO; + for (JSONObject detail : analysis) { + switch (detail.getString("channel")) { + case "Wechat": + wechatSurcharge = detail.getBigDecimal("total_charge"); + wechatTaxAmount = detail.getBigDecimal("tax_amount"); + wechatAmount = detail.getBigDecimal("distributed_surcharge"); + break; + case "Alipay": + alipaySurcharge = detail.getBigDecimal("total_charge"); + alipayTaxAmount = detail.getBigDecimal("tax_amount"); + alipayAmount = detail.getBigDecimal("distributed_surcharge"); + break; + default: + break; + } + } + pdfInfo.put("surcharge_wechat", wechatSurcharge); + pdfInfo.put("amount_wechat", wechatSurcharge); + pdfInfo.put("surcharge_alipay", alipaySurcharge); + pdfInfo.put("amount_alipay", alipaySurcharge); + pdfInfo.put("amount", wechatSurcharge.add(alipaySurcharge)); + pdfInfo.put("gst", wechatTaxAmount.add(alipayTaxAmount)); + pdfInfo.put("total_amount", (wechatAmount.add(alipayAmount)).setScale(2, RoundingMode.DOWN)); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java index bd021e8a6..6c7a893fa 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/web/SurchargeAccountController.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import java.util.List; @RequestMapping("/sys/surcharge_account") @@ -26,4 +27,10 @@ public class SurchargeAccountController { public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) { surchargeAccountService.fillMothsSurcharge(manager, detailId); } + + @ManagerMapping(value = "/{clientId}/settlement_logs/{clearingDetailId}/export", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.GET) + public void exportInvoicePDF(@PathVariable int clientId, @PathVariable String clearingDetailId, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { + surchargeAccountService.exportInvoicePDF(clientId, clearingDetailId, manager, httpResponse); + } } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 53c85d1e3..0eb1c26be 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2404,13 +2404,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); app.controller('surchargeAccountDetailCtrl', ['$scope', '$http', 'balance', 'partner', 'transactions', 'commonDialog', function ($scope, $http, balance, partner, transactions, commonDialog) { $scope.surcharge = angular.copy(balance); - $scope.transactions = angular.copy(transactions.data); + $scope.surchargeDetailData = angular.copy(transactions.data); $scope.partner = angular.copy(partner); $scope.canAddDetail = false; $scope.params = {}; $scope.getBalance = function () { - if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) { $scope.surcharge = resp.data; @@ -2421,7 +2420,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.getTransactions = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/account/transactions').then(function (resp) { - $scope.transactions = resp.data; + $scope.surchargeDetailData = resp.data; }); } diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 0e1ccad1a..6ebd7bb0e 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -315,7 +315,7 @@
      - +

      diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index e1e775dd4..fbc94df1f 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -708,7 +708,7 @@
      - +

      diff --git a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html index 10729bd43..87e709b28 100644 --- a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html +++ b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_dialog.html @@ -49,7 +49,7 @@ {{surcharge.remark}} - diff --git a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html index 4c2f98838..1e41d32d6 100644 --- a/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html +++ b/src/main/ui/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html @@ -51,7 +51,7 @@ - From 552cc0e404fcd0b91afcff4de761dc486741b359 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 21 May 2019 16:58:59 +0800 Subject: [PATCH 21/74] =?UTF-8?q?fix=20=E5=90=8E=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E6=89=8B=E7=BB=AD=E8=B4=B9Invoice=E6=A8=A1=E6=9D=BF=20?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=9B=9E=E6=BB=9A=E6=B8=85=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../system/ClearingDistributedSurchargeMapper.java | 2 +- .../core/impl/SurchargeAccountServiceImpl.java | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 1d0124e04..81b23401f 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.7 + 1.0.8 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java index 11f8b00e6..950877f1e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java @@ -23,7 +23,7 @@ public interface ClearingDistributedSurchargeMapper { void save(JSONObject transactions); @AutoSql(type = SqlType.SELECT) - JSONObject findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); + List findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index df89a5844..f53d0f34c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -148,8 +148,12 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { if (client == null) { throw new InvalidShortIdException(); } - JSONObject distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); - String date = DateFormatUtils.format(distributedDetail.getDate("settle_date"), "dd MMM yyyy", Locale.US); + List distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); + if (distributedDetail.size() > 1) { + throw new BadRequestException("此次清算扣款已回滚"); + } + JSONObject detial = distributedDetail.get(0); + String date = DateFormatUtils.format(detial.getDate("settle_date"), "dd MMM yyyy", Locale.US); httpResponse.setContentType("application/pdf"); httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); ServletOutputStream sos = null; From 049e6705a3ddec1f4e66829d0165b698c5de3084 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 21 May 2019 16:59:32 +0800 Subject: [PATCH 22/74] =?UTF-8?q?fix=20=E5=90=8E=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E6=89=8B=E7=BB=AD=E8=B4=B9Invoice=E6=A8=A1=E6=9D=BF=20?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=9B=9E=E6=BB=9A=E6=B8=85=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/ClearingDistributedSurchargeMapper.java | 2 +- .../core/impl/SurchargeAccountServiceImpl.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java index 11f8b00e6..950877f1e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClearingDistributedSurchargeMapper.java @@ -23,7 +23,7 @@ public interface ClearingDistributedSurchargeMapper { void save(JSONObject transactions); @AutoSql(type = SqlType.SELECT) - JSONObject findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); + List findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId); List getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index df89a5844..f53d0f34c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -148,8 +148,12 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { if (client == null) { throw new InvalidShortIdException(); } - JSONObject distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); - String date = DateFormatUtils.format(distributedDetail.getDate("settle_date"), "dd MMM yyyy", Locale.US); + List distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId); + if (distributedDetail.size() > 1) { + throw new BadRequestException("此次清算扣款已回滚"); + } + JSONObject detial = distributedDetail.get(0); + String date = DateFormatUtils.format(detial.getDate("settle_date"), "dd MMM yyyy", Locale.US); httpResponse.setContentType("application/pdf"); httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf"); ServletOutputStream sos = null; From bb41d026b4a394ffa5fa30d214b61910100d3d0f Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Wed, 22 May 2019 11:10:23 +0800 Subject: [PATCH 23/74] =?UTF-8?q?kpi=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/core/impls/DailyReportImp.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java index cfd767040..823285900 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.core.impls; import au.com.royalpay.payment.manage.analysis.core.DailyReport; import au.com.royalpay.payment.manage.mappers.cashback.CashbackRecordsMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDCommissionConfigMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper; import au.com.royalpay.payment.manage.mappers.log.DailyReportMapper; @@ -22,7 +23,6 @@ import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -54,6 +54,8 @@ public class DailyReportImp implements DailyReport { private MpWechatApiProvider mpWechatApiProvider; @Resource private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; + @Resource + private FinancialBDCommissionConfigMapper financialBDCommissionConfigMapper; private Logger logger = LoggerFactory.getLogger(getClass()); @@ -98,8 +100,8 @@ public class DailyReportImp implements DailyReport { private JSONObject getKPI(Date dt){ JSONObject report = new JSONObject(); List kpiList =new ArrayList<>(); - List prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH)); - List prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-2), Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-2), Calendar.MONTH)); + List prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH)); + List prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH)); List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE)); //BD团队总KPI BigDecimal total_kpi_amount = BigDecimal.ZERO; @@ -114,7 +116,8 @@ public class DailyReportImp implements DailyReport { kpi.put("total_amount",p.getBigDecimal("total_amount")); //当月数据 kpi.put("month_amount",p.getBigDecimal("month_amount")); - kpi.put("kpi_amount",p.getBigDecimal("kpi_amount")); + BigDecimal kpi_amount = financialBDCommissionConfigMapper.findCurrentCommissionMaxAmount(DateFormatUtils.format(DateUtils.truncate(dt,Calendar.MONTH),"yyyy-MM"), p.getIntValue("bd_type")); + kpi.put("kpi_amount",kpi_amount); for(JSONObject prize : prizeAmountAndBdTypeListYesterDay){ if(prize.getString("bd_group").equals(kpi.getString("bd_group"))){ BigDecimal compare = kpi.getBigDecimal("total_amount").subtract(prize.getBigDecimal("total_amount")); @@ -122,14 +125,14 @@ public class DailyReportImp implements DailyReport { kpi.put("compare_value",Math.abs(compare.doubleValue())); } } - kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(p.getBigDecimal("kpi_amount"),4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); + kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); for(JSONObject clientAmount :clientsAmount ){ if(clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))){ kpi.put("clients_history",clientAmount.getIntValue("clients_history")); kpi.put("clients_yesterday",clientAmount.getIntValue("clients_yesterday")); } } - total_kpi_amount = total_kpi_amount.add(p.getBigDecimal("kpi_amount")); + total_kpi_amount = total_kpi_amount.add(kpi_amount); total_month_amount = total_month_amount.add(p.getBigDecimal("month_amount")); kpiList.add(kpi); } From 3192310b80d211c2654933eee769b41132d664a2 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Wed, 22 May 2019 11:53:55 +0800 Subject: [PATCH 24/74] =?UTF-8?q?kpi=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/analysis/core/impls/DailyReportImp.java | 4 ++-- .../royalpay/payment/manage/mappers/system/ClientMapper.java | 2 +- .../royalpay/payment/manage/mappers/system/ClientMapper.xml | 4 ++-- src/main/resources/templates/reports/daily_report.html | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java index 823285900..f68e87375 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java @@ -102,7 +102,7 @@ public class DailyReportImp implements DailyReport { List kpiList =new ArrayList<>(); List prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH)); List prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH)); - List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE)); + List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH)); //BD团队总KPI BigDecimal total_kpi_amount = BigDecimal.ZERO; //BD团队当月总销售额 @@ -128,7 +128,7 @@ public class DailyReportImp implements DailyReport { kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); for(JSONObject clientAmount :clientsAmount ){ if(clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))){ - kpi.put("clients_history",clientAmount.getIntValue("clients_history")); + kpi.put("clients_month",clientAmount.getIntValue("clients_month")); kpi.put("clients_yesterday",clientAmount.getIntValue("clients_yesterday")); } } 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 50c765812..28b157084 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 @@ -119,5 +119,5 @@ public interface ClientMapper { @Select("select client_id from sys_clients where parent_client_id=#{parent_client_id}") List childClientId(@Param("parent_client_id") int parent_client_id); - List createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date); + List createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date,@Param("start_date_month") Date start_date_month); } 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 9efbb7400..de3f5474c 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 @@ -553,7 +553,7 @@ fbc.bd_name, fbc.bd_group, fbc.bd_type, - count( * ) clients_history + count( * ) clients_month FROM sys_clients sc INNER JOIN sys_client_bd d ON sc.client_id = d.client_id @@ -561,7 +561,7 @@ INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group WHERE sc.org_id = 1 - AND sc.create_time < #{start_date} + AND sc.create_time >= #{start_date_month} AND d.is_valid = 1 AND c.bd_group IS NOT NULL AND d.start_date <= now( ) AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > now( ) diff --git a/src/main/resources/templates/reports/daily_report.html b/src/main/resources/templates/reports/daily_report.html index 713c403be..8130f4909 100644 --- a/src/main/resources/templates/reports/daily_report.html +++ b/src/main/resources/templates/reports/daily_report.html @@ -183,7 +183,7 @@
      -
      昨日开户数(历史开户数)
      +
      昨日开户数(当月开户数)
      @@ -192,7 +192,7 @@
      + th:text="${kpi.clients_yesterday}+'('+${kpi.clients_month}+')'">
      From ca9d334c8ad406fd50f15837388dbad8dc92e65a Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Wed, 22 May 2019 11:55:06 +0800 Subject: [PATCH 25/74] =?UTF-8?q?kpi=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 345236f4f..ef816e9f0 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.9 + 1.0.10 From ae9346e6706a6c842f006dc13c47a8e0a18c1eab Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Wed, 22 May 2019 14:01:12 +0800 Subject: [PATCH 26/74] =?UTF-8?q?kpi=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/analysis/core/impls/DailyReportImp.java | 3 +++ src/main/resources/templates/reports/daily_report.html | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java index f68e87375..cd462889d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java @@ -139,6 +139,9 @@ public class DailyReportImp implements DailyReport { report.put("kpiList",kpiList); report.put("kpi_percent_total",total_month_amount.divide(total_kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); report.put("total_month_amount",total_month_amount); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(dt); + report.put("time_percent",BigDecimal.valueOf(calendar.get(Calendar.DAY_OF_MONTH)).divide(BigDecimal.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH)),4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%"); return report; } diff --git a/src/main/resources/templates/reports/daily_report.html b/src/main/resources/templates/reports/daily_report.html index 8130f4909..31d58f921 100644 --- a/src/main/resources/templates/reports/daily_report.html +++ b/src/main/resources/templates/reports/daily_report.html @@ -145,6 +145,11 @@
      +
      +
      时间进度
      +
      +
      Date: Wed, 22 May 2019 14:02:19 +0800 Subject: [PATCH 27/74] =?UTF-8?q?kpi=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef816e9f0..77371710a 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.10 + 1.0.11 From 47496e6cb257dde9667c6045a51af16d9dd6aefa Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 22 May 2019 16:10:58 +0800 Subject: [PATCH 28/74] =?UTF-8?q?fix=20=E5=8E=BB=E6=8E=89representative=5F?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientManager.java | 4 +-- .../core/impls/ClientManagerImpl.java | 16 ++-------- .../web/PartnerManageController.java | 8 ++--- .../static/payment/partner/partner-manage.js | 31 ++++++------------- 4 files changed, 17 insertions(+), 42 deletions(-) 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 2f085f777..b3b9a7b10 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 @@ -323,9 +323,9 @@ public interface ClientManager { String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); - void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayGms(String clientMoniker, JSONObject manager); - void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayOnlineGms(String clientMoniker, JSONObject manager); String queryAlipayGmsStatus(String clientMoniker, JSONObject manager); 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 2626bc65a..a6fc718a9 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 @@ -3979,7 +3979,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4002,13 +4002,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("Alipay Industry can't be null"); } - if (!"Company".equals(client.getString("business_structure"))) { - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { @@ -4117,7 +4110,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayOnlineGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4140,11 +4133,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } client.put("bank_id", client_bank.getString("account_no")); - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { 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 d324988f5..bb2f39f80 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 @@ -628,8 +628,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayGms(clientMoniker, representative_id, manager); + public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @@ -638,8 +638,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayOnlineGms(clientMoniker, representative_id, manager); + public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayOnlineGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 0eb1c26be..4ccf01a20 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1588,26 +1588,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms_json').then(function (resp) { $scope.alipay_gms_json = resp.data; commonDialog.confirm({ - title: 'Warning', - content: '是否使用该商户的现有信息进件?', - json:$scope.alipay_gms_json + title: 'Warning', + content: '是否使用该商户的现有信息进件?', + json: $scope.alipay_gms_json }).then(function () { - if ($scope.partner.business_structure === "Company") { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () { commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'}); }, function (resp) { commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }) - } else { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:Alipay进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) - }); - } - }) + }); }) }; $scope.queryAlipayGms = function () { @@ -1625,14 +1615,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: '是否使用该商户的现有信息进件?', json:$scope.alipayOnline_gms_json }).then(function () { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () { + commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }); - }) }); }; From aa2fea8f7151fa25c614790b3ffd2e6b59e1af66 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 22 May 2019 16:13:35 +0800 Subject: [PATCH 29/74] =?UTF-8?q?fix=20=E5=8E=BB=E6=8E=89representative=5F?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/merchants/core/ClientManager.java | 4 +-- .../core/impls/ClientManagerImpl.java | 16 ++-------- .../web/PartnerManageController.java | 8 ++--- .../static/payment/partner/partner-manage.js | 31 ++++++------------- 5 files changed, 18 insertions(+), 43 deletions(-) diff --git a/pom.xml b/pom.xml index 5ab2a115a..de462a78c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.5 + 1.0.6 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 2f085f777..b3b9a7b10 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 @@ -323,9 +323,9 @@ public interface ClientManager { String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); - void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayGms(String clientMoniker, JSONObject manager); - void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager); + void registerAlipayOnlineGms(String clientMoniker, JSONObject manager); String queryAlipayGmsStatus(String clientMoniker, JSONObject manager); 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 2626bc65a..a6fc718a9 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 @@ -3979,7 +3979,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4002,13 +4002,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("Alipay Industry can't be null"); } - if (!"Company".equals(client.getString("business_structure"))) { - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { @@ -4117,7 +4110,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager) { + public void registerAlipayOnlineGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -4140,11 +4133,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } client.put("bank_id", client_bank.getString("account_no")); - if (StringUtils.isBlank(representative_id.getString("representative_id"))) { - throw new BadRequestException("ID or passport number can't be null"); - } - client.put("representative_id", representative_id.getString("representative_id")); - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { 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 d324988f5..bb2f39f80 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 @@ -628,8 +628,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayGms(clientMoniker, representative_id, manager); + public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @@ -638,8 +638,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.registerAlipayOnlineGms(clientMoniker, representative_id, manager); + public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.registerAlipayOnlineGms(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 0eb1c26be..4ccf01a20 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1588,26 +1588,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms_json').then(function (resp) { $scope.alipay_gms_json = resp.data; commonDialog.confirm({ - title: 'Warning', - content: '是否使用该商户的现有信息进件?', - json:$scope.alipay_gms_json + title: 'Warning', + content: '是否使用该商户的现有信息进件?', + json: $scope.alipay_gms_json }).then(function () { - if ($scope.partner.business_structure === "Company") { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () { commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'}); }, function (resp) { commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }) - } else { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:Alipay进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) - }); - } - }) + }); }) }; $scope.queryAlipayGms = function () { @@ -1625,14 +1615,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: '是否使用该商户的现有信息进件?', json:$scope.alipayOnline_gms_json }).then(function () { - commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) { - $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms', {representative_id: text}).then(function () { - commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); - }) + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () { + commonDialog.alert({title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'}); }); - }) }); }; From 588db33a61f489e74239788cf2c8b1305a6ff205 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 22 May 2019 16:15:17 +0800 Subject: [PATCH 30/74] fix pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 77371710a..de1e4497a 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.11 + 1.0.12 From c713dc0e7bff11de3f1afea7f936d83020989649 Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 23 May 2019 13:23:51 +0800 Subject: [PATCH 31/74] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=80=9A=E9=93=B6?= =?UTF-8?q?=E6=8A=A5=E5=A4=87=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 21d2a1d39..19969b1c7 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -139,7 +139,7 @@ settle.abafile.bank.NAB.account-name=Tunnel Show Pty Ltd # 瀚银Secure app.hanyin-secure.pid=ROYALPAY -app.hanyin-secure.sftp-host=180.168.61.86 +app.hanyin-secure.sftp-host=180.168.61.93 app.hanyin-secure.sftp-port=28480 app.hanyin-secure.sftp-username=royalpay app.hanyin-secure.sftp-pwd=royalpay From 9370086ce61f267f71731dc167bd5f9bd170499f Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Thu, 23 May 2019 13:44:47 +0800 Subject: [PATCH 32/74] css --- src/main/ui/static/templates/cbpay/css/gateway_phone.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/ui/static/templates/cbpay/css/gateway_phone.css b/src/main/ui/static/templates/cbpay/css/gateway_phone.css index 5a5ab34c5..6f6fd783f 100644 --- a/src/main/ui/static/templates/cbpay/css/gateway_phone.css +++ b/src/main/ui/static/templates/cbpay/css/gateway_phone.css @@ -214,8 +214,8 @@ input:-ms-input-placeholder { /* Internet Explorer 10-11 */ } .all .all-logo img { - width: 35px; - height: 40px; + width: 50px; + height: 50px; } .all .all-royalpay { From bdfd997d05c9d70b93930c42f4cf71a349cd5850 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:44:08 +0800 Subject: [PATCH 33/74] =?UTF-8?q?add=20=E6=89=B9=E9=87=8F=E6=8A=A5?= =?UTF-8?q?=E5=A4=87=E6=94=AF=E4=BB=98=E5=AE=9D=E7=BA=BF=E4=B8=8A=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 4 +- .../dev/core/impl/AliforexcelServiceImpl.java | 80 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++ .../mappers/payment/TransactionMapper.java | 2 + .../mappers/payment/TransactionMapper.xml | 5 ++ .../ui/static/config/devtools/devtools.js | 24 ++++++ .../registerAlipayOnlineMerchant.html | 59 ++++++++++++++ 8 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html diff --git a/pom.xml b/pom.xml index de1e4497a..e004f1438 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.12 + 1.0.13 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 4fc7a3ab7..aab8939e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -9,5 +9,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; public interface AliforexcelService { - JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query); + JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query); + + JSONObject registerAlipayOnlineMerchant(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 639d14987..f98883406 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -1,26 +1,41 @@ package au.com.royalpay.payment.manage.dev.core.impl; +import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; +import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment; +import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient; +import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.manage.dev.bean.AliExcel; import au.com.royalpay.payment.manage.dev.core.AliforexcelService; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import com.alibaba.fastjson.JSONObject; +import com.yeepay.shade.org.apache.commons.lang3.StringUtils; import org.apache.commons.io.IOUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; +import org.dom4j.Element; import org.springframework.stereotype.Service; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; +import java.security.InvalidParameterException; +import java.util.ArrayList; import java.util.List; @Service public class AliforexcelServiceImpl implements AliforexcelService { @Resource private ClientMapper clientMapper; + @Resource + private TransactionMapper transactionMapper; + @Resource + private AlipayClient alipayClient; @Override public JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query) { @@ -75,4 +90,69 @@ public class AliforexcelServiceImpl implements AliforexcelService { return null; } + @Override + public JSONObject registerAlipayOnlineMerchant() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (!client.getBooleanValue("is_valid")) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + + private void checkPartnerInfo(JSONObject client) { + if (client == null) { + throw new InvalidShortIdException(); + } + if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { + throw new InvalidParameterException("Website cannot be empty "); + } + if (StringUtils.isBlank(client.getString("business_structure"))) { + throw new InvalidParameterException("Business Structure can't be null"); + } + + if (StringUtils.isBlank(client.getString("alipayindustry"))) { + throw new InvalidParameterException("Alipay Industry can't be null"); + } + } + } 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 b2a5dcaba..7b6b889d9 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 @@ -449,4 +449,9 @@ public class TestController implements ApplicationEventPublisherAware { public void downloadHanyinSecureReports(@PathVariable String date) { tradeSecureService.uploadSecureReport(DateTime.parse(date).toDate()); } + + @ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayOnlineMerchant() { + return aliforexcelService.registerAlipayOnlineMerchant(); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index b1b95225d..997831791 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -157,4 +157,6 @@ public interface TransactionMapper { List getClientOrderByTransactionTime(JSONObject params); List getLastDaytransAmount(JSONObject params); + + List useAlipayOnlineClients(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index d2319f3f7..5e1284444 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1208,4 +1208,9 @@ AND transaction_time < #{dateto} GROUP BY channel + + diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 009e3dcc5..871d99bc2 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -67,6 +67,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { url: '/rpayupdate', templateUrl: '/static/config/devtools/templates/rpayupdate.html', controller: 'rpayupdateCtrl' + }).state('devtools.registerAlipayOnlineMerchant', { + url: '/registerAlipayOnlineMerchant', + templateUrl: '/static/config/devtools/templates/registerAlipayOnlineMerchant.html', + controller: 'registerAlipayOnlineMerchantCtrl' }) }]); app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { @@ -404,6 +408,26 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }]); + app.controller('registerAlipayOnlineMerchantCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) { + $scope.selecttotal = true; + + $scope.registerOnlineGMS = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayOnlineGms').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + } + + }]); + return app; }); \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html new file mode 100644 index 000000000..f8ecbc6bd --- /dev/null +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -0,0 +1,59 @@ +
      +

      批量支付宝线上报备

      + +
      +
      +
      + +
      +
      + 需要报备的商户编码

      +
      +
      + 成功报备的商户编码

      +
      +
      + 注册失败的商户编码 + + + + + + + + + + + + + +
      client_moniker失败原因
      + {{client.client_moniker}} +
      +
      +
      + 缺少信息的商户编码 + + + + + + + + + + + + + +
      client_moniker缺少信息
      + {{client.client_moniker}} +
      +
      +
      \ No newline at end of file From e1d01a3a9f885777b49700ea83c90c181b5ac447 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:46:46 +0800 Subject: [PATCH 34/74] =?UTF-8?q?add=20=E6=89=B9=E9=87=8F=E6=8A=A5?= =?UTF-8?q?=E5=A4=87=E6=94=AF=E4=BB=98=E5=AE=9D=E7=BA=BF=E4=B8=8A=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 4 +- .../dev/core/impl/AliforexcelServiceImpl.java | 80 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++ .../mappers/payment/TransactionMapper.java | 2 + .../mappers/payment/TransactionMapper.xml | 5 ++ .../ui/static/config/devtools/devtools.js | 24 ++++++ .../registerAlipayOnlineMerchant.html | 59 ++++++++++++++ 8 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html diff --git a/pom.xml b/pom.xml index de462a78c..da979de13 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.6 + 1.0.7 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 4fc7a3ab7..aab8939e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -9,5 +9,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; public interface AliforexcelService { - JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query); + JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query); + + JSONObject registerAlipayOnlineMerchant(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 639d14987..f98883406 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -1,26 +1,41 @@ package au.com.royalpay.payment.manage.dev.core.impl; +import au.com.royalpay.payment.channels.alipay.config.AlipayConfig; +import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment; +import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient; +import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.manage.dev.bean.AliExcel; import au.com.royalpay.payment.manage.dev.core.AliforexcelService; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import com.alibaba.fastjson.JSONObject; +import com.yeepay.shade.org.apache.commons.lang3.StringUtils; import org.apache.commons.io.IOUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; +import org.dom4j.Element; import org.springframework.stereotype.Service; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; +import java.security.InvalidParameterException; +import java.util.ArrayList; import java.util.List; @Service public class AliforexcelServiceImpl implements AliforexcelService { @Resource private ClientMapper clientMapper; + @Resource + private TransactionMapper transactionMapper; + @Resource + private AlipayClient alipayClient; @Override public JSONObject listClients(HttpServletResponse httpResponse,JSONObject manager, AliExcel query) { @@ -75,4 +90,69 @@ public class AliforexcelServiceImpl implements AliforexcelService { return null; } + @Override + public JSONObject registerAlipayOnlineMerchant() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (!client.getBooleanValue("is_valid")) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + + private void checkPartnerInfo(JSONObject client) { + if (client == null) { + throw new InvalidShortIdException(); + } + if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { + throw new InvalidParameterException("Website cannot be empty "); + } + if (StringUtils.isBlank(client.getString("business_structure"))) { + throw new InvalidParameterException("Business Structure can't be null"); + } + + if (StringUtils.isBlank(client.getString("alipayindustry"))) { + throw new InvalidParameterException("Alipay Industry can't be null"); + } + } + } 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 b2a5dcaba..7b6b889d9 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 @@ -449,4 +449,9 @@ public class TestController implements ApplicationEventPublisherAware { public void downloadHanyinSecureReports(@PathVariable String date) { tradeSecureService.uploadSecureReport(DateTime.parse(date).toDate()); } + + @ManagerMapping(value = "/register/alipayOnlineGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayOnlineMerchant() { + return aliforexcelService.registerAlipayOnlineMerchant(); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index b1b95225d..997831791 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -157,4 +157,6 @@ public interface TransactionMapper { List getClientOrderByTransactionTime(JSONObject params); List getLastDaytransAmount(JSONObject params); + + List useAlipayOnlineClients(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index d2319f3f7..5e1284444 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1208,4 +1208,9 @@ AND transaction_time < #{dateto} GROUP BY channel + + diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 009e3dcc5..871d99bc2 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -67,6 +67,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { url: '/rpayupdate', templateUrl: '/static/config/devtools/templates/rpayupdate.html', controller: 'rpayupdateCtrl' + }).state('devtools.registerAlipayOnlineMerchant', { + url: '/registerAlipayOnlineMerchant', + templateUrl: '/static/config/devtools/templates/registerAlipayOnlineMerchant.html', + controller: 'registerAlipayOnlineMerchantCtrl' }) }]); app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { @@ -404,6 +408,26 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }]); + app.controller('registerAlipayOnlineMerchantCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) { + $scope.selecttotal = true; + + $scope.registerOnlineGMS = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayOnlineGms').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + } + + }]); + return app; }); \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html new file mode 100644 index 000000000..92c0db450 --- /dev/null +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -0,0 +1,59 @@ +
      +

      批量支付宝线上报备

      + +
      +
      +
      + +
      +
      + 需要报备的商户编码

      +
      +
      + 成功报备的商户编码

      +
      +
      + 注册失败的商户编码 + + + + + + + + + + + + + +
      client_moniker失败原因
      + {{client.client_moniker}} +
      +
      +
      + 缺少信息的商户编码 + + + + + + + + + + + + + +
      client_moniker缺少信息
      + {{client.client_moniker}} +
      +
      +
      \ No newline at end of file From 9377bec8de7c1f45488283145cd558ac712e0bd2 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:50:18 +0800 Subject: [PATCH 35/74] fix ui --- src/main/ui/static/config/devtools/templates/root.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/ui/static/config/devtools/templates/root.html b/src/main/ui/static/config/devtools/templates/root.html index 48774f3f1..6b44535f2 100644 --- a/src/main/ui/static/config/devtools/templates/root.html +++ b/src/main/ui/static/config/devtools/templates/root.html @@ -87,6 +87,10 @@ 更新Rpay+商户费率时间 + + + 批量报备支付宝线上商户 +
      From f21e8ecdad456f0364996e575336b04b393e4d95 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:50:38 +0800 Subject: [PATCH 36/74] fix ui --- src/main/ui/static/config/devtools/templates/root.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/ui/static/config/devtools/templates/root.html b/src/main/ui/static/config/devtools/templates/root.html index 48774f3f1..6b44535f2 100644 --- a/src/main/ui/static/config/devtools/templates/root.html +++ b/src/main/ui/static/config/devtools/templates/root.html @@ -87,6 +87,10 @@ 更新Rpay+商户费率时间 + + + 批量报备支付宝线上商户 + From 7b21e4aec7595e35fd9c474d90395b7f3eb37988 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:56:22 +0800 Subject: [PATCH 37/74] fix clientInfo null --- pom.xml | 2 +- .../payment/manage/dev/core/impl/AliforexcelServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e004f1438..3578d4298 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.13 + 1.0.14 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index f98883406..6b6f57391 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -100,7 +100,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); for (int clientId : useAlipayOnlineMerchant) { JSONObject client = clientMapper.findClient(clientId); - if (!client.getBooleanValue("is_valid")) { + if (client == null) { continue; } try { From d1e5f4c8ed1353a9288ebc5433961d6cfef512d6 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 14:57:09 +0800 Subject: [PATCH 38/74] fix clientInfo null --- .../payment/manage/dev/core/impl/AliforexcelServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index f98883406..6b6f57391 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -100,7 +100,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); for (int clientId : useAlipayOnlineMerchant) { JSONObject client = clientMapper.findClient(clientId); - if (!client.getBooleanValue("is_valid")) { + if (client == null) { continue; } try { From 06469a319a87741001d8bcf405b8d6fb56286c3b Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:32:12 +0800 Subject: [PATCH 39/74] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E6=88=B7bd=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 2 ++ .../dev/core/impl/AliforexcelServiceImpl.java | 25 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++++ .../ui/static/config/devtools/devtools.js | 11 ++++++++ .../registerAlipayOnlineMerchant.html | 3 +++ 6 files changed, 47 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3578d4298..2a2d0cbe7 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.14 + 1.0.15 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index aab8939e8..63ac55f5f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -12,4 +12,6 @@ public interface AliforexcelService { JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query); JSONObject registerAlipayOnlineMerchant(); + + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 6b6f57391..59acf4ed6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -110,6 +110,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); lessInfoMerchant.add(exception); continue; } @@ -139,6 +140,30 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject getLessPartnerInfo() { + JSONObject result = new JSONObject(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + continue; + } + try { + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + } + } + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + private void checkPartnerInfo(JSONObject client) { if (client == null) { throw new InvalidShortIdException(); 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 7b6b889d9..ceb3a28cd 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 @@ -454,4 +454,9 @@ public class TestController implements ApplicationEventPublisherAware { public JSONObject registerAlipayOnlineMerchant() { return aliforexcelService.registerAlipayOnlineMerchant(); } + + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) + public JSONObject getLessPartnerInfo() { + return aliforexcelService.getLessPartnerInfo(); + } } diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 871d99bc2..65576c7a1 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -424,6 +424,17 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }, function (resp) { alert(resp.data.message); }) + }; + + $scope.getLessPartnerInfo = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.get('/dev/register/getLessPartnerInfo').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + }, function (resp) { + alert(resp.data.message); + }) } }]); diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index f8ecbc6bd..ef8545b78 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -12,6 +12,9 @@
      +
      + +
      需要报备的商户编码

      From 3ae2c06286fe04e69660f6458f454f51e56afc4b Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:34:07 +0800 Subject: [PATCH 40/74] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E6=88=B7bd=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/core/AliforexcelService.java | 2 ++ .../dev/core/impl/AliforexcelServiceImpl.java | 25 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++++ .../ui/static/config/devtools/devtools.js | 11 ++++++++ .../registerAlipayOnlineMerchant.html | 5 +++- 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index aab8939e8..63ac55f5f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -12,4 +12,6 @@ public interface AliforexcelService { JSONObject listClients(HttpServletResponse httpResponse, JSONObject manager, AliExcel query); JSONObject registerAlipayOnlineMerchant(); + + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 6b6f57391..59acf4ed6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -110,6 +110,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); lessInfoMerchant.add(exception); continue; } @@ -139,6 +140,30 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject getLessPartnerInfo() { + JSONObject result = new JSONObject(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClients(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + continue; + } + try { + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + } + } + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + private void checkPartnerInfo(JSONObject client) { if (client == null) { throw new InvalidShortIdException(); 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 7b6b889d9..ceb3a28cd 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 @@ -454,4 +454,9 @@ public class TestController implements ApplicationEventPublisherAware { public JSONObject registerAlipayOnlineMerchant() { return aliforexcelService.registerAlipayOnlineMerchant(); } + + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) + public JSONObject getLessPartnerInfo() { + return aliforexcelService.getLessPartnerInfo(); + } } diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 871d99bc2..65576c7a1 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -424,6 +424,17 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }, function (resp) { alert(resp.data.message); }) + }; + + $scope.getLessPartnerInfo = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.get('/dev/register/getLessPartnerInfo').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + }, function (resp) { + alert(resp.data.message); + }) } }]); diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index 92c0db450..a59c7665e 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -10,7 +10,10 @@
      - + +
      +
      +
      需要报备的商户编码

      From 1892a8601ad8cfe3f63f19e980b018c616528518 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:55:47 +0800 Subject: [PATCH 41/74] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E6=88=B7bd=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/core/AliforexcelService.java | 2 + .../dev/core/impl/AliforexcelServiceImpl.java | 50 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++ .../mappers/payment/TransactionMapper.java | 2 + .../mappers/payment/TransactionMapper.xml | 5 ++ .../ui/static/config/devtools/devtools.js | 15 +++++- .../registerAlipayOnlineMerchant.html | 3 ++ 7 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 63ac55f5f..651b879ca 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,5 +13,7 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); + JSONObject registerAlipayOnlineMerchantTmp(); + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 59acf4ed6..2f91ecc83 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -140,6 +140,56 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject registerAlipayOnlineMerchantTmp() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClientsTmp(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); 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 ceb3a28cd..81692b649 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 @@ -455,6 +455,11 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } + @ManagerMapping(value = "/register/alipayOnlineGms/tmp", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayOnlineMerchantTmp() { + return aliforexcelService.registerAlipayOnlineMerchantTmp(); + } + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 997831791..4879c4dd7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -159,4 +159,6 @@ public interface TransactionMapper { List getLastDaytransAmount(JSONObject params); List useAlipayOnlineClients(); + + List useAlipayOnlineClientsTmp(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 5e1284444..5fdc15d58 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1213,4 +1213,9 @@ SELECT DISTINCT client_id FROM pmt_transactions WHERE channel='AlipayOnline' + + diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 65576c7a1..c238328c2 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,7 +425,20 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; - + $scope.registerOnlineGMSTmp = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayOnlineGms/tmp').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index a59c7665e..d793d5d7b 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -15,6 +15,9 @@
      +
      + +
      需要报备的商户编码

      From 11abda951a8c0132eea2970362e7b5e8c97804ae Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:57:53 +0800 Subject: [PATCH 42/74] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5order=5Fchannel?= =?UTF-8?q?=E4=B8=BA=E2=80=9CAlipayOnline=E2=80=9D=E7=9A=84=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 2 + .../dev/core/impl/AliforexcelServiceImpl.java | 50 +++++++++++++++++++ .../manage/dev/web/TestController.java | 5 ++ .../mappers/payment/TransactionMapper.java | 2 + .../mappers/payment/TransactionMapper.xml | 7 ++- .../ui/static/config/devtools/devtools.js | 15 +++++- .../registerAlipayOnlineMerchant.html | 3 ++ 8 files changed, 83 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 2a2d0cbe7..eb72d887b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.15 + 1.0.16 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 63ac55f5f..651b879ca 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,5 +13,7 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); + JSONObject registerAlipayOnlineMerchantTmp(); + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 59acf4ed6..2f91ecc83 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -140,6 +140,56 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject registerAlipayOnlineMerchantTmp() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClientsTmp(); + for (int clientId : useAlipayOnlineMerchant) { + JSONObject client = clientMapper.findClient(clientId); + if (client == null) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); 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 ceb3a28cd..81692b649 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 @@ -455,6 +455,11 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } + @ManagerMapping(value = "/register/alipayOnlineGms/tmp", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayOnlineMerchantTmp() { + return aliforexcelService.registerAlipayOnlineMerchantTmp(); + } + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 997831791..4879c4dd7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -159,4 +159,6 @@ public interface TransactionMapper { List getLastDaytransAmount(JSONObject params); List useAlipayOnlineClients(); + + List useAlipayOnlineClientsTmp(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 5e1284444..f11770b51 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1211,6 +1211,11 @@ + + diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 65576c7a1..c238328c2 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,7 +425,20 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; - + $scope.registerOnlineGMSTmp = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayOnlineGms/tmp').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index ef8545b78..df00a00bd 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -15,6 +15,9 @@
      +
      + +
      需要报备的商户编码

      From 392da611d575c2d76e25e47ed8acd2beaef14f32 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 15:58:30 +0800 Subject: [PATCH 43/74] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5order=5Fchannel?= =?UTF-8?q?=E4=B8=BA=E2=80=9CAlipayOnline=E2=80=9D=E7=9A=84=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/mappers/payment/TransactionMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 5fdc15d58..f11770b51 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1211,7 +1211,7 @@ - - diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index c238328c2..101374d74 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,20 +425,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; - $scope.registerOnlineGMSTmp = function () { - $scope.totalhide = true; - $scope.selecttotal = false; - $http.post('/dev/register/alipayOnlineGms/tmp').then(function (resp) { - $scope.totalhide = false; - $scope.selecttotal = true; - $scope.need_register_merchant = resp.data.need_register_merchant.toString(); - $scope.success_register_merchant = resp.data.success_register_merchant.toString(); - $scope.fail_register_merchant = resp.data.fail_register_merchant; - $scope.less_info_merchant = resp.data.less_info_merchant(); - }, function (resp) { - alert(resp.data.message); - }) - }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index d793d5d7b..cfe468bad 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -15,9 +15,6 @@
      -
      - -
      需要报备的商户编码

      @@ -43,23 +40,4 @@
      -
      - 缺少信息的商户编码 - - - - - - - - - - - - - -
      client_moniker缺少信息
      - {{client.client_moniker}} -
      -
      \ No newline at end of file From 1c0696f412b4502dfb73c53f88b4e2baad5a51ec Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 23 May 2019 16:20:37 +0800 Subject: [PATCH 45/74] =?UTF-8?q?fix=20=E5=88=A0=E9=99=A4=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/core/AliforexcelService.java | 2 - .../dev/core/impl/AliforexcelServiceImpl.java | 50 ------------------- .../manage/dev/web/TestController.java | 5 -- .../mappers/payment/TransactionMapper.java | 2 - .../mappers/payment/TransactionMapper.xml | 5 -- .../ui/static/config/devtools/devtools.js | 14 ------ .../registerAlipayOnlineMerchant.html | 22 -------- 7 files changed, 100 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 651b879ca..63ac55f5f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,7 +13,5 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); - JSONObject registerAlipayOnlineMerchantTmp(); - JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 2f91ecc83..59acf4ed6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -140,56 +140,6 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } - @Override - public JSONObject registerAlipayOnlineMerchantTmp() { - JSONObject result = new JSONObject(); - List needRegisterMerchant = new ArrayList<>(); - List registerSuccessMerchant = new ArrayList<>(); - List registerFailMerchant = new ArrayList<>(); - List lessInfoMerchant = new ArrayList<>(); - List useAlipayOnlineMerchant = transactionMapper.useAlipayOnlineClientsTmp(); - for (int clientId : useAlipayOnlineMerchant) { - JSONObject client = clientMapper.findClient(clientId); - if (client == null) { - continue; - } - try { - needRegisterMerchant.add(client.getString("client_moniker")); - checkPartnerInfo(client); - } catch (InvalidParameterException e) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", e.getMessage()); - exception.put("bd_name", client.getString("bd_user_name")); - lessInfoMerchant.add(exception); - continue; - } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - registerSuccessMerchant.add(client.getString("client_moniker")); - } - result.put("need_register_merchant", needRegisterMerchant); - result.put("success_register_merchant", registerSuccessMerchant); - result.put("fail_register_merchant", registerFailMerchant); - result.put("less_info_merchant", lessInfoMerchant); - return result; - } - @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); 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 81692b649..ceb3a28cd 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 @@ -455,11 +455,6 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } - @ManagerMapping(value = "/register/alipayOnlineGms/tmp", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) - public JSONObject registerAlipayOnlineMerchantTmp() { - return aliforexcelService.registerAlipayOnlineMerchantTmp(); - } - @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 4879c4dd7..997831791 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -159,6 +159,4 @@ public interface TransactionMapper { List getLastDaytransAmount(JSONObject params); List useAlipayOnlineClients(); - - List useAlipayOnlineClientsTmp(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index f11770b51..24cf01ff6 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1213,9 +1213,4 @@ SELECT DISTINCT client_id FROM pmt_transactions WHERE order_channel='AlipayOnline' - - diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index c238328c2..101374d74 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,20 +425,6 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; - $scope.registerOnlineGMSTmp = function () { - $scope.totalhide = true; - $scope.selecttotal = false; - $http.post('/dev/register/alipayOnlineGms/tmp').then(function (resp) { - $scope.totalhide = false; - $scope.selecttotal = true; - $scope.need_register_merchant = resp.data.need_register_merchant.toString(); - $scope.success_register_merchant = resp.data.success_register_merchant.toString(); - $scope.fail_register_merchant = resp.data.fail_register_merchant; - $scope.less_info_merchant = resp.data.less_info_merchant(); - }, function (resp) { - alert(resp.data.message); - }) - }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index df00a00bd..e3f2b2ec5 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -15,9 +15,6 @@
      -
      - -
      需要报备的商户编码

      @@ -43,23 +40,4 @@ -
      - 缺少信息的商户编码 - - - - - - - - - - - - - -
      client_moniker缺少信息
      - {{client.client_moniker}} -
      -
      \ No newline at end of file From 840e7cd26477619da53b4f0d65630f94360a1820 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 24 May 2019 10:40:02 +0800 Subject: [PATCH 46/74] =?UTF-8?q?add=20=E7=BA=BF=E4=B8=8B=E5=95=86?= =?UTF-8?q?=E6=88=B7=E6=89=B9=E9=87=8F=E6=8A=A5=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/AliforexcelService.java | 2 + .../dev/core/impl/AliforexcelServiceImpl.java | 71 ++++++++++++++++--- .../manage/dev/web/TestController.java | 5 ++ .../ui/static/config/devtools/devtools.js | 14 ++++ .../registerAlipayOnlineMerchant.html | 7 +- 6 files changed, 89 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index eb72d887b..1678d5ffa 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.16 + 1.0.17 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 63ac55f5f..d129c1eed 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,5 +13,7 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); + JSONObject registerAlipayMerchant(); + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 59acf4ed6..0adcbdfce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -105,7 +105,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { } try { needRegisterMerchant.add(client.getString("client_moniker")); - checkPartnerInfo(client); + checkPartnerInfo(client,"online"); } catch (InvalidParameterException e) { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); @@ -140,6 +140,57 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject registerAlipayMerchant() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + String alipayOfflineMerchantsStr = "FORE,RAYI,AASO,BGWI,HYMQ,LIFE,TWTA,AMYW,CCTM,JCYA,JICH,ADGJ,MAGL,TOMA,MCNE,LILC,YOTR,PENG,CASM,SHAO,SWCG,TMCF,BPAR,DNLG,OVAU,SJZH,VWPA,BCOL,MOLI,LIYA,TST3,AUKN,MMEK,GINF,EZE2,GOTR,CJKD,QR12,NJHI,WHAP,HOTO,OMNI,UGGM,JJTV,HHPL,BSPL,TOUR,AUMG,AYUC,BFLI,WAOR,SUTR,LTEA,BRAV,BTTC,FATT,VFPL,LEOH,BHHO,ISSP,JOLP,SUNH,NEVC,QR56,GNH9,SHFO,4UBW,ZZAO,B12H,QUMA,MAYH,FMPS,OWPL,CUDE,I2MI,FAGO,FADA,ZHHS,MANT,DOMU,NTTB,SDCN,8QNF,BHLW,KNIT,U4N9,WNNN"; + String[] alipayOfflineMerchants = alipayOfflineMerchantsStr.split(","); + for (String clientMoniker : alipayOfflineMerchants) { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client,"offline"); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); + Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); @@ -151,7 +202,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { continue; } try { - checkPartnerInfo(client); + checkPartnerInfo(client,"online"); } catch (InvalidParameterException e) { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); @@ -164,12 +215,15 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } - private void checkPartnerInfo(JSONObject client) { - if (client == null) { - throw new InvalidShortIdException(); - } - if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { - throw new InvalidParameterException("Website cannot be empty "); + private void checkPartnerInfo(JSONObject client,String type) { + if ("online".equals(type)) { + if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { + throw new InvalidParameterException("Website cannot be empty "); + } + }else { + if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { + throw new InvalidParameterException("store photo cannot be empty "); + } } if (StringUtils.isBlank(client.getString("business_structure"))) { throw new InvalidParameterException("Business Structure can't be null"); @@ -179,5 +233,4 @@ public class AliforexcelServiceImpl implements AliforexcelService { throw new InvalidParameterException("Alipay Industry can't be null"); } } - } 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 ceb3a28cd..e8fd2d89f 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 @@ -455,6 +455,11 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } + @ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayMerchant() { + return aliforexcelService.registerAlipayMerchant(); + } + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 101374d74..2cc56f2bb 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,6 +425,20 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; + $scope.registerGMS = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayGms').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index e3f2b2ec5..0be602e06 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -10,10 +10,13 @@
      - +
      - + +
      +
      +
      需要报备的商户编码

      From 2b516d51d0158e2a0033bb7e24c2d4c9a5984d28 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 24 May 2019 10:41:36 +0800 Subject: [PATCH 47/74] =?UTF-8?q?add=20=E7=BA=BF=E4=B8=8B=E5=95=86?= =?UTF-8?q?=E6=88=B7=E6=89=B9=E9=87=8F=E6=8A=A5=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/core/AliforexcelService.java | 2 + .../dev/core/impl/AliforexcelServiceImpl.java | 71 ++++++++++++++++--- .../manage/dev/web/TestController.java | 5 ++ .../ui/static/config/devtools/devtools.js | 14 ++++ .../registerAlipayOnlineMerchant.html | 7 +- 5 files changed, 88 insertions(+), 11 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java index 63ac55f5f..d129c1eed 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/AliforexcelService.java @@ -13,5 +13,7 @@ public interface AliforexcelService { JSONObject registerAlipayOnlineMerchant(); + JSONObject registerAlipayMerchant(); + JSONObject getLessPartnerInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 59acf4ed6..0adcbdfce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -105,7 +105,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { } try { needRegisterMerchant.add(client.getString("client_moniker")); - checkPartnerInfo(client); + checkPartnerInfo(client,"online"); } catch (InvalidParameterException e) { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); @@ -140,6 +140,57 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } + @Override + public JSONObject registerAlipayMerchant() { + JSONObject result = new JSONObject(); + List needRegisterMerchant = new ArrayList<>(); + List registerSuccessMerchant = new ArrayList<>(); + List registerFailMerchant = new ArrayList<>(); + List lessInfoMerchant = new ArrayList<>(); + String alipayOfflineMerchantsStr = "FORE,RAYI,AASO,BGWI,HYMQ,LIFE,TWTA,AMYW,CCTM,JCYA,JICH,ADGJ,MAGL,TOMA,MCNE,LILC,YOTR,PENG,CASM,SHAO,SWCG,TMCF,BPAR,DNLG,OVAU,SJZH,VWPA,BCOL,MOLI,LIYA,TST3,AUKN,MMEK,GINF,EZE2,GOTR,CJKD,QR12,NJHI,WHAP,HOTO,OMNI,UGGM,JJTV,HHPL,BSPL,TOUR,AUMG,AYUC,BFLI,WAOR,SUTR,LTEA,BRAV,BTTC,FATT,VFPL,LEOH,BHHO,ISSP,JOLP,SUNH,NEVC,QR56,GNH9,SHFO,4UBW,ZZAO,B12H,QUMA,MAYH,FMPS,OWPL,CUDE,I2MI,FAGO,FADA,ZHHS,MANT,DOMU,NTTB,SDCN,8QNF,BHLW,KNIT,U4N9,WNNN"; + String[] alipayOfflineMerchants = alipayOfflineMerchantsStr.split(","); + for (String clientMoniker : alipayOfflineMerchants) { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + continue; + } + try { + needRegisterMerchant.add(client.getString("client_moniker")); + checkPartnerInfo(client,"offline"); + } catch (InvalidParameterException e) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", e.getMessage()); + exception.put("bd_name", client.getString("bd_user_name")); + lessInfoMerchant.add(exception); + continue; + } + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); + Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } + result.put("need_register_merchant", needRegisterMerchant); + result.put("success_register_merchant", registerSuccessMerchant); + result.put("fail_register_merchant", registerFailMerchant); + result.put("less_info_merchant", lessInfoMerchant); + return result; + } + @Override public JSONObject getLessPartnerInfo() { JSONObject result = new JSONObject(); @@ -151,7 +202,7 @@ public class AliforexcelServiceImpl implements AliforexcelService { continue; } try { - checkPartnerInfo(client); + checkPartnerInfo(client,"online"); } catch (InvalidParameterException e) { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); @@ -164,12 +215,15 @@ public class AliforexcelServiceImpl implements AliforexcelService { return result; } - private void checkPartnerInfo(JSONObject client) { - if (client == null) { - throw new InvalidShortIdException(); - } - if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { - throw new InvalidParameterException("Website cannot be empty "); + private void checkPartnerInfo(JSONObject client,String type) { + if ("online".equals(type)) { + if (!client.containsKey("company_website") || StringUtils.isBlank(client.getString("company_website"))) { + throw new InvalidParameterException("Website cannot be empty "); + } + }else { + if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { + throw new InvalidParameterException("store photo cannot be empty "); + } } if (StringUtils.isBlank(client.getString("business_structure"))) { throw new InvalidParameterException("Business Structure can't be null"); @@ -179,5 +233,4 @@ public class AliforexcelServiceImpl implements AliforexcelService { throw new InvalidParameterException("Alipay Industry can't be null"); } } - } 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 ceb3a28cd..e8fd2d89f 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 @@ -455,6 +455,11 @@ public class TestController implements ApplicationEventPublisherAware { return aliforexcelService.registerAlipayOnlineMerchant(); } + @ManagerMapping(value = "/register/alipayGms", role = ManagerRole.DEVELOPER, method = RequestMethod.POST) + public JSONObject registerAlipayMerchant() { + return aliforexcelService.registerAlipayMerchant(); + } + @ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET) public JSONObject getLessPartnerInfo() { return aliforexcelService.getLessPartnerInfo(); diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index 101374d74..2cc56f2bb 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -425,6 +425,20 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { alert(resp.data.message); }) }; + $scope.registerGMS = function () { + $scope.totalhide = true; + $scope.selecttotal = false; + $http.post('/dev/register/alipayGms').then(function (resp) { + $scope.totalhide = false; + $scope.selecttotal = true; + $scope.need_register_merchant = resp.data.need_register_merchant.toString(); + $scope.success_register_merchant = resp.data.success_register_merchant.toString(); + $scope.fail_register_merchant = resp.data.fail_register_merchant; + $scope.less_info_merchant = resp.data.less_info_merchant(); + }, function (resp) { + alert(resp.data.message); + }) + }; $scope.getLessPartnerInfo = function () { $scope.totalhide = true; $scope.selecttotal = false; diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html index cfe468bad..abc8c8916 100644 --- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html +++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html @@ -10,10 +10,13 @@
      - +
      - + +
      +
      +
      需要报备的商户编码

      From bd9e1731deb9d601e992f70eb1e1a2d2c1624f83 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 24 May 2019 10:59:37 +0800 Subject: [PATCH 48/74] =?UTF-8?q?fix=20=E7=BA=BF=E4=B8=8B=E5=95=86?= =?UTF-8?q?=E6=88=B7=E6=89=B9=E9=87=8F=E6=8A=A5=E5=A4=87=20=E6=9C=89?= =?UTF-8?q?=E4=B8=80=E7=A7=8D=E7=85=A7=E7=89=87=E5=B0=B1=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8A=A5=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/dev/core/impl/AliforexcelServiceImpl.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1678d5ffa..8aab5c252 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.17 + 1.0.18 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 0adcbdfce..f0c446ccf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -221,9 +221,15 @@ public class AliforexcelServiceImpl implements AliforexcelService { throw new InvalidParameterException("Website cannot be empty "); } }else { - if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { + if (!client.containsKey("store_photo") && !client.containsKey("company_photo")) { throw new InvalidParameterException("store photo cannot be empty "); } + if (client.containsKey("store_photo") && !client.containsKey("company_photo")) { + client.put("company_photo", client.getString("store_photo")); + } + if (client.containsKey("company_photo") && !client.containsKey("store_photo")) { + client.put("store_photo", client.getString("company_photo")); + } } if (StringUtils.isBlank(client.getString("business_structure"))) { throw new InvalidParameterException("Business Structure can't be null"); From 8ecc9344d0cc577e2c268d79b98d15d38055d322 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 24 May 2019 11:34:57 +0800 Subject: [PATCH 49/74] =?UTF-8?q?fix=20=E7=BA=BF=E4=B8=8B=E5=95=86?= =?UTF-8?q?=E6=88=B7=E6=89=B9=E9=87=8F=E6=8A=A5=E5=A4=87=20=E6=9C=89?= =?UTF-8?q?=E4=B8=80=E7=A7=8D=E7=85=A7=E7=89=87=E5=B0=B1=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8A=A5=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/core/impl/AliforexcelServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 0adcbdfce..f0c446ccf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -221,9 +221,15 @@ public class AliforexcelServiceImpl implements AliforexcelService { throw new InvalidParameterException("Website cannot be empty "); } }else { - if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) { + if (!client.containsKey("store_photo") && !client.containsKey("company_photo")) { throw new InvalidParameterException("store photo cannot be empty "); } + if (client.containsKey("store_photo") && !client.containsKey("company_photo")) { + client.put("company_photo", client.getString("store_photo")); + } + if (client.containsKey("company_photo") && !client.containsKey("store_photo")) { + client.put("store_photo", client.getString("company_photo")); + } } if (StringUtils.isBlank(client.getString("business_structure"))) { throw new InvalidParameterException("Business Structure can't be null"); From 998a18761d63631add01a0f48143f5929e6fe343 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 28 May 2019 09:34:46 +0800 Subject: [PATCH 50/74] add mcc --- .../manage/product/core/ClientProduct.java | 6 + .../product/core/impls/ClientProductImpl.java | 23 + .../product/web/ManagerProductController.java | 15 +- src/main/ui/static/commons/commons.js | 1 + .../static/commons/filters/commonFilters.js | 11 + .../static/commons/services/wechatGoodMcc.js | 582 ++++++++++++++++++ .../static/payment/partner/partner-manage.js | 72 +-- .../product/templates/partner_product.html | 45 ++ 8 files changed, 692 insertions(+), 63 deletions(-) create mode 100644 src/main/ui/static/commons/services/wechatGoodMcc.js create mode 100644 src/main/ui/static/payment/product/templates/partner_product.html diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java b/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java index 33d52df9c..67bf34f6d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java @@ -3,16 +3,22 @@ package au.com.royalpay.payment.manage.product.core; import au.com.royalpay.payment.manage.product.beans.ProductBean; import com.alibaba.fastjson.JSONObject; +import java.util.List; + /** * Created by yuan on 2017/11/24. */ public interface ClientProduct { JSONObject listAllProduct(JSONObject manager, ProductBean productBean); + List listClientMcc(JSONObject manager, String clientMoniker); + void saveProduct(JSONObject manager, ProductBean productBean); void updateProduct(JSONObject manager, ProductBean productBean); + void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo); + void deleteProduct(JSONObject manager, String commodity_id); void importExcelToDb(String client_id, JSONObject manager, String sourceFile); diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java b/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java index 484e0849c..f4af79d3b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.product.core.impls; +import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper; import au.com.royalpay.payment.manage.product.beans.ProductBean; @@ -23,6 +24,7 @@ import java.io.InputStream; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; @@ -37,6 +39,8 @@ public class ClientProductImpl implements ClientProduct { private static final String EXCEL_XLSX = "xlsx"; @Resource private CommoditiesMapper commoditiesMapper; + @Resource + private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper; @Resource private ClientMapper clientMapper; @@ -50,6 +54,14 @@ public class ClientProductImpl implements ClientProduct { return PageListUtils.buildPageListResult(listProducts); } + @Override + public List listClientMcc(JSONObject manager, String clientMoniker) { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + Assert.notNull(client); + checkOrgPermission(manager, client); + return paymentChannelMccGoodMapper.findPaymentChannelMccByClientId(client.getIntValue("client_id")); + } + @Override public void saveProduct(JSONObject manager,ProductBean productBean) { JSONObject param = productBean.toJsonParam(); @@ -69,6 +81,17 @@ public class ClientProductImpl implements ClientProduct { commoditiesMapper.updateProduct(param); } + @Override + public void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo) { + JSONObject client = clientMapper.findClientByMoniker(mccInfo.getString("client_moniker")); + Assert.notNull(client); + checkOrgPermission(manager, client); + mccInfo.put("client_id", client.getIntValue("client_id")); + mccInfo.put("creation_date", new Date()); + mccInfo.put("creation_by", manager.getString("display_name")); + paymentChannelMccGoodMapper.update(mccInfo); + } + @Override public void deleteProduct(JSONObject manager,String commodity_id) { JSONObject param = new JSONObject(); diff --git a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java b/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java index 562b1f745..d9ab44990 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.List; /** * Created by yuan on 2017/11/24. @@ -23,8 +24,13 @@ public class ManagerProductController { @Resource private ClientProduct clientProduct; + @ManagerMapping(value = "/{clientMoniker}/list", method = RequestMethod.GET, role = ManagerRole.ADMIN) + public List listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { + return clientProduct.listClientMcc(manager, clientMoniker); + } + @ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.ADMIN) - public JSONObject listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ProductBean productBean){ + public JSONObject listSysProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ProductBean productBean){ return clientProduct.listAllProduct(manager,productBean); } @@ -34,11 +40,12 @@ public class ManagerProductController { clientProduct.saveProduct(manager,productBean); } - @ManagerMapping(value = "",method = RequestMethod.PUT,role = ManagerRole.ADMIN) - public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ProductBean productBean, Errors errors){ + @ManagerMapping(value = "/update", method = RequestMethod.PUT, role = ManagerRole.ADMIN) + public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject mccInfo, Errors errors) { HttpUtils.handleValidErrors(errors); - clientProduct.updateProduct(manager,productBean); + clientProduct.updateMerchantMccInfo(manager, mccInfo); } + @ManagerMapping(value = "/{commodity_id}/delete",method = RequestMethod.POST,role = ManagerRole.ADMIN) public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String commodity_id){ clientProduct.deleteProduct(manager,commodity_id); diff --git a/src/main/ui/static/commons/commons.js b/src/main/ui/static/commons/commons.js index 359b0e61f..1f764d66c 100644 --- a/src/main/ui/static/commons/commons.js +++ b/src/main/ui/static/commons/commons.js @@ -13,6 +13,7 @@ define(['./app', './services/yeepayIndustryMap', './services/stateMap', './services/industryMap', + './services/wechatGoodMcc', './services/sectorMap', './services/countryMap', './services/clearingDetailService', diff --git a/src/main/ui/static/commons/filters/commonFilters.js b/src/main/ui/static/commons/filters/commonFilters.js index db9d7a6a0..7106c5a49 100644 --- a/src/main/ui/static/commons/filters/commonFilters.js +++ b/src/main/ui/static/commons/filters/commonFilters.js @@ -116,6 +116,17 @@ define(['../app', 'jquery'], function (app, $) { return industryLabel; } }]); + app.filter('wechat_mcc', ['wechatGoodMcc', function (wechatGoodMcc) { + return function (industryCode) { + var industryLabel = ''; + angular.forEach(wechatGoodMcc.configs(), function (industry) { + if (industry.value == industryCode) { + industryLabel = industry.label; + } + }); + return industryLabel; + } + }]); app.filter('partner_alipay_industry', ['$http', function ($http) { diff --git a/src/main/ui/static/commons/services/wechatGoodMcc.js b/src/main/ui/static/commons/services/wechatGoodMcc.js new file mode 100644 index 000000000..51851f5a5 --- /dev/null +++ b/src/main/ui/static/commons/services/wechatGoodMcc.js @@ -0,0 +1,582 @@ +define(["../app"], function (app) { + "use strict"; + + var wechatGoodMcc = [ + { + "label": "Duty-free shops 免税店", + "value": 5309 + }, { + "label": "Department stores 百货商店", + "value": 5311 + }, { + "label": "Discount shops 折扣商店", + "value": 5310 + }, { + "label": "Auto and home supply outlets 汽车商店、家庭用品商店", + "value": 5531 + }, { + "label": "Men’s and boys’ clothing and accessory shops 男子和男童服装及用品商店", + "value": 5611 + }, { + "label": "Women’s ready-to-wear shops 妇女成衣商店", + "value": 5621 + }, { + "label": "Women’s accessory and speciality shops 女性用品商店", + "value": 5631 + }, { + "label": "Children’s and infants’ wear shops 婴儿、儿童服装店", + "value": 5641 + }, { + "label": "Family clothing shops 家庭服装商店", + "value": 5651 + }, { + "label": "Sports and riding apparel shops 运动服饰商店", + "value": 5655 + }, { + "label": "Shoe shops 鞋店", + "value": 5661 + }, { + "label": "Furriers and fur shops 皮货店", + "value": 5681 + }, { + "label": "Men’s and women’s clothing shops 成人成衣店", + "value": 5691 + }, { + "label": "Miscellaneous apparel and accessory shops 各类服装及饰物店", + "value": 5699 + }, { + "label": "Furniture, home furnishings and equipment shops and manufacturers, except appliances 家具、家庭摆品、家用设备零售商", + "value": 5712 + }, { + "label": "Household appliance shops 家用电器商店", + "value": 5722 + }, { + "label": "Jewellery, watch, clock and silverware shops 珠宝、钟表、银器店", + "value": 5944 + }, { + "label": "Luggage and leather goods shops 箱包、皮具店", + "value": 5948 + }, { + "label": "Precious stones and metals, watches and jewellery 宝石和金属、手表和珠宝", + "value": 5094 + }, { + "label": "Variety stores 各类杂货店、便利店", + "value": 5331 + }, { + "label": "Groceries and supermarkets 大型仓储式超级市场", + "value": 5411 + }, { + "label": "Home supply warehouse outlets 大型仓储式家庭用品卖场", + "value": 5200 + }, { + "label": "Tailors, seamstresses, mending and alterations 裁缝、修补、改衣店", + "value": 5697 + }, { + "label": "Wig and toupee shops 假发商店", + "value": 5698 + }, { + "label": "Floor covering services 地板商店", + "value": 5713 + }, { + "label": "Drapery, window covering and upholstery shops 帏帐、窗帘、室内装潢商店", + "value": 5714 + }, { + "label": "Alcoholic beverage wholesalers 酒精饮料", + "value": 5715 + }, { + "label": "Fireplaces, fireplace screens and accessories shops 壁炉、壁炉防护网及配件商店", + "value": 5718 + }, { + "label": "Miscellaneous home furnishing speciality shops 各种家庭装饰专营店", + "value": 5719 + }, { + "label": "Electronics shops 电子设备商店", + "value": 5732 + }, { + "label": "Music shops - musical instruments, pianos and sheet music 音乐商店-乐器、钢琴、乐谱", + "value": 5733 + }, { + "label": "Computer software outlets 计算机软件商店", + "value": 5734 + }, { + "label": "Record shops 音像制品商店", + "value": 5735 + }, { + "label": "Package shops - beer, wine and liquor 瓶装酒零售店", + "value": 5921 + }, { + "label": "Used merchandise and second-hand shops 旧商品店、二手商品店", + "value": 5931 + }, { + "label": "Antique shop - sale, repair and restoration 古玩店-出售、维修及还原", + "value": 5932 + }, { + "label": "Antique reproduction shops 古玩复制店", + "value": 5937 + }, { + "label": "Bicycle shops - sales and service 自行车商店", + "value": 5940 + }, { + "label": "Sporting goods shops 体育用品店", + "value": 5941 + }, { + "label": "Bookshops 书店", + "value": 5942 + }, { + "label": "Stationery, office and school supply shops 文具用品商店、各类办公用品商店", + "value": 5943 + }, { + "label": "Hobby, toy and game shops 玩具、游戏店", + "value": 5945 + }, { + "label": "Camera and photographic supply shops 照相器材商店", + "value": 5946 + }, { + "label": "Gift, card, novelty and souvenir shops 礼品、卡片、装饰品、纪念品商店", + "value": 5947 + }, { + "label": "Sewing, needlework, fabric and piece goods shops 纺织品及针织品零售", + "value": 5949 + }, { + "label": "Glassware and crystal shops 玻璃器皿和水晶饰品店", + "value": 5950 + }, { + "label": "Artist supply and craft shops 工艺美术商店", + "value": 5970 + }, { + "label": "Art dealers and galleries 艺术商和画廊", + "value": 5971 + }, { + "label": "Stamp and coin shops 邮票和纪念币商店", + "value": 5972 + }, { + "label": "Religious goods and shops 宗教品商店", + "value": 5973 + }, { + "label": "Cosmetic shops 化妆品商店", + "value": 5977 + }, { + "label": "Typewriter outlets - sales, service and rentals 打字机商店-销售、服务和出租", + "value": 5978 + }, { + "label": "Florists 花店", + "value": 5992 + }, { + "label": "Cigar shops and stands 香烟、雪茄专卖店", + "value": 5993 + }, { + "label": "Newsagents and news-stands 报亭、报摊", + "value": 5994 + }, { + "label": "Pet shops, pet food and supplies 宠物商店、宠物食品及用品", + "value": 5995 + }, { + "label": "Electric razor shops - sales and service 电动剃刀商店-销售和服务", + "value": 5997 + }, { + "label": "Miscellaneous and speciality retail outlets 其他专门零售店", + "value": 5999 + }, { + "label": "Office, photographic, photocopy and microfilm equipment 办公、影印及微缩摄影器材", + "value": 5044 + }, { + "label": "Computers, computer peripheral equipment - not elsewhere classified 计算机、计算机外围设备", + "value": 5045 + }, { + "label": "Piece goods, notions and other dry goods 布料、缝纫用品和其他纺织品", + "value": 5131 + }, { + "label": "Books, periodicals and newspapers 书、期刊和报纸", + "value": 5192 + }, { + "label": "Glass, paint and wallpaper shops 玻璃、油漆涂料、墙纸零售", + "value": 5231 + }, { + "label": "Hardware shops 五金商店", + "value": 5251 + }, { + "label": "Lawn and garden supplies outlets, including nurseries 草坪、花园用品商店", + "value": 5261 + }, { + "label": "Freezer and locker meat provisioners 各类肉类零售商", + "value": 5422 + }, { + "label": "Candy, nut and confectionery shops 糖果及坚果商店", + "value": 5441 + }, { + "label": "Dairies 乳制品店、冷饮店", + "value": 5451 + }, { + "label": "Bakeries 面包房、糕点商店", + "value": 5462 + }, { + "label": "Miscellaneous food shops - convenience and speciality retail outlets 各类食品店及专门食品零售店", + "value": 5499 + }, { + "label": "Automotive tyre outlets 汽车轮胎经销商", + "value": 5532 + }, { + "label": "Automotive parts and accessories outlets 汽车零配件商店", + "value": 5533 + }, { + "label": "Motorcycle shops and dealers 摩托车商店和经销商", + "value": 5571 + }, { + "label": "Lodging - hotels, motels and resorts 住宿服务(旅馆、酒店、汽车旅馆、度假村等)", + "value": 7011 + }, { + "label": "Time-sharing villa or holiday home 分时使用的别墅或度假用房", + "value": 7012 + }, { + "label": "Sporting and recreational camps 运动和娱乐露营地", + "value": 7032 + }, { + "label": "Trailer parks and camp-sites 活动房车场及露营场所", + "value": 7033 + }, { + "label": "Caterers 包办伙食,宴会承包商", + "value": 5811 + }, { + "label": "Eating places and restaurants 就餐场所和餐馆", + "value": 5812 + }, { + "label": "Fast food restaurants 快餐店", + "value": 5814 + }, { + "label": "Railroads 铁路运输", + "value": 4011 + }, { + "label": "Local and suburban commuter passenger transportation, including ferries 本市和市郊通勤旅客运输(包括轮渡)", + "value": 4111 + }, { + "label": "Passenger railways 铁路客运", + "value": 4112 + }, { + "label": "Ambulance services 救护车服务", + "value": 4119 + }, { + "label": "Taxi-cabs and limousines 出租车服务", + "value": 4121 + }, { + "label": "Bus lines 公路客运", + "value": 4131 + }, { + "label": "Motor freight carriers and trucking - local and long distance, moving and storage companies and local delivery 货物搬运和托运—当地和长途,移动和存储公司,以及当地递送服务", + "value": 4214 + }, { + "label": "Courier services - air and ground and freight forwarders 快递服务(空运、地面运输或海运)", + "value": 4215 + }, { + "label": "Steamships and cruise lines 轮船及巡游航线服务", + "value": 4411 + }, { + "label": "Boat rentals and leasing 出租船只", + "value": 4457 + }, { + "label": "Marinas, marine service and supplies 船舶、海运服务提供商", + "value": 4468 + }, { + "label": "Airlines and air carriers 航空公司", + "value": 4511 + }, { + "label": "Tolls and bridge fees 路桥通行费", + "value": 4784 + }, { + "label": "Laundry, cleaning and garment services 洗衣店", + "value": 7210 + }, { + "label": "Laundry services - family and commercial 洗熨服务(自助洗衣服务)", + "value": 7211 + }, { + "label": "Dry cleaners 干洗店", + "value": 7216 + }, { + "label": "Carpet and upholstery cleaning 室内清洁服务(地毯、沙发、家具表面的清洁服务)", + "value": 7217 + }, { + "label": "Photographic studios 摄影工作室", + "value": 7221 + }, { + "label": "Beauty and barber shops 美容理发店", + "value": 7230 + }, { + "label": "Shoe repair shops, shoe shine parlours and hat cleaning shops 修鞋店、擦鞋店、帽子清洗店", + "value": 7251 + }, { + "label": "Funeral services and crematoriums 殡葬服务", + "value": 7261 + }, { + "label": "Dating and escort services 婚姻介绍及陪同服务", + "value": 7273 + }, { + "label": "Advertising services 广告服务", + "value": 7311 + }, { + "label": "Commercial photography, art and graphics 商业摄影、工艺、绘图服务", + "value": 7333 + }, { + "label": "Quick copy, reproduction and blueprinting services 复印及绘图服务", + "value": 7338 + }, { + "label": "Stenographic and secretarial support services 速记、秘书服务(包括各类办公服务)", + "value": 7339 + }, { + "label": "Exterminating and disinfecting services 灭虫及消毒服务", + "value": 7342 + }, { + "label": "Cleaning, maintenance and janitorial services 清洁、保养及门卫服务", + "value": 7349 + }, { + "label": "Employment agencies and temporary help services 职业中介、临时工", + "value": 7361 + }, { + "label": "Computer programming, data processing and integrated systems design services 计算机编程、数据处理和系统集成设计服务", + "value": 7372 + }, { + "label": "Information retrieval services 信息检索服务", + "value": 7375 + }, { + "label": "Detective agencies, protective agencies and security services, including armoured cars and guard dogs 侦探、保安、安全服务", + "value": 7393 + }, { + "label": "Equipment, tool, furniture and appliance rentals and leasing 设备、工具、家具和电器出租", + "value": 7394 + }, { + "label": "Photofinishing laboratories and photo developing 照相洗印服务", + "value": 7395 + }, { + "label": "Automobile rentals 汽车出租", + "value": 7512 + }, { + "label": "Truck and utility trailer rentals 卡车及拖车出租", + "value": 7513 + }, { + "label": "Motor home and recreational vehicle rentals 房车和娱乐车辆出租", + "value": 7519 + }, { + "label": "Parking lots and garages 停车场", + "value": 7523 + }, { + "label": "Automotive body repair shops 车体维修店", + "value": 7531 + }, { + "label": "Tyre retreading and repair shops 轮胎翻新、维修店", + "value": 7534 + }, { + "label": "Automotive paint shops 汽车喷漆店", + "value": 7535 + }, { + "label": "Automotive service shops (non-dealer) 汽车服务商店(非经销商)", + "value": 7538 + }, { + "label": "Car washes 洗车", + "value": 7542 + }, { + "label": "Towing services 拖车服务", + "value": 7549 + }, { + "label": "Electronics repair shops 电器设备维修", + "value": 7622 + }, { + "label": "Air conditioning and refrigeration repair shops 空调、制冷设备维修", + "value": 7623 + }, { + "label": "Electrical and small appliance repair shops 电器设备、小家电维修", + "value": 7629 + }, { + "label": "Watch, clock and jewellery repair shops 手表、钟表和首饰维修店", + "value": 7631 + }, { + "label": "Furniture reupholstery, repair and refinishing 家具维修、翻新", + "value": 7641 + }, { + "label": "Welding services 焊接维修服务", + "value": 7692 + }, { + "label": "Miscellaneous repair shops and related services 各类维修店及相关服务", + "value": 7699 + }, { + "label": "Babysitting and housekeeping services 家政服务", + "value": 7295 + }, { + "label": "Clothing rentals - costumes, uniforms and formal wear 出租衣物-服装、制服和正式场合服装", + "value": 7296 + }, { + "label": "Utilities - electric, gas, water and sanitary 公共事业(电力、煤气、自来水、清洁服务)", + "value": 4900 + }, { + "label": "Service stations (with or without ancillary services) 加油站、服务站", + "value": 5541 + }, { + "label": "Automated fuel dispensers 自助加油站", + "value": 5542 + }, { + "label": "Airports, flying fields and airport terminals 机场服务", + "value": 4582 + }, { + "label": "Car and truck dealers (new and used) sales, services, repairs, parts and leasing 汽车货车经销商-新旧车的销售、服务、维修、零件及出租", + "value": 5511 + }, { + "label": "Car and truck dealers (used only) sales, service, repairs, parts and leasing 汽车货车经销商-专门从事旧车的销售、服务、维修、零件及出租", + "value": 5521 + }, { + "label": "Embassy and consulate fees 使领馆收费", + "value": 9400 + }, { + "label": " Postal Services - Government Only 国家邮政服务", + "value": 9402 + }, { + "label": "Ticketing 票务", + "value": 4733 + }, { + "label": "Travel agencies and tour operators 旅行社", + "value": 4722 + }, { + "label": "Motion picture and video tape production and distribution 电影和录像创作、发行", + "value": 7829 + }, { + "label": "Motion picture theatres 电影院", + "value": 7832 + }, { + "label": "Video tape rentals 音像制品出租商店", + "value": 7841 + }, { + "label": "Dance halls, studios and schools 歌舞厅", + "value": 7911 + }, { + "label": "Theatrical producers (except motion pictures) and ticket agencies 戏剧制片(不含电影)、演出和票务", + "value": 7922 + }, { + "label": "Billiard and pool establishments 台球、撞球场所", + "value": 7932 + }, { + "label": "Bowling alleys 保龄球馆", + "value": 7933 + }, { + "label": "Commercial sports, professional sports clubs, athletic fields and sports promoters 商业运动", + "value": 7941 + }, { + "label": "Tourist attractions and exhibits 景点、展览", + "value": 7991 + }, { + "label": "Public golf courses 公开高尔夫球赛", + "value": 7992 + }, { + "label": "Video amusement game supplies 电子游戏等", + "value": 7993 + }, { + "label": "Video game arcades and establishments 大型游戏机和游戏场所", + "value": 7994 + }, { + "label": "Amusement parks, circuses, carnivals and fortune tellers 游乐园、马戏团、嘉年华、占卜", + "value": 7996 + }, { + "label": "Membership clubs (sports, recreation, athletic), country clubs and private golf courses 会员俱乐部(体育、娱乐、运动等)、乡村俱乐部以及私人高尔夫课程班", + "value": 7997 + }, { + "label": "Aquariums, seaquariums and dolphinariums 水族馆、海洋馆和海豚馆", + "value": 7998 + }, { + "label": "Drinking places (alcoholic beverages) - bars, taverns, night-clubs, cocktail lounges and discothèques 饮酒场所(酒吧、酒馆、夜总会、鸡尾酒大厅、迪斯科舞厅)", + "value": 5813 + }, { + "label": "Massage parlours 按摩店", + "value": 7297 + }, { + "label": "Health and beauty spas 保健及美容SPA", + "value": 7298 + }, { + "label": "Telecommunication equipment and telephone sales 电信设备和销售", + "value": 4812 + }, { + "label": "Telecommunication services 电信服务,包括本地和长途电话、信用卡电话、磁卡电话和传真", + "value": 4814 + }, { + "label": "Monthly summary telephone charges 月结电话服务", + "value": 4815 + }, { + "label": "Computer network information services 计算机网络/信息服务", + "value": 4816 + }, { + "label": "Cable and other pay television services 有线和其他付费电视服务", + "value": 4899 + }, { + "label": "private hospital 私人医院", + "value": 7280 + }, { + "label": "Doctors and physicians - not elsewhere classified 其他医疗卫生活动", + "value": 8011 + }, { + "label": "Dentists and orthodontists 牙科医生", + "value": 8021 + }, { + "label": "Osteopaths 正骨医生", + "value": 8031 + }, { + "label": "Chiropractors 按摩医生", + "value": 8041 + }, { + "label": "Optometrists and ophthalmologists 眼科医生", + "value": 8042 + }, { + "label": "Opticians, optical goods and eyeglasses 光学产品、眼镜店", + "value": 8043 + }, { + "label": "Podiatrists and chiropodists 手足病医生", + "value": 8049 + }, { + "label": "Nursing and personal care facilities 护理和照料服务", + "value": 8050 + }, { + "label": "Hospitals 公立医院", + "value": 8062 + }, { + "label": "Medical and dental laboratories 医学及牙科实验室", + "value": 8071 + }, { + "label": "Medical services and health practitioners - not elsewhere classified 其他医疗保健服务", + "value": 8099 + }, { + "label": "Drug stores and pharmacies 药店、药房", + "value": 5912 + }, { + "label": "Hearing aids - sales, service and supplies 助听器-销售、服务和用品", + "value": 5975 + }, { + "label": "Orthopaedic goods and prosthetic devices 假肢店(整形外科用品、辅助设备)", + "value": 5976 + }, { + "label": "Dental laboratory medical ophthalmic hospital equipment and supplies 牙科/实验室/医疗/眼科医院器材和用品", + "value": 5047 + }, { + "label": "Elementary and secondary schools 中小学校(公立)", + "value": 8211 + }, { + "label": "Colleges, universities, professional schools and junior colleges 普通高校(公立)", + "value": 8220 + }, { + "label": "Correspondence schools 函授学校(成人教育)", + "value": 8241 + }, { + "label": "Business and secretarial schools 商业和文秘学校(中等专业学校)", + "value": 8244 + }, { + "label": "Trade and vocational schools 贸易和职业学校(职业技能培训)", + "value": 8249 + }, { + "label": "Schools and educational services - not elsewhere classified 其他学校和教育服务", + "value": 8299 + }, { + "label": "Child care services 儿童保育服务(含学前教育)", + "value": 8351 + } + ]; + app.factory("wechatGoodMcc", function () { + return { + configs: function () { + return wechatGoodMcc; + } + } + }); +}) +; \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 4ccf01a20..05d05cb5a 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -174,7 +174,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }).state('partners.detail.product', { url: '/partner_product', - templateUrl: 'static/payment/product/templates/product.html', + templateUrl: 'static/payment/product/templates/partner_product.html', controller: 'productCtrl' }).state('partners.detail.sub_merchant_applicaitons', { url: '/sub_merchant_applicaitons', @@ -3726,24 +3726,23 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.channelAndDayOfAnalysis(1); }]); - app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'industryMap', function ($scope, $http, $uibModal, commonDialog, $state, Upload, industryMap) { + app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'wechatGoodMcc', function ($scope, $http, $uibModal, commonDialog, $state, Upload, wechatGoodMcc) { $scope.importShow = 0; $scope.pagination = {}; $scope.params = {text_type: 'all', search_text: null}; - $scope.industries = industryMap.configs(); - $scope.loadProducts = function (page) { - var params = angular.copy($scope.params); - if ($scope.params.industry == null || angular.equals({}, $scope.params.industry)) { - params.industry = ''; - } else { - params.industry = $scope.params.industry.value; - } - params.page = page || $scope.pagination.page || 1; - $http.get('/client/product/' + $scope.partner.client_moniker + '/list', {params: params}).then(function (resp) { - $scope.products = resp.data.data; - $scope.pagination = resp.data.pagination; + $scope.wechatMccIndustries = wechatGoodMcc.configs(); + $scope.loadProducts = function () { + $http.get('/sys/product/' + $scope.partner.client_moniker + '/list').then(function (resp) { + $scope.mcc_goods = resp.data; + }); + }; + $scope.updateMccInfo = function (mccInfo) { + mccInfo.client_moniker = $scope.partner.client_moniker; + $http.put('/sys/product/update', mccInfo).then(function (resp) { + $state.reload(); }); }; + $scope.loadProducts(); /*$scope.importExcel = function (file) { if (file != null) { Upload.upload({ @@ -3766,51 +3765,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) } }*/ - $scope.deleteProduct = function (product) { - $scope.product = angular.copy(product); - commonDialog.confirm({ - title: 'Confirm', - content: 'This operation will delete the product, Are you sure?' - }).then(function () { - $http.post('/sys/product/' + product.commodity_id + '/delete').then(function () { - alert("Success!"); - $state.reload(); - }); - }) - }; - $scope.addProduct = function () { - $uibModal.open({ - templateUrl: '/static/payment/product/templates/add_product.html', - controller: 'AddProductDialogCtrl', - resolve: { - product: function () { - return {}; - }, - partner: function () { - return $scope.partner; - }, - } - }).result.then(function () { - $scope.loadProducts(1); - }) - }; - $scope.editProduct = function (product) { - $uibModal.open({ - templateUrl: '/static/payment/product/templates/add_product.html', - controller: 'AddProductDialogCtrl', - resolve: { - product: function () { - return product; - }, - partner: function () { - return $scope.partner; - }, - } - }).result.then(function () { - $scope.loadProducts(1); - }) - }; - $scope.loadProducts(1); }]); app.controller('AddProductDialogCtrl', ['$scope', '$http', '$uibModal', 'product', 'partner', '$state', 'industryMap', function ($scope, $http, $uibModal, product, partner, $state, industryMap) { $scope.product = angular.copy(product); diff --git a/src/main/ui/static/payment/product/templates/partner_product.html b/src/main/ui/static/payment/product/templates/partner_product.html new file mode 100644 index 000000000..ba9f8ffb2 --- /dev/null +++ b/src/main/ui/static/payment/product/templates/partner_product.html @@ -0,0 +1,45 @@ +
      +
      +
      +
      + +
      +
        +
      • + + + + + + + +
      • +
      • + 商品 + +
      • +
      • + 创建时间 + +
      • +
      • + 操作人 + +
      • +
      +
      +
      +
      +
      +
      +
      \ No newline at end of file From b65c2734e43630c53ca613fc22ecf7c0d5b9ab15 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 28 May 2019 09:56:16 +0800 Subject: [PATCH 51/74] fix pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da979de13..6ac8c13f8 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.7 + 1.0.8 From 7d60b3607ca7aa307a59798b7426cf2dbfb5bb3c Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 28 May 2019 11:35:45 +0800 Subject: [PATCH 52/74] fix remove main test --- pom.xml | 2 +- .../web/EncourageMoneyController.java | 9 -------- .../manage/openim/core/OpenimClient.java | 22 ------------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/pom.xml b/pom.xml index 6ac8c13f8..31747679d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.8 + 1.0.9 diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java index a536f7ed8..42a446ddf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/web/EncourageMoneyController.java @@ -80,13 +80,4 @@ public class EncourageMoneyController { public ModelAndView merchantsPage() { return new ModelAndView("activity/encourage_money/merchants"); } - - - public static void main(String[] args) { - JSONObject asd = null; - - JSONObject qwe = null; - System.out.println(asd); - System.out.println(qwe); - } } diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java index 9e4c8359c..24a6de1bc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java +++ b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java @@ -110,26 +110,4 @@ public class OpenimClient { throw new ServerErrorException("System error"); } } - - public static void main(String[] args) { - String appkey = "24980715"; - String secret = "60b1ba680a6f27ffc701f10b6d5be00e"; - String url = "https://eco.taobao.com/router/rest"; - - TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); - OpenimUsersGetRequest req = new OpenimUsersGetRequest(); - // 批量为userid逗号分隔字符串 - req.setUserids("kiraservant"); - OpenimUsersGetResponse rsp = null; - try { - rsp = client.execute(req); - } catch (ApiException e) { - } - JSONObject openInfo = JSONObject.parseObject(rsp.getBody()); - System.out.println(openInfo.toJSONString()); - System.out.println(openInfo.toJSONString()); - System.out.println(openInfo.toJSONString()); - } - - } From eede0722f7a11113192b92775e38af50ce107664 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 28 May 2019 18:20:32 +0800 Subject: [PATCH 53/74] fix mcc --- pom.xml | 2 +- .../manage/product/core/ClientProduct.java | 6 + .../product/core/impls/ClientProductImpl.java | 23 + .../product/web/ManagerProductController.java | 15 +- src/main/ui/static/commons/commons.js | 1 + .../static/commons/filters/commonFilters.js | 11 + .../static/commons/services/wechatGoodMcc.js | 582 ++++++++++++++++++ .../static/payment/partner/partner-manage.js | 72 +-- .../product/templates/partner_product.html | 45 ++ 9 files changed, 693 insertions(+), 64 deletions(-) create mode 100644 src/main/ui/static/commons/services/wechatGoodMcc.js create mode 100644 src/main/ui/static/payment/product/templates/partner_product.html diff --git a/pom.xml b/pom.xml index 8aab5c252..92a484913 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.18 + 1.0.19 diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java b/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java index 33d52df9c..67bf34f6d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/core/ClientProduct.java @@ -3,16 +3,22 @@ package au.com.royalpay.payment.manage.product.core; import au.com.royalpay.payment.manage.product.beans.ProductBean; import com.alibaba.fastjson.JSONObject; +import java.util.List; + /** * Created by yuan on 2017/11/24. */ public interface ClientProduct { JSONObject listAllProduct(JSONObject manager, ProductBean productBean); + List listClientMcc(JSONObject manager, String clientMoniker); + void saveProduct(JSONObject manager, ProductBean productBean); void updateProduct(JSONObject manager, ProductBean productBean); + void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo); + void deleteProduct(JSONObject manager, String commodity_id); void importExcelToDb(String client_id, JSONObject manager, String sourceFile); diff --git a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java b/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java index 484e0849c..f4af79d3b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/core/impls/ClientProductImpl.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.product.core.impls; +import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper; import au.com.royalpay.payment.manage.product.beans.ProductBean; @@ -23,6 +24,7 @@ import java.io.InputStream; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; @@ -37,6 +39,8 @@ public class ClientProductImpl implements ClientProduct { private static final String EXCEL_XLSX = "xlsx"; @Resource private CommoditiesMapper commoditiesMapper; + @Resource + private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper; @Resource private ClientMapper clientMapper; @@ -50,6 +54,14 @@ public class ClientProductImpl implements ClientProduct { return PageListUtils.buildPageListResult(listProducts); } + @Override + public List listClientMcc(JSONObject manager, String clientMoniker) { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + Assert.notNull(client); + checkOrgPermission(manager, client); + return paymentChannelMccGoodMapper.findPaymentChannelMccByClientId(client.getIntValue("client_id")); + } + @Override public void saveProduct(JSONObject manager,ProductBean productBean) { JSONObject param = productBean.toJsonParam(); @@ -69,6 +81,17 @@ public class ClientProductImpl implements ClientProduct { commoditiesMapper.updateProduct(param); } + @Override + public void updateMerchantMccInfo(JSONObject manager, JSONObject mccInfo) { + JSONObject client = clientMapper.findClientByMoniker(mccInfo.getString("client_moniker")); + Assert.notNull(client); + checkOrgPermission(manager, client); + mccInfo.put("client_id", client.getIntValue("client_id")); + mccInfo.put("creation_date", new Date()); + mccInfo.put("creation_by", manager.getString("display_name")); + paymentChannelMccGoodMapper.update(mccInfo); + } + @Override public void deleteProduct(JSONObject manager,String commodity_id) { JSONObject param = new JSONObject(); diff --git a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java b/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java index 562b1f745..d9ab44990 100644 --- a/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java +++ b/src/main/java/au/com/royalpay/payment/manage/product/web/ManagerProductController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.List; /** * Created by yuan on 2017/11/24. @@ -23,8 +24,13 @@ public class ManagerProductController { @Resource private ClientProduct clientProduct; + @ManagerMapping(value = "/{clientMoniker}/list", method = RequestMethod.GET, role = ManagerRole.ADMIN) + public List listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { + return clientProduct.listClientMcc(manager, clientMoniker); + } + @ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.ADMIN) - public JSONObject listProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ProductBean productBean){ + public JSONObject listSysProducts(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ProductBean productBean){ return clientProduct.listAllProduct(manager,productBean); } @@ -34,11 +40,12 @@ public class ManagerProductController { clientProduct.saveProduct(manager,productBean); } - @ManagerMapping(value = "",method = RequestMethod.PUT,role = ManagerRole.ADMIN) - public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ProductBean productBean, Errors errors){ + @ManagerMapping(value = "/update", method = RequestMethod.PUT, role = ManagerRole.ADMIN) + public void updateProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject mccInfo, Errors errors) { HttpUtils.handleValidErrors(errors); - clientProduct.updateProduct(manager,productBean); + clientProduct.updateMerchantMccInfo(manager, mccInfo); } + @ManagerMapping(value = "/{commodity_id}/delete",method = RequestMethod.POST,role = ManagerRole.ADMIN) public void deleteProduct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String commodity_id){ clientProduct.deleteProduct(manager,commodity_id); diff --git a/src/main/ui/static/commons/commons.js b/src/main/ui/static/commons/commons.js index 359b0e61f..1f764d66c 100644 --- a/src/main/ui/static/commons/commons.js +++ b/src/main/ui/static/commons/commons.js @@ -13,6 +13,7 @@ define(['./app', './services/yeepayIndustryMap', './services/stateMap', './services/industryMap', + './services/wechatGoodMcc', './services/sectorMap', './services/countryMap', './services/clearingDetailService', diff --git a/src/main/ui/static/commons/filters/commonFilters.js b/src/main/ui/static/commons/filters/commonFilters.js index db9d7a6a0..7106c5a49 100644 --- a/src/main/ui/static/commons/filters/commonFilters.js +++ b/src/main/ui/static/commons/filters/commonFilters.js @@ -116,6 +116,17 @@ define(['../app', 'jquery'], function (app, $) { return industryLabel; } }]); + app.filter('wechat_mcc', ['wechatGoodMcc', function (wechatGoodMcc) { + return function (industryCode) { + var industryLabel = ''; + angular.forEach(wechatGoodMcc.configs(), function (industry) { + if (industry.value == industryCode) { + industryLabel = industry.label; + } + }); + return industryLabel; + } + }]); app.filter('partner_alipay_industry', ['$http', function ($http) { diff --git a/src/main/ui/static/commons/services/wechatGoodMcc.js b/src/main/ui/static/commons/services/wechatGoodMcc.js new file mode 100644 index 000000000..51851f5a5 --- /dev/null +++ b/src/main/ui/static/commons/services/wechatGoodMcc.js @@ -0,0 +1,582 @@ +define(["../app"], function (app) { + "use strict"; + + var wechatGoodMcc = [ + { + "label": "Duty-free shops 免税店", + "value": 5309 + }, { + "label": "Department stores 百货商店", + "value": 5311 + }, { + "label": "Discount shops 折扣商店", + "value": 5310 + }, { + "label": "Auto and home supply outlets 汽车商店、家庭用品商店", + "value": 5531 + }, { + "label": "Men’s and boys’ clothing and accessory shops 男子和男童服装及用品商店", + "value": 5611 + }, { + "label": "Women’s ready-to-wear shops 妇女成衣商店", + "value": 5621 + }, { + "label": "Women’s accessory and speciality shops 女性用品商店", + "value": 5631 + }, { + "label": "Children’s and infants’ wear shops 婴儿、儿童服装店", + "value": 5641 + }, { + "label": "Family clothing shops 家庭服装商店", + "value": 5651 + }, { + "label": "Sports and riding apparel shops 运动服饰商店", + "value": 5655 + }, { + "label": "Shoe shops 鞋店", + "value": 5661 + }, { + "label": "Furriers and fur shops 皮货店", + "value": 5681 + }, { + "label": "Men’s and women’s clothing shops 成人成衣店", + "value": 5691 + }, { + "label": "Miscellaneous apparel and accessory shops 各类服装及饰物店", + "value": 5699 + }, { + "label": "Furniture, home furnishings and equipment shops and manufacturers, except appliances 家具、家庭摆品、家用设备零售商", + "value": 5712 + }, { + "label": "Household appliance shops 家用电器商店", + "value": 5722 + }, { + "label": "Jewellery, watch, clock and silverware shops 珠宝、钟表、银器店", + "value": 5944 + }, { + "label": "Luggage and leather goods shops 箱包、皮具店", + "value": 5948 + }, { + "label": "Precious stones and metals, watches and jewellery 宝石和金属、手表和珠宝", + "value": 5094 + }, { + "label": "Variety stores 各类杂货店、便利店", + "value": 5331 + }, { + "label": "Groceries and supermarkets 大型仓储式超级市场", + "value": 5411 + }, { + "label": "Home supply warehouse outlets 大型仓储式家庭用品卖场", + "value": 5200 + }, { + "label": "Tailors, seamstresses, mending and alterations 裁缝、修补、改衣店", + "value": 5697 + }, { + "label": "Wig and toupee shops 假发商店", + "value": 5698 + }, { + "label": "Floor covering services 地板商店", + "value": 5713 + }, { + "label": "Drapery, window covering and upholstery shops 帏帐、窗帘、室内装潢商店", + "value": 5714 + }, { + "label": "Alcoholic beverage wholesalers 酒精饮料", + "value": 5715 + }, { + "label": "Fireplaces, fireplace screens and accessories shops 壁炉、壁炉防护网及配件商店", + "value": 5718 + }, { + "label": "Miscellaneous home furnishing speciality shops 各种家庭装饰专营店", + "value": 5719 + }, { + "label": "Electronics shops 电子设备商店", + "value": 5732 + }, { + "label": "Music shops - musical instruments, pianos and sheet music 音乐商店-乐器、钢琴、乐谱", + "value": 5733 + }, { + "label": "Computer software outlets 计算机软件商店", + "value": 5734 + }, { + "label": "Record shops 音像制品商店", + "value": 5735 + }, { + "label": "Package shops - beer, wine and liquor 瓶装酒零售店", + "value": 5921 + }, { + "label": "Used merchandise and second-hand shops 旧商品店、二手商品店", + "value": 5931 + }, { + "label": "Antique shop - sale, repair and restoration 古玩店-出售、维修及还原", + "value": 5932 + }, { + "label": "Antique reproduction shops 古玩复制店", + "value": 5937 + }, { + "label": "Bicycle shops - sales and service 自行车商店", + "value": 5940 + }, { + "label": "Sporting goods shops 体育用品店", + "value": 5941 + }, { + "label": "Bookshops 书店", + "value": 5942 + }, { + "label": "Stationery, office and school supply shops 文具用品商店、各类办公用品商店", + "value": 5943 + }, { + "label": "Hobby, toy and game shops 玩具、游戏店", + "value": 5945 + }, { + "label": "Camera and photographic supply shops 照相器材商店", + "value": 5946 + }, { + "label": "Gift, card, novelty and souvenir shops 礼品、卡片、装饰品、纪念品商店", + "value": 5947 + }, { + "label": "Sewing, needlework, fabric and piece goods shops 纺织品及针织品零售", + "value": 5949 + }, { + "label": "Glassware and crystal shops 玻璃器皿和水晶饰品店", + "value": 5950 + }, { + "label": "Artist supply and craft shops 工艺美术商店", + "value": 5970 + }, { + "label": "Art dealers and galleries 艺术商和画廊", + "value": 5971 + }, { + "label": "Stamp and coin shops 邮票和纪念币商店", + "value": 5972 + }, { + "label": "Religious goods and shops 宗教品商店", + "value": 5973 + }, { + "label": "Cosmetic shops 化妆品商店", + "value": 5977 + }, { + "label": "Typewriter outlets - sales, service and rentals 打字机商店-销售、服务和出租", + "value": 5978 + }, { + "label": "Florists 花店", + "value": 5992 + }, { + "label": "Cigar shops and stands 香烟、雪茄专卖店", + "value": 5993 + }, { + "label": "Newsagents and news-stands 报亭、报摊", + "value": 5994 + }, { + "label": "Pet shops, pet food and supplies 宠物商店、宠物食品及用品", + "value": 5995 + }, { + "label": "Electric razor shops - sales and service 电动剃刀商店-销售和服务", + "value": 5997 + }, { + "label": "Miscellaneous and speciality retail outlets 其他专门零售店", + "value": 5999 + }, { + "label": "Office, photographic, photocopy and microfilm equipment 办公、影印及微缩摄影器材", + "value": 5044 + }, { + "label": "Computers, computer peripheral equipment - not elsewhere classified 计算机、计算机外围设备", + "value": 5045 + }, { + "label": "Piece goods, notions and other dry goods 布料、缝纫用品和其他纺织品", + "value": 5131 + }, { + "label": "Books, periodicals and newspapers 书、期刊和报纸", + "value": 5192 + }, { + "label": "Glass, paint and wallpaper shops 玻璃、油漆涂料、墙纸零售", + "value": 5231 + }, { + "label": "Hardware shops 五金商店", + "value": 5251 + }, { + "label": "Lawn and garden supplies outlets, including nurseries 草坪、花园用品商店", + "value": 5261 + }, { + "label": "Freezer and locker meat provisioners 各类肉类零售商", + "value": 5422 + }, { + "label": "Candy, nut and confectionery shops 糖果及坚果商店", + "value": 5441 + }, { + "label": "Dairies 乳制品店、冷饮店", + "value": 5451 + }, { + "label": "Bakeries 面包房、糕点商店", + "value": 5462 + }, { + "label": "Miscellaneous food shops - convenience and speciality retail outlets 各类食品店及专门食品零售店", + "value": 5499 + }, { + "label": "Automotive tyre outlets 汽车轮胎经销商", + "value": 5532 + }, { + "label": "Automotive parts and accessories outlets 汽车零配件商店", + "value": 5533 + }, { + "label": "Motorcycle shops and dealers 摩托车商店和经销商", + "value": 5571 + }, { + "label": "Lodging - hotels, motels and resorts 住宿服务(旅馆、酒店、汽车旅馆、度假村等)", + "value": 7011 + }, { + "label": "Time-sharing villa or holiday home 分时使用的别墅或度假用房", + "value": 7012 + }, { + "label": "Sporting and recreational camps 运动和娱乐露营地", + "value": 7032 + }, { + "label": "Trailer parks and camp-sites 活动房车场及露营场所", + "value": 7033 + }, { + "label": "Caterers 包办伙食,宴会承包商", + "value": 5811 + }, { + "label": "Eating places and restaurants 就餐场所和餐馆", + "value": 5812 + }, { + "label": "Fast food restaurants 快餐店", + "value": 5814 + }, { + "label": "Railroads 铁路运输", + "value": 4011 + }, { + "label": "Local and suburban commuter passenger transportation, including ferries 本市和市郊通勤旅客运输(包括轮渡)", + "value": 4111 + }, { + "label": "Passenger railways 铁路客运", + "value": 4112 + }, { + "label": "Ambulance services 救护车服务", + "value": 4119 + }, { + "label": "Taxi-cabs and limousines 出租车服务", + "value": 4121 + }, { + "label": "Bus lines 公路客运", + "value": 4131 + }, { + "label": "Motor freight carriers and trucking - local and long distance, moving and storage companies and local delivery 货物搬运和托运—当地和长途,移动和存储公司,以及当地递送服务", + "value": 4214 + }, { + "label": "Courier services - air and ground and freight forwarders 快递服务(空运、地面运输或海运)", + "value": 4215 + }, { + "label": "Steamships and cruise lines 轮船及巡游航线服务", + "value": 4411 + }, { + "label": "Boat rentals and leasing 出租船只", + "value": 4457 + }, { + "label": "Marinas, marine service and supplies 船舶、海运服务提供商", + "value": 4468 + }, { + "label": "Airlines and air carriers 航空公司", + "value": 4511 + }, { + "label": "Tolls and bridge fees 路桥通行费", + "value": 4784 + }, { + "label": "Laundry, cleaning and garment services 洗衣店", + "value": 7210 + }, { + "label": "Laundry services - family and commercial 洗熨服务(自助洗衣服务)", + "value": 7211 + }, { + "label": "Dry cleaners 干洗店", + "value": 7216 + }, { + "label": "Carpet and upholstery cleaning 室内清洁服务(地毯、沙发、家具表面的清洁服务)", + "value": 7217 + }, { + "label": "Photographic studios 摄影工作室", + "value": 7221 + }, { + "label": "Beauty and barber shops 美容理发店", + "value": 7230 + }, { + "label": "Shoe repair shops, shoe shine parlours and hat cleaning shops 修鞋店、擦鞋店、帽子清洗店", + "value": 7251 + }, { + "label": "Funeral services and crematoriums 殡葬服务", + "value": 7261 + }, { + "label": "Dating and escort services 婚姻介绍及陪同服务", + "value": 7273 + }, { + "label": "Advertising services 广告服务", + "value": 7311 + }, { + "label": "Commercial photography, art and graphics 商业摄影、工艺、绘图服务", + "value": 7333 + }, { + "label": "Quick copy, reproduction and blueprinting services 复印及绘图服务", + "value": 7338 + }, { + "label": "Stenographic and secretarial support services 速记、秘书服务(包括各类办公服务)", + "value": 7339 + }, { + "label": "Exterminating and disinfecting services 灭虫及消毒服务", + "value": 7342 + }, { + "label": "Cleaning, maintenance and janitorial services 清洁、保养及门卫服务", + "value": 7349 + }, { + "label": "Employment agencies and temporary help services 职业中介、临时工", + "value": 7361 + }, { + "label": "Computer programming, data processing and integrated systems design services 计算机编程、数据处理和系统集成设计服务", + "value": 7372 + }, { + "label": "Information retrieval services 信息检索服务", + "value": 7375 + }, { + "label": "Detective agencies, protective agencies and security services, including armoured cars and guard dogs 侦探、保安、安全服务", + "value": 7393 + }, { + "label": "Equipment, tool, furniture and appliance rentals and leasing 设备、工具、家具和电器出租", + "value": 7394 + }, { + "label": "Photofinishing laboratories and photo developing 照相洗印服务", + "value": 7395 + }, { + "label": "Automobile rentals 汽车出租", + "value": 7512 + }, { + "label": "Truck and utility trailer rentals 卡车及拖车出租", + "value": 7513 + }, { + "label": "Motor home and recreational vehicle rentals 房车和娱乐车辆出租", + "value": 7519 + }, { + "label": "Parking lots and garages 停车场", + "value": 7523 + }, { + "label": "Automotive body repair shops 车体维修店", + "value": 7531 + }, { + "label": "Tyre retreading and repair shops 轮胎翻新、维修店", + "value": 7534 + }, { + "label": "Automotive paint shops 汽车喷漆店", + "value": 7535 + }, { + "label": "Automotive service shops (non-dealer) 汽车服务商店(非经销商)", + "value": 7538 + }, { + "label": "Car washes 洗车", + "value": 7542 + }, { + "label": "Towing services 拖车服务", + "value": 7549 + }, { + "label": "Electronics repair shops 电器设备维修", + "value": 7622 + }, { + "label": "Air conditioning and refrigeration repair shops 空调、制冷设备维修", + "value": 7623 + }, { + "label": "Electrical and small appliance repair shops 电器设备、小家电维修", + "value": 7629 + }, { + "label": "Watch, clock and jewellery repair shops 手表、钟表和首饰维修店", + "value": 7631 + }, { + "label": "Furniture reupholstery, repair and refinishing 家具维修、翻新", + "value": 7641 + }, { + "label": "Welding services 焊接维修服务", + "value": 7692 + }, { + "label": "Miscellaneous repair shops and related services 各类维修店及相关服务", + "value": 7699 + }, { + "label": "Babysitting and housekeeping services 家政服务", + "value": 7295 + }, { + "label": "Clothing rentals - costumes, uniforms and formal wear 出租衣物-服装、制服和正式场合服装", + "value": 7296 + }, { + "label": "Utilities - electric, gas, water and sanitary 公共事业(电力、煤气、自来水、清洁服务)", + "value": 4900 + }, { + "label": "Service stations (with or without ancillary services) 加油站、服务站", + "value": 5541 + }, { + "label": "Automated fuel dispensers 自助加油站", + "value": 5542 + }, { + "label": "Airports, flying fields and airport terminals 机场服务", + "value": 4582 + }, { + "label": "Car and truck dealers (new and used) sales, services, repairs, parts and leasing 汽车货车经销商-新旧车的销售、服务、维修、零件及出租", + "value": 5511 + }, { + "label": "Car and truck dealers (used only) sales, service, repairs, parts and leasing 汽车货车经销商-专门从事旧车的销售、服务、维修、零件及出租", + "value": 5521 + }, { + "label": "Embassy and consulate fees 使领馆收费", + "value": 9400 + }, { + "label": " Postal Services - Government Only 国家邮政服务", + "value": 9402 + }, { + "label": "Ticketing 票务", + "value": 4733 + }, { + "label": "Travel agencies and tour operators 旅行社", + "value": 4722 + }, { + "label": "Motion picture and video tape production and distribution 电影和录像创作、发行", + "value": 7829 + }, { + "label": "Motion picture theatres 电影院", + "value": 7832 + }, { + "label": "Video tape rentals 音像制品出租商店", + "value": 7841 + }, { + "label": "Dance halls, studios and schools 歌舞厅", + "value": 7911 + }, { + "label": "Theatrical producers (except motion pictures) and ticket agencies 戏剧制片(不含电影)、演出和票务", + "value": 7922 + }, { + "label": "Billiard and pool establishments 台球、撞球场所", + "value": 7932 + }, { + "label": "Bowling alleys 保龄球馆", + "value": 7933 + }, { + "label": "Commercial sports, professional sports clubs, athletic fields and sports promoters 商业运动", + "value": 7941 + }, { + "label": "Tourist attractions and exhibits 景点、展览", + "value": 7991 + }, { + "label": "Public golf courses 公开高尔夫球赛", + "value": 7992 + }, { + "label": "Video amusement game supplies 电子游戏等", + "value": 7993 + }, { + "label": "Video game arcades and establishments 大型游戏机和游戏场所", + "value": 7994 + }, { + "label": "Amusement parks, circuses, carnivals and fortune tellers 游乐园、马戏团、嘉年华、占卜", + "value": 7996 + }, { + "label": "Membership clubs (sports, recreation, athletic), country clubs and private golf courses 会员俱乐部(体育、娱乐、运动等)、乡村俱乐部以及私人高尔夫课程班", + "value": 7997 + }, { + "label": "Aquariums, seaquariums and dolphinariums 水族馆、海洋馆和海豚馆", + "value": 7998 + }, { + "label": "Drinking places (alcoholic beverages) - bars, taverns, night-clubs, cocktail lounges and discothèques 饮酒场所(酒吧、酒馆、夜总会、鸡尾酒大厅、迪斯科舞厅)", + "value": 5813 + }, { + "label": "Massage parlours 按摩店", + "value": 7297 + }, { + "label": "Health and beauty spas 保健及美容SPA", + "value": 7298 + }, { + "label": "Telecommunication equipment and telephone sales 电信设备和销售", + "value": 4812 + }, { + "label": "Telecommunication services 电信服务,包括本地和长途电话、信用卡电话、磁卡电话和传真", + "value": 4814 + }, { + "label": "Monthly summary telephone charges 月结电话服务", + "value": 4815 + }, { + "label": "Computer network information services 计算机网络/信息服务", + "value": 4816 + }, { + "label": "Cable and other pay television services 有线和其他付费电视服务", + "value": 4899 + }, { + "label": "private hospital 私人医院", + "value": 7280 + }, { + "label": "Doctors and physicians - not elsewhere classified 其他医疗卫生活动", + "value": 8011 + }, { + "label": "Dentists and orthodontists 牙科医生", + "value": 8021 + }, { + "label": "Osteopaths 正骨医生", + "value": 8031 + }, { + "label": "Chiropractors 按摩医生", + "value": 8041 + }, { + "label": "Optometrists and ophthalmologists 眼科医生", + "value": 8042 + }, { + "label": "Opticians, optical goods and eyeglasses 光学产品、眼镜店", + "value": 8043 + }, { + "label": "Podiatrists and chiropodists 手足病医生", + "value": 8049 + }, { + "label": "Nursing and personal care facilities 护理和照料服务", + "value": 8050 + }, { + "label": "Hospitals 公立医院", + "value": 8062 + }, { + "label": "Medical and dental laboratories 医学及牙科实验室", + "value": 8071 + }, { + "label": "Medical services and health practitioners - not elsewhere classified 其他医疗保健服务", + "value": 8099 + }, { + "label": "Drug stores and pharmacies 药店、药房", + "value": 5912 + }, { + "label": "Hearing aids - sales, service and supplies 助听器-销售、服务和用品", + "value": 5975 + }, { + "label": "Orthopaedic goods and prosthetic devices 假肢店(整形外科用品、辅助设备)", + "value": 5976 + }, { + "label": "Dental laboratory medical ophthalmic hospital equipment and supplies 牙科/实验室/医疗/眼科医院器材和用品", + "value": 5047 + }, { + "label": "Elementary and secondary schools 中小学校(公立)", + "value": 8211 + }, { + "label": "Colleges, universities, professional schools and junior colleges 普通高校(公立)", + "value": 8220 + }, { + "label": "Correspondence schools 函授学校(成人教育)", + "value": 8241 + }, { + "label": "Business and secretarial schools 商业和文秘学校(中等专业学校)", + "value": 8244 + }, { + "label": "Trade and vocational schools 贸易和职业学校(职业技能培训)", + "value": 8249 + }, { + "label": "Schools and educational services - not elsewhere classified 其他学校和教育服务", + "value": 8299 + }, { + "label": "Child care services 儿童保育服务(含学前教育)", + "value": 8351 + } + ]; + app.factory("wechatGoodMcc", function () { + return { + configs: function () { + return wechatGoodMcc; + } + } + }); +}) +; \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 4ccf01a20..05d05cb5a 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -174,7 +174,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }).state('partners.detail.product', { url: '/partner_product', - templateUrl: 'static/payment/product/templates/product.html', + templateUrl: 'static/payment/product/templates/partner_product.html', controller: 'productCtrl' }).state('partners.detail.sub_merchant_applicaitons', { url: '/sub_merchant_applicaitons', @@ -3726,24 +3726,23 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.channelAndDayOfAnalysis(1); }]); - app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'industryMap', function ($scope, $http, $uibModal, commonDialog, $state, Upload, industryMap) { + app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'wechatGoodMcc', function ($scope, $http, $uibModal, commonDialog, $state, Upload, wechatGoodMcc) { $scope.importShow = 0; $scope.pagination = {}; $scope.params = {text_type: 'all', search_text: null}; - $scope.industries = industryMap.configs(); - $scope.loadProducts = function (page) { - var params = angular.copy($scope.params); - if ($scope.params.industry == null || angular.equals({}, $scope.params.industry)) { - params.industry = ''; - } else { - params.industry = $scope.params.industry.value; - } - params.page = page || $scope.pagination.page || 1; - $http.get('/client/product/' + $scope.partner.client_moniker + '/list', {params: params}).then(function (resp) { - $scope.products = resp.data.data; - $scope.pagination = resp.data.pagination; + $scope.wechatMccIndustries = wechatGoodMcc.configs(); + $scope.loadProducts = function () { + $http.get('/sys/product/' + $scope.partner.client_moniker + '/list').then(function (resp) { + $scope.mcc_goods = resp.data; + }); + }; + $scope.updateMccInfo = function (mccInfo) { + mccInfo.client_moniker = $scope.partner.client_moniker; + $http.put('/sys/product/update', mccInfo).then(function (resp) { + $state.reload(); }); }; + $scope.loadProducts(); /*$scope.importExcel = function (file) { if (file != null) { Upload.upload({ @@ -3766,51 +3765,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) } }*/ - $scope.deleteProduct = function (product) { - $scope.product = angular.copy(product); - commonDialog.confirm({ - title: 'Confirm', - content: 'This operation will delete the product, Are you sure?' - }).then(function () { - $http.post('/sys/product/' + product.commodity_id + '/delete').then(function () { - alert("Success!"); - $state.reload(); - }); - }) - }; - $scope.addProduct = function () { - $uibModal.open({ - templateUrl: '/static/payment/product/templates/add_product.html', - controller: 'AddProductDialogCtrl', - resolve: { - product: function () { - return {}; - }, - partner: function () { - return $scope.partner; - }, - } - }).result.then(function () { - $scope.loadProducts(1); - }) - }; - $scope.editProduct = function (product) { - $uibModal.open({ - templateUrl: '/static/payment/product/templates/add_product.html', - controller: 'AddProductDialogCtrl', - resolve: { - product: function () { - return product; - }, - partner: function () { - return $scope.partner; - }, - } - }).result.then(function () { - $scope.loadProducts(1); - }) - }; - $scope.loadProducts(1); }]); app.controller('AddProductDialogCtrl', ['$scope', '$http', '$uibModal', 'product', 'partner', '$state', 'industryMap', function ($scope, $http, $uibModal, product, partner, $state, industryMap) { $scope.product = angular.copy(product); diff --git a/src/main/ui/static/payment/product/templates/partner_product.html b/src/main/ui/static/payment/product/templates/partner_product.html new file mode 100644 index 000000000..ba9f8ffb2 --- /dev/null +++ b/src/main/ui/static/payment/product/templates/partner_product.html @@ -0,0 +1,45 @@ +
      +
      +
      +
      + +
      +
        +
      • + + + + + + + +
      • +
      • + 商品 + +
      • +
      • + 创建时间 + +
      • +
      • + 操作人 + +
      • +
      +
      +
      +
      +
      +
      + \ No newline at end of file From fc83c27d87f1b3763d2bd0ff0d22d22b485e984b Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 29 May 2019 09:29:45 +0800 Subject: [PATCH 54/74] =?UTF-8?q?fix=20=E5=90=88=E8=A7=84=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../core/impls/ClientManagerImpl.java | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 92a484913..314ed15ad 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.19 + 1.0.20 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 a6fc718a9..f9ae1193a 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 @@ -3061,12 +3061,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); if (bdOperatClientRole <= 0) { @@ -3140,13 +3134,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } - JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); if (surCharge == null || surCharge.size() <= 0) { throw new BadRequestException("The Partner's Rate is not config!"); @@ -3174,12 +3161,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); From 1549c64c08f4eec1cc07d3c5f007c1be2c50b8be Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 29 May 2019 09:31:02 +0800 Subject: [PATCH 55/74] =?UTF-8?q?fix=20=E5=90=88=E8=A7=84=E5=95=86?= =?UTF-8?q?=E5=93=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impls/ClientManagerImpl.java | 19 ------------------- 1 file changed, 19 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 a6fc718a9..f9ae1193a 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 @@ -3061,12 +3061,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); if (bdOperatClientRole <= 0) { @@ -3140,13 +3134,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } - JSONObject surCharge = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); if (surCharge == null || surCharge.size() <= 0) { throw new BadRequestException("The Partner's Rate is not config!"); @@ -3174,12 +3161,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } client.putAll(clientConfigService.find(client.getIntValue("client_id"))); - if (client.getInteger("open_status") == null) { - int countProduct = commoditiesMapper.checkProduct(client.getInteger("client_id")); - if (countProduct <= 0) { - throw new BadRequestException("The Merchant's Product is empty!"); - } - } if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id")); From 7ffee061f07f4ab43d1dfb7c4df1c7169692d1b9 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 3 Jun 2019 12:16:37 +0800 Subject: [PATCH 56/74] =?UTF-8?q?=E9=80=80=E6=AC=BE=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/mappers/payment/RefundMapper.xml | 125 +++++++++--------- 1 file changed, 61 insertions(+), 64 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml index ccb6688ce..0bc54e7fb 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/RefundMapper.xml @@ -3,53 +3,50 @@ @@ -71,53 +68,53 @@ + 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 de3f5474c..673aae015 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 @@ -591,4 +591,12 @@ WHERE t1.bd_type IN ( 1, 2, 6, 7 ) + + diff --git a/src/main/ui/static/commons/filters/commonFilters.js b/src/main/ui/static/commons/filters/commonFilters.js index 7106c5a49..af6d51e3e 100644 --- a/src/main/ui/static/commons/filters/commonFilters.js +++ b/src/main/ui/static/commons/filters/commonFilters.js @@ -70,17 +70,6 @@ define(['../app', 'jquery'], function (app, $) { } }); - var offlineDesc = []; - $.ajax({ - url: '/static/data/client_offline_desc.json', - method: 'GET', - async: false, - dataType: 'json', - success: function (data) { - offlineDesc = data; - - } - }); app.filter('partner_state', ['stateMap', function (stateMap) { return function (stateValue) { @@ -236,29 +225,6 @@ define(['../app', 'jquery'], function (app, $) { }]); - app.filter('partner_offline_desc', ['$http', function ($http) { - return function (industryCode) { - var industryLabel = ''; - angular.forEach(offlineDesc, function (category) { - if (category.value == industryCode) { - industryLabel = category.label; - } - angular.forEach(category.children, function (categoryChildren1) { - if (categoryChildren1.value == industryCode) { - industryLabel = categoryChildren1.label; - } - angular.forEach(categoryChildren1.children, function (categoryChildren2) { - if (categoryChildren2.value == industryCode) { - industryLabel = categoryChildren2.label; - } - }); - }); - }); - return industryLabel; - } - - }]); - app.filter('partner_sector', ['sectorMap', function (sectorMap) { return function (sectorValue) { var sectorLabel = ''; diff --git a/src/main/ui/static/data/client_offline_desc.json b/src/main/ui/static/data/client_offline_desc.json deleted file mode 100644 index 777877860..000000000 --- a/src/main/ui/static/data/client_offline_desc.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "children": [ - { - "children": [], - "label": "立牌", - "value": "qrcode" - }, - { - "children": [], - "label": "POS", - "value": "pos" - } - ], - "label": "门店", - "value": "1" - }, - { - "children": [ - { - "children": [], - "label": "ipos", - "value": "ipos" - }, - { - "children": [], - "label": "银豹", - "value": "pospal" - }, - { - "children": [], - "label": "aupos", - "value": "aupos" - }, - { - "children": [], - "label": "其他", - "value": "other" - } - ], - "label": "收银系统", - "value": "2" - },{ - "children": [ - { - "children": [], - "label": "无门店", - "value": "no-store" - } - ], - "label": "其他", - "value": "3" - } -] diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 05d05cb5a..104b239b9 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -370,8 +370,52 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.partner.company_phone_c = 61; $scope.partner.contact_phone_c = 61; + $scope.partner.client_pay_type = []; + $scope.partner.client_pay_desc = []; + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + while (parseInt($scope.partner.client_pay_desc[0]) < 6) { + $scope.partner.client_pay_desc.splice(0, 1); + } + } + if (type == 2) { + while (parseInt($scope.partner.client_pay_desc[$scope.partner.client_pay_desc.length-1]) > 5) { + $scope.partner.client_pay_desc.splice($scope.partner.client_pay_desc.length-1, 1); + } + } + }; - + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; $scope.pagination = {}; $scope.industries = industryMap.configs(); $scope.states = stateMap.configs(); @@ -382,12 +426,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.bd_citys = angular.copy(bd_city_map); $scope.params = {textType: 'all', org_name: 'ALL'}; - - $scope.onOfflineDescSelect = function (selectedItem) { - $scope.partner.offline_label = selectedItem.label; - $scope.partner.client_offline_desc = selectedItem.value; - }; - function remove(arr, val) { if (angular.isArray(arr)) { for (var i = arr.length; i--;) { @@ -400,13 +438,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter return arr; } - $scope.loadOfflineDesc = function () { - $http.get('/static/data/client_offline_desc.json').then(function (resp) { - $scope.client_offline_select = resp.data; - }) - }; - $scope.loadOfflineDesc(); - var industries = angular.copy($scope.industries); $scope.industries = remove(industries, 331); @@ -538,7 +569,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert("Logo is necessary!"); return; } - if ($scope.partner.partner_type == 'photo') { + if ($scope.partner.client_pay_type.indexOf('2')>=0) { if (!$scope.partner.company_photo) { alert('Shop Photo1 is necessary'); return; @@ -557,20 +588,32 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }) } - // if ($scope.partner.client_pay_type =='online' || $scope.partner.client_pay_type =='all') { - // if (!$scope.partner.online_website && !$scope.partner.online_public_account && !$scope.partner.online_mini_program && !$scope.partner.online_app) { - // alert('线上支付场景至少填写一种方式'); - // return; - // } - // } - // if(!window.frames['merchant_detail'].merchant_location){ - // alert("Please Locate Merchant's Location"); - // return; - // } - if ($scope.params.client_pay_type == '') { + + if ($scope.partner.client_pay_type.length==0) { alert('请选择商户支付场景') + return; } - + if ($scope.partner.client_pay_desc.length==0) { + alert('请选择商户支付方式') + return; + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0 && $scope.partner.client_pay_type.indexOf('2') >= 0) { + var fristDesc = $scope.partner.client_pay_desc[0]; + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(fristDesc) > 5 || parseInt(lastDesc) < 6) { + alert("请检查线上/线下支付场景是否已选择支付方式") + return; + } + } + if ($scope.partner.client_pay_desc.indexOf('8') >= 0) { + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(lastDesc) < 10) { + alert("请检查线下支付是否已选择收银系统类型") + return; + } + } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); $http.post('/sys/partners', $scope.partner).then(function (resp) { commonDialog.alert({title: 'Success', content: 'Register new partner successfully', type: 'success'}); $scope.updateMerchantLocation(); @@ -1130,18 +1173,48 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.timezones = timezone.configs(); $scope.partner = partner.data; var origin_referrer_id = angular.copy($scope.partner.referrer_id); - $scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo'; - - $scope.loadOfflineDesc = function () { - $http.get('/static/data/client_offline_desc.json').then(function (resp) { - $scope.client_offline_select = resp.data; - }) + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + while (parseInt($scope.partner.client_pay_desc[0]) < 6) { + $scope.partner.client_pay_desc.splice(0, 1); + } + } + if (type == 2) { + while (parseInt($scope.partner.client_pay_desc[$scope.partner.client_pay_desc.length-1]) > 5) { + $scope.partner.client_pay_desc.splice($scope.partner.client_pay_desc.length-1, 1); + } + } }; - $scope.loadOfflineDesc(); - - $scope.onOfflineDescSelect = function (selectedItem) { - $scope.partner.offline_label = selectedItem.label; - $scope.partner.client_offline_desc = selectedItem.value; + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } }; $scope.listReferrers = function () { @@ -1239,7 +1312,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert('suburb can not contain two and more continuous space characters'); return; } - if ($scope.partner.partner_type == 'photo') { + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { if (!$scope.partner.company_photo) { alert('Shop Photo1 is necessary'); return; @@ -1277,9 +1350,31 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // alert("Please Locate Merchant Location!"); // return; // } - if ($scope.params.client_pay_type == '') { + if ($scope.partner.client_pay_type.length == 0) { alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length == 0) { + alert('请选择商户支付方式') + return; } + if ($scope.partner.client_pay_type.indexOf('1') >= 0 && $scope.partner.client_pay_type.indexOf('2') >= 0) { + var fristDesc = $scope.partner.client_pay_desc[0]; + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(fristDesc) > 5 || parseInt(lastDesc) < 6) { + alert("请检查线上/线下支付场景是否已选择支付方式") + return; + } + } + if ($scope.partner.client_pay_desc.indexOf('8') >= 0) { + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(lastDesc) < 10) { + alert("请检查线下支付是否已选择收银系统类型") + return; + } + } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); $http.put('/sys/partners/' + $scope.partner.client_moniker, $scope.partner).then(function () { if (content != '') { commonDialog.alert({ @@ -2624,6 +2719,52 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.partner.company_phone_c = 61; $scope.partner.contact_phone_c = 61; + $scope.partner.client_pay_type = []; + $scope.partner.client_pay_desc = []; + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + while (parseInt($scope.partner.client_pay_desc[0]) < 6) { + $scope.partner.client_pay_desc.splice(0, 1); + } + } + if (type == 2) { + while (parseInt($scope.partner.client_pay_desc[$scope.partner.client_pay_desc.length-1]) > 5) { + $scope.partner.client_pay_desc.splice($scope.partner.client_pay_desc.length-1, 1); + } + } + }; + + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; $scope.business_structures = businessStructuresMap.configs(); $scope.industries = industryMap.configs(); @@ -2776,9 +2917,31 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // alert("Please Locate Merchant Location!"); // return; // } - if ($scope.partner.client_pay_type == '') { + if ($scope.partner.client_pay_type.length==0) { alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length==0) { + alert('请选择商户支付方式') + return; + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0 && $scope.partner.client_pay_type.indexOf('2') >= 0) { + var fristDesc = $scope.partner.client_pay_desc[0]; + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(fristDesc) > 5 || parseInt(lastDesc) < 6) { + alert("请检查线上/线下支付场景是否已选择支付方式") + return; + } + } + if ($scope.partner.client_pay_desc.indexOf('8') >= 0) { + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(lastDesc) < 10) { + alert("请检查线下支付是否已选择收银系统类型") + return; + } } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); $http.post('/sys/partners/' + clientMoniker + '/sub_clients', $scope.partner).then(function () { $scope.updateMerchantLocation(); $scope.$close(); diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 28e414196..8789c2cf8 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -3,6 +3,12 @@ max-height: 100px; margin-left: 20px; } + .btn btn-default:active{ + position: relative; + top: 1px; + box-shadow: inset 0 3px 5px 0 rgba(0,0,0, 0.2); + outline: 0; + }

      New Partner

      @@ -221,77 +227,6 @@ -
      - -
      - -

      If the partner is a offline shop then - a photo of shop is - required while an online store shall choose - companyWebsite

      -

      - 只要有可能产生线下交易(商户静态码、POS),就必须上传照片,否则支付宝会禁止交易

      -
      -

      Required - Field

      -
      -
      -
      -
      - -
      -
      1:  - -
      - - -
      -
      -
      2:  - -
      - - -
      -
      - -
      - -
      - -
      -

      Required - Field

      -

      Less - Than 200 - Characters(including symbols and spaces)

      -
      -
      -