Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r31173 -r31190 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 31173) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 31190) @@ -15155,7 +15155,7 @@ + extraJoin + " join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql; + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql; sql+= " union all select distinct " + dataSql + " dateStr," + " qmd.tousseName toussName,qmd.material material,qmd.amount amount,qmi.id qmiId,qmi.positionMsg positionMsg," + " '' fdiName,null orderNum,'' value,null id,fi.createUserName,null orderNumber " @@ -15166,7 +15166,7 @@ + extraJoin + " left join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + " and fiov.id is null and qmi.id not in(" + " select qmi.id qmiId" + " from QualityMonitoringInstance qmi join FormInstance fi on qmi.id=fi.id join FormDefinition fd on fi.formDefinition_id=fd.id " @@ -15175,7 +15175,7 @@ + extraJoin + " join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + "))temp " + tempOrderBySql; addMonitoringItemBeanOptionRadioAndCHeck(list,sql,showSterilizationInfo, washScope); // 没有录入材料和包,有配了多选的细则的项 @@ -15189,7 +15189,7 @@ + " join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + extraJoin + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + " and qmi.id in ( select qmi.id from QualityMonitoringInstance qmi left join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id where qmd.id is null)"; sql += " union all select distinct " + dataSql + " dateStr," + " qmi.id qmiId,qmi.positionMsg positionMsg," @@ -15201,7 +15201,7 @@ + " left join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + extraJoin + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + " and qmi.id in ( select qmi.id from QualityMonitoringInstance qmi left join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id where qmd.id is null)" + " and fiov.id is null and qmi.id not in (" + " select qmi.id qmiId " @@ -15211,7 +15211,7 @@ + " join FormInstanceOptionValue fiov on fiov.formInstanceItem_id=fiItem.id " + extraJoin + " and fiov.definitionItemOption_id=fdio.id " - + " where (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + + " where fdi.isReportDisplay='是' and (fdi.type = '" + FormDefinitionItem.TYPE_RADIO + "' or fdi.type ='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + " and qmi.id in ( select qmi.id from QualityMonitoringInstance qmi left join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id where qmd.id is null)" + ")"; addMonitoringItemBeanOptionRadioAndCHeckWithoutMaterial(list,sql,showSterilizationInfo); @@ -15223,7 +15223,7 @@ + " join QualityMonitoringDefinition qmdf on qmdf.id=fd.id join FormInstanceItem fiItem on qmi.id=fiItem.formInstance_id join FormDefinitionItem fdi on fiItem.formDefinitionItem_id=fdi.id " + " join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id " + extraJoin - + " where "+ answerWhereSql +" (fdi.type != '" + FormDefinitionItem.TYPE_RADIO + "' and fdi.type!='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + qmdOrderNumberBySql; + + " where "+ answerWhereSql +" (fdi.type != '" + FormDefinitionItem.TYPE_RADIO + "' and fdi.isReportDisplay='是' and fdi.type!='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql + tousseNameSql + qmdOrderNumberBySql; addMonitoringItemBeanOptionSingleResult(list,sql,showSterilizationInfo, washScope); // 没有录入材料和包,单一的结果 sql = " select " + dataSql + " dateStr," @@ -15234,7 +15234,7 @@ + " join QualityMonitoringDefinition qmdf on qmdf.id=fd.id join FormInstanceItem fiItem on qmi.id=fiItem.formInstance_id join FormDefinitionItem fdi on fiItem.formDefinitionItem_id=fdi.id " + extraJoin + " where "+ answerWhereSql +" (fdi.type != '" + FormDefinitionItem.TYPE_RADIO + "' and fdi.type!='" + FormDefinitionItem.TYPE_CHECK + "')" + " and " + whereSql - + " and qmi.id in ( select qmi.id from QualityMonitoringInstance qmi left join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id where qmd.id is null) "; + + " and fdi.isReportDisplay='是' and qmi.id in ( select qmi.id from QualityMonitoringInstance qmi left join QualityMonitoringGoods qmd on qmi.id=qmd.qualityMonitoringInstance_id where qmd.id is null) "; addMonitoringItemBeanOptionSingleResultWithoutMaterial(list,sql,showSterilizationInfo,monitoringType); if(FormDefinition.FOMRTYPE_QUALITYMONITORING.equals(monitoringType)){ @@ -15495,7 +15495,7 @@ + SqlUtils.getHandleDepartCodingOfQualityMonitoringDefinitionSql(orgUnitCoding) //+ SqlUtils.get_InSql_Extra("fi.orgUnitCoding", orgUnitCoding) + fiOrgUnitCodingSql - + " and fiov.id is not null " + + " and fiov.id is not null and fdi.isReportDisplay='是' " + " and fiov.id in (select id from FormInstanceOptionValue where formInstanceItem_id = fiItem.id) " + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startYear) + "and "+dateQueryAdapter.dateAdapter(nextYear) @@ -15511,7 +15511,7 @@ + SqlUtils.getHandleDepartCodingOfQualityMonitoringDefinitionSql(orgUnitCoding) //+ SqlUtils.get_InSql_Extra("fi.orgUnitCoding", orgUnitCoding) + fiOrgUnitCodingSql - + " and fiov.id is null " + + " and fiov.id is null and fdi.isReportDisplay='是' " + " and fdi.type != '" + FormDefinitionItem.TYPE_RADIO + "' " + " and fdi.type != '" + FormDefinitionItem.TYPE_CHECK + "' " + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startYear) @@ -15530,7 +15530,7 @@ //+ SqlUtils.get_InSql_Extra("fi.orgUnitCoding", orgUnitCoding) + fiOrgUnitCodingSql + " and fdi.name = '" + inspectDetail + "'" - + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startYear) + + " and fdi.isReportDisplay='是' and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startYear) + "and "+dateQueryAdapter.dateAdapter(nextYear) + " group by " + dateQueryAdapter.dateConverAdapter3("qmi.dateTime","mm") + " ,fiOption.answer "; } @@ -15582,7 +15582,7 @@ + fiOrgUnitCodingSql //+ SqlUtils.get_InSql_Extra("fi.orgUnitCoding", orgUnitCoding) + " and (fiItem.id in (select formInstanceItem_id from FormInstanceOptionValue )) " - + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startTime) + + " and fdi.isReportDisplay='是' and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startTime) + "and "+dateQueryAdapter.dateAdapter(endTime) + " group by " + dateQueryAdapter.dateConverAdapter3("qmi.dateTime","dd") + " ,fdi.name "; }else{ @@ -15597,7 +15597,7 @@ + SqlUtils.getHandleDepartCodingOfQualityMonitoringDefinitionSql(orgUnitCoding) + fiOrgUnitCodingSql //+ SqlUtils.get_InSql_Extra("fi.orgUnitCoding", orgUnitCoding) - + " and fdi.name = '" + inspectDetail + "'" + + " and fdi.isReportDisplay='是' and fdi.name = '" + inspectDetail + "'" + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startTime) + "and "+dateQueryAdapter.dateAdapter(endTime) + " group by " + dateQueryAdapter.dateConverAdapter3("qmi.dateTime","dd") + " ,fiOption.answer "; @@ -15680,7 +15680,7 @@ + fiOrgUnitCodingSql + SqlUtils.getHandleDepartCodingOfQualityMonitoringDefinitionSql(orgUnitCoding) //+ " and (fiItem.id in (select formInstanceItem_id from FormInstanceOptionValue)) " - + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startDay) + + " and fdi.isReportDisplay='是' and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startDay) + "and "+dateQueryAdapter.dateAdapter(endDay) + " group by " + " fdi.name "; }else{ @@ -15696,7 +15696,7 @@ + " and fd.formType = '" + monitoringType + "'" + fiOrgUnitCodingSql + SqlUtils.getHandleDepartCodingOfQualityMonitoringDefinitionSql(orgUnitCoding) - + " and fdi.name = '" + inspectDetail + "'" + + " and fdi.isReportDisplay='是' and fdi.name = '" + inspectDetail + "'" + " and qmi.dateTime between " + dateQueryAdapter.dateAdapter(startDay) + "and "+dateQueryAdapter.dateAdapter(endDay) + " group by "+ " fiOption.answer "; @@ -16039,13 +16039,22 @@ return nameList; } List fds = formDefinitionManager.getFormDefinitionsByTypeAndName(monitoringType, inspectItem); + List filterFormDefinitionItem = objectDao.findByHql("select po.items from FormDefinition po where po.version=(select max(version) from FormDefinition where formName='"+ inspectItem +"' and formType='"+ monitoringType +"') "); + Set filterName = new HashSet(); + for (FormDefinitionItem fdi : filterFormDefinitionItem) { + if(!Constants.STR_YES.equals(fdi.getIsReportDisplay())){ + filterName.add(fdi.getName()); + } + } if(StringUtils.isBlank(inspectDetail)){ // 获取统计细则的项 if( fds != null && CollectionUtils.isNotEmpty(fds)){ for (FormDefinition fd : fds){ for(FormDefinitionItem item : fd.getItems()){ - if(Constants.STR_YES.equals(item.getIsReportDisplay())){ - nameList.add(item.getName()); + if(Constants.STR_YES.equals(item.getIsReportDisplay()) && !filterName.contains(item.getName())){ + if(!nameList.contains(item.getName())){ + nameList.add(item.getName()); + } } } } @@ -16056,12 +16065,14 @@ if( fds != null && CollectionUtils.isNotEmpty(fds)){ for (FormDefinition fd : fds){ for(FormDefinitionItem item : fd.getItems()){ - if(inspectDetail.equals(item.getName())){ + if(inspectDetail.equals(item.getName()) && !filterName.contains(item.getName())){ String type = item.getType(); // 只有单选或者多选,才加入统计 if(FormDefinitionItem.TYPE_CHECK.equals(type) || FormDefinitionItem.TYPE_RADIO.equals(type)){ for(FormDefinitionItemOption optoin : item.getOptions()){ - nameList.add(optoin.getValue()); + if(!nameList.contains(optoin.getValue())){ + nameList.add(optoin.getValue()); + } } } } @@ -22540,7 +22551,7 @@ .append(formName) .append("') and formName='") .append(formName) - .append("' order by fdi.orderNumber,fdio.orderNumber asc"); + .append("' and fdi.isReportDisplay='是' order by fdi.orderNumber,fdio.orderNumber asc"); ResultSet rs = null; Map> columnNameMap = new LinkedHashMap>(); Map columnWidthMap = new LinkedHashMap();