diff --git a/src/db/modify.sql b/src/db/modify.sql index 61a23de4a..29607b206 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -543,4 +543,10 @@ alter table sys_client_pre_apply add COLUMN `client_moniker` varchar(20) DEFAULT alter table sys_client_pre_apply modify COLUMN `agree` tinyint(1) DEFAULT 0; -insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); \ No newline at end of file +insert into `royalpay_production`.`sys_configs` ( `config_key`, `config_value`) values ( 'royalpayindustry.json', '[{"children":[{"children":[],"label":"机票","mccCode":"10001"},{"children":[],"label":"旅游行业","mccCode":"10002"},{"children":[],"label":"私人定制旅游","mccCode":"10003"},{"children":[],"label":"租车","mccCode":"10004"},{"children":[],"label":"巴士","mccCode":"10005"}],"label":"旅游出行","mccCode":"1"},{"children":[{"children":[],"label":"饭店","mccCode":"20001"},{"children":[],"label":"奶茶店","mccCode":"20002"},{"children":[],"label":"烧烤","mccCode":"20003"},{"children":[],"label":"火锅","mccCode":"20004"},{"children":[],"label":"Coffee","mccCode":"20005"},{"children":[],"label":"酒吧","mccCode":"20006"}],"label":"餐饮","mccCode":"2"},{"children":[{"children":[],"label":"培训类","mccCode":"30001"},{"children":[],"label":"移民留学","mccCode":"30002"},{"children":[],"label":"私人幼儿园","mccCode":"30003"}],"label":"教育","mccCode":"3"},{"children":[{"children":[],"label":"换汇","mccCode":"40001"},{"children":[],"label":"房产","mccCode":"40002"}],"label":"商务咨询","mccCode":"4"},{"children":[{"children":[],"label":"公众号服务商","mccCode":"50001"},{"children":[],"label":"各种媒体类宣传","mccCode":"50002"}],"label":"传媒","mccCode":"5","value":"{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"},{"children":[{"children":[],"label":"美容院","mccCode":"60001"},{"children":[],"label":"医疗美容","mccCode":"60002"}],"label":"医美","mccCode":"6"},{"children":[{"label":"超市","mccCode":"70001"},{"children":[],"label":"服装店","mccCode":"70002"},{"children":[],"label":"鞋店","mccCode":"70003"},{"children":[],"label":"珠宝店","mccCode":"70004"},{"children":[],"label":"箱包","mccCode":"70005"}],"label":"零售","mccCode":"7"},{"children":[{"children":[],"label":"桌游吧","mccCode":"80001"},{"children":[],"label":"演唱会","mccCode":"80002"},{"children":[],"label":"马术训练","mccCode":"80003"},{"children":[],"label":"瑜伽","mccCode":"80004"},{"children":[],"label":"健身","mccCode":"80005"},{"children":[],"label":"社团","mccCode":"80006"},{"children":[],"label":"网吧","mccCode":"80007"},{"children":[],"label":"KTV","mccCode":"80008"},{"children":[],"label":"电影","mccCode":"80009"}],"label":"休闲娱乐","mccCode":"8"},{"children":[{"children":[],"label":"摄影","mccCode":"90001"},{"children":[],"label":"massage","mccCode":"90002"},{"children":[],"label":"通讯运营商","mccCode":"90003"},{"children":[],"label":"车行","mccCode":"90004"},{"children:":[],"label":"软件服务","mccCode":"90005"}],"label":"其他服务类","mccCode":"9"},{"children":[{"children":[],"label":"Hotel","mccCode":"100001"},{"children":[],"label":"Motel","mccCode":"100002"}],"label":"酒店","mccCode":"10"},{"children":[{"children":[],"label":"代购","mccCode":"110001"},{"children":[],"label":"物流(大宗出口贸易)","mccCode":"110002"},{"children":[],"label":"红酒出口","mccCode":"110003"},{"children":[],"label":"综合电商","mccCode":"110004"}],"label":"出口贸易","mccCode":"11"},{"children":[{"children":[],"label":"建材","mccCode":"120001"},{"children":[],"label":"家居","mccCode":"120002"}],"label":"家居建材","mccCode":"12"}]'); + + +ALTER TABLE `sys_client_config` +ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; +ALTER TABLE `sys_clients` +ADD COLUMN `gateway_alipay_online` tinyint(1) NULL DEFAULT 1 COMMENT '支付宝线上网关使用线上渠道' AFTER `require_remark`; \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index 47941ad78..f6e07eeba 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -152,14 +152,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT return res; } - private JSONObject getSevenOrMonth(JSONObject params, JSONObject today){ - JSONObject res = new JSONObject(); - res.put("traded_partners", clientCustomersMapper.countTradedClients(params) + clientAnalysisMapper.countNewClients(today)); - res.put("total_customers", clientCustomersMapper.countTotalCustomers(params) + clientAnalysisMapper.countClients(today)); - res.put("old_customers", clientCustomersMapper.countTotalOldCustomers(params) + clientAnalysisMapper.countTradedPartners(params)); - return res; - } - @Override public List getTradeInTypes(JSONObject params) { return transactionAnalysisMapper.getTradeAmountInTypes(params); @@ -540,7 +532,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT }*/ @Override public JSONObject getPlatformAmount(JSONObject params) { - String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("begin")).get(); + String jsonStr = stringRedisTemplate.boundValueOps("org_ChannelAnalysis" + params.getString("org_id")+params.getString("begin")).get(); JSONObject channelAnalysis = JSONObject.parseObject(jsonStr); if(channelAnalysis != null){ return channelAnalysis; @@ -555,7 +547,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT }else { resp = customerAndOrdersStatisticsMapper.getChannelCommonCount(params); } - stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); + stringRedisTemplate.boundValueOps("org_ChannelAnalysis"+ params.getString("org_id")+params.getString("begin")).set(resp.toJSONString(), 5, TimeUnit.MINUTES); return resp; } } 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 093aa108c..939d22ef6 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 @@ -242,6 +242,10 @@ public interface ClientManager { void changeRetailPaySurcharge(JSONObject account, boolean paySurcharge); + void changeRequireCustinfo(JSONObject account, boolean requireCustinfo); + + void changeRequireRemark(JSONObject account, boolean requireRemark); + void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO); void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark); 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 86372631f..512addbba 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 @@ -2933,6 +2933,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", paySurcharge)); } + @Override + public void changeRequireCustinfo(JSONObject account, boolean requireCustinfo) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + clientModifySupport + .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_custinfo", requireCustinfo)); + + } + + @Override + public void changeRequireRemark(JSONObject account, boolean requireRemark) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + clientModifySupport + .processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark)); + + } + @Override public void changeSurcharge(JSONObject account, JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) { JSONObject client = clientMapper.findClient(device.getIntValue("client_id")); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 6ca899497..ce2466929 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -342,6 +342,18 @@ public class PartnerViewController { clientManager.changeRetailPaySurcharge(account, pass.getBooleanValue("retail_surcharge")); } + @PartnerMapping(value = "/require_custinfo", method = RequestMethod.PUT) + @ResponseBody + public void changeRequireCustinfo(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeRequireCustinfo(account, pass.getBooleanValue("require_custinfo")); + } + + @PartnerMapping(value = "/require_remark", method = RequestMethod.PUT) + @ResponseBody + public void changeRequireRemark(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeRequireRemark(account, pass.getBooleanValue("require_remark")); + } + @PartnerMapping(value = "/sign_events", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @ResponseBody diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml index da8477938..8213b5ba3 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml @@ -316,6 +316,7 @@ ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount, ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count FROM statistics_customer_order s + LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 ]]> s.client_id != 0 @@ -403,7 +404,9 @@ and s.client_id=#{client_id} and s.channel = #{channel} - and c.org_id = #{org_id} + and c.org_id=#{org_id} + and c.org_id in + #{org_id} and c.client_id in (SELECT b.client_id FROM sys_client_bd b INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml index 55833812f..a7b8534b1 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/client/ClientCustomersMapper.xml @@ -45,29 +45,41 @@ \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 47932a3e3..b35da3b96 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -627,6 +627,42 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }) }) } + $scope.toggleRequireCustInfo = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.ctrl.require_custinfo) { + $scope.ctrl.require_custinfo = true; + return; + } + $http.put('/client/partner_info/require_custinfo', {require_custinfo: $scope.paymentInfo.require_custinfo}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change require customer Info permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; + $scope.toggleRequireRemark = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.ctrl.require_remark) { + $scope.ctrl.require_remark = true; + return; + } + $http.put('/client/partner_info/require_remark', {require_remark: $scope.paymentInfo.require_remark}).then(function () { + + }, function (resp) { + commonDialog.alert({ + title: 'failed to change require remark permission status', + content: resp.data.message, + type: 'error' + }) + }) + }; }]); app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) { $scope.paymentInfo = partner.data; diff --git a/src/main/ui/static/payment/partner/templates/client_payment_info.html b/src/main/ui/static/payment/partner/templates/client_payment_info.html index 674369685..a9b00fb40 100644 --- a/src/main/ui/static/payment/partner/templates/client_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/client_payment_info.html @@ -145,6 +145,28 @@ +
+
Order Config
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
Payment Page