@ -943,24 +943,25 @@ public class HrmSelfHelpController {
String groupId = "weaver-ebuilder-form-service" ;
String groupId = "weaver-ebuilder-form-service" ;
String sourceType = "LOGIC" ;
String sourceType = "LOGIC" ;
SimpleEmployee employee = UserContext . getCurrentUser ( ) ;
long employeeId = UserContext . getCurrentEmployeeId ( ) ;
String employeeId = request . getParameter ( "employeeId" ) ;
if ( StringUtils . isBlank ( employeeId ) ) {
employeeId = String . valueOf ( UserContext . getCurrentEmployeeId ( ) ) ;
}
List < Map < String , Object > > dataList = new ArrayList < Map < String , Object > > ( ) ;
List < Map < String , Object > > dataList = new ArrayList < Map < String , Object > > ( ) ;
try {
try {
String sql = " select id from uf_zzfwrkpz where ry='" + employeeId + "' delete_type=0 and tenant_key = '" + tenant_key + "'" ;
String sql = " select distinct taby from uf_zzfwrkpz where ry='"+ employeeId + "' and qy is not null and taby is not null and delete_type=0 and tenant_key ='"+ tenant_key + "'" ;
log . info ( "sql:" + sql ) ;
log . error ( "sql:" + sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
if ( recordList . size ( ) > 0 ) {
if ( recordList . size ( ) > 0 ) {
Map < String , Object > recordMap = recordList . get ( 0 ) ;
// /api/file/preview?type=redirect&imgFormat=small&fileId=977697615197618177&module=ebuilderform&authModule=ebuilderform&source=form&fieldId=977686869110833154&customParam=%7B%22dataId%22%3A%22977697666574729218%22%7D&refId=977697666574729218&folderId=8120831157448215424
String id = String . valueOf ( recordMap . get ( "id" ) ) ;
dataList = getCustomeServiceData ( groupId , sourceType , field_id , recordList , employeeId ) ;
if ( StringUtils . isNotBlank ( id ) ) {
dataList = getCustomeServiceData ( groupId , sourceType , field_id ) ;
} else {
} else {
dataList = getDefaultServiceData ( groupId , sourceType , field_id ) ;
dataList = getDefaultServiceData ( groupId , sourceType , field_id ) ;
}
}
}
} catch ( Exception e ) {
} catch ( Exception e ) {
log . error ( "testSapi51-Exception:" + e . getMessage ( ) ) ;
log . error ( "testSapi51-Exception:" + e . getMessage ( ) ) ;
return WeaResult . fail ( 500 , "程序执行异常" ) ;
return WeaResult . fail ( 500 , "程序执行异常" ) ;
@ -973,49 +974,44 @@ public class HrmSelfHelpController {
*
*
* @param groupId
* @param groupId
* @param sourceType
* @param sourceType
* @param field_id
* @return
* @return
* /
* /
public Map < String , String > get ServiceTypeName( String groupId , String sourceType , String field_i d) {
public Map < String , String > get Custom ServiceTypeName( String groupId , String sourceType , String employeeI d) {
Map < String , String > optionMap = new HashMap < String , String > ( ) ;
Map < String , String > optionMap = new HashMap < String , String > ( ) ;
String sql = " select name,value_key from field_option where field_id='"+ field_id + "' and delete_type=0 and tenant_key = '"+ tenant_key + "'" ;
String sql = " select id,tabymmc from uf_zzfwrktaby where qy is not null and ry='"+ employeeId + "' and delete_type=0 and tenant_key = '"+ tenant_key + "'" ;
log . info ( "sql:" + sql ) ;
log . info ( "sql:" + sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
Map < String , Object > recordMap = recordList . get ( i ) ;
Map < String , Object > recordMap = recordList . get ( i ) ;
String value = String . valueOf ( recordMap . get ( " value_key ") ) ;
String value = String . valueOf ( recordMap . get ( " id ") ) ;
String name = String . valueOf ( recordMap . get ( " name ") ) ;
String name = String . valueOf ( recordMap . get ( " tabymmc ") ) ;
optionMap . put ( value , name ) ;
optionMap . put ( value , name ) ;
}
}
return optionMap ;
return optionMap ;
}
}
public List < Map < String , Object > > getCustomeServiceData ( String groupId , String sourceType , String field_id ){
public List < Map < String , Object > > getCustomeServiceData ( String groupId , String sourceType , String field_id ,List < Map < String , Object > > recordList , String employeeId ){
Map < String , String > optionMap = get ServiceTypeName( groupId , sourceType , field_id ) ;
Map < String , String > optionMap = get Custom ServiceTypeName( groupId , sourceType , field_id ) ;
String sql = " select distinct taby as value_key from uf_zzfwrkp_mxb1 where delete_type=0 and tenant_key = '" + tenant_key + "'" ;
log . info ( "sql:" + sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
Map < String , Object > recordMap = recordList . get ( i ) ;
Map < String , Object > recordMap = recordList . get ( i ) ;
String taby = String . valueOf ( recordMap . get ( " value_ke y") ) ;
String taby = String . valueOf ( recordMap . get ( "taby" ) ) ;
log . error ( "getCustemSelfServiceType-taby:" + taby ) ;
log . error ( "getCustemSelfServiceType-taby:" + taby ) ;
List < Map < String , Object > > customList = new ArrayList < Map < String , Object > > ( ) ;
List < Map < String , Object > > customList = new ArrayList < Map < String , Object > > ( ) ;
String tabyName = "" ;
String tabyName = "" ;
if ( StringUtils . isNotBlank ( taby ) ) {
if ( StringUtils . isNotBlank ( taby ) ) {
tabyName = optionMap . get ( taby ) ;
tabyName = optionMap . get ( taby ) ;
customList = getCustomeServiceDataByType ( groupId , sourceType , taby );
customList = getCustomeServiceDataByType ( groupId , sourceType , taby ,employeeId );
}
}
log . error ( "getCustemSelfServiceType-tabyName:" + tabyName ) ;
log . error ( "getCustemSelfServiceType-tabyName:" + tabyName ) ;
log . error ( "getCustemSelfServiceType-taby:" + taby ) ;
log . error ( "getCustemSelfServiceType-taby:" + taby ) ;
recordMap . put ( "menu ", customList ) ;
recordMap . put ( "menu s ", customList ) ;
recordMap . put ( "name" , tabyName ) ;
recordMap . put ( "name" , tabyName ) ;
}
}
return recordList ;
return recordList ;
@ -1024,9 +1020,8 @@ public class HrmSelfHelpController {
public List < Map < String , Object > > getCustomeServiceDataByType ( String groupId , String sourceType , String value ) {
public List < Map < String , Object > > getCustomeServiceDataByType ( String groupId , String sourceType , String value , String employeeId ) {
String sql = " select distinct taby as value_key from uf_zzfwrkp_mxb1 where taby = " + value + " and delete_type=0 and tenant_key = '" + tenant_key + "'" ;
String sql = " select fwmc,fwdz,fwtb,taby from uf_zzfwrkpz where ry='" + employeeId + "' and qy is not null and taby is not null and taby=" + value + " and delete_type=0 and tenant_key = '" + tenant_key + "'" ;
log . info ( "getSelfServiceData--sql:" + sql ) ;
log . info ( "getSelfServiceData--sql:" + sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
Map < String , Object > result = databaseUtils . execute ( sourceType , groupId , sql ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
List < Map < String , Object > > recordList = databaseUtils . getDataSourceList ( result ) ;
@ -1049,8 +1044,8 @@ public class HrmSelfHelpController {
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
for ( int i = 0 ; i < recordList . size ( ) ; i + + ) {
Map < String , Object > recordMap = recordList . get ( i ) ;
Map < String , Object > recordMap = recordList . get ( i ) ;
String value = String . valueOf ( recordMap . get ( "value_key" ) ) ;
String value = String . valueOf ( recordMap . get ( "value_key" ) ) ;
List < Map < String , Object > > recor dList2 = getDefaultServiceDataByType ( groupId , sourceType , value ) ;
List < Map < String , Object > > default List = getDefaultServiceDataByType ( groupId , sourceType , value ) ;
recordMap . put ( "menus" , recor dList2 ) ;
recordMap . put ( "menus" , default List) ;
}
}
return recordList ;
return recordList ;
}
}