@ -4,7 +4,7 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service ;
import com.engine.core.impl.Service ;
import com.engine.organization.entity.chart.ChartPO ;
import com.engine.organization.entity.chart.ChartPO ;
import com.engine.organization.entity.chart.CompanyTreePO ;
import com.engine.organization.entity.chart.CompanyTreePO ;
import com.engine.organization.entity.chart. Moving Tree;
import com.engine.organization.entity.chart. TreeSelect ;
import com.engine.organization.mapper.hrmresource.SystemDataMapper ;
import com.engine.organization.mapper.hrmresource.SystemDataMapper ;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper ;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper ;
import com.engine.organization.service.ChartService ;
import com.engine.organization.service.ChartService ;
@ -477,13 +477,32 @@ public class ChartServiceImpl extends Service implements ChartService {
public Map < String , Object > getMovingTree ( Map < String , Object > params ) {
public Map < String , Object > getMovingTree ( Map < String , Object > params ) {
RecordSet rs = new RecordSet ( ) ;
RecordSet rs = new RecordSet ( ) ;
rs . executeQuery ( "select id,subcompanyname from hrmsubcompany where (canceled is null or canceled != 1) and (supsubcomid is null or supsubcomid = 0)" ) ;
rs . executeQuery ( "select id,subcompanyname from hrmsubcompany where (canceled is null or canceled != 1) and (supsubcomid is null or supsubcomid = 0)" ) ;
List < Moving Tree> movingTrees = new ArrayList < > ( ) ;
List < TreeSelect > movingTrees = new ArrayList < > ( ) ;
while ( rs . next ( ) ) {
while ( rs . next ( ) ) {
movingTrees . add ( Moving Tree. builder ( ) . key ( rs . getString ( "id" ) ) . title ( rs . getString ( "subcompanyname" ) ) . type ( Moving Tree. SUB_COMPANY ) . build ( ) ) ;
movingTrees . add ( TreeSelect . builder ( ) . key ( rs . getString ( "id" ) ) . title ( rs . getString ( "subcompanyname" ) ) . type ( TreeSelect . SUB_COMPANY ) . build ( ) ) ;
}
}
Map < String , Object > result = new HashMap < > ( 2 ) ;
Map < String , Object > result = new HashMap < > ( 2 ) ;
result . put ( "movingTree" , movingTrees ) ;
result . put ( "movingTree" , movingTrees ) ;
result . put ( "expandedKeys" , movingTrees . stream ( ) . map ( MovingTree : : getKey ) . collect ( Collectors . toList ( ) ) ) ;
result . put ( "expandedKeys" , movingTrees . stream ( ) . map ( TreeSelect : : getKey ) . collect ( Collectors . toList ( ) ) ) ;
result . put ( "api_status" , true ) ;
return result ;
}
@Override
public Map < String , Object > getFullSelectTree ( Map < String , Object > params ) {
RecordSet rs = new RecordSet ( ) ;
rs . executeQuery ( "select id,companyname from hrmcompany" ) ;
TreeSelect companyTree = null ;
List < String > expandedKeys = new ArrayList < > ( ) ;
if ( rs . next ( ) ) {
companyTree = TreeSelect . builder ( ) . key ( rs . getString ( "id" ) ) . title ( rs . getString ( "companyname" ) ) . type ( TreeSelect . COMPANY ) . build ( ) ;
expandedKeys = companyTree . getChildren ( ) . stream ( ) . map ( TreeSelect : : getKey ) . collect ( Collectors . toList ( ) ) ;
expandedKeys . add ( companyTree . getKey ( ) ) ;
}
Map < String , Object > result = new HashMap < > ( 2 ) ;
result . put ( "selectTree" , companyTree ) ;
result . put ( "expandedKeys" , expandedKeys ) ;
result . put ( "api_status" , true ) ;
result . put ( "api_status" , true ) ;
return result ;
return result ;
}
}