|
@@ -156,10 +156,48 @@ public class TreeUtils {
|
|
|
List<PersonnelVO.PerRole> perRoles =personnelVO.getRList();
|
|
|
String tem ="";
|
|
|
String reField =field;
|
|
|
+ //如果参数是sql语句
|
|
|
if(field.contains("select")){
|
|
|
+ for(DataSource dataSource :dataSources) {
|
|
|
+ String sourceField=dataSource.getDataSourceField();
|
|
|
+if(field.contains("local."+sourceField)){
|
|
|
+ // 判断是否是部门信息
|
|
|
+ if(sourceField.contains("DP.")){
|
|
|
+ // 分割字符串获得部门字段
|
|
|
+ String Fields= sourceField.split("\\.")[1];
|
|
|
+ // 遍历部门信息,用反射将对应字段转换成(*,*,...)格式
|
|
|
+ for(PersonnelVO.DP dp : dps){
|
|
|
+ Class DPClass =dp.getClass();
|
|
|
+ Field dataField = DPClass.getDeclaredField(Fields);
|
|
|
+ dataField.setAccessible(true);
|
|
|
+ tem =dataField.get(dp).toString()+"," ;
|
|
|
+
|
|
|
+ }
|
|
|
+ reField = sourceField.replace("local."+sourceField,"("+tem.substring(0,tem.length() - 1)+")") ;
|
|
|
+ }
|
|
|
+ //判断是否是角色信息(处理过程同部门信息处理过程)
|
|
|
+ else if(sourceField.contains("PerRole.")){
|
|
|
+ String Fields= sourceField.split("\\.")[1];
|
|
|
+ for(PersonnelVO.PerRole perRole : perRoles){
|
|
|
+ Class DPClass =perRole.getClass();
|
|
|
+ Field dataField = DPClass.getDeclaredField(Fields);
|
|
|
+ dataField.setAccessible(true);
|
|
|
+ tem =dataField.get(perRole).toString()+"," ;
|
|
|
+ }
|
|
|
+ reField = sourceField.replace("local."+sourceField,"("+tem.substring(0,tem.length() - 1)+")") ;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ Class personClass =personnelVO.getClass();
|
|
|
+ Field dataField = personClass.getDeclaredField(sourceField);
|
|
|
+ dataField.setAccessible(true);
|
|
|
+ reField = field.replace("local."+sourceField,dataField.get(personnelVO).toString());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+} }
|
|
|
|
|
|
}
|
|
|
//遍历字典数据
|