Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/StatisticalWorkloadHelper.java =================================================================== diff -u -r38307 -r41318 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/StatisticalWorkloadHelper.java (.../StatisticalWorkloadHelper.java) (revision 38307) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/StatisticalWorkloadHelper.java (.../StatisticalWorkloadHelper.java) (revision 41318) @@ -84,7 +84,14 @@ sequenceMap.put("预回收数量", ++staticFieldsCount); sequenceMap.put("回收数量", ++staticFieldsCount); sequenceMap.put("清点数量", ++staticFieldsCount); - sequenceMap.put("清洗数量", ++staticFieldsCount); + boolean enableHandWashIndependentStatistics = CssdUtils.getSystemSetConfigByNameBool("enableHandWashIndependentStatistics", false); + if(enableHandWashIndependentStatistics){ + sequenceMap.put("清洗数量(机洗)", ++staticFieldsCount); + sequenceMap.put("清洗数量(手洗)", ++staticFieldsCount); + }else{ + sequenceMap.put("清洗数量", ++staticFieldsCount); + } + boolean enablesThePurposePropertyOfRinser = CssdUtils.getSystemSetConfigByNameBool("enablesThePurposePropertyOfRinser", false); if(enablesThePurposePropertyOfRinser){ sequenceMap.put("吹干数量", ++staticFieldsCount); @@ -201,23 +208,52 @@ tousseAmountSql += " union all "; String oldExtraQuery = params.extraQuery; + + String thePurposePropertyOfRinserSql = StringUtils.EMPTY; if(enablesThePurposePropertyOfRinser){ - params.extraQuery = " and exists (select 1 from Rinser where wdr.rinserId=id and purpose='"+ Rinser.PURPOSE_WASH +"') "; + thePurposePropertyOfRinserSql = " and exists (select 1 from Rinser where wdr.rinserId=id and purpose='"+ Rinser.PURPOSE_WASH +"') "; } - //清洗数量 - tousseAmountSql += String.format("select '清洗数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" - +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) - + ") tl group by tl.userName " + integralSql); - if(enablesThePurposePropertyOfRinser){ - params.extraQuery = " and exists (select 1 from Rinser where wdr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; + if(enableHandWashIndependentStatistics){ + + params.extraQuery = thePurposePropertyOfRinserSql + + " and exists (select 1 from Rinser where wdr.rinserId=id and (isManualClean is null or isManualClean<>'是')) "; + tousseAmountSql += String.format("select '清洗数量(机洗)' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" + +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + + ") tl group by tl.userName " + integralSql); + tousseAmountSql += " union all "; + params.extraQuery = thePurposePropertyOfRinserSql + + " and exists (select 1 from Rinser where wdr.rinserId=id and isManualClean='是') "; //清洗数量 - tousseAmountSql += String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" + tousseAmountSql += String.format("select '清洗数量(手洗)' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + ") tl group by tl.userName " + integralSql); + + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = " and exists (select 1 from Rinser where wdr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; + //清洗数量 + tousseAmountSql += String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" + +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + + ") tl group by tl.userName " + integralSql); + } + }else{ + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = thePurposePropertyOfRinserSql; + } + //清洗数量 + tousseAmountSql += String.format("select '清洗数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" + +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + + ") tl group by tl.userName " + integralSql); + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = " and exists (select 1 from Rinser where wdr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; + //清洗数量 + tousseAmountSql += String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" + +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + + ") tl group by tl.userName " + integralSql); + } } + params.extraQuery = oldExtraQuery; tousseAmountSql += " union all "; - //装配数量(按包统计) tousseAmountSql += String.format("select '配包数量' type,tl.userName,sum(tl.amount) amount"+ sumIntegralSql +" from (" +dataIndex.getWorkAmountByPackageSQL("配包数量", params) @@ -296,7 +332,7 @@ + ") tl group by tl.userName " + integralSql); } - Set readedNames = new HashSet(); + Set readedNames = new HashSet(); ResultSet rs = objectDao.executeSql(tousseAmountSql); if (rs != null) { try { @@ -383,22 +419,54 @@ materialAmountSql += " union all "; oldExtraQuery = params.extraQuery; - if(enablesThePurposePropertyOfRinser){ - params.extraQuery = " and exists (select 1 from Rinser where wr.rinserId=id and purpose='"+ Rinser.PURPOSE_WASH +"') "; - } - //清洗记录 - String s = String.format("select '清洗数量' type,tl.userName,sum(tl.amount) amount from (" - +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) - + ") tl group by tl.userName "); - materialAmountSql += s; + thePurposePropertyOfRinserSql = StringUtils.EMPTY; if(enablesThePurposePropertyOfRinser){ - params.extraQuery = " and exists (select 1 from Rinser where wr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; - //清洗记录 - String drySql = String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount from (" + thePurposePropertyOfRinserSql = " and exists (select 1 from Rinser where wr.rinserId=id and purpose='"+ Rinser.PURPOSE_WASH +"') "; + } + if(enableHandWashIndependentStatistics){ + + params.extraQuery = thePurposePropertyOfRinserSql + + " and exists (select 1 from Rinser where wr.rinserId=id and (isManualClean is null or isManualClean<>'是')) "; + //清洗记录 + String s = String.format("select '清洗数量(机洗)' type,tl.userName,sum(tl.amount) amount from (" +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl group by tl.userName "); - materialAmountSql += drySql; - } + materialAmountSql += s; + materialAmountSql += " union all "; + params.extraQuery = thePurposePropertyOfRinserSql + + " and exists (select 1 from Rinser where wr.rinserId=id and isManualClean='是') ";; + //清洗记录 + String s2 = String.format("select '清洗数量(手洗)' type,tl.userName,sum(tl.amount) amount from (" + +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + + ") tl group by tl.userName "); + materialAmountSql += s2; + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = " and exists (select 1 from Rinser where wr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; + //清洗记录 + String drySql = String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount from (" + +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + + ") tl group by tl.userName "); + materialAmountSql += drySql; + } + }else{ + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = thePurposePropertyOfRinserSql; + } + //清洗记录 + String s = String.format("select '清洗数量' type,tl.userName,sum(tl.amount) amount from (" + +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + + ") tl group by tl.userName "); + materialAmountSql += s; + if(enablesThePurposePropertyOfRinser){ + params.extraQuery = " and exists (select 1 from Rinser where wr.rinserId=id and purpose='"+ Rinser.PURPOSE_DRY +"') "; + //清洗记录 + String drySql = String.format(" union all select '吹干数量' type,tl.userName,sum(tl.amount) amount from (" + +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + + ") tl group by tl.userName "); + materialAmountSql += drySql; + } + } + params.extraQuery = oldExtraQuery; materialAmountSql += "union all "; if(statisticTousseWorkLoadIncludeDisposableGoodsAmountObj !=null){