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 11f8d5d18..cf3e60100 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 @@ -106,7 +106,6 @@ import org.springframework.ui.Model; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import org.thymeleaf.context.Context; import org.thymeleaf.spring5.SpringTemplateEngine; @@ -124,11 +123,12 @@ import java.math.RoundingMode; import java.net.URISyntaxException; import java.net.URL; import java.net.URLDecoder; -import java.security.*; +import java.security.InvalidParameterException; +import java.security.KeyPair; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; -import java.util.List; import java.util.*; +import java.util.List; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -271,8 +271,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientConfigMapper clientConfigMapper; @Resource - private PermissionPartnerModuleMapper permissionPartnerModuleMapper; - @Resource private PermissionPartnerManagerImpl permissionPartnerManagerImpl; @Resource private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper; @@ -360,7 +358,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (manager != null) { checkClientOrg(manager, client); } - String same_phone = clientMapper.findSamePhone(client.getString("contact_phone")).getString("a"); if (same_phone != null && client.getString("contact_phone") != null && same_phone.contains(" ")) { same_phone = same_phone.replace(client.getString("client_moniker"), ""); @@ -1584,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private void checkPhoneAndWechatExist(NewAccountBean account) { List accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code()); - if ( accounts != null && accounts.size()>0) { + if (accounts != null && accounts.size() > 0) { throw new BadRequestException("Mobile phone number has been bound to other accounts"); } } @@ -1657,13 +1654,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (account == null) { throw new BadRequestException("account not exists"); } - if(user.getString("openid")!=null && !"".equals(user.getString("openid"))) { + if (user.getString("openid") != null && !"".equals(user.getString("openid"))) { if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) { throw new BadRequestException("The WeChat has been linked to other accounts"); } } - if(user.getString("unioinid")!=null && !"".equals(user.getString("unioinid"))){ - if(clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0 ){ + if (user.getString("unioinid") != null && !"".equals(user.getString("unioinid"))) { + if (clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size() > 0) { throw new BadRequestException("The WeChat has been linked to other accounts"); } } @@ -5903,76 +5900,76 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return key; } - public JSONObject partnerIncrementalService(String clientMoniker){ + public JSONObject partnerIncrementalService(String clientMoniker) { JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if(client==null){ + if (client == null) { throw new InvalidShortIdException(); } List service = clientIncrementalMapper.findAllByclientMoniker(client.getInteger("client_id")); - List incrementalChannels = new ArrayList<>(); + List incrementalChannels = new ArrayList<>(); for (IncrementalChannel e : IncrementalChannel.values()) { boolean exist = false; - for(JSONObject s : service){ - exist = e.getChannel().equals(s.getString("channel")); - if(exist){ - break; - } - } - if(!exist){ - incrementalChannels.add(e.getChannel()); - } + for (JSONObject s : service) { + exist = e.getChannel().equals(s.getString("channel")); + if (exist) { + break; + } + } + if (!exist) { + incrementalChannels.add(e.getChannel()); + } } incrementalChannels.remove("system"); - return new JSONObject(){{ - put("all_service",service); - put("incremental_channel",incrementalChannels); - }}; + return new JSONObject() {{ + put("all_service", service); + put("incremental_channel", incrementalChannels); + }}; } - public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService,JSONObject manager){ + public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) { JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if(client==null){ + if (client == null) { throw new InvalidShortIdException(); } - JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel")); + JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel")); JSONObject saveIncrementalService = new JSONObject(); - if(existIncrementalService==null){ - saveIncrementalService.put("incremental_id",UUID.randomUUID().toString()); - saveIncrementalService.put("channel",incrementalService.getString("channel")); - saveIncrementalService.put("create_time",new Date()); - saveIncrementalService.put("update_time",new Date()); - saveIncrementalService.put("is_valid",1); - }else{ - saveIncrementalService.put("incremental_id",incrementalService.getString("incremental_id")); - saveIncrementalService.put("update_time",new Date()); - } - saveIncrementalService.put("client_id",client.getInteger("client_id")); - saveIncrementalService.put("operator",manager.getString("display_name")); - saveIncrementalService.put("incremental_mode",incrementalService.getInteger("incremental_mode")); - saveIncrementalService.put("incremental_rate_value",incrementalService.getInteger("incremental_mode")==1?incrementalService.getString("incremental_rate_value"):0); - saveIncrementalService.put("total_incremental_amount",incrementalService.getInteger("incremental_mode")!=1?incrementalService.getString("total_incremental_amount"):0); - if(existIncrementalService==null){ + if (existIncrementalService == null) { + saveIncrementalService.put("incremental_id", UUID.randomUUID().toString()); + saveIncrementalService.put("channel", incrementalService.getString("channel")); + saveIncrementalService.put("create_time", new Date()); + saveIncrementalService.put("update_time", new Date()); + saveIncrementalService.put("is_valid", 1); + } else { + saveIncrementalService.put("incremental_id", incrementalService.getString("incremental_id")); + saveIncrementalService.put("update_time", new Date()); + } + saveIncrementalService.put("client_id", client.getInteger("client_id")); + saveIncrementalService.put("operator", manager.getString("display_name")); + saveIncrementalService.put("incremental_mode", incrementalService.getInteger("incremental_mode")); + saveIncrementalService.put("incremental_rate_value", incrementalService.getInteger("incremental_mode") == 1 ? incrementalService.getString("incremental_rate_value") : 0); + saveIncrementalService.put("total_incremental_amount", incrementalService.getInteger("incremental_mode") != 1 ? incrementalService.getString("total_incremental_amount") : 0); + if (existIncrementalService == null) { clientIncrementalMapper.save(saveIncrementalService); - }else{ + } else { clientIncrementalMapper.update(saveIncrementalService); } } - public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager){ + public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) { JSONObject client = clientMapper.findClientByMoniker(clientMoniker); - if(client==null){ + if (client == null) { throw new InvalidShortIdException(); } - JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel")); - if(existIncrementalService==null){ + JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel")); + if (existIncrementalService == null) { throw new BadRequestException("Incremental service is not exist"); } - existIncrementalService.put("update_time",new Date()); - existIncrementalService.put("incremental_id",incrementalService.getString("incremental_id")); - existIncrementalService.put("is_valid",incrementalService.getInteger("is_valid")); - existIncrementalService.put("operator",manager.getString("display_name")); + existIncrementalService.put("update_time", new Date()); + existIncrementalService.put("incremental_id", incrementalService.getString("incremental_id")); + existIncrementalService.put("is_valid", incrementalService.getInteger("is_valid")); + existIncrementalService.put("operator", manager.getString("display_name")); clientIncrementalMapper.update(existIncrementalService); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java b/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java index 0bc258cfb..b7e7a3f67 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/web/SignInController.java @@ -60,7 +60,6 @@ public class SignInController { private ManagerTodoNoticeProvider[] managerTodoNoticeProviders; @Resource private ClientManager clientManager; - @Resource private ManagerAccountsService managerAccountsService; @@ -191,6 +190,7 @@ public class SignInController { @PartnerMapping(value = "/current_partner", method = RequestMethod.GET) public JSONObject partnerLoginStatus(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) { + partner.put("has_incremental_setvice",clientManager.partnerIncrementalService(partner.getString("client_moniker")).getJSONArray("all_service").size()>0); return partner; } diff --git a/src/main/ui/index.html b/src/main/ui/index.html index 16eb1a20b..2d9bedac9 100644 --- a/src/main/ui/index.html +++ b/src/main/ui/index.html @@ -1040,7 +1040,7 @@ margin-bottom: 10%;"/> -
  • +
  • R Service
  • diff --git a/src/main/ui/static/incrementalService/partner-incremental-service.js b/src/main/ui/static/incrementalService/partner-incremental-service.js index ad4dcf3d6..529c7799b 100644 --- a/src/main/ui/static/incrementalService/partner-incremental-service.js +++ b/src/main/ui/static/incrementalService/partner-incremental-service.js @@ -26,20 +26,13 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.serviceAll = []; $scope.channelOptions = []; $scope.windowHeight = document.body.clientWidth; - document.getElementsByTagName("body"). - debugger $scope.clientInfo = angular.copy(partner.data); $scope.initDate = function(){ $http.get("/client/partner_info/"+$scope.clientInfo.client_moniker+"/incremental_service").then(function (res) { $scope.serviceAll = res.data.all_service; $scope.serviceAll.forEach(function(service){ - service.logo_url = '/static/images/'+'yangmatou'+'.jpg' + service.logo_url = '/static/images/'+service.channel+'.jpg' }) - for (var i=0;i<5;i++){ - $scope.serviceAll.forEach(function(service){ - service.logo_url = '/static/images/'+'yangmatou'+'.jpg' - }) - } $scope.channelOptions = res.data.incremental_channel; }) } diff --git a/src/main/ui/static/incrementalService/templates/partner_incremental_service.html b/src/main/ui/static/incrementalService/templates/partner_incremental_service.html index 5c82c1f48..759fe5e58 100644 --- a/src/main/ui/static/incrementalService/templates/partner_incremental_service.html +++ b/src/main/ui/static/incrementalService/templates/partner_incremental_service.html @@ -30,19 +30,21 @@ } .img_auto_height_width { - width: 100%; - height: 100%; + width: 75%; + height: 60%; display: flex; align-items: center; justify-content: center; - padding-left: 12%; + padding-left: 32%; text-align: center; + margin-bottom: 30px; } .label-right{ float: right; } .border-show{ margin: 4px 0px; + font-size: 16px; } .service-background:hover{ background: #7C8085; @@ -62,41 +64,52 @@
  • Service List
  • -
    +
    -
    -
    - -
    -
    - -
    -
    - {{service.channel+'小程序'}} -
    -
    -
    -
    - -
    -
    - {{service.incremental_mode==1?'固定手续费':'固定金额扣款'}} -
    -
    -
    -
    - -
    -
    - {{service.incremental_mode==1?service.incremental_rate_value+'%':service.total_incremental_amount}} +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + {{service.channel+'小程序'}} +
    +
    +
    +
    + +
    +
    + {{service.incremental_mode==1?'固定手续费':'固定金额扣款'}} +
    +
    +
    +
    + +
    +
    + {{service.incremental_mode==1?service.incremental_rate_value+'%':service.total_incremental_amount}} +
    +
    +
    +
    + +
    +
    + {{service.is_valid?'启用':'禁用' }} +
    +
    +
    -

    您尚未开通任何增值渠道点击去开通

    \ 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 571f4e043..9fb781d55 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -5295,7 +5295,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.post('/sys/partners/'+params.clientMoniker+'/incremental_service',$scope.model).then(function(res){ commonDialog.alert({ title: 'Success', - content: $scope.isCreate?'Create':'Update'+' Service Successful!', + content: $scope.isCreate?'Create Service Successful!':'Update Service Successful!', type: 'success' }); $scope.ctrl.sending = false; diff --git a/src/main/ui/static/payment/partner/templates/incremental_service_dialog.html b/src/main/ui/static/payment/partner/templates/incremental_service_dialog.html index 2dd5e9ec9..0c2de0935 100644 --- a/src/main/ui/static/payment/partner/templates/incremental_service_dialog.html +++ b/src/main/ui/static/payment/partner/templates/incremental_service_dialog.html @@ -6,10 +6,9 @@
    -
    - +
    @@ -31,31 +30,36 @@ Required Field
    -
    > - +
    +
    - +
    %
    -
    +
    - No less than 0.0% + No less than 0% +
    +
    + No less than 100%
    Required Field
    -
    -
    > - +
    +
    -
    + min="0" maxlength="20" id="total_incremental_amount" required> +
    +
    + Required Field +
    +