@ -66,6 +66,8 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicInteger ;
import java.util.stream.Collectors ;
import static weaver.general.Util.getIntValue ;
/ * *
* @author : dxfeng
* @createTime : 2022 / 06 / 20
@ -308,7 +310,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
@Override
public Integer updateCustomTemplate ( Map < String , Object > params ) {
int rowNum = Util. getIntValue( ( String ) params . get ( "rownum" ) ) ;
int rowNum = getIntValue( ( String ) params . get ( "rownum" ) ) ;
int count = 0 ;
List < Long > allIds = getJclOrgCustomTemplateMapper ( ) . listAllId ( ) ;
String currentDate = OrganizationDateUtil . getFormatLocalDate ( new java . util . Date ( ) ) ;
@ -424,11 +426,54 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
}
@Override
public Map < String , Object > chartResourceList ( Integer departmentId ) {
public Map < String , Object > chartResourceList ( Integer departmentId ,String versionId , String dimension ) {
Map < String , Object > dataMap = new HashMap < > ( ) ;
List < ResourceListColumns > resourceListColumns = getTableColumns ( ) ;
List < ResourceChartPO > resourceChartPOS = getHrmResourceMapper ( ) . selectByDepartmentId ( departmentId ) ;
List < ResourceChartVO > resourceChartVOS = ResourceChartBO . convertToVO ( resourceChartPOS ) ;
List < ResourceChartPO > resourceChartPOS = new ArrayList < > ( ) ;
List < ResourceChartVO > resourceChartVOS = new ArrayList < > ( ) ;
RecordSet rs = new RecordSet ( ) ;
if ( "0" . equals ( dimension ) ) {
if ( "0" . equals ( versionId ) ) {
//当前数据
resourceChartPOS = getHrmResourceMapper ( ) . selectByDepartmentId ( departmentId ) ;
resourceChartVOS = ResourceChartBO . convertToVO ( resourceChartPOS ) ;
} else {
rs . executeQuery ( "select resourceid,workcode,lastname,sex,department,subcompany,jobtitle,mobile from jcl_chart_resource where departmentid = ? and versionid = ?" , departmentId , versionId ) ;
while ( rs . next ( ) ) {
ResourceChartVO build = ResourceChartVO . builder ( )
. id ( ( long ) Util . getIntValue ( rs . getString ( "resourceid" ) ) )
. workCode ( Util . null2String ( rs . getString ( "workcode" ) ) )
. lastName ( Util . null2String ( rs . getString ( "lastname" ) ) )
. sex ( "1" . equals ( Util . null2String ( rs . getString ( "workcode" ) ) ) ? "女" : "男" )
. departmentName ( Util . null2String ( rs . getString ( "department" ) ) )
. subcompanyName ( Util . null2String ( rs . getString ( "subcompany" ) ) )
. jobTitle ( Util . null2String ( rs . getString ( "jobtitle" ) ) )
. mobile ( Util . null2String ( rs . getString ( "mobile" ) ) )
. build ( ) ;
resourceChartVOS . add ( build ) ;
}
}
} else {
rs . executeQuery ( "select h.id,h.workcode,h.lastname,h.sex,h.departmentid,h.subcompanyid1,h.jobtitle,h.status,h.mobile " +
" from hrmresourcevirtual v left join hrmresource h on v.resourceid = h.id and v.virtualtype = ? and h.departmentid = ?" , versionId , departmentId ) ;
while ( rs . next ( ) ) {
ResourceChartPO build = ResourceChartPO . builder ( )
. id ( ( long ) Util . getIntValue ( rs . getString ( "id" ) ) )
. workCode ( Util . null2String ( rs . getString ( "workcode" ) ) )
. lastName ( Util . null2String ( rs . getString ( "lastname" ) ) )
. sex ( Util . null2String ( rs . getString ( "sex" ) ) )
. departmentId ( Util . getIntValue ( rs . getString ( "departmentid" ) ) )
. subcompanyid1 ( Util . getIntValue ( rs . getString ( "subcompanyid1" ) ) )
. jobTitle ( Util . getIntValue ( rs . getString ( "jobtitle" ) ) )
. status ( Util . getIntValue ( rs . getString ( "subcompanyid1" ) ) )
. mobile ( Util . null2String ( rs . getString ( "subcompanyid1" ) ) )
. build ( ) ;
resourceChartPOS . add ( build ) ;
}
resourceChartVOS = ResourceChartBO . convertToVO ( resourceChartPOS ) ;
}
dataMap . put ( "columns" , resourceListColumns ) ;
dataMap . put ( "dataSource" , resourceChartVOS ) ;
return dataMap ;