Merge remote-tracking branch 'origin/develop' into develop

master
yuan 7 years ago
commit 2b377006cb

@ -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;
}
}

@ -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);

@ -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;
}
}

@ -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;
}

@ -32,7 +32,10 @@ import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* account service for sign in
@ -64,14 +67,11 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
@Cacheable(value = ":login:managers:", key = "''+#accountId")
public JSONObject getManager(String accountId) {
JSONObject manager = managerMapper.findById(accountId);
JSONObject org = null;
if (manager == null) {
throw new ForbiddenException("用户不存在或已禁用");
}
if (manager.getInteger("org_id") != null) {
org = orgMapper.findOne(manager.getIntValue("org_id"));
manager.put("org", org);
manager.put("parent_org_id",org.getIntValue("parent_org_id"));
manager.put("org", orgMapper.findOne(manager.getIntValue("org_id")));
}
List<JSONObject> funcs = permissionManager.listUserFunctions(manager.getIntValue("role"));
List<String> funcIds = new ArrayList<>();
@ -90,36 +90,12 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
modules.put(module, mod);
}
}
if(org != null && org.getIntValue("type")==0 && org.getString("parent_org_id") != null){
if(modules.containsKey("org")){
deleteOrgModule(modules,"org");
}
if(modules.containsKey("manager_accounts")){
deleteOrgModule(modules,"manager_accounts");
}
}
if(org != null && org.getIntValue("type")==0 && org.getString("parent_org_id") == null){
if(modules.containsKey("manager_accounts")){
deleteOrgModule(modules,"manager_accounts");
}
}
manager.put("available_func_ids", funcIds);
manager.put("available_func_names", funcNames);
manager.put("modules", modules.values());
manager.put("module_names", modules.keySet());
return manager;
}
private void deleteOrgModule(Map<String, JSONObject> modules,String module){
Iterator iterator = modules.keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
if (module.equals(key)) {
iterator.remove();
modules.remove(key);
}
}
}
@Override
@Cacheable(value = ":login:clients:", key = "''+#accountId")

@ -83,6 +83,9 @@
<div class="checkbox-inline">
<label><input type="checkbox" ng-model="params.guest" name="params.guest">GUEST:观察员</label>
</div>
<div class="checkbox-inline">
<label><input type="checkbox" ng-model="params.orgmanager" name="params.orgmanager">ORG_MANAGER:代理商管理</label>
</div>
<div class="form-group">
<label>Title</label>
<input ng-model="params.r_title" class="form-control" type="text" required/>

@ -95,6 +95,7 @@
<i class="fa fa-male" title="BD Leader" ng-class="{'text-green':manager.bdleader,'text-gray':!manager.bdleader}"></i>
<i class="fa fa-user" title="Risk Manager" ng-class="{'text-green':manager.riskmanager,'text-gray':!manager.riskmanager}"></i>
<i class="fa fa-tripadvisor" title="GUEST" ng-class="{'text-green':manager.guest,'text-gray':!manager.guest}"></i>
<i class="fa fa-user-plus" title="Org Manager" ng-class="{'text-green':manager.orgmanager,'text-gray':!manager.orgmanager}"></i>
</td>
<td>
<a role="button" class="text-bold text-primary" ng-click="modifyManager(manager)">Modify</a>

@ -81,6 +81,9 @@
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.riskmanager" name="riskmanager">Risk Manager
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="orgmanager">Org Manager
</label>
</p>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && !manager.sitemanager && orgs!=null">

@ -90,6 +90,9 @@
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.guest" name="guest">Guest
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="guest">Org Manager
</label>
</p>
</div>
<div class="form-group" ng-if="('1'|withRole) && !manager.admin && !manager.operator && orgs != null">

Loading…
Cancel
Save