Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java =================================================================== diff -u -r26144 -r26151 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 26144) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 26151) @@ -1776,13 +1776,13 @@ }else{ //只查出一次性物品 mapList2 = tousseDefinitionManager.searchTousseOrDiposableGoodsBySpellAndWbCode( - spell, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,cssdOrgUnitCode,specifyDisposableTypes); + spell, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,cssdOrgUnitCode,specifyDisposableTypes,false); } //如果申请单类型为组合申请单,则需要再查询一次性物品出来和上面的器械包物品合并 if("combo".equals(tousseType)){ mapList2 = (tousseDefinitionManager.searchTousseOrDiposableGoodsBySpellAndWbCode( - spell, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,cssdOrgUnitCode,null)); + spell, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,cssdOrgUnitCode,null,false)); } List> mapDataList = new ArrayList>(); @@ -1861,15 +1861,15 @@ String tousseType = StrutsParamUtils.getPraramValue("tousseType", ""); List> list = new ArrayList>(); if (StringTools.isBlank(tousseType)) { - list = (List>) tousseDefinitionManager.searchComboGoods(spell, tousseType, false, false, null, null).get("data"); + list = (List>) tousseDefinitionManager.searchComboGoods(spell, tousseType, false, false, null, null,false).get("data"); } else if (StringTools.equals(tousseType, DisposableGoods.TYPE_NAME)) { list = tousseDefinitionManager.searchTousseOrDiposableGoodsBySpellAndWbCode( - spell, false, false, false,false,false,"1","0",false,false,null,"",null); + spell, false, false, false,false,false,"1","0",false,false,null,"",null,false); } else { list = tousseDefinitionManager.searchTousseByKeywordAndTousseTypeArr( spell, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DRESSING, - TousseDefinition.PACKAGE_TYPE_DISINFECTION },false ,true); + TousseDefinition.PACKAGE_TYPE_DISINFECTION },false ,true,false); } if(CollectionUtils.isNotEmpty(list)){ @@ -1937,7 +1937,7 @@ } try { spell = java.net.URLDecoder.decode(spell, "UTF-8"); - Map result = tousseDefinitionManager.searchComboGoods(spell, TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DISINFECTION,false,false,null,null); + Map result = tousseDefinitionManager.searchComboGoods(spell, TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DISINFECTION,false,false,null,null,false); List> data = (List>) result.get("data"); PageUtil.outPutResult(PageUtil.getPagePara(), data); } catch (IOException e) { @@ -1961,7 +1961,7 @@ TousseDefinition.PACKAGE_TYPE_DRESSING,TousseDefinition.PACKAGE_TYPE_DISINFECTION }; List> mapList = tousseDefinitionManager.searchTousseByKeywordAndTousseTypeArr( - spell, searchTousseTypeArray ,false ,false); + spell, searchTousseTypeArray ,false ,false,false); Map map = new HashMap(); map.put("totalCount", mapList.size()); @@ -1981,7 +1981,7 @@ } try { spell = java.net.URLDecoder.decode(spell, "UTF-8"); - Map result = tousseDefinitionManager.searchComboGoods(spell, TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DRESSING,false,false,null,null); + Map result = tousseDefinitionManager.searchComboGoods(spell, TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DRESSING,false,false,null,null,false); JSONObject json = JSONObject.fromObject(result); HttpServletResponse response = StrutsParamUtils.getResponse(); response.setCharacterEncoding("UTF-8"); @@ -2597,7 +2597,7 @@ .searchTousseByKeywordAndTousseTypeArr(false, spell, tousseTypeArray, true); }else{ list = tousseDefinitionManager - .searchTousseByKeywordAndTousseTypeArr(spell, tousseTypeArray, true ,false); + .searchTousseByKeywordAndTousseTypeArr(spell, tousseTypeArray, true ,false,false); } PageUtil.outPutResult(PageUtil.getPagePara(), list); } Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java =================================================================== diff -u -r26144 -r26151 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 26144) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 26151) @@ -168,19 +168,6 @@ * @param showExternalCodeOfDisposableGoods 是否显示一次性物品的外部编码 * @param settleAccountsDepartCoding 结算科室编码 * @param deptCode 处理科室编码 - * @return - */ - public Map searchComboGoods(String searchString, String tousseType,boolean showReferencePrice,boolean showExternalCodeOfDisposableGoods, - String settleAccountsDepartCoding,String deptCode); - - /** - * 搜索器械包(含消毒物品)和一次性物品,返回JSONObject对象. - * @param searchString 搜索的字符串 - * @param tousseType 搜索的物品类型(多样化) - * @param showReferencePrice 是否显示参考价格 - * @param showExternalCodeOfDisposableGoods 是否显示一次性物品的外部编码 - * @param settleAccountsDepartCoding 结算科室编码 - * @param deptCode 处理科室编码 * @param useAssetsBelong 使用资产归属过滤 * @return */ @@ -391,32 +378,6 @@ * @param settleAccountsDepartCoding 结算科室的科室编码(用于取一次性物品的浮动系数) * @param handleDepartCode * @param specifyDisposableTypes 是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} - * @return - */ - public List> searchTousseOrDiposableGoodsBySpellAndWbCode( - String simpleSpell, boolean isSeachTousse, - boolean includeCoustomTousse, boolean searchTousseBelonged, - boolean onlySearchRecyclingTousse, boolean displayPrice, - String pageIndex, String countOfLI, boolean showDisableGoods, - boolean showExternalCodeOfDisposableGoods,String settleAccountsDepartCoding,String handleDepartCode,String specifyDisposableTypes); - - /** - * 根据关键字进行检索,获取器械包或一次性物品..
- * 如果searchString为中文,则按照器械包的(拼音码、五笔码、外部编码、名称)这四个字段进行检索
- * 如果searchString为英文,则根据用户属性表的searchMode字段来决定
- * @param simpleSpell 检索的关键字 - * @param isSeachTousse 为true时只查询器械包,为false时只查询一次性物品 - * @param includeCoustomTousse 为true时不过滤自定义器械包,为false时过滤自定义器械包 - * @param searchTousseBelonged 是否只搜索登录用户当前科室能处理的器械包 - * @param onlySearchRecyclingTousse 是否只搜索要回收的器械包 - * @param displayPrice - * @param pageIndex 页码 - * @param countOfLI 显示数目,当countOfLI为0时查询所有的记录,不分页 - * @param showDisableGoods 是否显示禁用物品 - * @param showExternalCodeOfDisposableGoods 是否显示一次性物品的外部编码 - * @param settleAccountsDepartCoding 结算科室的科室编码(用于取一次性物品的浮动系数) - * @param handleDepartCode - * @param specifyDisposableTypes 是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} * @param useAssetsBelong 使用资产归属过滤 * @return */ @@ -446,35 +407,6 @@ * @param settleAccountsDepartCoding * @param handleDepartCode * @param specifyDisposableTypes 是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} - * - * @return - */ - public List> searchTousseOrDiposableGoodsBySpellAndWbCode( - String simpleSpell, boolean isSeachTousse, - boolean includeCoustomTousse, boolean searchTousseBelonged, - boolean onlySearchRecyclingTousse, boolean displayPrice, - boolean includeForeignTousse, - String pageIndex, String countOfLI, boolean showDisableGoods, - boolean showExternalCodeOfDisposableGoods,String settleAccountsDepartCoding,String handleDepartCode,String specifyDisposableTypes); - /** - * 根据关键字进行检索,获取器械包或一次性物品..
- * 如果searchString为中文,则按照器械包的(拼音码、五笔码、外部编码、名称)这四个字段进行检索
- * 如果searchString为英文,则根据用户属性表的searchMode字段来决定
- * - * @param simpleSpell 检索的关键字 - * @param isSeachTousse 为true时只查询器械包,为false时只查询一次性物品 - * @param includeCoustomTousse 为true时不过滤自定义器械包,为false时过滤自定义器械包 - * @param includeForeignTousse 为true时包含外来器械包,为false时过滤外来器械包 - * @param searchTousseBelonged 是否只搜索登录用户当前科室能处理的器械包 - * @param onlySearchRecyclingTousse 是否只搜索要回收的器械包 - * @param showReferencePrice - * @param pageIndex 页码 - * @param countOfLI 显示数目,当countOfLI为0时查询所有的记录,不分页 - * @param showDisableGoods 是否显示禁用物品 - * @param showExternalCodeOfDisposableGoods 是否显示一次性物品的外部编码 - * @param settleAccountsDepartCoding - * @param handleDepartCode - * @param specifyDisposableTypes 是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} * @param useAssetsBelong 使用资产归属过滤 * @return */ @@ -533,39 +465,12 @@ public TousseDefinition getMostRecentCommonTousseDefinitionByTousseDefinition( TousseDefinition tousseDefinition); - /** * 在指定的器械包类型的基础上,根据关键字模糊查询,获取器械包的部分信息.. * @param keyword 搜索的关键字:为空时则不需要模糊查询(即:全部符合条件),否则按照用户的检索习惯进行模糊查询 * @param tousseTypeArr 指定的器械包类型的数组,如果不指定则为:所有器械包类型 * @param showDisableGoods 是否要显示已经停用的器械包 * @param sortBySpelling 是否按拼音码进行排序 - * @return 返回值格式如下,取每个器械包对象的12个属性:
- * [{
- * id:器械包id,
- * name:器械包名称,
- * displayName:如果外部编码不为空则为“外部编码+ +器械包名称”,否则为“器械包名称”,
- * spelling:器械包名称拼音码,
- * wbCode:器械包名称五笔码,
- * price:器械包价格,
- * borrowPrice:器械包出借价格,
- * type:器械包类型,
- * isCleanedEntirely:是否整包清洗,
- * isApplyEntireTousse:是否整包申请(只针对消毒物品才有意义),
- * expressInvoice:是否快速发货,
- * unit:器械包的单位,
- * materialsArry:材料的详细信息(包类型为消毒物品才有此属性)
- * },{}......] - */ - public List> searchTousseByKeywordAndTousseTypeArr(String keyword, - String[] tousseTypeArr ,boolean showDisableGoods, boolean sortBySpelling); - - /** - * 在指定的器械包类型的基础上,根据关键字模糊查询,获取器械包的部分信息.. - * @param keyword 搜索的关键字:为空时则不需要模糊查询(即:全部符合条件),否则按照用户的检索习惯进行模糊查询 - * @param tousseTypeArr 指定的器械包类型的数组,如果不指定则为:所有器械包类型 - * @param showDisableGoods 是否要显示已经停用的器械包 - * @param sortBySpelling 是否按拼音码进行排序 * @param useAssetsBelong 使用资产归属过滤 * @return 返回值格式如下,取每个器械包对象的12个属性:
* [{
@@ -601,17 +506,6 @@ */ public List> searchTousseByKeywordAndTousseTypeArr(boolean filterForDisplay, String keyword, String[] tousseTypeArr ,boolean showDisableGoods); - /** - * 查询科室处理器械包. - * @param cssdOrgUnit 处理科室的科室编码 - * @param spell 搜索关键字 - * @param start 开始的行数 - * @param limit 每一页显示的大小 - * @param predicates 需要过滤的条件集合 - * @param retObj 额外的参数是一个JSONObject对象(里面有两个属性:1、needToBw:为true则需要根据物品黑白名单过滤 2、appCode:申请科室的科室编码) - * @return - */ - public List getCssdHandleTousseDefinitionList(OrgUnit cssdOrgUnit,String spell,int start,int limit,Set predicates,JSONObject retObj); /** * 查询科室处理器械包. @@ -718,13 +612,6 @@ String cssdOrgUnitCode,String cssdOrgUnitName, String applyOrgUnitCode,String applyOrgUnitName); public List searchTousseDefinitions(String searchString,String tousseType, - String handlerDepartCodes,String supplierName,boolean showDisableGoods,boolean showForeignTousseAncestorDefinition); - - /** - * 重载上面的方法,新增是否使用资产归属过滤 - * @param useAssetsBelong 使用资产归属过滤 - */ - public List searchTousseDefinitions(String searchString,String tousseType, String handlerDepartCodes,String supplierName,boolean showDisableGoods,boolean showForeignTousseAncestorDefinition,boolean useAssetsBelong); /** * 获取祖先id,如果祖先id为空,则返回包定义自己的id. Index: ssts-web/src/test/java/test/forgon/disinfectsystem/goodFilterConfig/GoodFilterConfigTest.java =================================================================== diff -u -r26085 -r26151 --- ssts-web/src/test/java/test/forgon/disinfectsystem/goodFilterConfig/GoodFilterConfigTest.java (.../GoodFilterConfigTest.java) (revision 26085) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/goodFilterConfig/GoodFilterConfigTest.java (.../GoodFilterConfigTest.java) (revision 26151) @@ -118,7 +118,7 @@ OrgUnit cssd = OrgUnitDataProvider.createOrgUnit("testCSSD"); String tousseType = InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM; Set predicates = this.prepareSearch(tousseType); - List list = this.tousseDefinitionManager.getCssdHandleTousseDefinitionList(cssd, "", 0, 1000, predicates, new JSONObject()); + List list = this.tousseDefinitionManager.getCssdHandleTousseDefinitionList(cssd, "", 0, 1000, predicates, new JSONObject(),false); // 查找结果是否包含专科器械组和一次性物品 Collection select = CollectionUtils.select(list, td -> TousseDefinition.TOUSSE_GROUP_SPECIALIZED_INSTRUMENT.equals(td.getTousseType()) || TousseItem.TYPE_DIPOSABLE_GOODS.equals(td.getTousseType())); //断言不包含这两种物品 @@ -268,7 +268,7 @@ this.saveGoodFilterConfig(appCode, blackNames, whiteNames); Set predicates = this.prepareSearch(tousseType); JSONObject retObj = this.buildBWListPara(appCode); - return this.tousseDefinitionManager.getCssdHandleTousseDefinitionList(cssd, "", 0, 0, predicates, retObj); + return this.tousseDefinitionManager.getCssdHandleTousseDefinitionList(cssd, "", 0, 0, predicates, retObj,false); } /** Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java =================================================================== diff -u -r26144 -r26151 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 26144) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 26151) @@ -807,7 +807,7 @@ JSONObject json = null; List tousseDefinitions = searchTousseDefinitions(searchString, tousseType, - handlerDepartCodes, supplierName, showDisableGoods,showForeignTousseAncestorDefinition); + handlerDepartCodes, supplierName, showDisableGoods,showForeignTousseAncestorDefinition,false); List> mapList = new ArrayList>(); for (TousseDefinition tousseDefinition : tousseDefinitions) { @@ -878,97 +878,6 @@ * TODO 外来器械查询随着申请单生成的包定义的增加,此方法会越来越慢,需要改造 */ @Override - public List searchTousseDefinitions(String searchString,String tousseType, - String handlerDepartCodes,String supplierName,boolean showDisableGoods,boolean showForeignTousseAncestorDefinition) { - - searchString = SqlUtils.filterIllegalCharachers(searchString); - - String sql = createQuerySQL(searchString); - - if (TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType)) {// 内部器械包 - // 申请单会进入这个ELSE - sql += " and po.tousseType = '" - + TousseDefinition.PACKAGE_TYPE_INSIDE + "'"; - } else if (TousseDefinition.PACKAGE_TYPE_FOREIGN.equals(tousseType)) {// 外来器械包 - // 外来器械包 - sql += " and po.tousseType = '" - + TousseDefinition.PACKAGE_TYPE_FOREIGN + "'"; - // 如果当前登录用户为外来器械供应商的申请人员时,只查询该申请人员关联的供应商下的外来器械包或未配置申请人员的供应商的外来器械包 - List supplierNameList = supplierManager.getSupplierNameListByTypeAndUserCode(Supplier.SUPPLIER_TYPE_RENTTOUSSE, AcegiHelper.getLoginUser().getUserName()); - if(CollectionUtils.isNotEmpty(supplierNameList)){ - sql += " and " + SqlUtils.getStringFieldInLargeCollectionsPredicate("supplierName", supplierNameList); - } - } else if (TousseDefinition.PACKAGE_TYPE_DISINFECTION - .equals(tousseType)) { - // 消毒物品 - sql += " and po.tousseType = '" - + TousseDefinition.PACKAGE_TYPE_DISINFECTION - + "'"; - } else if (TousseDefinition.PACKAGE_TYPE_FOREIGNPROXY.equals(tousseType)) {// 外部代理灭菌器械包 - // 外部代理灭菌器械包 - sql += " and po.tousseType = '" - + TousseDefinition.PACKAGE_TYPE_FOREIGNPROXY + "'"; - } - // 允许自定义装配的器械包 - else if (TousseDefinition.PACKAGE_TYPE_CAN_CUSTOM_PACKING.equals(tousseType)) { - sql = addInternalTousseTypesQuery(sql); - - sql += " and po.isCustomPacking = '" - + TousseDefinition.STR_YES + "'"; - } else if ("all".equals(tousseType)) { - sql += " and po.tousseType != '" - + TousseDefinition.PACKAGE_TYPE_SPLIT + "'"; - } else { - // 其他 (内部器械包) - sql = addInternalTousseTypesQuery(sql); - } - - if (StringUtils.isNotBlank(handlerDepartCodes)) { - String handlerDepartCodeSql = null; - for (String handlerDepartCode : handlerDepartCodes.split(";")) { - if (handlerDepartCodeSql == null) { - handlerDepartCodeSql = " and (po.handlerDepartCode = '" - + handlerDepartCode + "'"; - } else { - handlerDepartCodeSql += " or po.handlerDepartCode = '" - + handlerDepartCode + "'"; - } - } - sql += handlerDepartCodeSql + ")"; - } - if(StringUtils.isNotBlank(supplierName)){ - sql += String.format(" and po.supplierName='%s'", supplierName); - } - - // 包类型不是【外来器械包】时,才增加forDisplay!=0的过滤 - if (!TousseDefinition.PACKAGE_TYPE_FOREIGN.equals(tousseType)) { - sql += " and po.forDisplay != 0 "; - }else{ - if(showForeignTousseAncestorDefinition){ - sql += " and po.forDisplay != 0 "; - // 查询外来器械申请单创建的包定义 - } else { - if(!showDisableGoods){ - //用祖先id的话,有些旧数据祖先id是自己,就没办法停用了。 - sql += String.format(" and po.name not in(select distinct t.name from TousseDefinition t where t.tousseType = '%s' and t.forDisplay = 1 and t.isDisable = '%s') ", - TousseDefinition.PACKAGE_TYPE_FOREIGN,Constants.STR_YES); - } - } - } - - //不显示停用的器械包 - if(!showDisableGoods){ - sql += " and (po.isDisable = '" + Constants.STR_NO + "' or po.isDisable is null) "; - } - - sql += " order by " + DatabaseUtil.getSqlLengthFunctionName(dbConnection) + "(po.name) asc,id desc"; - - @SuppressWarnings("unchecked") - List tousseDefinitions = objectDao.findBySql( - TousseDefinition.class.getSimpleName(), sql); - return tousseDefinitions; - } - @Override public List searchTousseDefinitions(String searchString, String tousseType, String handlerDepartCodes, String supplierName, boolean showDisableGoods, @@ -1014,6 +923,7 @@ // 其他 (内部器械包) sql = addInternalTousseTypesQuery(sql); } + if (StringUtils.isNotBlank(handlerDepartCodes)) { String handlerDepartCodeSql = null; for (String handlerDepartCode : handlerDepartCodes.split(";")) { @@ -1051,14 +961,7 @@ if(!showDisableGoods){ sql += " and (po.isDisable = '" + Constants.STR_NO + "' or po.isDisable is null) "; } - //根据资产归属进行过滤 - String orgUnitCoding = AcegiHelper.getCurrentOrgUnitCode(); - //判断当前科室是否是供应室 不过滤供应室 - boolean isFirstOrSecondSupplyRoomOrgUnit = supplyRoomConfigManager.isFirstOrSecondSupplyRoomOrgUnit(orgUnitCoding); - if(useAssetsBelong && !isFirstOrSecondSupplyRoomOrgUnit){ - //只查询归属本科室的包 - sql += " and ( (po.assetsBelong like '%\"departCode\":\""+orgUnitCoding+"\"%') or po.assetsBelong is null or po.assetsBelong = '')"; - } + sql = getWhereSqlForAssetsBelong(useAssetsBelong, sql); sql += " order by " + DatabaseUtil.getSqlLengthFunctionName(dbConnection) + "(po.name) asc,id desc"; @SuppressWarnings("unchecked") @@ -1083,9 +986,9 @@ */ @Override public JSONObject searchTousseAndDiposableGoods(String searchString) { - List> mapList = searchTousseByKeywordAndTousseTypeArr(searchString, null, false, true); + List> mapList = searchTousseByKeywordAndTousseTypeArr(searchString, null, false, true,false); mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, true, false,false,false,"1","0",false,false,null,null,null)); + searchString, false, true, false,false,false,"1","0",false,false,null,null,null,false)); Map map = new HashMap(); map.put("totalCount", mapList.size()); @@ -1099,9 +1002,9 @@ @Override public JSONObject searchTousseAndForeignTousseDiposableGoods(String searchString) { List> mapList = searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, true, true, false,false,false,true,"1","0",false,false,null,null,null); + searchString, true, true, false,false,false,true,"1","0",false,false,null,null,null,false); mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, true, false,false,false,true,"1","0",false,false,null,null,null)); + searchString, false, true, false,false,false,true,"1","0",false,false,null,null,null,false)); Map map = new HashMap(); map.put("totalCount", mapList.size()); @@ -1117,7 +1020,7 @@ public JSONObject searchTousseOrDiposableGoods(String simpleSpell, boolean isSeachTousse) { List> mapList = searchTousseOrDiposableGoodsBySpellAndWbCode( - simpleSpell, isSeachTousse, true, false,false,false,"1","0",false,false,null,null,null); + simpleSpell, isSeachTousse, true, false,false,false,"1","0",false,false,null,null,null,false); Map map = new HashMap(); map.put("totalCount", mapList.size()); map.put("data", mapList); @@ -1142,18 +1045,6 @@ public List> searchTousseOrDiposableGoodsBySpellAndWbCode( String simpleSpell, boolean isSeachTousse, boolean includeCoustomTousse, boolean searchTousseBelonged, - boolean onlySearchRecyclingTousse,boolean showReferencePrice, - String pageIndex, String countOfLI, boolean showDisableGoods, - boolean showExternalCodeOfDisposableGoods,String settleAccountsDepartCoding,String handleDepartCode,String specifyDisposableTypes) { - return searchTousseOrDiposableGoodsBySpellAndWbCode(simpleSpell,isSeachTousse,includeCoustomTousse, - searchTousseBelonged,onlySearchRecyclingTousse,showReferencePrice,false,pageIndex, - countOfLI,showDisableGoods,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,handleDepartCode,specifyDisposableTypes); - } - - @Override - public List> searchTousseOrDiposableGoodsBySpellAndWbCode( - String simpleSpell, boolean isSeachTousse, - boolean includeCoustomTousse, boolean searchTousseBelonged, boolean onlySearchRecyclingTousse, boolean displayPrice, String pageIndex, String countOfLI, boolean showDisableGoods, boolean showExternalCodeOfDisposableGoods, @@ -1164,134 +1055,9 @@ countOfLI,showDisableGoods,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,handleDepartCode,specifyDisposableTypes,true); } @Override - @SuppressWarnings("unchecked") public List> searchTousseOrDiposableGoodsBySpellAndWbCode( String simpleSpell, boolean isSeachTousse, boolean includeCoustomTousse, boolean searchTousseBelonged, - boolean onlySearchRecyclingTousse,boolean showReferencePrice, - boolean includeForeignTousse, - String pageIndex, String countOfLI, boolean showDisableGoods, - boolean showExternalCodeOfDisposableGoods, - String settleAccountsDepartCoding,String handleDepartCode,String specifyDisposableTypes) { - // 有些输入法会输入"'",要过滤掉,不过滤执行sql会报异常 - if(StringUtils.isNotBlank(simpleSpell)){ - simpleSpell = simpleSpell.replace("'", ""); - } - String sql = createQuerySQL(simpleSpell); - - if (onlySearchRecyclingTousse){ - sql += " and po.isRecycling = '"+TousseDefinition.STR_YES+"' and po.tousseType in ('"+ TousseDefinition.PACKAGE_TYPE_INSIDE +"','"+ TousseDefinition.PACKAGE_TYPE_DISINFECTION +"') "; - } - - //按处理科室查询器械包,改为从CssdHandleTousses表查询,不再按器械包定义里面的查询 - /*if (searchTousseBelonged){ - String handlerDepartCode = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig(); - if(StringUtils.isNotBlank(handlerDepartCode)){ - sql += " and po.handlerDepartCode = '" + handlerDepartCode + "' "; - } - }*/ - List> mapList = new ArrayList>(); - if (isSeachTousse) { - // 排除外部代理灭菌和外来器械拆分小包 - sql += (" and po.tousseType != '" - + TousseDefinition.PACKAGE_TYPE_SPLIT - + "' and po.tousseType != '" - + TousseDefinition.PACKAGE_TYPE_FOREIGNPROXY + "'"); - - if(includeCoustomTousse == false){ - sql += (" and po.tousseType != '" - + TousseDefinition.PACKAGE_TYPE_CUSTOM + "'"); - } - if(includeForeignTousse == false){ - sql += (" and po.tousseType != '" - + TousseDefinition.PACKAGE_TYPE_FOREIGN + "'"); - } - sql += " and po.forDisplay = 1 ";//自己生成的包定义不显示 - if(searchTousseBelonged){ - sql += " and po.ancestorID in (select tousseDefinitionId from " + CssdHandleTousses.class.getSimpleName() - + " where orgUnitCode='"+ AcegiHelper.getLoginUser().getCurrentOrgUnitCode()+"')"; - } - //是否显示禁用物品 - if(!showDisableGoods){ - sql += " and po.isDisable != '" + TousseDefinition.STR_YES + "' "; - } - - int amount = Integer.parseInt(countOfLI); - int index = (Integer.parseInt(pageIndex) - 1) * amount; - - if (amount > 0){ - // 如果要分页显示,则不能按名字长度排序。因为同样长度的包太多,会导致分页不准确 - sql += " order by po.name asc"; - }else{ - // 不分页显示,按名称的长度排序显示 - sql += " order by " + DatabaseUtil.getSqlLengthFunctionName(dbConnection) + "(po.name) asc"; - } - List tousseDefinitions = objectDao - .findBySql(TousseDefinition.class.getSimpleName(), sql, - index, amount, null); - if (tousseDefinitions != null) { -// String handlerDepartCode = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig(); - for (TousseDefinition tousseDefinition : tousseDefinitions) { - //不可以在这里这样判断,因为有分页,有可能因为分页导致查询结果中没有目标处理科室的内容,但是实际上是有对应的内容的,只是当前页没有获取到 -// if (searchTousseBelonged){ -// if(!getTousseTaskGroupByOrgUnitCode(tousseDefinition , handlerDepartCode)){ -// continue; -// } -// } - Map temp = new HashMap(); - temp.put("id", tousseDefinition.getId()); - temp.put("name", tousseDefinition.getName()); - temp.put("showName", tousseDefinition.getName()); - temp.put("displayName", tousseDefinition.getName()); - temp.put("spelling", tousseDefinition.getSpelling()); - temp.put("price", tousseDefinition.getPrice()); - temp.put("type", tousseDefinition.getTousseType()); - temp.put("isCleanedEntirely", tousseDefinition.getIsCleanedEntirely()); - temp.put("isApplyEntireTousse", tousseDefinition.getIsApplyEntireTousse()); - Double borrowPrice = tousseDefinition.getBorrowPrice(); - temp.put("borrowPrice", borrowPrice == null ? 0 : borrowPrice); - String isDisableIDCard = tousseDefinition.getIsDisableIDCard(); - String isThereIdentificationCard = "否"; - if("否".equals(isDisableIDCard)){ - isThereIdentificationCard = "是"; - } - temp.put("isThereIdentificationCard", isThereIdentificationCard); - mapList.add(temp); - } - } - } else { - if(!showDisableGoods){ - sql += " and po.isDisable = '" + Constants.STR_NO + "' and po.isApplicationMaterial = '" + DisposableGoodsStock.CONSTANT_YES + "' "; - } - //按一次性物品类型过滤 - if (StringTools.isNotBlank(specifyDisposableTypes)) { - JSONObject specifyDisposableTypeObj = JSONObject.fromObject(specifyDisposableTypes); - String[] split = specifyDisposableTypeObj.optString("disposableTypes").split(";"); - if (split.length > 0) { - List list = Arrays.asList(split); - String typeSql = ""; - if (specifyDisposableTypeObj.optBoolean("include")) { - typeSql = String.format(" and %s ", SqlUtils.getStringFieldInLargeCollectionsPredicate("po.type", list)); - } else { - typeSql = String.format(" and (%s or po.type='' or po.type is null) ", SqlUtils.getStringFieldNotInCollectionsPredicate("po.type", list)); - } - sql += typeSql; - } - } - sql += " order by " - + DatabaseUtil.getSqlLengthFunctionName(dbConnection) - + "(po.name) asc"; - List> diposableGoodsList = diposableGoodsManager - .getDisposableGoodsList(sql,showReferencePrice,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,handleDepartCode); - - mapList = diposableGoodsList; - } - return mapList; - } - @Override - public List> searchTousseOrDiposableGoodsBySpellAndWbCode( - String simpleSpell, boolean isSeachTousse, - boolean includeCoustomTousse, boolean searchTousseBelonged, boolean onlySearchRecyclingTousse, boolean displayPrice, boolean includeForeignTousse, String pageIndex, String countOfLI, boolean showDisableGoods, @@ -1340,14 +1106,7 @@ if(!showDisableGoods){ sql += " and po.isDisable != '" + TousseDefinition.STR_YES + "' "; } - //根据资产归属进行过滤 - String orgUnitCoding = AcegiHelper.getCurrentOrgUnitCode(); - //判断当前科室是否是供应室 不过滤供应室 - boolean isFirstOrSecondSupplyRoomOrgUnit = supplyRoomConfigManager.isFirstOrSecondSupplyRoomOrgUnit(orgUnitCoding); - if(useAssetsBelong && !isFirstOrSecondSupplyRoomOrgUnit){ - //只查询归属本科室的包 - sql += " and ( (po.assetsBelong like '%\"departCode\":\""+orgUnitCoding+"\"%') or po.assetsBelong is null or po.assetsBelong = '')"; - } + sql = getWhereSqlForAssetsBelong(useAssetsBelong, sql); int amount = Integer.parseInt(countOfLI); int index = (Integer.parseInt(pageIndex) - 1) * amount; @@ -1745,59 +1504,6 @@ } @Override - public Map searchComboGoods(String searchString, String tousseType, - boolean showReferencePrice, - boolean showExternalCodeOfDisposableGoods,String settleAccountsDepartCoding,String deptCode) { - - List> mapList = new ArrayList>(); - // 只搜索器械包(包含敷料包和消毒物品),如果启用了聚合包功能则包括聚合包 - if (TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DISINFECTION.equals(tousseType)){ - String[] searchTousseTypeArray = new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING,TousseDefinition.PACKAGE_TYPE_DISINFECTION }; - if(CssdUtils.getSystemSetConfigByNameBool("enableComboTousse")){ - searchTousseTypeArray = new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING,TousseDefinition.PACKAGE_TYPE_DISINFECTION,TousseDefinition.PACKAGE_TYPE_COMBO }; - } - mapList = searchTousseByKeywordAndTousseTypeArr( - searchString, searchTousseTypeArray,false ,false); - //器械包和敷料包 - }else if(TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DRESSING.equals(tousseType)){ - mapList = searchTousseByKeywordAndTousseTypeArr( - searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING},false ,false); - } - // 只搜索器械包(包含敷料包,不含消毒物品) - else if (TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType)){ - mapList = searchTousseByKeywordAndTousseTypeArr( - searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING },false ,false); - } - // 只搜索一次性物品 - else if (TousseItem.TYPE_DIPOSABLE_GOODS.equals(tousseType)){ - mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, false, false,false,true,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null)); - } - //只搜索消毒物品 - else if (TousseDefinition.PACKAGE_TYPE_DISINFECTION.equals(tousseType)){ - mapList = searchTousseByKeywordAndTousseTypeArr(searchString, new String[]{TousseDefinition.PACKAGE_TYPE_DISINFECTION},false ,false); - } - // 搜索多种器械包(含消毒物品)和一次性物品,用于组合申请单 - else{ - mapList = searchTousseByKeywordAndTousseTypeArr( - searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING, - TousseDefinition.PACKAGE_TYPE_DISINFECTION },false ,true); - - mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null)); - } - - Map map = new HashMap(); - map.put("totalCount", mapList.size()); - map.put("data", mapList); - return map; - } - @Override public Map searchComboGoods(String searchString, String tousseType, boolean showReferencePrice, boolean showExternalCodeOfDisposableGoods, @@ -1813,12 +1519,12 @@ TousseDefinition.PACKAGE_TYPE_DRESSING,TousseDefinition.PACKAGE_TYPE_DISINFECTION,TousseDefinition.PACKAGE_TYPE_COMBO }; } mapList = searchTousseByKeywordAndTousseTypeArr( - searchString, searchTousseTypeArray,false ,false); + searchString, searchTousseTypeArray,false ,false,true); //器械包和敷料包 }else if(TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DRESSING.equals(tousseType)){ mapList = searchTousseByKeywordAndTousseTypeArr( searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, - TousseDefinition.PACKAGE_TYPE_DRESSING},false ,false); + TousseDefinition.PACKAGE_TYPE_DRESSING},false ,false,true); } // 只搜索器械包(包含敷料包,不含消毒物品) else if (TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType)){ @@ -1829,7 +1535,7 @@ // 只搜索一次性物品 else if (TousseItem.TYPE_DIPOSABLE_GOODS.equals(tousseType)){ mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, false, false,false,true,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null)); + searchString, false, false, false,false,true,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null,false)); } //只搜索消毒物品 else if (TousseDefinition.PACKAGE_TYPE_DISINFECTION.equals(tousseType)){ @@ -1840,10 +1546,10 @@ mapList = searchTousseByKeywordAndTousseTypeArr( searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DRESSING, - TousseDefinition.PACKAGE_TYPE_DISINFECTION },false ,true); + TousseDefinition.PACKAGE_TYPE_DISINFECTION },false ,true,true); mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode( - searchString, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null)); + searchString, false, false, false,false,showReferencePrice,"1","0",false,showExternalCodeOfDisposableGoods,settleAccountsDepartCoding,deptCode,null,false)); } Map map = new HashMap(); @@ -1866,8 +1572,8 @@ */ @Override public List> searchAllTousseAndDiposableGoods(String simpleSpell,boolean showDisableGoods) { - List> mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] {},showDisableGoods ,false); - mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode(simpleSpell, false, false, false,false,false,"1","0",showDisableGoods,false,null,null,null)); + List> mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] {},showDisableGoods ,false,false); + mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode(simpleSpell, false, false, false,false,false,"1","0",showDisableGoods,false,null,null,null,false)); return mapList; } @@ -1890,10 +1596,10 @@ public List> searchInsideTousseOrDiposableGoods(String simpleSpell, boolean isSearchTousse) { List> mapList = new ArrayList<>(); if (isSearchTousse) { - mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] { TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DRESSING, TousseDefinition.PACKAGE_TYPE_HOMEMADE },false ,false); + mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] { TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DRESSING, TousseDefinition.PACKAGE_TYPE_HOMEMADE },false ,false,false); } else { - mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode(simpleSpell, false, false, false,false,false,"1","0",false,false,null,null,null)); + mapList.addAll(searchTousseOrDiposableGoodsBySpellAndWbCode(simpleSpell, false, false, false,false,false,"1","0",false,false,null,null,null,false)); } return mapList; } @@ -1920,7 +1626,7 @@ @Override public List> searchTousseForBorrowing(String simpleSpell){ - List> mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] { TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_HOMEMADE, TousseDefinition.PACKAGE_TYPE_DISINFECTION},false ,false); + List> mapList = searchTousseByKeywordAndTousseTypeArr(simpleSpell, new String[] { TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_HOMEMADE, TousseDefinition.PACKAGE_TYPE_DISINFECTION},false ,false,false); return mapList; } /* @@ -2133,49 +1839,6 @@ } @Override - public List> searchTousseByKeywordAndTousseTypeArr(String keyword, - String[] tousseTypeArr ,boolean showDisableGoods, boolean sortBySpelling) { - - String sql = createQuerySQL(keyword); - - //只在指定器械包类型做查询 - if (tousseTypeArr != null && tousseTypeArr.length > 0) { - String tempTousseTypeSql = ""; - for (String tousseType : tousseTypeArr) { - if (tousseType != null) { - if (StringUtils.isNotBlank(tempTousseTypeSql)) { - tempTousseTypeSql += " or "; - } - tempTousseTypeSql += " po.tousseType = '" - + tousseType.trim() + "'"; - } - } - - if (StringUtils.isNotBlank(tempTousseTypeSql)) { - sql += " and (" + tempTousseTypeSql + ") "; - } - } - sql += " and po.forDisplay != 0 "; //forDisplay=0的过滤掉 - - if (!showDisableGoods) { //过滤已停用的器械包(注意:如果isDisable属性为空,当成非停用的器械包,不过滤) - sql += String.format(" and(po.isDisable is null or po.isDisable<>'%s') ", - TousseDefinition.STR_YES); - } - - String orderBySql = String.format(" order by %s ", (sortBySpelling ? "spelling" : DatabaseUtil.getSqlLengthFunctionName(dbConnection) + "(name)")); - - List> mapList = new ArrayList>(); - List tousseDefinitions = objectDao.findBySql(TousseDefinition.class.getSimpleName(), sql + orderBySql); - - if (tousseDefinitions != null) { - for (TousseDefinition tousseDefinition : tousseDefinitions) { - mapList.add(buildTousseDefinitionInfo(tousseDefinition)); - } - } - return mapList; - - } - @Override public List> searchTousseByKeywordAndTousseTypeArr( String keyword, String[] tousseTypeArr, boolean showDisableGoods, boolean sortBySpelling, boolean useAssetsBelong) { @@ -2204,14 +1867,7 @@ sql += String.format(" and(po.isDisable is null or po.isDisable<>'%s') ", TousseDefinition.STR_YES); } - //根据资产归属进行过滤 - String orgUnitCoding = AcegiHelper.getCurrentOrgUnitCode(); - //判断当前科室是否是供应室 不过滤供应室 - boolean isFirstOrSecondSupplyRoomOrgUnit = supplyRoomConfigManager.isFirstOrSecondSupplyRoomOrgUnit(orgUnitCoding); - if(useAssetsBelong && !isFirstOrSecondSupplyRoomOrgUnit){ - //只查询归属本科室的包 - sql += " and ( (po.assetsBelong like '%\"departCode\":\""+orgUnitCoding+"\"%') or po.assetsBelong is null or po.assetsBelong = '')"; - } + sql = getWhereSqlForAssetsBelong(useAssetsBelong, sql); String orderBySql = String.format(" order by %s ", (sortBySpelling ? "spelling" : DatabaseUtil.getSqlLengthFunctionName(dbConnection) + "(name)")); List> mapList = new ArrayList>(); @@ -2631,7 +2287,8 @@ @SuppressWarnings("unchecked") @Override public List getCssdHandleTousseDefinitionList( - OrgUnit cssdOrgUnit,String spell,int start,int limit,Set predicates,JSONObject retObj) { + OrgUnit cssdOrgUnit, String spell, int start, int limit, + Set predicates, JSONObject retObj, boolean useAssetsBelong) { List list = null; int totalCount = 0; String whereSql = " where fordisplay = 1 and id in (select tousseDefinitionId from " + @@ -2653,8 +2310,8 @@ whereSql = goodFilterConfigManagerImpl.buildBWListSql(whereSql, appCode); } } - - String findSql = String.format(" from %s %s order by spelling ", TousseDefinition.class.getSimpleName(),whereSql); + whereSql = getWhereSqlForAssetsBelong(useAssetsBelong, whereSql); + String findSql = String.format(" from %s po %s order by spelling ", TousseDefinition.class.getSimpleName(),whereSql); logger.debug("findSql:" + findSql); if(limit > 0){ list = objectDao.findByHql(findSql,start,limit); @@ -2668,52 +2325,23 @@ retObj.put("totalCount", totalCount); return list; } - @Override - public List getCssdHandleTousseDefinitionList( - OrgUnit cssdOrgUnit, String spell, int start, int limit, - Set predicates, JSONObject retObj, boolean useAssetsBelong) { - List list = null; - int totalCount = 0; - String whereSql = " where fordisplay = 1 and id in (select tousseDefinitionId from " + - CssdHandleTousses.class.getSimpleName() + " where orgUnitCode = '" + cssdOrgUnit.getOrgUnitCoding() + "')"; - whereSql += " and (spelling like '%" + spell + "%' or wbCode like '%" - + spell + "%' or externalCode like '" + spell - + "%' or name like '%" + spell + "%') and (isDisable is null or isDisable = '"+TousseDefinition.STR_NO+"')"; - if(!predicates.isEmpty()){ - for (String predicate : predicates) { - whereSql += " and " + predicate; - } - } - - if (JSONUtil.optBoolean(retObj, "needToBw", false)){ - //黑白名单过滤 - String appCode = retObj.getString("appCode"); - if(StringUtils.isNotBlank(appCode)){ - //只有申请科室编号不为空才开启过滤 - whereSql = goodFilterConfigManagerImpl.buildBWListSql(whereSql, appCode); - } - } + /** + * 给sql添加资产归属查询条件 + * @param useAssetsBelong 是否使用资产归属字段过滤 + * @param sql + * @return 添加查询资产归属条件的sql + */ + private String getWhereSqlForAssetsBelong(boolean useAssetsBelong, String sql) { //根据资产归属进行过滤 - String orgUnitCoding = AcegiHelper.getCurrentOrgUnitCode(); - //判断当前科室是否是供应室 不过滤供应室 - boolean isFirstOrSecondSupplyRoomOrgUnit = supplyRoomConfigManager.isFirstOrSecondSupplyRoomOrgUnit(orgUnitCoding); - if(true && !isFirstOrSecondSupplyRoomOrgUnit){ - //只查询归属本科室的包 - whereSql += " and ( (po.assetsBelong like '%\"departCode\":\""+orgUnitCoding+"\"%') or po.assetsBelong is null or po.assetsBelong = '')"; - } - String findSql = String.format(" from %s %s order by spelling ", TousseDefinition.class.getSimpleName(),whereSql); - logger.debug("findSql:" + findSql); - if(limit > 0){ - list = objectDao.findByHql(findSql,start,limit); - totalCount = objectDao.countObjectBySql(TousseDefinition.class.getSimpleName(),whereSql); - }else{ - list = objectDao.findByHql(findSql); - if(list != null){ - totalCount = list.size(); + if(useAssetsBelong){ + String orgUnitCoding = AcegiHelper.getCurrentOrgUnitCode(); + //判断当前科室是否是供应室 不过滤供应室 + boolean isFirstOrSecondSupplyRoomOrgUnit = supplyRoomConfigManager.isFirstOrSecondSupplyRoomOrgUnit(orgUnitCoding); + if(isFirstOrSecondSupplyRoomOrgUnit){//只查询归属本科室的包 + sql += " and ( (po.assetsBelong like '%\"departCode\":\""+orgUnitCoding+"\"%') or po.assetsBelong is null or po.assetsBelong = '')"; } } - retObj.put("totalCount", totalCount); - return list; + return sql; } @Override public List saveOrUpdateCssdHandleTousseDefinitions( @@ -3801,13 +3429,13 @@ public List> searchTousseAndDisposableGoodsAndExpensiveGoods(String keyword) { //1、器械包 List> list = new ArrayList>(); - List> tousseList = searchTousseByKeywordAndTousseTypeArr(keyword, new String[]{},true ,true); + List> tousseList = searchTousseByKeywordAndTousseTypeArr(keyword, new String[]{},true ,true,false); if (CollectionUtils.isNotEmpty(tousseList)) { list.addAll(tousseList); } //2、一次性物品 - List> disposableGoodsList = searchTousseOrDiposableGoodsBySpellAndWbCode(keyword, false, false, false,false,false,"1","0",true,false,null,AcegiHelper.getCurrentOrgUnitCode(),null); + List> disposableGoodsList = searchTousseOrDiposableGoodsBySpellAndWbCode(keyword, false, false, false,false,false,"1","0",true,false,null,AcegiHelper.getCurrentOrgUnitCode(),null,false); if (CollectionUtils.isNotEmpty(disposableGoodsList)) { list.addAll(disposableGoodsList); } Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/service/ServiceManagerImpl.java =================================================================== diff -u -r26083 -r26151 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/service/ServiceManagerImpl.java (.../ServiceManagerImpl.java) (revision 26083) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/service/ServiceManagerImpl.java (.../ServiceManagerImpl.java) (revision 26151) @@ -889,7 +889,7 @@ String spell = params.optString("spell"); if(StringUtils.isNotBlank(spell)){ List> mapList = tousseDefinitionManager.searchTousseOrDiposableGoodsBySpellAndWbCode( - spell, true, false, true, true,false, "1", "10000",false,false,null,null,null); + spell, true, false, true, true,false, "1", "10000",false,false,null,null,null,false); if (mapList != null) { for (int i = 0; i < mapList.size(); i++) { Map map = mapList.get(i);