liuxm
2024-05-16 fffea208c02105c37de1a15de81f2b868fa70ab5
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/privilege/PriSv.java
@@ -8,8 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@@ -37,10 +36,17 @@
        return rsVo ;
    }
    public Map<String, List<BaPrivilege>> selectByType(){
    public List<Map<String, Object>> selectByType(){
        List<BaPrivilege> priList = dao.selectAll();
        Map<String, List<BaPrivilege>> map = priList.stream()
                .collect(Collectors.groupingBy(BaPrivilege::getTypeName));
        return map;
        List<Map<String,Object>> resultList=new ArrayList<>();
        map.forEach((key, value) -> {
            Map<String, Object> temp = new HashMap<>();
            temp.put("name", key);
            temp.put("list", value);
            resultList.add(temp);
        });
        return resultList;
    }
}