|
@ -23,6 +23,7 @@ import com.yihu.jw.util.date.DateUtil;
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
import com.yihu.utils.security.MD5;
|
|
import com.yihu.utils.security.MD5;
|
|
|
|
import org.apache.axis.utils.Admin;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@ -444,7 +445,8 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
List<OrgTree> orgList = new ArrayList<>();
|
|
List<OrgTree> orgList = new ArrayList<>();
|
|
// 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
|
|
// 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
|
|
if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
|
|
|
|
|
|
String admin ="admin";
|
|
|
|
if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(admin,roleId)){
|
|
StringBuilder sql = new StringBuilder("SELECT " +
|
|
StringBuilder sql = new StringBuilder("SELECT " +
|
|
" tree.* " +
|
|
" tree.* " +
|
|
" FROM " +
|
|
" FROM " +
|
|
@ -498,8 +500,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
public JSONObject orgChoiceInfo(String saasid,String userId,String roleId) throws IOException {
|
|
public JSONObject orgChoiceInfo(String saasid,String userId,String roleId) throws IOException {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
List<OrgTree> orgList = new ArrayList<>();
|
|
List<OrgTree> orgList = new ArrayList<>();
|
|
|
|
String admin = "admin";
|
|
// 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
|
|
// 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
|
|
if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
|
|
|
|
|
|
if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(admin,roleId)){
|
|
StringBuilder sql = new StringBuilder("SELECT tree.* FROM org_tree tree, base_org org, base_org_saas saas WHERE org.code = saas.org_code and 'null'= '{saasid}';");
|
|
StringBuilder sql = new StringBuilder("SELECT tree.* FROM org_tree tree, base_org org, base_org_saas saas WHERE org.code = saas.org_code and 'null'= '{saasid}';");
|
|
// StringBuilder sql = new StringBuilder("SELECT tree.* FROM base_org base , org_tree tree WHERE base.`code` = tree.code ");
|
|
// StringBuilder sql = new StringBuilder("SELECT tree.* FROM base_org base , org_tree tree WHERE base.`code` = tree.code ");
|
|
orgList = jdbcTemplate.query(sql.toString().replace("{saasid}","null"),new BeanPropertyRowMapper(OrgTree.class));
|
|
orgList = jdbcTemplate.query(sql.toString().replace("{saasid}","null"),new BeanPropertyRowMapper(OrgTree.class));
|