Index: ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/config.js =================================================================== diff -u -r23090 -r23121 --- ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/config.js (.../config.js) (revision 23090) +++ ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/config.js (.../config.js) (revision 23121) @@ -70,7 +70,13 @@ //待回收申请单,是否打印回收汇总单 printWaitRecyclingInvoicePlanSummary:true, //打印回收汇总单的统计天数 - waitRecyclingInvoicePlanSummaryDays:1, + waitRecyclingInvoicePlanSummaryDays:180, + //打印回收汇总单是否要选择回收科室分组。true表示要选择,然后只打印选择的回收科室。false表示不选择,打印全部回收科室分组的科室 + printInvoicePlanSummarySelectDepartgroup:true, + //打印回收汇总单统计的申请单回收状态。默认为待回收,如果配置了多个,就以英文分号分隔 + recyclingSummaryPrintInvoicePlanRecyclingStatus:'待回收;部分回收', + //打印回收汇总单,已经打印的申请单,是否可以重复打印,默认为false,此时打印过的单,不会再打印 + recyclingSummaryPrintCanRepeat:true, //是否显示按器械包分组选择框 isShowTousseGroup : true, //装配界面,扫描清洗篮筐后是否默认自动勾选篮筐内的器械包 Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r22812 -r23121 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 22812) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 23121) @@ -1735,7 +1735,8 @@ public void printWaitRecyclingInvoicePlanSummary(){ try{ - JSONObject data = recyclingRecordManager.printWaitRecyclingInvoicePlanSummary(); + String departGroupsIds = StrutsParamUtils.getPraramValue("departmentGroupIds", null); + JSONObject data = recyclingRecordManager.printWaitRecyclingInvoicePlanSummary(departGroupsIds); StrutsResponseUtils.output(data); }catch(Exception e){ exceptionHandler.handleException(StrutsParamUtils.getResponse(), e); Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/selectDepartGroup.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/selectDepartGroup.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/selectDepartGroup.jsp (revision 23121) @@ -0,0 +1,91 @@ +<%@page import="java.util.List"%> +<%@page import="com.forgon.disinfectsystem.entity.recycledepartmentgroup.DepartmentGroup"%> +<%@page import="com.forgon.disinfectsystem.basedatamanager.departmentgroup.service.DepartmentGroupManager"%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + +<% + DepartmentGroupManager departmentGroupManager = (DepartmentGroupManager) SpringBeanManger.getBean("departmentGroupManager"); + List list = departmentGroupManager.getAll(); + request.setAttribute("list",list); +%> + +<%@ include file="/common/clearCache.jsp"%> +选择回收科室分组 + + + + + + + + +<%--防止模态框在新窗口打开--%> + + + + +
+ +
+ + ${i.name} +
+
+
+ +
+ + 确定 + + 取消 +
+ + + \ No newline at end of file Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r22988 -r23121 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 22988) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 23121) @@ -4094,7 +4094,7 @@ } @Override - public JSONObject printWaitRecyclingInvoicePlanSummary() { + public JSONObject printWaitRecyclingInvoicePlanSummary(String departmentGroupIds) { Calendar now = Calendar.getInstance(); String toTime = ForgonDateUtils.safelyFormatDate(now.getTime(), Constants.SIMPLEDATEFORMAT_YYYYMMDD, ""); int days = CssdUtils.getSystemSetConfigByNameInt("waitRecyclingInvoicePlanSummaryDays", 2); @@ -4105,19 +4105,44 @@ throw new SystemException("登录用户的所属科室不能为空"); } String dateSql = dateQueryAdapter.dateAreaSql("po.applicationTime", fromTime, toTime, true, true); - List departGroups = departmentGroupManager.getAll(); + List departGroups = null; + if(StringUtils.isNotBlank(departmentGroupIds)){ + departGroups = departmentGroupManager.getCollection(departmentGroupIds, ";"); + }else{ + departGroups = departmentGroupManager.getAll(); + } + String departmentGroupSql = "1=1"; + if(CollectionUtils.isNotEmpty(departGroups)){ + List departCodes = new ArrayList<>(); + departGroups.stream().forEach(p->departCodes.addAll(p.departCodes())); + departmentGroupSql = SqlUtils.getStringFieldInLargeCollectionsPredicate("po.departCoding", departCodes); + } + String recyclingSummaryPrintStatusSql = String.format("po.recyclingSummaryPrintStatus <> '%s'", Constants.STR_YES); + if(CssdUtils.getSystemSetConfigByNameBool("recyclingSummaryPrintCanRepeat")){ + recyclingSummaryPrintStatusSql = "1=1"; + } + String recyclingStatus = null; + String recyclingSummaryPrintInvoicePlanRecyclingStatus = CssdUtils.getSystemSetConfigByName("recyclingSummaryPrintInvoicePlanRecyclingStatus"); + if(StringUtils.isNotBlank(recyclingSummaryPrintInvoicePlanRecyclingStatus)){ + recyclingStatus = SqlUtils.getStringFieldInLargeCollectionsPredicate("po.recyclingStatus", + Arrays.asList(recyclingSummaryPrintInvoicePlanRecyclingStatus.split(";"))); + }else{ + recyclingStatus = SqlUtils.getStringFieldInLargeCollectionsPredicate("po.recyclingStatus", + Arrays.asList(InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE)); + } + String sql = String .format("select po.id,min(po.depart) departName,po.departCoding,td.ancestorID,min(bo.tousseName) tousseName,sum(bo.amount) amount,td.id tousseDefId from %s po " + "join %s bo on po.id = bo.recyclingApplication_ID join %s td on td.id = bo.tousseDefinitionId " - + "where %s and po.handleDepartCoding = '%s' and po.recyclingStatus='%s' and bo.tousseType in ('%s','%s','%s') " - + " and po.type in ('%s','%s','%s','%s') and po.recyclingSummaryPrintStatus <> '%s'" - + " and td.isRecycling='%s' group by po.departCoding,po.id,td.ancestorID,td.id", + + "where %s and po.handleDepartCoding = '%s' and %s and bo.tousseType in ('%s','%s','%s') " + + " and po.type in ('%s','%s','%s','%s') and %s" + + " and td.isRecycling='%s' and %s group by po.departCoding,po.id,td.ancestorID,td.id", InvoicePlan.class.getSimpleName(), TousseItem.class.getSimpleName(), - TousseDefinition.class.getSimpleName(),dateSql, handlerDepartCoding,InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE,TousseDefinition.PACKAGE_TYPE_INSIDE, + TousseDefinition.class.getSimpleName(),dateSql, handlerDepartCoding,recyclingStatus,TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DISINFECTION,TousseDefinition.PACKAGE_TYPE_CUSTOM, InvoicePlan.TYPE_COMBO_FORM,InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM,InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM, - InvoicePlan.TYPE_CUSTOM_TOUSSE_APPLIACTION_FORM,Constants.STR_YES,Constants.STR_YES); + InvoicePlan.TYPE_CUSTOM_TOUSSE_APPLIACTION_FORM,recyclingSummaryPrintStatusSql,Constants.STR_YES,departmentGroupSql); logger.debug("回收汇总单sql:" + sql); ResultSet rs = objectDao.executeSql(sql); Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r23120 -r23121 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 23120) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 23121) @@ -247,6 +247,14 @@ var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseGroup.jsp?allowNull=false&resultType=code"; return openModalWindow(url, "选择器械包分组", "1000", "750"); } +/** + * 选择器械包分组,根据分组进行发货计划的打印 + * @returns + */ +function showSelectDepartmentGroup(){ + var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectDepartGroup.jsp?allowNull=false&resultType=code"; + return openModalWindow(url, "选择回收科室分组", "1000", "750"); +} function sumTotal(store){ if(store.getCount()!=0){ var sum =0; @@ -2241,8 +2249,21 @@ top.Ext.MessageBox.confirm("请确认", "要打印回收汇总单吗?", function (btn) { if (btn == 'yes') { + var departmentGroupIds = null; + if(sstsConfig.printInvoicePlanSummarySelectDepartgroup){ + departmentGroupIds = showSelectDepartmentGroup(); + if (departmentGroupIds == null && departmentGroupIds == undefined) { + return; + } + if (departmentGroupIds == '') { + showResult('请选择回收科室分组!'); + return; + } + } + Ext.Ajax.request({ url : WWWROOT + '/disinfectSystem/recyclingRecordAction!printWaitRecyclingInvoicePlanSummary.do', + params : {departmentGroupIds : departmentGroupIds}, success : function(response, options) { var obj = Ext.decode(response.responseText); if(obj.success){ Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java =================================================================== diff -u -r22988 -r23121 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 22988) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 23121) @@ -91,5 +91,5 @@ /** * 打印待回收的申请单的物品汇总,供回收的时候使用。按打印单上的物品及数量进行回收 */ - public JSONObject printWaitRecyclingInvoicePlanSummary(); + public JSONObject printWaitRecyclingInvoicePlanSummary(String departmentGroupIds); }