|
@@ -21,6 +21,7 @@ import com.jeeplus.common.constant.CommonConstants;
|
|
|
import com.jeeplus.common.redis.RedisUtils;
|
|
|
import com.jeeplus.common.utils.RequestUtils;
|
|
|
import com.jeeplus.sys.domain.*;
|
|
|
+import com.jeeplus.sys.feign.IDictApi;
|
|
|
import com.jeeplus.sys.feign.IOfficeApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.mapper.OfficeMapper;
|
|
@@ -39,10 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
@@ -848,22 +846,65 @@ public class UserService extends ServiceImpl<UserMapper, User> {
|
|
|
if (StringUtils.isBlank(tenantId)) {
|
|
|
tenantId = "10000";
|
|
|
}
|
|
|
- Stream<UserDTO> list = UserUtils.getOnlineUsers ( ).stream ( );
|
|
|
- if ( StrUtil.isNotEmpty ( userDTO.getLoginName ( ) ) ) {
|
|
|
- list = list.filter ( user -> user.getLoginName ( ).contains ( userDTO.getLoginName ( ) ) );
|
|
|
+ if(null != userDTO){
|
|
|
+ Stream<UserDTO> list = UserUtils.getOnlineUsers ( ).stream ( );
|
|
|
+ if ( StrUtil.isNotEmpty ( userDTO.getLoginName ( ) ) ) {
|
|
|
+ list = list.filter ( user -> user.getLoginName ( ).contains ( userDTO.getLoginName ( ) ) );
|
|
|
+
|
|
|
+ }
|
|
|
+ if ( StrUtil.isNotEmpty ( userDTO.getName ( ) ) ) {
|
|
|
+ list = list.filter ( user -> user.getName ( ).contains ( userDTO.getName ( ) ) );
|
|
|
+ }
|
|
|
+ if ( !CommonConstants.DEFAULT_TENANT_ID.equals ( tenantId ) ) { // 非平台租户只显示租户内在线用户
|
|
|
+
|
|
|
+ String finalTenantId = tenantId;
|
|
|
+ list = list.filter (user -> user.getTenantDTO ( ).getId ( ).contains (finalTenantId) );
|
|
|
+
|
|
|
+ }
|
|
|
+ List <UserDTO> users = list.collect ( Collectors.toList ( ) );
|
|
|
+
|
|
|
+ return users;
|
|
|
+ }
|
|
|
+
|
|
|
+ List <UserDTO> users = Lists.newArrayList();
|
|
|
+ return users;
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据登录名和对应租户id查询登陆人员信息
|
|
|
+ * @param tenantId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List <UserDTO> modifyReportEditFlag( String tenantId) {
|
|
|
+ String reportEditFlags = SpringUtil.getBean ( IDictApi.class ).getDictListMapByDict ("report_edit_flag");
|
|
|
+ Map<String,Object> paymentStatusValueDTOs = JSON.parseObject(reportEditFlags, new TypeReference<Map<String,Object>>() {});
|
|
|
|
|
|
+ for (String key : paymentStatusValueDTOs.keySet()) {
|
|
|
+ if("1".equals(key)){
|
|
|
+ SpringUtil.getBean ( IDictApi.class ).updateDictValue ("open", "0");
|
|
|
+ break;
|
|
|
+ }else if("0".equals(key)){
|
|
|
+ SpringUtil.getBean ( IDictApi.class ).updateDictValue ("open", "1");
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- if ( StrUtil.isNotEmpty ( userDTO.getName ( ) ) ) {
|
|
|
- list = list.filter ( user -> user.getName ( ).contains ( userDTO.getName ( ) ) );
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(tenantId)) {
|
|
|
+ tenantId = "10000";
|
|
|
}
|
|
|
- if ( !CommonConstants.DEFAULT_TENANT_ID.equals ( tenantId ) ) { // 非平台租户只显示租户内在线用户
|
|
|
+ redisUtils.delPattern ( "sys:cache:dictMap:*" );
|
|
|
|
|
|
+
|
|
|
+ Stream<UserDTO> list = UserUtils.getOnlineUsers ( ).stream ( );
|
|
|
+ if ( !CommonConstants.DEFAULT_TENANT_ID.equals ( tenantId ) ) { // 非平台租户只显示租户内在线用户
|
|
|
String finalTenantId = tenantId;
|
|
|
list = list.filter (user -> user.getTenantDTO ( ).getId ( ).contains (finalTenantId) );
|
|
|
|
|
|
}
|
|
|
List <UserDTO> users = list.collect ( Collectors.toList ( ) );
|
|
|
-
|
|
|
+ if(null == users){
|
|
|
+ users = Lists.newArrayList();
|
|
|
+ }
|
|
|
return users;
|
|
|
|
|
|
}
|