Browse Source

工具类

4.0
lip 2 years ago
parent
commit
2863ca08e9
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/user/UserHandler.java
  2. +2
    -2
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/StringUtil.java

+ 1
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/user/UserHandler.java View File

@@ -156,7 +156,7 @@ public class UserHandler {
protected void afterQuery(List<SwMap> listData) { protected void afterQuery(List<SwMap> listData) {
if (pageDataSet._isCurDataSet(DS_UserParty)) { if (pageDataSet._isCurDataSet(DS_UserParty)) {
listData.forEach(sw -> { listData.forEach(sw -> {
sw.put("sup_roles", UserRoleCache.getInstance().getRoleByParty(sw.readLong("sup_id")));
sw.put("sup_roles", StringUtil.join(UserRoleCache.getInstance().getRoleByParty(sw.readLong("sup_id")),","));
sw.put("sup_roles_text", RoleCache.getInstance().getNamesByIds(UserRoleCache.getInstance().getRoleByParty(sw.readLong("sup_id")))); sw.put("sup_roles_text", RoleCache.getInstance().getNamesByIds(UserRoleCache.getInstance().getRoleByParty(sw.readLong("sup_id"))));
}); });
return; return;


+ 2
- 2
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/util/StringUtil.java View File

@@ -240,14 +240,14 @@ public class StringUtil {
* @param delim the delimiter character(s) to use. (null value will join with no delimiter) * @param delim the delimiter character(s) to use. (null value will join with no delimiter)
* @return a String of all values in the list seperated by the delimiter * @return a String of all values in the list seperated by the delimiter
*/ */
public static String join(Collection<String> list, String delim) {
public static String join(Collection<? extends Object> list, String delim) {
if (list == null || list.size() < 1) if (list == null || list.size() < 1)
return null; return null;
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
Iterator i = list.iterator(); Iterator i = list.iterator();


while (i.hasNext()) { while (i.hasNext()) {
buf.append((String) i.next());
buf.append(i.next().toString());
if (i.hasNext()) if (i.hasNext())
buf.append(delim); buf.append(delim);
} }


Loading…
Cancel
Save