diff --git a/src/db/modify.sql b/src/db/modify.sql index d100ce9a4..1a26ebc08 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -188,6 +188,8 @@ alter table financial_partner_commission_detail add column commission_type small INSERT INTO `royalpay_production`.`sys_configs`(`config_key` , `config_value`) + + VALUES ( 'android_version_content' , diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java new file mode 100644 index 000000000..496860b2e --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java @@ -0,0 +1,25 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import org.apache.ibatis.annotations.Param; + +import javax.validation.constraints.Max; +import java.util.List; + +/** + * Created by yixian on 2017-03-14. + */ +@AutoMapper(tablename = "sys_wx_merchant_apply",pkName = "merchant_app_id") +public interface SysWxMerchantApplyMapper { + @AutoSql(type = SqlType.SELECT) + List listWxMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds); + + @AutoSql(type = SqlType.INSERT) + void insertWxMerchantApply(JSONObject params); + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java new file mode 100644 index 000000000..4d1a843a4 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java @@ -0,0 +1,174 @@ +package au.com.royalpay.payment.manage.merchants.beans; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import org.apache.commons.lang3.StringUtils; +import org.hibernate.validator.constraints.Length; +import org.hibernate.validator.constraints.NotBlank; + +/** + * Created by yuan on 2018/1/19. + */ +public class SubMerchantIdApply { + + @NotBlank(message = "error.payment.valid.param_missing") + @Length(max = 50) + @JSONField(name = "company_name") + private String merchant_name; + @NotBlank(message = "error.payment.valid.param_missing") + @Length(max = 10) + @JSONField(name = "merchant_id") + private String merchant_id; + @NotBlank(message = "error.payment.valid.param_missing") + @Length(max = 20) + @JSONField(name = "short_name") + private String merchant_shortname; + @NotBlank(message = "error.payment.valid.param_missing") + @Length(max = 20) + @JSONField(name = "company_phone") + private String office_phone; + @JSONField(name = "contact_person") + private String contact_name; + private String contact_phone; + private String contact_email; + @NotBlank(message = "error.payment.valid.param_missing") + @JSONField(name = "industry") + private String business_category; + @NotBlank(message = "error.payment.valid.param_missing") + @Length(max = 20) + @JSONField(name = "remark") + private String merchant_remark; + @JSONField(name = "company_website") + private String website; + @NotBlank(message = "error.payment.valid.param_missing") + @Length(min = 10, max = 256) + @JSONField(name = "description") + private String merchant_introduction; + + public JSONObject insertObject() { + JSONObject params = new JSONObject(); + if(StringUtils.isNotEmpty(merchant_name)){ + params.put("merchant_name",merchant_name); + } + if(StringUtils.isNotEmpty(merchant_shortname)){ + params.put("merchant_shortname",merchant_shortname); + } + if(StringUtils.isNotEmpty(office_phone)){ + params.put("office_phone",office_phone); + } + if(StringUtils.isNotEmpty(contact_name)){ + params.put("contact_name",contact_name); + } + if(StringUtils.isNotEmpty(contact_phone)){ + params.put("contact_phone",contact_phone); + } + if(StringUtils.isNotEmpty(contact_email)){ + params.put("contact_email",contact_email); + } + if(StringUtils.isNotEmpty(business_category)){ + params.put("business_category",business_category); + } + if(StringUtils.isNotEmpty(merchant_remark)){ + params.put("merchant_remark",merchant_remark); + } + if(StringUtils.isNotEmpty(website)){ + params.put("website",website); + } + if(StringUtils.isNotEmpty(merchant_introduction)){ + params.put("merchant_introduction",merchant_introduction); + } + return params; + } + + public SubMerchantIdApply() { + } + + public String getMerchant_name() { + return this.merchant_name; + } + + public String getMerchant_id() { + return merchant_id; + } + + public void setMerchant_id(String merchant_id) { + this.merchant_id = merchant_id; + } + + public void setMerchant_name(String merchant_name) { + this.merchant_name = merchant_name; + } + + public String getMerchant_shortname() { + return this.merchant_shortname; + } + + public void setMerchant_shortname(String merchant_shortname) { + this.merchant_shortname = merchant_shortname; + } + + public String getOffice_phone() { + return this.office_phone; + } + + public void setOffice_phone(String office_phone) { + this.office_phone = office_phone; + } + + public String getContact_name() { + return this.contact_name; + } + + public void setContact_name(String contact_name) { + this.contact_name = contact_name; + } + + public String getContact_phone() { + return this.contact_phone; + } + + public void setContact_phone(String contact_phone) { + this.contact_phone = contact_phone; + } + + public String getContact_email() { + return this.contact_email; + } + + public void setContact_email(String contact_email) { + this.contact_email = contact_email; + } + + public String getBusiness_category() { + return this.business_category; + } + + public void setBusiness_category(String business_category) { + this.business_category = business_category; + } + + public String getMerchant_remark() { + return this.merchant_remark; + } + + public void setMerchant_remark(String merchant_remark) { + this.merchant_remark = merchant_remark; + } + + public String getMerchant_introduction() { + return this.merchant_introduction; + } + + public void setMerchant_introduction(String merchant_introduction) { + this.merchant_introduction = merchant_introduction; + } + + public String getWebsite() { + return this.website; + } + + public void setWebsite(String website) { + this.website = website; + } +} 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 7f29c5718..c093b50cc 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 @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.merchants.core; +import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.merchants.beans.*; @@ -264,4 +265,12 @@ public interface ClientManager { void validRefundPwd(JSONObject account, String pwd); void setWeekendDelay(int clientId, boolean delay); + + List listSubMerchantIdApplys(JSONObject manager, String clientMoniker); + + String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); + + List listMerchantIds(String clientMoniker,JSONObject manager); + + void clearCacheSubMerchantIdApplices(String clientMoniker); } 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 a2814d7ee..638bebfdd 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 @@ -1,7 +1,10 @@ package au.com.royalpay.payment.manage.merchants.core.impls; import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; +import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; +import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient; +import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; import au.com.royalpay.payment.core.PaymentChannelApi; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; @@ -54,6 +57,7 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; +import org.dom4j.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -135,6 +139,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private MpPaymentApi mpPaymentApi; @Resource private SignInAccountService signInAccountService; + @Resource + private WxPayClient wxPayClient; @Resource private ManagerMapper managerMapper; @@ -152,6 +158,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientAuditProcessMapper clientAuditProcessMapper; + + @Resource + private SysWxMerchantApplyMapper sysWxMerchantApplyMapper; @Resource private SpringTemplateEngine thymeleaf; @@ -1241,6 +1250,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if(configJson.getString("rate_name").equals(rateName)){ if(org.containsKey(rateValueKey)){ if(configJson.getDouble("rate_value").compareTo(org.getDouble(rateValueKey)) < 0){ + throw new ForbiddenException("费率参数小于旗下商户最低"+rateName+"费率,请重新输入"); }; } @@ -2923,4 +2933,89 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } + + @Override + @Cacheable(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") + public List listSubMerchantIdApplys(JSONObject manager, String clientMoniker) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + List applices = sysWxMerchantApplyMapper.listWxMerchantApplices(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc"))); + if(!applices.isEmpty()){ + return applices; + }else { + if(StringUtils.isNotEmpty(client.getString("sub_merchant_id")) && StringUtils.isNotEmpty(client.getString("merchant_id"))){ + Element elem = wxPayClient.querySubMerchant(client.getString("merchant_id"),client.getString("sub_merchant_id")); + JSONObject object = new JSONObject(); + object.put("sub_merchant_id",elem.elementText("sub_mch_id_0")); + object.put("client_id",client.getInteger("client_id")); + object.put("merchant_name",elem.elementText("merchant_name_0")); + object.put("merchant_shortname",elem.elementText("merchant_shortname_0")); + object.put("office_phone",elem.elementText("office_phone_0")); + object.put("contact_name",elem.elementText("contact_name_0")); + object.put("contact_email",elem.elementText("contact_email_0")); + object.put("contact_phone",elem.elementText("contact_phone_0")); + object.put("business_category",elem.elementText("business_category_0")); + object.put("merchant_remark",elem.elementText("merchant_remark_0")); + object.put("website",elem.elementText("website_0")); + object.put("merchant_introduction",elem.elementText("merchant_introduction_0")); + object.put("merchant_id",client.getString("merchant_id")); + object.put("create_time",new Date()); + object.put("operator",manager.getString("display_name")); + List applyQuery = new ArrayList<>(); + applyQuery.add(object); + return applyQuery; + } + } + return null; + } + @Override + @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") + public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + + JSONObject params = subMerchantApply.insertObject(); + SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params,SubMerchantInfo.class); + params.put("merchant_id",subMerchantApply.getMerchant_id()); + params.put("client_id",client.getString("client_id")); + params.put("create_time",new Date()); + params.put("operator",manager.getString("display_name")); + Element elem = wxPayClient.subMerchantApplication(subMerchantApply.getMerchant_id(),subMerchantInfo); + String sub_merchant_id = elem.elementText("sub_mch_id"); + if(StringUtils.isNotEmpty(sub_merchant_id)){ + params.put("sub_merchant_id",sub_merchant_id); + sysWxMerchantApplyMapper.insertWxMerchantApply(params); + clearCacheSubMerchantIdApplices(clientMoniker); + }else { + throw new BadRequestException(elem.elementText("return_msg")); + } + return sub_merchant_id; + } + + @Override + public List listMerchantIds(String clientMoniker,JSONObject manager) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + List list = new ArrayList<>(); + for (WeChatPayConfig.Merchant mch : WechatPayEnvironment.getEnv().getWechatMerchantConfigs()){ + JSONObject merchantIds = new JSONObject(); + merchantIds.put("merchant_id",mch.getMerchantId()); + list.add(merchantIds); + } + return list; + } + + @Override + @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") + public void clearCacheSubMerchantIdApplices(String clientMoniker) { + } } 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 f9d090a2c..2c15a63f2 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 @@ -482,4 +482,19 @@ public class PartnerManageController { public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); } + + @ManagerMapping(value = "/{clientMoniker}/list_sub_applices",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + public List listSubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.listSubMerchantIdApplys(manager,clientMoniker); + } + + @ManagerMapping(value = "/{clientMoniker}/sub_apply",method = RequestMethod.POST,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager); + } + + @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + public List getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.listMerchantIds(clientMoniker,manager); + } } diff --git a/src/main/ui/static/analysis/client_rates.js b/src/main/ui/static/analysis/client_rates.js index fff3c0845..4235a8133 100644 --- a/src/main/ui/static/analysis/client_rates.js +++ b/src/main/ui/static/analysis/client_rates.js @@ -69,9 +69,11 @@ define(['angular', 'echarts', 'jquery', 'uiRouter','./monitoring/analysis-monito } else { $scope.chooseLastDays(30); if($filter('withRole')('1000000000000') && $scope.currentUser.org_id){ + $scope.org2 = "ALL Organizations" $scope.loadOrgChild(); } if (!$scope.currentUser.org_id) { + $scope.org2 = "ALL" $scope.loadOrgs(); } if(!($filter('withRole')('1000000000000') && $scope.currentUser.org_id) || $scope.currentUser.org_id){ diff --git a/src/main/ui/static/analysis/org/templates/analysis_org.html b/src/main/ui/static/analysis/org/templates/analysis_org.html index c1a6666b3..13cefc4d8 100644 --- a/src/main/ui/static/analysis/org/templates/analysis_org.html +++ b/src/main/ui/static/analysis/org/templates/analysis_org.html @@ -2,7 +2,7 @@
diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index a4fab9761..619fee907 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -30,6 +30,56 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter {code: 2, label: 'Manager'}, {code: 3, label: 'Cashier'} ]; + var wxMerchantIndustries = [ + { + "label": "鞋包服饰|Shoes&Garments", + "value": "343" + }, + { + "label": "机票行业|Air Ticket", + "value": "493" + }, + { + "label": "文具/办公用品|Stationery/office supplies", + "value": "492" + }, + { + "label": "酒店行业|Hotel Industry", + "value": "491" + }, + { + "label": "教育行业|Education Industry", + "value": "490" + }, + { + "label": "国际物流|Logistics", + "value": "489" + }, + { + "label": "数码电器|Digital appliance", + "value": "488" + }, + { + "label": "母婴|Maternal and infant", + "value": "487" + }, + { + "label": "化妆品|Cosmetics", + "value": "486" + }, + { + "label": "食品|Food", + "value": "485" + }, + { + "label": "综合商城|Comprehensive mall", + "value": "484" + }, + { + "label": "其它货物贸易行业|Other trade industry", + "value": "494" + } + ]; var app = angular.module('partnerManageApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ui.select', 'ngFileUpload']); app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('partners', { @@ -109,6 +159,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter url: '/partner_product', templateUrl: 'static/payment/product/templates/product.html', controller: 'productCtrl' + }).state('partners.detail.sub_merchant_applicaitons', { + url: '/sub_merchant_applicaitons', + templateUrl: 'static/payment/partner/templates/sub_merchant_id_apply.html', + controller: 'subMerchantIdApplicaitonsCtrl' }); }]); app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', @@ -2522,6 +2576,90 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); + app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal','$state','commonDialog', function ($scope, $http, $uibModal, $state,commonDialog) { + $scope.loadSubMerchantInfos = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) { + $scope.subMerchantInfos = resp.data; + }); + }; + $scope.useSubMerchantId = function (sub_merchant_id) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + } + $scope.applySubMerchantId = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html', + controller: 'applySubMerchantIdCtrl', + resolve: { + subMerchantInfo:function () { + return $scope.partner; + }, + merchantIds: ['$http', '$stateParams', function ($http) { + return $http.get('/sys/partners/'+ $scope.partner.client_moniker +'/get_merchant_ids'); + }] + } + }).result.then(function () { + $scope.loadSubMerchantInfos(); + }) + }; + $scope.loadSubMerchantInfos(); + }]); + app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal','$state','subMerchantInfo', '$filter','merchantIds','commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo,$filter,merchantIds,commonDialog) { + $scope.wxIndustries = angular.copy(wxMerchantIndustries); + $scope.subMerchantInfo = angular.copy(subMerchantInfo); + $scope.merchantIds = merchantIds.data; + $scope.subMerchantInfo.industry = $filter('wxindustries')($scope.subMerchantInfo.industry); + $scope.saveAppliy = function (form) { + $scope.errmsg = null; + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker+ '/sub_apply', $scope.subMerchantInfo).then(function (resp) { + $scope.apply_sub_merchant_id = resp.data; + $scope.$close(); + if(subMerchantInfo.sub_merchant_id != null){ + commonDialog.confirm({title:'Confirm',content:'已申请成功,是否确认使用'}).then(function () { + $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }) + }else { + $http.put('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/payment_config', {sub_merchant_id: $scope.apply_sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Apply Success And Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + } + }, function (resp) { + $scope.errmsg = resp.data.message; + }) + } + }]); app.filter('bdOrg', function () { return function (bdUsers, org_id) { if (org_id) { @@ -2538,7 +2676,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter return bdUsers; } }); - + app.filter('wxMerchants', function () { + return function (values) { + var industry = ''; + angular.forEach(wxMerchantIndustries, function (wxMerchant) { + if (wxMerchant.value == values) { + industry = wxMerchant.label; + } + }); + return industry; + } + }); app.filter('bdOrgSelect', function () { return function (bdUsers, params) { var org_id; @@ -2565,5 +2713,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter return bdUsers; } }); + + app.filter('wxindustries', function () { + return function (value) { + switch (value + '') { + case '327': + return '343'; + case '339': + return '493'; + case '337': + return '492'; + case '328': + return '491'; + case '362': + case '361': + case '363': + case '329': + return '490'; + case '330': + return '489'; + case '332': + return '487'; + case '334': + return '486'; + case '335': + return '485'; + case '336': + return '484'; + case '338': + case '358': + return '494' + } + } + }); + + app.filter('cut', function () { + return function (value, wordwise, max, tail) { + if (!value) return ''; + + max = parseInt(max, 10); + if (!max) return value; + if (value.length <= max) return value; + + value = value.substr(0, max); + if (wordwise) { + var lastspace = value.lastIndexOf(' '); + if (lastspace != -1) { + value = value.substr(0, lastspace); + } + } + return value + (tail || ' …'); + }; + }); return app; }); \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html new file mode 100644 index 000000000..c5ef569e7 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html @@ -0,0 +1,159 @@ +
+
+
+
+
+
Apply Sub Merchant Id
+
+
+
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+

More than 50

+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 50

+
+
+
+ +
+ +
+ +
+

Required Field

+
+
+
+

More than 50

+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+

Required Field

+

Length is more than 20

+
+
+
+ +
+ +
+ +
+

Required Field

+

Length is more than 256

+

Length is less than 10

+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + + + + + + +
+ +
+
+
+
+
\ No newline at end of file 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 8e25d248a..f9dcb03a0 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -238,6 +238,9 @@
  • Product
  • +
  • + Sub Merchant Id Applicaitons +
  • diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html new file mode 100644 index 000000000..4c02dd91b --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html @@ -0,0 +1,91 @@ + +
    +
    +
    +
    +
    +
    +

    + Sub Merchant Id : {{partner.sub_merchant_id}} + +

    + +
    +
    +
    +
    +

    List of Sub Merchant Id

    +
    +
    +
      +
    • + Sub Merchant Id + (当前使用){{id_apply.sub_merchant_id}} +
    • +
    • + Apply Time + +
    • +
    • + Merchant Short Name + {{id_apply.merchant_shortname | cut:true:20:' ...'}} +
    • +
    • + Business Category + {{id_apply.business_category | wxMerchants}} +
    • +
    • + Description + {{id_apply.merchant_introduction | cut:true:20:' ...'}} +
    • +
    • + Operator + +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/ui/static/payment/tradelog/templates/trade_logs.html b/src/main/ui/static/payment/tradelog/templates/trade_logs.html index 29d0e0575..36d8b6f17 100644 --- a/src/main/ui/static/payment/tradelog/templates/trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/trade_logs.html @@ -62,7 +62,7 @@
    @@ -70,7 +70,7 @@
    diff --git a/src/main/ui/static/payment/tradelog/tradelog-manage.js b/src/main/ui/static/payment/tradelog/tradelog-manage.js index 79d07f627..803839a78 100644 --- a/src/main/ui/static/payment/tradelog/tradelog-manage.js +++ b/src/main/ui/static/payment/tradelog/tradelog-manage.js @@ -77,7 +77,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.loadTradeLogs(1); }; if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) { - /* $scope.showOrg = 'Organization';*/ + $scope.org2 = "ALL" $http.get('/sys/orgs', {params: {}}).then(function (resp) { $scope.orgs = resp.data; }); @@ -90,6 +90,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { }) }; if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && ($scope.currentUser.org_id != null)){ + $scope.org2 = "ALL Organizations" $scope.loadOrgs(); }