Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/Invoice.java =================================================================== diff -u -r15906 -r16096 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/Invoice.java (.../Invoice.java) (revision 15906) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/Invoice.java (.../Invoice.java) (revision 16096) @@ -22,9 +22,9 @@ import org.hibernate.annotations.CascadeType; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.forgon.Constants; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; import com.forgon.tools.hibernate.ObjectDao; +import com.forgon.tools.string.StringTools; /** * @author WangYi 2012-3-5 @@ -498,4 +498,21 @@ setPrintTime(new Date()); } } + /** + * 是否自定义发货 + * @return + */ + @Transient + public boolean isCustomInvoice(){ + return StringTools.equals(TYPE_CUSTOM, invoicePlanType); + } + + /** + * 是否手术预约发货 + * @return + */ + @Transient + public boolean isOperationReservationInvoice(){ + return StringTools.equals(TYPE_OPERATION_RESERVATION, invoicePlanType); + } } Index: ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java =================================================================== diff -u -r16078 -r16096 --- ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16078) +++ ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16096) @@ -709,9 +709,9 @@ if (StringUtils.isNotBlank(departCoding)) { sql += "and po.invoicePlan.departCoding = '" + departCoding + "'"; } - sql += " and po.invoicePlan.type != '" + sql += " and po.invoicePlanType != '" + InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM - + "' and po.invoicePlan.type != '" + + "' and po.invoicePlanType != '" + InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM + "' order by po.sendTime asc"; List list = findBySql(sql); @@ -797,7 +797,7 @@ if (StringUtils.isNotBlank(departCoding)) { sql += "and invoicePlan.departCoding = '" + departCoding + "'"; } - sql += " and invoicePlan.type = '" + sql += " and invoicePlanType = '" + InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM + "'"; String orderBy = " order by sendTime asc"; List list = findBySql(sql + orderBy); @@ -873,7 +873,7 @@ if (StringUtils.isNotBlank(departCoding)) { sql += "and po.invoicePlan.departCoding = '" + departCoding + "'"; } - sql += " and po.invoicePlan.type = '" + sql += " and po.invoicePlanType = '" + InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM + "' order by po.sendTime asc"; List list = findBySql(sql); @@ -6326,7 +6326,13 @@ tempVo = new InvoicePrintVo(); tempVo.setAmount(1); - tempVo.setRecyclingAmount(getTousseActualRecycleAmount(recycleAmountInfo, tousseDefinition.getAncestorID())); + if(invoice.isCustomInvoice() || invoice.isOperationReservationInvoice()){ + //自定义发货与手术预约发货,实收数量为0 + tempVo.setRecyclingAmount(0); + }else{ + tempVo.setRecyclingAmount(getTousseActualRecycleAmount(recycleAmountInfo, tousseDefinition.getAncestorID())); + } + tempVo.setSendDate(invoice.getSendTime()); tempVo.setFrequency(frequency); tempVo.setName(tousseInstance.getTousseName()); @@ -6496,7 +6502,12 @@ tempVo = new InvoicePrintVo(); tempVo.setAmount(1); - tempVo.setRecyclingAmount(getTousseActualRecycleAmount(recycleAmountInfo, tousseDefinition.getAncestorID())); + if(invoice.isCustomInvoice() || invoice.isOperationReservationInvoice()){ + //自定义发货与手术预约发货,实收数量为0 + tempVo.setRecyclingAmount(0); + }else{ + tempVo.setRecyclingAmount(getTousseActualRecycleAmount(recycleAmountInfo, tousseDefinition.getAncestorID())); + } tempVo.setSendDate(invoice.getSendTime()); tempVo.setFrequency(frequency); tempVo.setName(tousseInstance.getTousseName()); @@ -6604,8 +6615,8 @@ String idsStr = StringUtils.join(invoiceIds, ","); String sql = String.format(" where po.id in (%s)", idsStr); - sql += String.format(" and po.invoicePlan.type != '%s'" - + " and po.invoicePlan.type != '%s'" + sql += String.format(" and po.invoicePlanType != '%s'" + + " and po.invoicePlanType != '%s'" + " order by po.sendTime asc", InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM, InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM); @@ -6706,12 +6717,17 @@ invoicePrintVo.setSterilizerName(tousseInstance.getSterilizerName()); invoicePrintVo.setFrequency(tousseInstance.getSterileFrequency()); - Integer recyclingAmount = getTousseActualRecycleAmount(recycleAmountInfo,tousseDefinition.getAncestorID()); - if(!tousseDefinition.applyEntireTousse()){ - recyclingAmount = MathTools.mul(materialJson.getInt("totalAmout"), recyclingAmount).intValue(); + if(invoice.isCustomInvoice() || invoice.isOperationReservationInvoice()){ + //自定义发货与手术预约发货,实收数量为0 + invoicePrintVo.setRecyclingAmount(0); + }else{ + Integer recyclingAmount = getTousseActualRecycleAmount(recycleAmountInfo,tousseDefinition.getAncestorID()); + if(!tousseDefinition.applyEntireTousse()){ + recyclingAmount = MathTools.mul(materialJson.getInt("totalAmout"), recyclingAmount).intValue(); + } + invoicePrintVo.setRecyclingAmount(recyclingAmount); } - invoicePrintVo.setRecyclingAmount(recyclingAmount); - + invoicePrintVo.setSendDate(invoice.getSendTime()); if(tousseDefinition.applyEntireTousse()){ invoicePrintVo.setPrice(materialJson.getDouble("totalPrice")); @@ -6816,7 +6832,7 @@ String idsStr = StringUtils.join(invoiceIds, ","); String sql = String.format(" where id in (%s)", idsStr); - sql += String.format(" and invoicePlan.type != '%s'", + sql += String.format(" and invoicePlanType != '%s'", InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM); String orderBy = " order by sendTime asc"; List list = findBySql(sql + orderBy); @@ -6973,9 +6989,13 @@ if(dg != null){ tempVo.setName(dg.getName()); tempVo.setSpecification(dg.showSpecification()); - tempVo.setRecyclingAmount(applyAmountMap.get(dg.getId())); + if(invoice.isCustomInvoice() || invoice.isOperationReservationInvoice()){ + //自定义发货与手术预约发货,实收数量为0 + tempVo.setRecyclingAmount(0); + }else{ + tempVo.setRecyclingAmount(applyAmountMap.get(dg.getId())); + } } - } voList.add(tempVo); } @@ -7001,7 +7021,7 @@ String idsStr = StringUtils.join(invoiceIds, ","); String sql = String.format(" where po.id in (%s)", idsStr); - sql += String.format(" and po.invoicePlan.type != '%s'" + sql += String.format(" and po.invoicePlanType != '%s'" + " order by po.sendTime asc", InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM); List list = findBySql(sql); @@ -7022,7 +7042,7 @@ } String[] depts = departCodes.split(";"); - String depSql = SqlUtils.getStringFieldInCollectionsPredicate("po.invoicePlan.departCoding", Arrays.asList(depts)); + String depSql = SqlUtils.getStringFieldInCollectionsPredicate("po.departCoding", Arrays.asList(depts)); String where = " where " + depSql + " and po.isPrint in ('" + Invoice.PRINT_NO + "','" + Invoice.PRINT_PART + "') "; String invoiceSql = "from " + Invoice.class.getSimpleName() + " po " + " left outer join fetch po.invoiceItem " + where; Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js =================================================================== diff -u -r15909 -r16096 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 15909) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 16096) @@ -1759,7 +1759,7 @@ {header : "责任人",width : 70,dataIndex : 'personInCharge'}, {header : "发货时间",width : 120,dataIndex : 'sendTime',renderer : myDateFormatByMinute}, {header : "状态",width : 70,dataIndex : 'status',renderer : renderColor}, - {header : "类型",width : 110,dataIndex : 'invoicePlan.type',sortable:false}, + {header : "类型",width : 110,dataIndex : 'invoicePlanType',sortable:false}, {id : 'remark',header : "备注",width : 110,dataIndex : 'remark'}, {header : "打印时间",width : 120,dataIndex : 'printTime',sortable:false,renderer : myDateFormatByMinute}, {header : "已打印",width : 50,dataIndex : 'isPrint',renderer : renderPrintColor}, @@ -1789,7 +1789,7 @@ {name : 'totalPrice'}, {name : 'remark'}, {name : 'hospitalNumber'}, - {name : 'invoicePlan.type'}, + {name : 'invoicePlanType'}, {name : 'receiptor'}, {name : 'receiptingTime'}, {name : 'personInCharge'}, @@ -1807,7 +1807,7 @@ {type : 'list',dataIndex : 'status',options : [ invoiceStatusNo, invoiceStatusYes,invoiceStatusSigned ],phpMode : true}, {type : 'date',dataIndex : 'sendTime'}, {type : 'date',dataIndex : 'applicationTime'}, - {type : 'string',dataIndex : 'invoicePlan.type'}, + {type : 'string',dataIndex : 'invoicePlanType'}, {type : 'numeric',dataIndex : 'totalPrice'}, {type : 'string',dataIndex : 'hospitalNumber'}, {type : 'string',dataIndex : 'remark'}