用款申请单列表过滤逻辑优化
This commit is contained in:
parent
094c55ad31
commit
e872b0b2d3
|
@ -9,7 +9,9 @@ import kd.bos.list.ListShowParameter;
|
|||
import kd.bos.list.plugin.AbstractListPlugin;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.permission.api.HasPermOrgResult;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.permission.PermissionServiceHelper;
|
||||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -80,9 +82,16 @@ public class paymentApplicationListPlugin extends AbstractListPlugin {
|
|||
return;
|
||||
}
|
||||
if ("zcgj_org.id".equals(key)) {
|
||||
String userid = RequestContext.get().getUserId();//获取当前用户id
|
||||
List<Long> ids = UserServiceHelper.getOrgsUserJoin(Long.parseLong(userid));//获取用户所有部门id
|
||||
String userId = RequestContext.get().getUserId();//获取当前用户id
|
||||
boolean superUser = PermissionServiceHelper.isSuperUser(Long.parseLong(userId)); //判断是否为全功能用户
|
||||
boolean adminUser = PermissionServiceHelper.isAdminUser(Long.parseLong(userId)); //判断是否管理员用户
|
||||
List<Long> ids = UserServiceHelper.getOrgsUserJoin(Long.parseLong(userId));//获取用户所有部门id
|
||||
List<Long> ids2 = new ArrayList<>();
|
||||
if(!superUser && !adminUser){
|
||||
HasPermOrgResult userHasPermOrgs = PermissionServiceHelper.getUserHasPermOrgs(Long.parseLong(userId),true);
|
||||
List<Long> hasPermOrgs = userHasPermOrgs.getHasPermOrgs();
|
||||
ids2.addAll(hasPermOrgs);
|
||||
}
|
||||
for (Long userMainOrgId : ids) {
|
||||
QFilter[] qFilter = new QFilter[]{new QFilter("id", QCP.equals, userMainOrgId)};
|
||||
DynamicObject org = BusinessDataServiceHelper.loadSingle("bos_adminorg", qFilter);//行政组织
|
||||
|
|
Loading…
Reference in New Issue