直接获取orguser改善
This commit is contained in:
parent
28433c4c59
commit
a7cfe16dc7
Binary file not shown.
@ -900,14 +900,6 @@ public class CoEPALController {
|
|||||||
return we.saveImportCoeWorkspace(wsFileName, replaceChoice, source);
|
return we.saveImportCoeWorkspace(wsFileName, replaceChoice, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 流程资产 选择用户
|
|
||||||
// @Mapping("COE_PAL_WS_USERLIST")
|
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_ws_userlist")
|
|
||||||
public String coePALWSUserList(UserContext me, String users, String removeUserIds) {
|
|
||||||
CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me);
|
|
||||||
return web.toPALWSUserList(users, removeUserIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 停用启用流程资产
|
// 停用启用流程资产
|
||||||
// @Mapping("COE_PAL_WS_STOPOROPEN")
|
// @Mapping("COE_PAL_WS_STOPOROPEN")
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_ws_stoporopen")
|
@Mapping("com.actionsoft.apps.coe.pal_ws_stoporopen")
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationRoleModel;
|
|||||||
import com.actionsoft.bpms.commons.database.RowMap;
|
import com.actionsoft.bpms.commons.database.RowMap;
|
||||||
import com.actionsoft.bpms.commons.database.RowMapper;
|
import com.actionsoft.bpms.commons.database.RowMapper;
|
||||||
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
||||||
|
import com.actionsoft.bpms.org.cache.UserCache;
|
||||||
|
import com.actionsoft.bpms.org.model.UserModel;
|
||||||
import com.actionsoft.bpms.util.DBSql;
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
import com.actionsoft.bpms.util.UUIDGener;
|
import com.actionsoft.bpms.util.UUIDGener;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
@ -12,6 +14,7 @@ import com.actionsoft.exception.AWSDataAccessException;
|
|||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -48,20 +51,30 @@ public class CoeCooperationMemberDao extends DaoObject<CoeCooperationMemberModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取小组的用户
|
* 获取小组的用户 todo
|
||||||
* @param teamId
|
* @param teamId
|
||||||
* @param roleType "0":管理员,"1":设计人员,"2":浏览人员,"3":自定义角色
|
* @param roleType "0":管理员,"1":设计人员,"2":浏览人员,"3":自定义角色
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<String> getCooperationAdminUsers(String teamId, String roleType) {
|
public List<String> getCooperationAdminUsers(String teamId, String roleType) {
|
||||||
String sql = "SELECT m.USERID FROM " + entityName() + " m, " + CoeCooperationRoleModel.DATABASE_ENTITY+ " r, ORGUSER o WHERE m.TEAMID = ? AND m.TEAMID = r.TEAMID AND m.ROLEID = r.ID AND r.ROLETYPE = ? AND o.USERID = m.USERID AND o.CLOSED = '0' ORDER BY o.USERNAME";
|
String sql = "SELECT m.USERID FROM " + entityName() + " m, " + CoeCooperationRoleModel.DATABASE_ENTITY+ " r WHERE m.TEAMID = ? AND m.TEAMID = r.TEAMID AND m.ROLEID = r.ID AND r.ROLETYPE = ? ";
|
||||||
try {
|
try {
|
||||||
return DBSql.query(sql, new RowMapper<String>() {
|
List<String> list = DBSql.query(sql, new RowMapper<String>() {
|
||||||
@Override
|
@Override
|
||||||
public String mapRow(ResultSet rs, int arg1) throws SQLException {
|
public String mapRow(ResultSet rs, int arg1) throws SQLException {
|
||||||
return rs.getString(1);
|
return rs.getString(1);
|
||||||
}
|
}
|
||||||
}, new Object[]{teamId, roleType});
|
}, new Object[]{teamId, roleType});
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
for (String userId : list) {
|
||||||
|
UserModel user = UserCache.getModel(userId);
|
||||||
|
if (user == null || user.isClosed()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result.add(userId);
|
||||||
|
}
|
||||||
|
Collections.sort(result);
|
||||||
|
return result;
|
||||||
} catch (AWSDataAccessException e) {
|
} catch (AWSDataAccessException e) {
|
||||||
e.printStackTrace(System.err);
|
e.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -239,7 +239,7 @@ public class SynchronousOrgJob implements IJob {
|
|||||||
JSONObject definition = JSONObject.parseObject(define);
|
JSONObject definition = JSONObject.parseObject(define);
|
||||||
JSONObject elements = definition.getJSONObject("elements");
|
JSONObject elements = definition.getJSONObject("elements");
|
||||||
|
|
||||||
|
// todo
|
||||||
List<RowMap> orgdepartmentList = DBSql.getMaps(conn, "select DISTINCT(POSITION_NAME) from ORGUSER WHERE DEPARTMENTID=?", departmentId);
|
List<RowMap> orgdepartmentList = DBSql.getMaps(conn, "select DISTINCT(POSITION_NAME) from ORGUSER WHERE DEPARTMENTID=?", departmentId);
|
||||||
|
|
||||||
JSONArray shapes = new JSONArray();
|
JSONArray shapes = new JSONArray();
|
||||||
|
|||||||
@ -10,10 +10,14 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.team.user.dao.CoeUser;
|
||||||
import com.actionsoft.bpms.commons.database.RowMapper;
|
import com.actionsoft.bpms.commons.database.RowMapper;
|
||||||
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
||||||
import com.actionsoft.bpms.commons.mvc.model.PlatformMetaModelBean;
|
import com.actionsoft.bpms.commons.mvc.model.PlatformMetaModelBean;
|
||||||
import com.actionsoft.bpms.commons.pagination.SQLPagination;
|
import com.actionsoft.bpms.commons.pagination.SQLPagination;
|
||||||
|
import com.actionsoft.bpms.org.cache.UserCache;
|
||||||
|
import com.actionsoft.bpms.org.model.UserModel;
|
||||||
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
import com.actionsoft.bpms.server.conf.server.AWSServerConf;
|
import com.actionsoft.bpms.server.conf.server.AWSServerConf;
|
||||||
import com.actionsoft.bpms.util.DBSql;
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
import com.actionsoft.bpms.util.UUIDGener;
|
import com.actionsoft.bpms.util.UUIDGener;
|
||||||
@ -426,6 +430,7 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
|
|||||||
if (!isUp) {
|
if (!isUp) {
|
||||||
upOrDown = "DESC";
|
upOrDown = "DESC";
|
||||||
}
|
}
|
||||||
|
// todo
|
||||||
String sql = "SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0" + " ORDER BY " + sortFiled + " " + upOrDown;
|
String sql = "SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0" + " ORDER BY " + sortFiled + " " + upOrDown;
|
||||||
if (isPaging) {
|
if (isPaging) {
|
||||||
sql = SQLPagination.getPaginitionSQL(sql, start, limit);
|
sql = SQLPagination.getPaginitionSQL(sql, start, limit);
|
||||||
@ -446,6 +451,7 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
|
|||||||
public List<CoeUserModel> searchUser(String name) {
|
public List<CoeUserModel> searchUser(String name) {
|
||||||
String sortFiled = CoeUserModel.FIELD_USER_NAME;
|
String sortFiled = CoeUserModel.FIELD_USER_NAME;
|
||||||
String upOrDown = "ASC";
|
String upOrDown = "ASC";
|
||||||
|
// todo
|
||||||
StringBuilder sql = new StringBuilder("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID ");
|
StringBuilder sql = new StringBuilder("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID ");
|
||||||
String namelike = "";
|
String namelike = "";
|
||||||
if (StringUtil.containSpecialChar(name)) {
|
if (StringUtil.containSpecialChar(name)) {
|
||||||
@ -479,13 +485,16 @@ public class CoeWorkSpace extends DaoObject<PlatformMetaModelBean> {
|
|||||||
// 获取所有的记录条数
|
// 获取所有的记录条数
|
||||||
|
|
||||||
public int getCoeUserCount() {
|
public int getCoeUserCount() {
|
||||||
try {
|
List<CoeUserModel> list = new CoeUser().getCoeUsers();
|
||||||
String sql = "SELECT COUNT(*) AS number FROM APP_ACT_COE_USER cu ,ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0";
|
int count = 0;
|
||||||
return DBSql.getInt(sql, "number");
|
for (CoeUserModel model : list) {
|
||||||
} catch (AWSDataAccessException e) {
|
UserModel user = UserCache.getModel(model.getUserId());
|
||||||
e.printStackTrace();
|
if (user == null || user.isClosed()) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
return 0;
|
count++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getCoeWorkSpaceVersions(String versionId) {
|
public Map<String, Object> getCoeWorkSpaceVersions(String versionId) {
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
|||||||
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
||||||
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
|
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
|
||||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||||
|
import com.actionsoft.bpms.org.cache.UserCache;
|
||||||
import com.actionsoft.bpms.org.model.UserModel;
|
import com.actionsoft.bpms.org.model.UserModel;
|
||||||
import com.actionsoft.bpms.server.UserContext;
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
import com.actionsoft.bpms.server.fs.DCContext;
|
import com.actionsoft.bpms.server.fs.DCContext;
|
||||||
@ -1654,50 +1655,6 @@ public class CoeWorkSpaceWeb extends ActionWeb {
|
|||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程库属性-选择用户页面
|
|
||||||
*
|
|
||||||
* @param users
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String toPALWSUserList(String users, String removeUserIds) {
|
|
||||||
String[] userArray = null;
|
|
||||||
if (users != null) {
|
|
||||||
userArray = users.split(",");
|
|
||||||
}
|
|
||||||
|
|
||||||
Map allUsers = CoeUserDaoFactory.createUser().getInstanceWithUserName(CoeUserModel.FIELD_ID);
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
|
||||||
for (int i = 0; allUsers != null && i < allUsers.size(); i++) {
|
|
||||||
CoeUserModel userModel = (CoeUserModel) allUsers.get(new Integer(i));
|
|
||||||
if (removeUserIds != null && removeUserIds.contains(userModel.getUserId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String isAdmin = userModel.getIsAdmin() == 0 ? "否" : "是";
|
|
||||||
String isChecked = "";
|
|
||||||
if (userArray != null && isExist(userArray, userModel.getUserId())) {
|
|
||||||
isChecked = "checked";
|
|
||||||
} else if (userArray == null || userArray.length == 0) {
|
|
||||||
if (userModel.getUserId().equals(_uc.getUID())) {
|
|
||||||
isChecked = "checked";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
JSONObject object = new JSONObject();
|
|
||||||
object.put("id", userModel.getUserId());
|
|
||||||
object.put("userName", userModel.getUserName());
|
|
||||||
object.put("isChecked", isChecked);
|
|
||||||
object.put("isAdmin", isAdmin);
|
|
||||||
object.put("name", userModel.getUserId() + "<" + userModel.getUserName() + ">");
|
|
||||||
jsonArray.add(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
|
||||||
macroLibraries.put("sid", super.getContext().getSessionId());
|
|
||||||
macroLibraries.put("userList", jsonArray);
|
|
||||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.ws.userlist.html", macroLibraries);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断某个id是否在数组中
|
* 判断某个id是否在数组中
|
||||||
*
|
*
|
||||||
@ -1910,12 +1867,16 @@ public class CoeWorkSpaceWeb extends ActionWeb {
|
|||||||
Map allUsers = CoeUserDaoFactory.createUser().getInstanceWithUserName(CoeUserModel.FIELD_ID);
|
Map allUsers = CoeUserDaoFactory.createUser().getInstanceWithUserName(CoeUserModel.FIELD_ID);
|
||||||
for (int i = 0; allUsers != null && i < allUsers.size(); i++) {
|
for (int i = 0; allUsers != null && i < allUsers.size(); i++) {
|
||||||
CoeUserModel userModel = (CoeUserModel) allUsers.get(new Integer(i));
|
CoeUserModel userModel = (CoeUserModel) allUsers.get(new Integer(i));
|
||||||
|
UserModel user = UserCache.getModel(userModel.getUserId());
|
||||||
|
if (user == null || user.isClosed()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (userModel.getIsAdmin() == 0 || (HighSecurityUtil.isON() && HighSecurityUtil.isSecAdminUser(userModel.getUserId()))) {
|
if (userModel.getIsAdmin() == 0 || (HighSecurityUtil.isON() && HighSecurityUtil.isSecAdminUser(userModel.getUserId()))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
object.put("value", userModel.getUserId());
|
object.put("value", userModel.getUserId());
|
||||||
object.put("label", userModel.getUserId() + "<" + userModel.getUserName() + ">");
|
object.put("label", userModel.getUserId() + "<" + user.getUserName() + ">");
|
||||||
object.put("path", SDK.getORGAPI().getDepartmentByUser(userModel.getUserId()).getPathNameI18NOfCache());
|
object.put("path", SDK.getORGAPI().getDepartmentByUser(userModel.getUserId()).getPathNameI18NOfCache());
|
||||||
adminOptions.add(object);
|
adminOptions.add(object);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,26 +50,6 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
// super.setEntityName(CoeUserModel.DATABASE_ENTITY);
|
// super.setEntityName(CoeUserModel.DATABASE_ENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlatformMetaModelBean getInstanceById(String id) {
|
|
||||||
CoeUserModel model = new CoeUserModel();
|
|
||||||
try {
|
|
||||||
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", o." + model.FIELD_USER_NAME + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID AND cu." + model.FIELD_ID + "=?";
|
|
||||||
return DBSql.getObject(sql, new RowMapper<CoeUserModel>() {
|
|
||||||
@Override
|
|
||||||
public CoeUserModel mapRow(ResultSet rs, int arg1) throws SQLException {
|
|
||||||
CoeUserModel model = new CoeUserModel();
|
|
||||||
model.setId(rs.getString(model.FIELD_ID));
|
|
||||||
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
|
|
||||||
model.setUserId(rs.getString(model.FIELD_USER_ID) + "<" + rs.getString(model.FIELD_USER_NAME) + ">");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
}, id);
|
|
||||||
} catch (Exception sqle) {
|
|
||||||
sqle.printStackTrace();
|
|
||||||
}
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户Id获取用户信息
|
* 根据用户Id获取用户信息
|
||||||
*
|
*
|
||||||
@ -78,8 +58,12 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
*/
|
*/
|
||||||
public PlatformMetaModelBean getInstanceByUserId(String userId) {
|
public PlatformMetaModelBean getInstanceByUserId(String userId) {
|
||||||
CoeUserModel model = new CoeUserModel();
|
CoeUserModel model = new CoeUserModel();
|
||||||
|
UserModel userModel = UserCache.getModel(userId);
|
||||||
|
if (userModel == null) {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", o." + model.FIELD_USER_NAME + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID AND cu." + model.FIELD_USER_ID + "=?";
|
String sql = "SELECT cu." + model.FIELD_ID + ", cu." + model.FIELD_USER_ID + ", cu." + model.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu WHERE cu." + model.FIELD_USER_ID + "=?";
|
||||||
return DBSql.getObject(sql, new RowMapper<CoeUserModel>() {
|
return DBSql.getObject(sql, new RowMapper<CoeUserModel>() {
|
||||||
@Override
|
@Override
|
||||||
public CoeUserModel mapRow(ResultSet rs, int arg1) throws SQLException {
|
public CoeUserModel mapRow(ResultSet rs, int arg1) throws SQLException {
|
||||||
@ -87,7 +71,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
model.setId(rs.getString(model.FIELD_ID));
|
model.setId(rs.getString(model.FIELD_ID));
|
||||||
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
|
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
|
||||||
model.setUserId(rs.getString(model.FIELD_USER_ID));
|
model.setUserId(rs.getString(model.FIELD_USER_ID));
|
||||||
model.setUserName(rs.getString(model.FIELD_USER_NAME));
|
model.setUserName(userModel.getUserName());
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}, userId);
|
}, userId);
|
||||||
@ -153,7 +137,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
sorttype = "DESC";
|
sorttype = "DESC";
|
||||||
}
|
}
|
||||||
StringBuilder sqlbufer = new StringBuilder();
|
StringBuilder sqlbufer = new StringBuilder();
|
||||||
sqlbufer.append(sql.append("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", o." + CoeUserModel.FIELD_USER_NAME + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu, ORGUSER o WHERE cu.USERID = o.USERID and o.CLOSED = 0 ").toString());
|
sqlbufer.append(sql.append("SELECT cu." + CoeUserModel.FIELD_ID + ", cu." + CoeUserModel.FIELD_USER_ID + ", cu." + CoeUserModel.FIELD_IS_ADMIN + " FROM " + CoeUserModel.DATABASE_ENTITY + " cu ").toString());
|
||||||
if ((sortname != null) && (!sortname.equals(""))) {
|
if ((sortname != null) && (!sortname.equals(""))) {
|
||||||
sqlbufer.append(" ORDER BY cu.").append(sortname).append(" ").append(sorttype);
|
sqlbufer.append(" ORDER BY cu.").append(sortname).append(" ").append(sorttype);
|
||||||
}
|
}
|
||||||
@ -164,7 +148,7 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
model.setId(rs.getString(model.FIELD_ID));
|
model.setId(rs.getString(model.FIELD_ID));
|
||||||
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
|
model.setIsAdmin(rs.getInt(model.FIELD_IS_ADMIN));
|
||||||
model.setUserId(rs.getString(model.FIELD_USER_ID));
|
model.setUserId(rs.getString(model.FIELD_USER_ID));
|
||||||
model.setUserName(rs.getString(model.FIELD_USER_NAME));
|
model.setUserName("");
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -260,14 +244,19 @@ public class CoeUser extends DaoObject<PlatformMetaModelBean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean validateIsAccessCOE(String userid) {
|
public boolean validateIsAccessCOE(String userid) {
|
||||||
String sql = "select u1.USERID from APP_ACT_COE_USER u1,ORGUSER u2 where u1.USERID=? and u1.USERID=u2.USERID and u2.CLOSED=0";
|
String sql = "select u1.USERID from APP_ACT_COE_USER u1 where u1.USERID=?";
|
||||||
String id = DBSql.getObject(sql, new RowMapper<String>() {
|
String id = DBSql.getObject(sql, new RowMapper<String>() {
|
||||||
@Override
|
@Override
|
||||||
public String mapRow(ResultSet rs, int arg1) throws SQLException {
|
public String mapRow(ResultSet rs, int arg1) throws SQLException {
|
||||||
return rs.getString(1);
|
return rs.getString(1);
|
||||||
}
|
}
|
||||||
}, userid);
|
}, userid);
|
||||||
if (id != null && !"".equals(id)) {
|
|
||||||
|
if (UtilString.isNotEmpty(id)) {
|
||||||
|
UserModel user = UserCache.getModel(id);
|
||||||
|
if (user == null || user.isClosed()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user