@ -11,6 +11,7 @@ import weaver.conn.RecordSet;
import weaver.general.Util ;
import weaver.hrm.company.DepartmentComInfo ;
import java.text.DecimalFormat ;
import java.time.LocalDate ;
import java.time.Period ;
import java.time.YearMonth ;
@ -31,9 +32,9 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public TreeSe t< PortalTopVO > getPortalTop ( ) {
public LinkedLis t< PortalTopVO > getPortalTop ( ) {
RecordSet rs = new RecordSet ( ) ;
TreeSet< PortalTopVO > portalTopVOList = new TreeSe t< > ( ) ;
LinkedList< PortalTopVO > portalTopVOList = new LinkedLis t< > ( ) ;
rs . executeQuery ( "select count(1) as count from hrmresource where status < 4" ) ;
rs . next ( ) ;
@ -46,12 +47,14 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
while ( rs . next ( ) ) {
birthdayList . add ( Util . null2String ( rs . getString ( "birthday" ) ) ) ;
}
DecimalFormat df = new DecimalFormat ( "#.00" ) ;
double averageAge = birthdayList . stream ( )
. map ( CommonUtils : : parseLocalDate )
. mapToInt ( CommonUtils : : calculateAge )
. average ( )
. orElse ( 0 ) ;
portalTopVOList . add ( PortalTopVO . builder ( ) . title ( "平均年龄" ) . count ( averageAge ) . build ( ) ) ;
String avgAge = df . format ( averageAge ) ;
portalTopVOList . add ( PortalTopVO . builder ( ) . title ( "平均年龄" ) . count ( avgAge ) . build ( ) ) ;
String startMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateStartOfMonth ( YearMonth . now ( ) ) ) ;
String endMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateEndOfMonth ( YearMonth . now ( ) ) ) ;
@ -66,29 +69,26 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getPortalDepartment ( ) {
RecordSet rs = new RecordSet ( ) ;
TreeSet< String > xData = new TreeSe t< > ( ) ;
TreeSet< Integer > yData = new TreeSe t< > ( ) ;
LinkedList< String > xData = new LinkedLis t< > ( ) ;
LinkedList< Integer > yData = new LinkedLis t< > ( ) ;
List < Integer > ids = new ArrayList < > ( ) ;
rs . executeQuery ( "select id,departmentname from hrmdepartment where supdepid = 0 ") ;
rs . executeQuery ( "select id,departmentname from hrmdepartment where supdepid = 0 and (canceled = 0 or canceled is null) ") ;
while ( rs . next ( ) ) {
xData . add ( Util . null2String ( rs . getString ( "departmentname" ) ) ) ;
ids . add ( Util . getIntValue ( rs . getString ( "id" ) ) ) ;
}
List < DepartmentParam > deptList = new ArrayList < > ( ) ;
rs . executeQuery ( "select departmentid,count(1) AS count from hrmresource where status < 4 and departmentid in (" + StringUtils . join ( ids , "," ) + ") group by departmentid" ) ;
rs . executeQuery ( "SELECT d.id, CASE WHEN t.count IS NULL THEN 0 ELSE t.count END AS num \n" +
" FROM hrmdepartment d left join (SELECT departmentid, COUNT(1) AS count FROM hrmresource where status < 4 GROUP BY departmentid) t ON d.id = t.departmentid \n" +
" where d.id in (" + StringUtils . join ( ids , "," ) + ")" ) ;
while ( rs . next ( ) ) {
deptList . add ( DepartmentParam . builder ( ) . departmentId ( Util . getIntValue ( rs . getString ( "departmentid" ) ) ) . count ( Util . getIntValue ( rs . getString ( "count" ) ) ) . build ( ) ) ;
int num = Util . getIntValue ( rs . getString ( "num" ) ) ;
yData . add ( num ) ;
deptList . add ( DepartmentParam . builder ( ) . departmentId ( Util . getIntValue ( rs . getString ( "id" ) ) ) . count ( num ) . build ( ) ) ;
}
ids . forEach ( item - > deptList . forEach ( dept - > {
if ( dept . getDepartmentId ( ) . equals ( item ) ) {
yData . add ( dept . getCount ( ) ) ;
} else {
yData . add ( 0 ) ;
}
} ) ) ;
int max = Collections . max ( yData ) ;
int ceil = ( int ) Math . ceil ( ( double ) max / 5 ) ;
@ -108,16 +108,18 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getPortalSubCompany ( ) {
RecordSet rs = new RecordSet ( ) ;
TreeSet< Integer > yData = new TreeSe t< > ( ) ;
LinkedList< Integer > yData = new LinkedLis t< > ( ) ;
List < YearMonth > yearMonths = CommonDateUtil . getYearMonths ( LocalDate . now ( ) ) ;
yearMonths . forEach ( yearMonth - > {
String startMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateStartOfMonth ( yearMonth ) ) ;
String endMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateEndOfMonth ( yearMonth ) ) ;
rs . executeQuery ( "select count(1) as sum from hrmresource where status < 4 and companystartdate >= ? and companystartdate <= ? " , startMonth , endMonth ) ;
rs . next ( ) ;
Integer sum = Util . getIntValue ( rs . getString ( "sum" ) , 0 ) ;
yData . add ( sum ) ;
rs . executeQuery ( "select count(1) as sum from hrmresource where status < 4 and companystartdate <= ?" , endMonth ) ;
if ( rs . next ( ) ) {
Integer sum = Util . getIntValue ( rs . getString ( "sum" ) , 0 ) ;
yData . add ( sum ) ;
}
} ) ;
int max = Collections . max ( yData ) ;
@ -137,30 +139,27 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getPortalEthnic ( ) {
RecordSet rs = new RecordSet ( ) ;
List < String > colorList = Arrays . asList ( "#6e94f3" , "#83d8ae" , "#697695" , "#8ac9e9" , "#faf0e6" , "#7cfc00" , "#ao20f0" , "#9933fa" );
TreeSet< SeriesParam > seriesData = new TreeSe t< > ( ) ;
TreeSet< String > nameSet = new TreeSe t< > ( ) ;
List < String > colorList = Arrays . asList ( "#6e94f3" , "#83d8ae" , "#697695" , "#8ac9e9" , "#faf0e6" , "#7cfc00" , "#ao20f0" , "#9933fa" ,"#c0ff3e" , "#00ced1" , "#ffe4c4" , "#cd6090" );
LinkedList< SeriesParam > seriesData = new LinkedLis t< > ( ) ;
LinkedList< String > nameSet = new LinkedLis t< > ( ) ;
rs . executeQuery ( "select distinct folk,count(1) as sums from hrmresource where status < 4 \n" +
" and folk is not null group by folk" ) ;
int index = 0 ;
while ( rs . next ( ) ) {
if ( index > colorList . size ( ) ) {
index = 0 ;
}
index + + ;
String name = Util . null2String ( rs . getString ( "name" ) ) ;
Random random = new Random ( ) ;
String color = colorList . get ( random . nextInt ( colorList . size ( ) ) ) ;
String name = Util . null2String ( rs . getString ( "folk" ) ) ;
seriesData . add ( SeriesParam . builder ( ) . value ( Util . getIntValue ( rs . getString ( "sums" ) ) )
. name ( name ) . color ( color List. get ( index ) ) . build ( ) ) ;
. name ( name ) . color ( color ) . build ( ) ) ;
nameSet . add ( name ) ;
}
TreeSe t< String > legendDataFirst = null ;
LinkedLis t< String > legendDataFirst = null ;
if ( nameSet . size ( ) > 2 ) {
int splitSize = nameSet . size ( ) / 2 ;
legendDataFirst = nameSet . stream ( )
. collect ( Collectors . partitioningBy ( e - > nameSet . headSet( e ) . size ( ) < splitSize ,
Collectors . toCollection ( TreeSe t: : new ) ) )
. collect ( Collectors . partitioningBy ( e - > nameSet . indexOf( e ) < splitSize ,
Collectors . toCollection ( LinkedLis t: : new ) ) )
. get ( false ) ;
nameSet . removeAll ( legendDataFirst ) ;
}
@ -176,51 +175,60 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getHomePlace ( ) {
RecordSet rs = new RecordSet ( ) ;
List < String > colorList = Arrays . asList ( "#ao20f0" , "#8ac9e9" , "#697695" , "#83d8ae" , "#faf0e6" , "#7cfc00" , "#6e94f3" , "#9933fa" );
TreeSet< SeriesParam > seriesData = new TreeSe t< > ( ) ;
TreeSet< String > legendData = new TreeSe t< > ( ) ;
List < String > colorList = Arrays . asList ( "#ao20f0" , "#8ac9e9" , "#697695" , "#83d8ae" , "#faf0e6" , "#7cfc00" , "#6e94f3" , "#9933fa" ,"#c0ff3e" , "#00ced1" , "#ffe4c4" , "#cd6090" );
LinkedList< SeriesParam > seriesData = new LinkedLis t< > ( ) ;
LinkedList< String > legendData = new LinkedLis t< > ( ) ;
rs . executeQuery ( "select h.locationid,l.locationname,count(1) as num from hrmresource h\n" +
" left join hrmlocations l on h.locationid = l.id\n" +
" where h.status < 4 and h.locationid is not null group by h.locationid ") ;
" where h.status < 4 and h.locationid is not null group by h.locationid ,l.locationname ") ;
while ( rs . next ( ) ) {
String locationname = Util . null2String ( rs . getString ( "locationname" ) ) ;
legendData . add ( locationname ) ;
//seriesData.add(SeriesParam.builder().value(Util.getIntValue(rs.getString("num"))).name(locationname).color(colorList.get(new Random(colorList.size()))));
Random random = new Random ( ) ;
String color = colorList . get ( random . nextInt ( colorList . size ( ) ) ) ;
seriesData . add ( SeriesParam . builder ( ) . value ( Util . getIntValue ( rs . getString ( "num" ) ) ) . name ( locationname ) . color ( color ) . build ( ) ) ;
}
return null ;
List < Integer > values = seriesData . stream ( ) . map ( SeriesParam : : getValue ) . collect ( Collectors . toList ( ) ) ;
int percentage = values . stream ( ) . mapToInt ( Integer : : intValue ) . sum ( ) ;
seriesData . forEach ( item - > item . setValue ( item . getValue ( ) / percentage ) ) ;
return OptionVO . builder ( )
. titleText ( "归属地分析" )
. legendDataFirst ( legendData )
. seriesData ( seriesData )
. build ( ) ;
}
@Override
public OptionVO getEducational ( ) {
RecordSet rs = new RecordSet ( ) ;
List < String > colorList = Arrays . asList ( "#ee8164" , "#f19c45" , "#6fcecf" , "#507ef7" , "#faf0e6" , "#7cfc00" , "#ao20f0" , "#9933fa" ) ;
TreeSet < SeriesParam > seriesData = new TreeSet < > ( ) ;
TreeSet < String > nameSet = new TreeSet < > ( ) ;
LinkedList< SeriesParam > seriesData = new LinkedLis t< > ( ) ;
LinkedList< String > nameSet = new LinkedLis t< > ( ) ;
rs . executeQuery ( "select distinct h.educationlevel,count(1) as sum,d.name from hrmresource h\n" +
"left join hrmeducationlevel d on h.educationlevel = d.id where status < 4 \n" +
"and h.educationlevel is not null and d.name is not null group by h.educationlevel ") ;
"and h.educationlevel is not null and d.name is not null group by h.educationlevel ,d.name ") ;
int index = 0 ;
while ( rs . next ( ) ) {
if ( index > colorList . size ( ) ) {
index = 0 ;
}
index + + ;
String name = Util . null2String ( rs . getString ( "name" ) ) ;
if ( name . contains ( "~" ) ) {
name = chineseSubstringExample ( name ) ;
}
String name = Util . formatMultiLang ( Util . null2String ( rs . getString ( "name" ) ) ) ;
seriesData . add ( SeriesParam . builder ( ) . value ( Util . getIntValue ( rs . getString ( "sum" ) ) )
. name ( name ) . color ( colorList . get ( index ) ) . build ( ) ) ;
nameSet . add ( name ) ;
}
TreeSet< String > legendDataFirst = new TreeSe t< > ( ) ;
LinkedList< String > legendDataFirst = new LinkedLis t< > ( ) ;
if ( nameSet . size ( ) > 2 ) {
treeSetSplitExample( legendDataFirst , nameSet ) ;
legendDataFirst = treeSetSplitExample( nameSet ) ;
}
return OptionVO . builder ( )
@ -234,7 +242,7 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getSurname ( ) {
RecordSet rs = new RecordSet ( ) ;
TreeSet< SeriesParam > seriesData = new TreeSe t< > ( ) ;
LinkedList< SeriesParam > seriesData = new LinkedLis t< > ( ) ;
List < SurnameParam > surnameList = new ArrayList < > ( ) ;
rs . executeQuery ( "select companyworkyear,count(1) as sum from hrmresource where status < 4 " +
@ -252,10 +260,12 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
int percentage = statisticsList . stream ( ) . mapToInt ( Integer : : intValue ) . sum ( ) ;
List < Integer > newList = statisticsList . stream ( )
. map ( num - > num / percentage )
. map ( num - > ( num * 100 ) / percentage )
. collect ( Collectors . toList ( ) ) ;
newList . stream ( ) . map ( count - > seriesData . add ( SeriesParam . builder ( ) . value ( count ) . build ( ) ) ) ;
newList . forEach ( count - > {
seriesData . add ( SeriesParam . builder ( ) . value ( count ) . build ( ) ) ;
} ) ;
return OptionVO . builder ( )
. titleText ( "司龄统计" )
@ -266,8 +276,8 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getAgeAndSex ( ) {
RecordSet rs = new RecordSet ( ) ;
TreeSet< Integer > barSeriesData = new TreeSe t< > ( ) ;
TreeSet< Integer > barSeriesDataTwo = new TreeSe t< > ( ) ;
LinkedList< Integer > barSeriesData = new LinkedLis t< > ( ) ;
LinkedList< Integer > barSeriesDataTwo = new LinkedLis t< > ( ) ;
List < String > ageArr = Arrays . asList ( "16~20" , "21~25" , "26~30" , "31~35" , "36~40" , "41~45" , "46~50" , "51~55" , "56~60" , "61~65" , "66~70" ) ;
List < String > birthdayListMen = new ArrayList < > ( ) ;
@ -283,14 +293,15 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
} )
. collect ( Collectors . toList ( ) ) ;
int yMax = menAge . stream ( ) . max ( Integer : : compare ) . orElse ( 0 ) + 20 ;
for ( int i = 0 ; i < ageArr . size ( ) ; i + + ) {
String [ ] split = ageArr . get ( i ) . split ( "~" ) ;
Integer sum = menAge . stream ( ) . filter ( item - > item > Integer . parseInt ( split [ 0 ] ) & & item < = Integer . parseInt ( split [ 1 ] ) ) . mapToInt( Integer : : valueOf ) . sum ( ) ;
barSeriesData . add ( sum ) ;
List< Integer > collect = menAge . stream ( ) . filter ( item - > item > Integer . parseInt ( split [ 0 ] ) & & item < = Integer . parseInt ( split [ 1 ] ) ) . collect( Collectors . toList ( ) ) ;
barSeriesData . add ( collect. size ( ) ) ;
}
int yMax = barSeriesData . stream ( ) . max ( Integer : : compare ) . orElse ( 0 ) + 20 ;
List < String > birthdayListWomen = new ArrayList < > ( ) ;
rs . executeQuery ( "select birthday from hrmresource where status < 4 and sex is not null and sex = 1" ) ;
@ -305,14 +316,18 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
} )
. collect ( Collectors . toList ( ) ) ;
int yMin = - ( womenAge . stream ( ) . max ( Integer : : compare ) . orElse ( 0 ) + 20 ) ;
LinkedList < Integer > list = new LinkedList < > ( ) ;
for ( int i = 0 ; i < ageArr . size ( ) ; i + + ) {
String [ ] split = ageArr . get ( i ) . split ( "~" ) ;
Integer sum = womenAge . stream ( ) . filter ( item - > item > Integer . parseInt ( split [ 0 ] ) & & item < = Integer . parseInt ( split [ 1 ] ) ) . mapToInt ( Integer : : valueOf ) . sum ( ) ;
barSeriesDataTwo . add ( sum ) ;
List < Integer > collect = womenAge . stream ( ) . filter ( item - > item > Integer . parseInt ( split [ 0 ] ) & & item < = Integer . parseInt ( split [ 1 ] ) ) . collect ( Collectors . toList ( ) ) ;
barSeriesDataTwo . add ( - collect . size ( ) ) ;
list . add ( collect . size ( ) ) ;
}
int yMin = - ( list . stream ( ) . max ( Integer : : compare ) . orElse ( 0 ) + 20 ) ;
Integer yInterval = ( yMax + Math . abs ( yMin ) ) / 6 ;
return OptionVO . builder ( )
@ -327,7 +342,34 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
@Override
public OptionVO getJobType ( ) {
return null ;
RecordSet rs = new RecordSet ( ) ;
LinkedList < String > xData = new LinkedList < > ( ) ;
LinkedList < Integer > barSeriesData = new LinkedList < > ( ) ;
rs . executeQuery ( "select a.*,b.jobgroupname from (select g.id as jobgroupid,count(1) as sum from hrmresource h \n" +
" left join hrmjobtitles j on h.jobtitle = j.id\n" +
" left join hrmjobactivities c on j.jobactivityid = c.id\n" +
" left join hrmjobgroups g on c.jobgroupid = g.id\n" +
" where h.status < 4 and g.id is not null group by g.id) as a left join hrmjobgroups b on a.jobgroupid = b.id" ) ;
while ( rs . next ( ) ) {
xData . add ( Util . null2String ( rs . getString ( "jobgroupname" ) ) ) ;
barSeriesData . add ( Util . getIntValue ( rs . getString ( "sum" ) ) ) ;
}
int max = Collections . max ( barSeriesData ) ;
int ceil = ( int ) Math . ceil ( ( double ) max / 4 ) ;
ceil = CommonUtils . roundUpToNearestTen ( ceil ) ;
int roundedMax = CommonUtils . roundedMax ( ceil , 4 ) ;
return OptionVO . builder ( )
. titleText ( "职务类别统计" )
. xData ( xData )
. yMin ( 0 )
. yMax ( roundedMax )
. yInterval ( ceil )
. barSeriesData ( barSeriesData )
. build ( ) ;
}
@Override
@ -336,9 +378,9 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
RecordSet rs = new RecordSet ( ) ;
String startMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateStartOfMonth ( YearMonth . now ( ) ) ) ;
String endMonth = CommonDateUtil . getFormatYear ( CommonDateUtil . toDateEndOfMonth ( YearMonth . now ( ) ) ) ;
TreeSet< String > xData = new TreeSe t< > ( ) ;
TreeSet< Integer > barSeriesData = new TreeSe t< > ( ) ;
TreeSet< BrowserParam > browser = new TreeSe t< > ( ) ;
LinkedList< String > xData = new LinkedLis t< > ( ) ;
LinkedList< Integer > barSeriesData = new LinkedLis t< > ( ) ;
LinkedList< BrowserParam > browser = new LinkedLis t< > ( ) ;
StringBuilder sql = new StringBuilder ( ) ;
sql . append ( "select t.departmentname, t.id,CASE \n" +
@ -346,7 +388,7 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
" ELSE a.sum \n" +
" END AS num from hrmdepartment t \n" +
" left join (select s.departmentid,count(1) as sum from hrmstatushistory h left join hrmresource s on h.resourceid = s.id " +
" where type_n = 5 and changedate >= ? && changedate <= ? group by s.departmentid ) a\n" +
" where type_n = 5 and changedate >= ? and changedate <= ? group by s.departmentid ) a\n" +
" on t.id = a.departmentid" ) ;
if ( StringUtils . isNotEmpty ( departmentIds ) ) {
@ -389,12 +431,12 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
public Map < String , Object > getLeaveYear ( String departmentIds ) {
Map < String , Object > data = new HashMap < > ( 4 ) ;
RecordSet rs = new RecordSet ( ) ;
TreeSet< String > legendDataFirst = new TreeSe t< > ( ) ;
TreeSet< Integer > barSeriesData = new TreeSe t< > ( ) ;
TreeSet< Integer > barSeriesDataTwo = new TreeSe t< > ( ) ;
TreeSet< Integer > barSeriesDataThree = new TreeSe t< > ( ) ;
LinkedList< String > legendDataFirst = new LinkedLis t< > ( ) ;
LinkedList< Integer > barSeriesData = new LinkedLis t< > ( ) ;
LinkedList< Integer > barSeriesDataTwo = new LinkedLis t< > ( ) ;
LinkedList< Integer > barSeriesDataThree = new LinkedLis t< > ( ) ;
DepartmentComInfo comInfo = new DepartmentComInfo ( ) ;
TreeSet< BrowserParam > browser = new TreeSe t< > ( ) ;
LinkedList< BrowserParam > browser = new LinkedLis t< > ( ) ;
List < Integer > deptList = new ArrayList < > ( ) ;
if ( StringUtils . isNotEmpty ( departmentIds ) ) {
@ -441,6 +483,9 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
case 2 :
barSeriesDataThree . add ( value ) ;
break ;
default :
break ;
}
}
@ -472,19 +517,20 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
private Integer calculateLeave ( Integer id , String startMonth , String endMonth ) {
RecordSet rs = new RecordSet ( ) ;
StringBuilder sql = new StringBuilder ( ) ;
sql . append ( "select t.departmentname, t.id,CASE \n" +
String sql = ( "select t.departmentname, t.id,CASE \n" +
" WHEN a.sum IS NULL THEN 0 \n" +
" ELSE a.sum \n" +
" END AS num from hrmdepartment t \n" +
" left join (select s.departmentid,count(1) as sum from hrmstatushistory h left join hrmresource s on h.resourceid = s.id " +
" where type_n = 5 and changedate >= ? && changedate <= ? group by s.departmentid ) a\n" +
" where type_n = 5 and changedate >= ? and changedate <= ? group by s.departmentid ) a\n" +
" on t.id = a.departmentid where t.id = ?" ) ;
rs . executeQuery ( sql .toString ( ) ,startMonth , endMonth , id ) ;
rs . executeQuery ( sql ,startMonth , endMonth , id ) ;
rs . next ( ) ;
return Util . getIntValue ( rs . getString ( "num" ) ) / countBydeptId ( id , endMonth ) ;
}
/ * *
* 部 门 人 数 统 计
* @param departmentId
@ -508,16 +554,16 @@ public class StatisticsPortalServiceImpl extends Service implements StatisticsPo
/ * *
* 平 分 legendData
* @param legendDataFirst
* @param nameSet
* /
private void treeSetSplitExample ( TreeSet < String > legendDataFirst , TreeSe t< String > nameSet ) {
private LinkedList < String > treeSetSplitExample ( LinkedLis t< String > nameSet ) {
int splitSize = nameSet . size ( ) / 2 ;
legendDataFirst = nameSet . stream ( )
. collect ( Collectors . partitioningBy ( e - > nameSet . headSet( e ) . size ( ) < splitSize ,
Collectors . toCollection ( TreeSe t: : new ) ) )
LinkedList< String > legendDataFirst = nameSet . stream ( )
. collect ( Collectors . partitioningBy ( e - > nameSet . indexOf( e ) < splitSize ,
Collectors . toCollection ( LinkedLis t: : new ) ) )
. get ( false ) ;
nameSet . removeAll ( legendDataFirst ) ;
return legendDataFirst ;
}
/ * *