From f1f1a62e317e659dcef42a37a818af10638c6163 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Tue, 9 Jan 2018 16:16:00 +0800 Subject: [PATCH] fix add orgmanager Role --- .../payment/manage/dev/bean/SendWechatMessage.java | 9 +++++++++ .../dev/core/impl/WechatMessageServiceImpl.java | 3 +++ .../payment/manage/signin/beans/ManagerInfo.java | 12 ++++++++++++ .../signin/core/impls/ManagerAccountServiceImpl.java | 1 + .../config/devtools/templates/wechat_message.html | 3 +++ .../static/config/managers/templates/managers.html | 1 + .../ui/static/config/managers/templates/modify.html | 3 +++ .../config/managers/templates/new_manager.html | 3 +++ 8 files changed, 35 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java b/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java index 61975d7b6..3e2529319 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/bean/SendWechatMessage.java @@ -24,6 +24,7 @@ public class SendWechatMessage { private boolean bdleader; private boolean riskmanager; private boolean guest; + private boolean orgmanager; public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -157,4 +158,12 @@ public class SendWechatMessage { public void setGuest(boolean guest) { this.guest = guest; } + + public boolean isOrgmanager() { + return orgmanager; + } + + public void setOrgmanager(boolean orgmanager) { + this.orgmanager = orgmanager; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java index e49e5769f..b31e7f614 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/WechatMessageServiceImpl.java @@ -117,6 +117,9 @@ public class WechatMessageServiceImpl implements WechatMessageService { if(sendWechatMessage.isDirector()){ set = getOpenIdSet(set, ManagerRole.DIRECTOR.getMask()); } + if(sendWechatMessage.isOrgmanager()){ + set = getOpenIdSet(set, ManagerRole.ORG_MANAGER.getMask()); + } for(String open_id : set){ object.put("open_id",open_id); sendWecharMessageByOpenId(object); diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java b/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java index 3d62ee532..41eb051e3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/beans/ManagerInfo.java @@ -37,6 +37,7 @@ public class ManagerInfo { private boolean bdleader; private boolean riskmanager; private boolean guest; + private boolean orgmanager; @JSONField(name = "org_id") private Integer orgId; @@ -101,6 +102,9 @@ public class ManagerInfo { if (guest){ role |= ManagerRole.GUEST.getMask(); } + if (orgmanager){ + role |= ManagerRole.ORG_MANAGER.getMask(); + } account.put("role", role); if (insert) { account.put("username", getUsername()); @@ -260,4 +264,12 @@ public class ManagerInfo { public void setGuest(boolean guest) { this.guest = guest; } + + public boolean isOrgmanager() { + return orgmanager; + } + + public void setOrgmanager(boolean orgmanager) { + this.orgmanager = orgmanager; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java index a8a4ef3f9..82413d448 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/ManagerAccountServiceImpl.java @@ -51,6 +51,7 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService { manager.put("bdleader", ManagerRole.BD_LEADER.hasRole(role)); manager.put("riskmanager", ManagerRole.RISK_MANAGER.hasRole(role)); manager.put("guest", ManagerRole.GUEST.hasRole(role)); + manager.put("orgmanager", ManagerRole.ORG_MANAGER.hasRole(role)); } return managers; } diff --git a/src/main/ui/static/config/devtools/templates/wechat_message.html b/src/main/ui/static/config/devtools/templates/wechat_message.html index da0811abb..77d45aed6 100644 --- a/src/main/ui/static/config/devtools/templates/wechat_message.html +++ b/src/main/ui/static/config/devtools/templates/wechat_message.html @@ -83,6 +83,9 @@
+
+ +
diff --git a/src/main/ui/static/config/managers/templates/managers.html b/src/main/ui/static/config/managers/templates/managers.html index 36fa9f08d..7908d970b 100644 --- a/src/main/ui/static/config/managers/templates/managers.html +++ b/src/main/ui/static/config/managers/templates/managers.html @@ -95,6 +95,7 @@ + Modify diff --git a/src/main/ui/static/config/managers/templates/modify.html b/src/main/ui/static/config/managers/templates/modify.html index cf678293b..5faa653ac 100644 --- a/src/main/ui/static/config/managers/templates/modify.html +++ b/src/main/ui/static/config/managers/templates/modify.html @@ -81,6 +81,9 @@ +

diff --git a/src/main/ui/static/config/managers/templates/new_manager.html b/src/main/ui/static/config/managers/templates/new_manager.html index 1fa60ccb9..da4e5fd2d 100644 --- a/src/main/ui/static/config/managers/templates/new_manager.html +++ b/src/main/ui/static/config/managers/templates/new_manager.html @@ -90,6 +90,9 @@ +