Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java =================================================================== diff -u -r23290 -r23298 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 23290) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 23298) @@ -2129,6 +2129,8 @@ int rowsPerPage = printScope.optInt("rowsPerPage", 8); // 打印申请信息,而不是回收信息 boolean printApplyInfo = printScope.optBoolean("printApplyInfo", false); + // 同一个物品,是否合并打印 + boolean mergeSameGoods = printScope.optBoolean("mergeSameGoods", false); boolean isMergePrintMultiApplicationsOfSameDepart = printScope .optBoolean("isMergePrintMultipleSelectedApplications", true); @@ -2208,7 +2210,7 @@ for (Long id : applicationIdsArray){ Collection col = toPrintMap.getCollection(id); if (col != null && col.size() > 0){ - addToSummaryList(rowsPerPage, summaryList, new ArrayList(col), printApplyInfo, shiftName, sheetName,printTemplate); + addToSummaryList(rowsPerPage, summaryList, new ArrayList(col), printApplyInfo, shiftName, sheetName,printTemplate,mergeSameGoods); } } } @@ -2217,7 +2219,7 @@ populateSummaryList(printScope, allTousseItems, summaryList, rowsPerPage, printApplyInfo, - isMergePrintMultiApplicationsOfSameDepart, shiftName, sheetName); + isMergePrintMultiApplicationsOfSameDepart, shiftName, sheetName,mergeSameGoods); } @@ -2235,7 +2237,7 @@ @Override public void populateSummaryList(JSONObject printScope,Collection allTousseItems, List summaryList, int rowsPerPage, - boolean printApplyInfo, boolean isMergePrintMultiApplicationsOfSameDepart, String shiftName, String sheetName) { + boolean printApplyInfo, boolean isMergePrintMultiApplicationsOfSameDepart, String shiftName, String sheetName,boolean mergeSameGoods) { // 默认为器械包和一次性物品不合并打印 boolean isMergePrintTousseAndDisposable = printScope.optBoolean("mergePrintTousseAndDiposable"); @@ -2372,31 +2374,31 @@ // 物品打印顺序,优先打印一次性物品 if (printOrder == CSSDConstants.PRINT_ORDER_DISPOSABLE_FIRST){ toPrintItemsOfDiposableGoods.addAll(toPrintItemsOfTousses); - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName,mergeSameGoods); } // 物品打印顺序,优先打印器械包 else{ toPrintItemsOfTousses.addAll(toPrintItemsOfDiposableGoods); - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName,mergeSameGoods); } } // 器械包和一次性物品不合并打印 else{ // 物品打印顺序,优先打印一次性物品 if (printOrder == CSSDConstants.PRINT_ORDER_DISPOSABLE_FIRST){ - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName); - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName,mergeSameGoods); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName,mergeSameGoods); } // 物品打印顺序,优先打印器械包 else{ - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName); - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfTousses, printApplyInfo, shiftName, sheetName,mergeSameGoods); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDiposableGoods, printApplyInfo, shiftName, sheetName,mergeSameGoods); } } // 如果待打印的消毒物品集合不为空,则单独打印消毒物品 if (toPrintItemsOfDisinfectGoods.size() > 0){ - addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDisinfectGoods, printApplyInfo, shiftName, sheetName); + addToSummaryList(rowsPerPage, summaryList, toPrintItemsOfDisinfectGoods, printApplyInfo, shiftName, sheetName,mergeSameGoods); } } @@ -2603,10 +2605,10 @@ */ private void addToSummaryList(int rowsPerPage, List summaryList, List toPrintItems, - boolean printApplyInfo, String shiftName, String sheetName,String printTemplate) { + boolean printApplyInfo, String shiftName, String sheetName,String printTemplate,boolean mergeSameGoods) { List printRowVos = tousseItems2PrintRowVos(toPrintItems, - printApplyInfo); + printApplyInfo,mergeSameGoods); makeSummaryList(rowsPerPage, summaryList, printRowVos, shiftName, sheetName,printTemplate); } @@ -2621,8 +2623,8 @@ */ private void addToSummaryList(int rowsPerPage, List summaryList, List toPrintItems, - boolean printApplyInfo, String shiftName, String sheetName) { - addToSummaryList(rowsPerPage, summaryList, toPrintItems, printApplyInfo, shiftName,sheetName,null); + boolean printApplyInfo, String shiftName, String sheetName,boolean mergeSameGoods) { + addToSummaryList(rowsPerPage, summaryList, toPrintItems, printApplyInfo, shiftName,sheetName,null,mergeSameGoods); } /** @@ -2752,8 +2754,23 @@ return pages; } - - private List tousseItems2PrintRowVos(List tousseItems, boolean printApplyInfo){ + /** + * + * @param vos + * @param tousseAncestorId + * @return + */ + private PrintRowVo find(Collection vos,Long tousseAncestorId){ + if(CollectionUtils.isNotEmpty(vos)){ + for(PrintRowVo vo : vos){ + if(MathTools.valueEquals(tousseAncestorId, vo.getAncestorID())){ + return vo; + } + } + } + return null; + } + private List tousseItems2PrintRowVos(List tousseItems, boolean printApplyInfo,boolean mergeSameGoods){ List rowVos = new ArrayList(); // 过滤掉要打印的属性的数量为零0 TousseItem @@ -2764,9 +2781,19 @@ boolean afterRecyclingTousseDeliver = systemParamsObj.getAfterRecyclingTousseDeliver(); for (int i=0;i allTousseItems, List summaryList, int rowsPerPage, - boolean printApplyInfo, boolean isMergePrintMultiApplicationsOfSameDepart, String shiftName, String sheetName); + boolean printApplyInfo, boolean isMergePrintMultiApplicationsOfSameDepart, String shiftName, String sheetName,boolean mergeSameGoods); public void setPrintInfo(String printUser, List summaryList); Index: ssts-web/src/main/webapp/disinfectsystem/config/kpszxyy/print/printConfig.js =================================================================== diff -u -r22813 -r23298 --- ssts-web/src/main/webapp/disinfectsystem/config/kpszxyy/print/printConfig.js (.../printConfig.js) (revision 22813) +++ ssts-web/src/main/webapp/disinfectsystem/config/kpszxyy/print/printConfig.js (.../printConfig.js) (revision 23298) @@ -163,6 +163,7 @@ isMergePrintTousseAndDisposable : false, // 器械包和一次性物品是否合并打印 printByOriginalApplications : true, //不合并打印情况下是否按原始单据逐份打印 printApplyInfo : false, + mergeSameGoods : true, printOrder : 1, // 1:优先打印一次性物品, 2:优先打印器械包 // 在器械包和一次性物品不合并打印的情况下,消毒物品打印方式: // 1:优先与一次性物品合并打印,如果无一次性物品则与器械包合并打印, 2:优先与器械包一起合并打印,如果没有器械包则与一次性物品合并打印 ,3:单独打印