|
|
|
@ -16,6 +16,7 @@ import com.jianteng.modules.pms.service.EamService; |
|
|
|
import com.jianteng.modules.pms.util.HolidayUtils; |
|
|
|
import com.jianteng.modules.pms.util.SendMessageUtils; |
|
|
|
import com.jianteng.modules.report.dao.ProcedureDao; |
|
|
|
import com.jianteng.modules.sys.entity.SysRoleEntity; |
|
|
|
import com.jianteng.modules.sys.entity.SysSceneDynamicControlModelEntity; |
|
|
|
import com.jianteng.modules.sys.entity.SysUserEntity; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@ -26,6 +27,10 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.function.Predicate; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class EamServiceImpl implements EamService { |
|
|
|
@ -2346,16 +2351,15 @@ public class EamServiceImpl implements EamService { |
|
|
|
throw new RuntimeException("工厂和部门有误!"); |
|
|
|
} |
|
|
|
List<EamAdminData> list = eamMapper.getCheckerList(data); |
|
|
|
// 如果查询条件有部门 |
|
|
|
// if (StringUtils.isNotBlank(data.getDepartmentName())) { |
|
|
|
// // 过滤出含有条件的数据 |
|
|
|
// List<EamAdminData> collect = list.stream() |
|
|
|
// .filter(a -> StringUtils.isNotBlank(a.getDepartmentName())) |
|
|
|
// .filter(b -> b.getDepartmentName().contains(data.getDepartmentName())) |
|
|
|
// .collect(Collectors.toList()); |
|
|
|
// return collect; |
|
|
|
// } |
|
|
|
return list; |
|
|
|
List<EamAdminData> returnList = list.stream() |
|
|
|
.filter(distinctByKey(EamAdminData::getUserId)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return returnList; |
|
|
|
} |
|
|
|
|
|
|
|
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
|
|
|
Map<Object, Boolean> seen = new ConcurrentHashMap<>(); |
|
|
|
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -2863,6 +2867,12 @@ public class EamServiceImpl implements EamService { |
|
|
|
return new PageUtils(resultList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<SysRoleEntity> getUserRoleList() { |
|
|
|
List<SysRoleEntity> list = eamMapper.getUserRoleList(); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 排列树形集合 |
|
|
|
|