Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java =================================================================== diff -u -r22998 -r23065 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java (.../RecyclingApplicationTableManager.java) (revision 22998) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java (.../RecyclingApplicationTableManager.java) (revision 23065) @@ -198,7 +198,7 @@ Map sqlWhereParamMap = gridManager.getParamFromView(parameterMap); StringBuilder sqlBuilder = new StringBuilder(" where 1=1 "); - //1、当前登录用户的过滤(即:1、处理科室用户能看到已经提交的单 2、申请科室用户只能看到本科室申请的单 3、自己填的单 4、外来器械厂商人员的外来器械申请单) + //1、当前登录用户的过滤(即:1、处理科室用户能看到已经提交的单 2、自己填的单 3、申请科室用户只能看到本科室申请的单(如果是外来器械包申请单那么还要判断用户是否为外来器械租用商配置的“允许申请人”,注意:如果租用商没配置“允许申请人”则本科室的所有用户都可以看) LoginUserData loginUserData = AcegiHelper.getLoginUser(); String currentOrgUnitCode = loginUserData.getCurrentOrgUnitCode(); String userName = loginUserData.getUserName(); @@ -209,10 +209,11 @@ if(CollectionUtils.isNotEmpty(supplierNameList)){ // foreignTousseAppFilterSql = " or (po.type <> '"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' or " // + "(po.type='"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' and po.id in (select id from "+ ForeignTousseApplication.class.getSimpleName() +" where "+ SqlUtils.getStringFieldInLargeCollectionsPredicate("supplierName", supplierNameList) +")))"; - foreignTousseAppFilterSql = " or (po.type='"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' and po.id in (select id from "+ ForeignTousseApplication.class.getSimpleName() +" where "+ SqlUtils.getStringFieldInLargeCollectionsPredicate("supplierName", supplierNameList) +"))"; + foreignTousseAppFilterSql = " or (po.departCoding = '" + currentOrgUnitCode +"' and po.type='"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' and po.id in (select id from "+ ForeignTousseApplication.class.getSimpleName() +" where "+ SqlUtils.getStringFieldInLargeCollectionsPredicate("supplierName", supplierNameList) +"))"; } - String loginUserSql = String.format(" and ((po.handleDepartCoding = '%s' and po.committedStatus = 1) or po.departCoding = '%s' or po.applicantCode='%s' "+ foreignTousseAppFilterSql +") ", currentOrgUnitCode, currentOrgUnitCode, userName); + String loginUserSql = String.format(" and ((po.handleDepartCoding = '%s' and po.committedStatus = 1) or po.applicantCode='%s' or (po.departCoding = '%s' and po.type<>'%s') %s) ", + currentOrgUnitCode, userName, currentOrgUnitCode, InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION, foreignTousseAppFilterSql); sqlBuilder.append(loginUserSql); //2、不包含的申请单类型